This file is indexed.

/usr/include/libspreadsheet-1.12/spreadsheet/sheet.h is in gnumeric 1.12.28-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef _GNM_SHEET_H_
# define _GNM_SHEET_H_

#include "gnumeric.h"
#include "colrow.h"
#include "position.h"
#include <pango/pango.h>
#include <goffice/goffice.h>
#include "libgnumeric.h"

G_BEGIN_DECLS

GNM_VAR_DECL Sheet *invalid_sheet;

struct _GnmSheetSize {
	int max_cols, max_rows;
};
GType gnm_sheet_size_get_type (void);

typedef struct _SheetPrivate SheetPrivate;
GType gnm_sheet_type_get_type (void);
#define GNM_SHEET_TYPE_TYPE (gnm_sheet_type_get_type ())

GType gnm_sheet_visibility_get_type (void);
#define GNM_SHEET_VISIBILITY_TYPE (gnm_sheet_visibility_get_type ())

struct _Sheet {
	GObject	base;

	int         index_in_wb;
	Workbook    *workbook;
	gboolean    being_invalidated;
	gboolean    being_constructed;

	GOUndoGroup *revive;

	GPtrArray   *sheet_views;

	char        *name_quoted;
	char        *name_unquoted;
	char        *name_unquoted_collate_key;
	char	    *name_case_insensitive;

	GnmSheetStyleData *style_data; /* See sheet-style.c */

	ColRowCollection cols, rows;

	GHashTable  *cell_hash;	/* The cells in hashed format */

	GnmNamedExprCollection *names;

	/* This should eventually be moved to the views.  */
	double      last_zoom_factor_used;
	GnmRenderedValueCollection *rendered_values;

	GSList      *sheet_objects;	/* List of objects in this sheet */
	GnmCellPos   max_object_extent;

	/* Sheet level preferences */
	GnmConventions const *convs;
	gboolean    display_formulas;
	gboolean    hide_zero;
	gboolean    hide_grid;
	gboolean    hide_col_header;
	gboolean    hide_row_header;
	gboolean    is_protected;
	struct {
		gboolean edit_objects;		/* TODO */
		gboolean edit_scenarios;	/* TODO */
		gboolean cell_formatting;	/* TODO */
		gboolean column_formatting;	/* TODO */
		gboolean row_formatting;	/* TODO */
		gboolean insert_columns;	/* TODO */
		gboolean insert_rows;		/* TODO */
		gboolean insert_hyperlinks;	/* TODO */
		gboolean delete_columns;	/* TODO */
		gboolean delete_rows;		/* TODO */
		gboolean select_locked_cells;	/* Partial : TODO range selection */
		gboolean sort_ranges;		/* TODO */
		gboolean edit_auto_filters;	/* TODO */
		gboolean edit_pivottable;	/* TODO */
		gboolean select_unlocked_cells;	/* Partial : TODO range selection */
	} protected_allow;

	GnmSheetVisibility visibility;

	gboolean    display_outlines;
	gboolean    outline_symbols_below;
	gboolean    outline_symbols_right;
	gboolean    text_is_rtl;

	gboolean    has_filtered_rows;

        GnmSolverParameters *solver_parameters;
	GList            *scenarios;
	GHashTable       *sort_setups;

	gint simulation_round;

	GnmDepContainer *deps;

	GSList		 *slicers;
	GSList		 *filters;
	GSList		 *list_merged;
	GHashTable	 *hash_merged;
	SheetPrivate     *priv;
	GnmPrintInformation *print_info;
	GnmColor	 *tab_color;
	GnmColor	 *tab_text_color;
	GnmSheetType	  sheet_type;

	GnmSheetSize size;

	/* tile related data */
	int tile_top_level;
};

#define GNM_SHEET_TYPE	(gnm_sheet_get_type ())
#define SHEET(obj)     (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_SHEET_TYPE, Sheet))
#define IS_SHEET(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_SHEET_TYPE))
#define GNM_SHEET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SHEET_TYPE, GnmSheetClass))
GType     gnm_sheet_get_type	 (void);

Sheet    *sheet_new		 (Workbook *wb, char const *name, int columns, int rows);
Sheet    *sheet_new_with_type	 (Workbook *wb, char const *name,
				  GnmSheetType type, int columns, int rows);
Sheet    *sheet_dup		 (Sheet const *source_sheet);
void      sheet_destroy_contents (Sheet *sheet);

gboolean  gnm_sheet_valid_size   (int cols, int rows);
void      gnm_sheet_suggest_size (int *cols, int *rows);

GOUndo   *gnm_sheet_resize       (Sheet *sheet, int cols, int rows,
				  GOCmdContext *cc, gboolean *perr);

GnmSheetSize const *gnm_sheet_get_size (Sheet const *sheet);
GnmSheetSize const *gnm_sheet_get_size2 (Sheet const *sheet,
					 Workbook const *wb);
#define gnm_sheet_get_max_rows(sheet) (gnm_sheet_get_size(sheet)->max_rows)
#define gnm_sheet_get_max_cols(sheet) (gnm_sheet_get_size(sheet)->max_cols)
#define gnm_sheet_get_last_col(sheet) (gnm_sheet_get_max_cols(sheet) - 1)
#define gnm_sheet_get_last_row(sheet) (gnm_sheet_get_max_rows(sheet) - 1)

/* GnmCell management */
GnmCell  *sheet_cell_get	 (Sheet const *sheet, int col, int row);
GnmCell  *sheet_cell_fetch	 (Sheet *sheet, int col, int row);
GnmCell  *sheet_cell_create	 (Sheet *sheet, int col, int row);
void      sheet_cell_remove	 (Sheet *sheet, GnmCell *cell,
				  gboolean redraw, gboolean queue_recalc);
/* TODO TODO TODO
 * Merge with sheet_cell_foreach
 *
 **/
struct _GnmCellIter {
	GnmCell	    *cell;
	GnmParsePos  pp;
	ColRowInfo  *ci, *ri;
};
GnmValue *sheet_foreach_cell_in_range (Sheet *sheet, CellIterFlags flags,
				       int start_col, int start_row,
				       int end_col, int end_row,
				       CellIterFunc callback,
				       gpointer     closure);
void	    sheet_cell_foreach	 (Sheet const *sheet,
				  GHFunc callback, gpointer data);
unsigned    sheet_cells_count	 (Sheet const *sheet);
GPtrArray  *sheet_cell_positions (Sheet *sheet, gboolean comments);

GPtrArray  *sheet_cells          (Sheet *sheet, const GnmRange *r);

void        sheet_recompute_spans_for_col     (Sheet *sheet, int col);

gboolean    sheet_is_region_empty	      (Sheet *sheet, GnmRange const *r);
gboolean    sheet_is_cell_empty		      (Sheet *sheet, int col, int row);

gboolean    sheet_col_is_hidden		   (Sheet const *sheet, int col);
gboolean    sheet_row_is_hidden		   (Sheet const *sheet, int row);

GnmComment *sheet_get_comment		   (Sheet const *sheet,
					    GnmCellPos const *pos);

int	    sheet_find_boundary_horizontal (Sheet *sheet, int col, int move_row,
					    int base_row, int count,
					    gboolean jump_to_boundaries);
int	    sheet_find_boundary_vertical   (Sheet *sheet, int move_col, int row,
					    int base_col, int count,
					    gboolean jump_to_boundaries);

ColRowInfo const *sheet_colrow_get_default (Sheet const *sheet,
					    gboolean is_cols);

void        sheet_colrow_optimize          (Sheet *sheet);

/* Returns a pointer to a ColRowInfo: existing or NULL */
ColRowInfo *sheet_col_get                 (Sheet const *sheet, int col);
ColRowInfo *sheet_row_get                 (Sheet const *sheet, int row);
ColRowInfo *sheet_colrow_get              (Sheet const *sheet,
					   int colrow, gboolean is_cols);
/* Returns a pointer to a ColRowInfo: existing or freshly created */
ColRowInfo *sheet_col_fetch               (Sheet *sheet, int col);
ColRowInfo *sheet_row_fetch               (Sheet *sheet, int row);
ColRowInfo *sheet_colrow_fetch            (Sheet *sheet,
					   int colrow, gboolean is_cols);
/* Returns a pointer to a ColRowInfo: existing or default */
ColRowInfo const *sheet_col_get_info	  (Sheet const *sheet, int col);
ColRowInfo const *sheet_row_get_info	  (Sheet const *sheet, int row);
ColRowInfo const *sheet_colrow_get_info	  (Sheet const *sheet,
					   int colrow, gboolean is_cols);

/*
 * Definitions of row/col size terminology :
 *
 * _pixels == measurments are in screen pixels.
 * _pts == measurments are in 'points' and should be the same size on all displays
 *         (printers and monitors).
 *
 * distance == pixels from the leading edge of the 'from' col/row
 *             to the leading edge of the 'to' col/row
 *             INCLUDING all internal margins.
 *             INCLUDING the leading grid line
 *             EXCLUDING the trailing grid line.
 *
 * _default == The size of all cols/rows that do not have explicit sizes.
 */
/* Col width */
double  sheet_col_get_distance_pts	  (Sheet const *sheet, int from_col, int to_col);
int     sheet_col_get_distance_pixels     (Sheet const *sheet, int from_col, int to_col);
void    sheet_col_set_size_pts		  (Sheet *sheet, int col, double width_pts,
					   gboolean set_by_user);
void    sheet_col_set_size_pixels	  (Sheet *sheet, int col, int width_pixels,
					   gboolean set_by_user);
double  sheet_col_get_default_size_pts	  (Sheet const *sheet);
int     sheet_col_get_default_size_pixels (Sheet const *sheet);
void    sheet_col_set_default_size_pts	  (Sheet *sheet, double width_pts);
void    sheet_col_set_default_size_pixels (Sheet *sheet, int width_pixels);

/* Row height */
double  sheet_row_get_distance_pts	  (Sheet const *sheet, int from_row, int to_row);
int     sheet_row_get_distance_pixels     (Sheet const *sheet, int from, int to);
void    sheet_row_set_size_pts		  (Sheet *sheet, int row, double height_pts,
					   gboolean set_by_user);
void    sheet_row_set_size_pixels	  (Sheet *sheet, int row, int height_pixels,
					   gboolean set_by_user);
double  sheet_row_get_default_size_pts	  (Sheet const *sheet);
int     sheet_row_get_default_size_pixels (Sheet const *sheet);
void    sheet_row_set_default_size_pts	  (Sheet *sheet, double height_pts);
void    sheet_row_set_default_size_pixels (Sheet *sheet, int height_pixels);

/* Find minimum pixel size to display contents (including margins and far grid line) */
int     sheet_col_size_fit_pixels    (Sheet *sheet, int col,
				      int srow, int erow,
				      gboolean ignore_strings);
int     sheet_row_size_fit_pixels    (Sheet *sheet, int row,
				      int scol, int ecol,
				      gboolean ignore_strings);

gboolean sheet_colrow_can_group	     (Sheet *sheet, GnmRange const *r,
				      gboolean is_cols);
gboolean sheet_colrow_group_ungroup  (Sheet *sheet, GnmRange const *r,
				      gboolean is_cols, gboolean inc);
void     sheet_colrow_gutter	     (Sheet *sheet,
				      gboolean is_cols, int max_outline);

gboolean sheet_range_splits_array    (Sheet const *sheet,
				      GnmRange const *r, GnmRange const *ignore,
				      GOCmdContext *cc, char const *cmd);
gboolean sheet_range_splits_region   (Sheet const *sheet,
				      GnmRange const *r, GnmRange const *ignore,
				      GOCmdContext *cc, char const *cmd);
gboolean sheet_ranges_split_region   (Sheet const *sheet, GSList const *ranges,
				      GOCmdContext *cc, char const *cmd);
gboolean sheet_range_contains_merges_or_arrays (Sheet const *sheet,
						GnmRange const *r,
						GOCmdContext *cc,
						char const *cmd,
						gboolean merges,
						gboolean arrays);
void	 sheet_range_bounding_box    (Sheet const *sheet, GnmRange *r);
gboolean sheet_range_trim	     (Sheet const *sheet, GnmRange *r,
				      gboolean cols, gboolean rows);
gboolean sheet_range_has_heading     (Sheet const *sheet, GnmRange const *src,
				      gboolean top, gboolean ignore_styles);


void gnm_sheet_foreach_name (Sheet const *sheet, GHFunc func, gpointer data);

void gnm_sheet_set_solver_params (Sheet *sheet, GnmSolverParameters *param);

GnmScenario *gnm_sheet_scenario_new (Sheet *sheet, const char *name);
GnmScenario *gnm_sheet_scenario_find (Sheet *sheet, const char *name);
void gnm_sheet_scenario_add (Sheet *sheet, GnmScenario *sc);
void gnm_sheet_scenario_remove (Sheet *sheet, GnmScenario *sc);

GHashTable *gnm_sheet_get_sort_setups (Sheet *sheet);
void gnm_sheet_add_sort_setup (Sheet *sheet, char *key, gpointer setup);
gconstpointer gnm_sheet_find_sort_setup (Sheet *sheet, char const *key);

/* Redraw */
#define sheet_is_visible(_sheet) ((_sheet)->visibility == GNM_SHEET_VISIBILITY_VISIBLE)
void     sheet_redraw_all       (Sheet const *sheet, gboolean header);
void     sheet_redraw_range     (Sheet const *sheet, GnmRange const *r);
void     sheet_redraw_region    (Sheet const *sheet,
				 int start_col, int start_row,
				 int end_col,   int end_row);

void	 sheet_flag_status_update_cell	(GnmCell const *cell);
void	 sheet_flag_status_update_range	(Sheet const *sheet, GnmRange const *range);
void     sheet_flag_style_update_range	(Sheet const *sheet, GnmRange const *range);
void	 sheet_flag_recompute_spans	(Sheet const *sheet);
void	 sheet_update_only_grid		(Sheet const *sheet);
void     sheet_update                   (Sheet const *sheet);
void	 sheet_scrollbar_config		(Sheet const *sheet);

void     sheet_mark_dirty	(Sheet *sheet);
GnmRange    sheet_get_extent	(Sheet const *sheet,
				 gboolean spans_and_merges_extend,
				 gboolean include_hidden);
GnmRange    sheet_get_cells_extent (Sheet const *sheet);
GnmRange    sheet_get_printarea	(Sheet const *sheet,
				 gboolean include_styles,
				 gboolean ignore_printarea);
GnmRange    *sheet_get_nominal_printarea (Sheet const *sheet);

/*
 * Utilities to set cell contents, queueing recalcs,
 * redraws and rendering as required.  Does NOT check for
 * division of arrays.
 */
void	     sheet_cell_set_expr    (GnmCell *cell, GnmExprTop const *texpr);
void	     sheet_cell_set_value   (GnmCell *cell, GnmValue *v);
void	     sheet_cell_set_text    (GnmCell *cell, char const *str,
				     PangoAttrList *markup);
GnmValue const *sheet_cell_get_value(Sheet *sheet, int col, int row);
void	     sheet_range_set_text   (GnmParsePos const *pos,
				     GnmRange const *r, char const *str);
GOUndo *     sheet_range_set_text_undo (GnmSheetRange *sr,
					char const *text);
GOUndo *     sheet_range_set_expr_undo (GnmSheetRange *sr,
					GnmExprTop const  *texpr);
GOUndo *     sheet_range_set_markup_undo (GnmSheetRange *sr,
					  PangoAttrList *markup);
void	     sheet_apply_style	    (Sheet  *sheet, GnmRange const *range, GnmStyle *mstyle);
GOUndo *     sheet_apply_style_undo (GnmSheetRange *sr,
				     GnmStyle      *style);
void	     sheet_apply_border	    (Sheet  *sheet, GnmRange const *range, GnmBorder **borders);
void	     sheet_queue_respan     (Sheet const *sheet, int start_row, int end_row);
void         sheet_cell_queue_respan (GnmCell *cell);
void	     sheet_range_calc_spans (Sheet *sheet, GnmRange const *r, GnmSpanCalcFlags flags);

void	     sheet_set_outline_direction (Sheet *sheet, gboolean is_cols);
gboolean     sheet_selection_is_allowed (Sheet const *sheet, GnmCellPos const *pos);

GnmConventions const *sheet_get_conventions (Sheet const *sheet);

gboolean  sheet_insert_cols (Sheet *sheet, int col, int count,
			     GOUndo **pundo, GOCmdContext *cc);
gboolean  sheet_delete_cols (Sheet *sheet, int col, int count,
			     GOUndo **pundo, GOCmdContext *cc);
gboolean  sheet_insert_rows (Sheet *sheet, int row, int count,
			     GOUndo **pundo, GOCmdContext *cc);
gboolean  sheet_delete_rows (Sheet *sheet, int row, int count,
			     GOUndo **pundo, GOCmdContext *cc);
void      sheet_move_range   (GnmExprRelocateInfo const *rinfo,
			      GOUndo **pundo, GOCmdContext *cc);

typedef enum {
	CLEAR_VALUES	   = 0x01,
	CLEAR_FORMATS	   = 0x02,
	CLEAR_COMMENTS	   = 0x04,
	CLEAR_NOCHECKARRAY = 0x08,
	CLEAR_NORESPAN	   = 0x10,
	CLEAR_RECALC_DEPS  = 0x20,
	CLEAR_MERGES	   = 0x40,
	CLEAR_OBJECTS	   = 0x80,
	CLEAR_FILTERED_ONLY = 0x100
} SheetClearFlags;

void  sheet_clear_region (Sheet *sheet,
			  int start_col, int start_row,
			  int end_col, int end_row,
			  int clear_flags, GOCmdContext *cc);

GOUndo *sheet_clear_region_undo (GnmSheetRange *sr,
				 int clear_flags);

SheetView *sheet_get_view (Sheet const *sheet, WorkbookView const *wbv);

#define SHEET_FOREACH_VIEW(sheet, view, code)					\
do {										\
	int InD;								\
	GPtrArray *views = (sheet)->sheet_views;				\
	if (views != NULL) /* Reverse is important during destruction */	\
		for (InD = views->len; InD-- > 0; ) {				\
			SheetView *view = g_ptr_array_index (views, InD);	\
			code							\
		}								\
} while (0)

#define SHEET_FOREACH_CONTROL(sheet, view, control, code)		\
	SHEET_FOREACH_VIEW((sheet), view,				\
		SHEET_VIEW_FOREACH_CONTROL(view, control, code);)

/*
 * Walk the dependents.  WARNING: Note, that it is only valid to muck with
 * the current dependency in the code.
 */
#define SHEET_FOREACH_DEPENDENT(sheet, dep, code)					\
  do {											\
	/* Maybe external deps here.  */						\
											\
	if ((sheet)->deps) {								\
		DEPENDENT_CONTAINER_FOREACH_DEPENDENT ((sheet)->deps, dep, code);	\
	}										\
  } while (0)

G_END_DECLS

#endif /* _GNM_SHEET_H_ */