-typedef void (*data_func_t)(GtkTreeViewColumn *col,
- GtkCellRenderer *renderer,
- GtkTreeModel *model,
- GtkTreeIter *iter,
- gpointer data);
-
-static GtkTreeViewColumn *divelist_column(struct DiveList *dl, int index, const char *title,
- data_func_t data_func, int align_right)
-{
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *col;
+static struct divelist_column {
+ const char *header;
+ data_func_t data;
+ sort_func_t sort;
+ unsigned int flags;
+ int *visible;
+} dl_column[] = {
+ [DIVE_NR] = { "#", NULL, NULL, ALIGN_RIGHT | UNSORTABLE },
+ [DIVE_DATE] = { "Date", date_data_func, NULL, ALIGN_LEFT },
+ [DIVE_RATING] = { UTF8_BLACKSTAR, star_data_func, NULL, ALIGN_LEFT },
+ [DIVE_DEPTH] = { "ft", depth_data_func, NULL, ALIGN_RIGHT },
+ [DIVE_DURATION] = { "min", duration_data_func, NULL, ALIGN_RIGHT },
+ [DIVE_TEMPERATURE] = { UTF8_DEGREE "F", temperature_data_func, NULL, ALIGN_RIGHT, &visible_cols.temperature },
+ [DIVE_CYLINDER] = { "Cyl", NULL, NULL, 0, &visible_cols.cylinder },
+ [DIVE_NITROX] = { "O" UTF8_SUBSCRIPT_2 "%", nitrox_data_func, nitrox_sort_func, 0, &visible_cols.nitrox },
+ [DIVE_SAC] = { "SAC", sac_data_func, NULL, 0, &visible_cols.sac },
+ [DIVE_OTU] = { "OTU", otu_data_func, NULL, 0, &visible_cols.otu },
+ [DIVE_LOCATION] = { "Location", NULL, NULL, ALIGN_LEFT },
+};