2011-09-20 19:40:34 +00:00
|
|
|
#ifndef DISPLAY_GTK_H
|
|
|
|
#define DISPLAY_GTK_H
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
|
|
|
|
extern GtkWidget *main_window;
|
|
|
|
|
|
|
|
/* we want a progress bar as part of the device_data_t - let's abstract this out */
|
|
|
|
typedef struct {
|
|
|
|
GtkWidget *bar;
|
|
|
|
} progressbar_t;
|
|
|
|
|
2011-09-27 17:16:40 +00:00
|
|
|
typedef struct {
|
2011-10-23 20:36:37 +00:00
|
|
|
gboolean cylinder;
|
|
|
|
gboolean temperature;
|
|
|
|
gboolean nitrox;
|
2011-09-27 17:16:40 +00:00
|
|
|
gboolean sac;
|
|
|
|
gboolean otu;
|
|
|
|
} visible_cols_t;
|
|
|
|
|
2011-11-24 06:56:57 +00:00
|
|
|
typedef enum {
|
|
|
|
PREF_BOOL,
|
|
|
|
PREF_STRING
|
|
|
|
} pref_type_t;
|
|
|
|
|
|
|
|
#define BOOL_TO_PTR(_cond) ((_cond) ? (void *)1 : NULL)
|
|
|
|
#define PTR_TO_BOOL(_ptr) ((_ptr) != NULL)
|
|
|
|
|
2012-01-03 04:49:10 +00:00
|
|
|
#if defined __APPLE__
|
|
|
|
#define CTRLCHAR "<Meta>"
|
2012-01-03 19:18:04 +00:00
|
|
|
#define PREFERENCE_ACCEL "<Meta>comma"
|
2012-01-03 04:49:10 +00:00
|
|
|
#else
|
|
|
|
#define CTRLCHAR "<Control>"
|
|
|
|
#define PREFERENCE_ACCEL NULL
|
|
|
|
#endif
|
|
|
|
|
2011-11-24 06:56:57 +00:00
|
|
|
extern void subsurface_open_conf(void);
|
|
|
|
extern void subsurface_set_conf(char *name, pref_type_t type, const void *value);
|
|
|
|
extern const void *subsurface_get_conf(char *name, pref_type_t type);
|
|
|
|
extern void subsurface_close_conf(void);
|
|
|
|
|
2011-12-14 04:34:56 +00:00
|
|
|
extern const char *subsurface_USB_name(void);
|
2011-12-28 23:57:36 +00:00
|
|
|
extern const char *subsurface_icon_name(void);
|
2012-01-03 04:49:10 +00:00
|
|
|
extern void subsurface_ui_setup(GtkSettings *settings, GtkWidget *menubar,
|
|
|
|
GtkWidget *vbox, GtkUIManager *ui_manager);
|
2012-01-01 21:41:47 +00:00
|
|
|
|
|
|
|
extern const char *divelist_font;
|
2011-12-14 04:34:56 +00:00
|
|
|
|
2011-09-27 17:16:40 +00:00
|
|
|
extern visible_cols_t visible_cols;
|
|
|
|
|
2011-09-20 19:40:34 +00:00
|
|
|
extern const char *divelist_font;
|
|
|
|
extern void set_divelist_font(const char *);
|
|
|
|
|
|
|
|
extern void import_dialog(GtkWidget *, gpointer);
|
|
|
|
extern void report_error(GError* error);
|
|
|
|
extern int process_ui_events(void);
|
|
|
|
extern void update_progressbar(progressbar_t *progress, double value);
|
|
|
|
|
|
|
|
extern GtkWidget *dive_profile_widget(void);
|
|
|
|
extern GtkWidget *dive_info_frame(void);
|
|
|
|
extern GtkWidget *extended_dive_info_widget(void);
|
|
|
|
extern GtkWidget *equipment_widget(void);
|
2012-01-15 22:29:08 +00:00
|
|
|
extern GtkWidget *single_stats_widget(void);
|
|
|
|
extern GtkWidget *total_stats_widget(void);
|
2011-11-19 19:47:04 +00:00
|
|
|
extern GtkWidget *cylinder_list_widget(void);
|
2011-09-20 19:40:34 +00:00
|
|
|
|
|
|
|
extern GtkWidget *dive_list_create(void);
|
|
|
|
|
2012-03-14 17:01:34 +00:00
|
|
|
unsigned int amount_selected;
|
|
|
|
|
|
|
|
extern void process_selected_dives(GList *, GtkTreeModel *);
|
|
|
|
|
2011-10-02 20:05:12 +00:00
|
|
|
typedef void (*data_func_t)(GtkTreeViewColumn *col,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
GtkTreeModel *model,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gpointer data);
|
|
|
|
|
Add capability of custom sorts to divelist columns
.. and use this for the nitrox column, which can now be more complex
than just a single number.
The rule for the "nitrox" column is now:
- we look up the highest Oxygen and Helium mix for the dive
(Note: we look them up independently, so if you have a EAN50 deco
bottle, and a 20% Helium low-oxygen bottle for the deep portion, then
we'll consider the dive to be a "50% Oxygen, 20% Helium" dive, even
though you obviously never used that combination at the same time)
- we sort by Helium first, Oxygen second. So a dive with a 10% Helium
mix is considered to be "stronger" than a 50% Nitrox mix.
- If Helium is non-zero, we show "O2/He", otherwise we show just "O2"
(or "air"). So "21/20" means "21% oxygen, 20% Helium", while "40"
means "Ean 40".
- I got rid of the decimals. We save them, and you can see them in the
dive equipment details, but for the dive list we just use rounded
percentages.
Let's see how many bugs I introduced. I don't actually have any trimix
dives, but I edited a few for (very limited) testing.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-12-11 22:38:58 +00:00
|
|
|
typedef gint (*sort_func_t)(GtkTreeModel *model,
|
|
|
|
GtkTreeIter *a,
|
|
|
|
GtkTreeIter *b,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2011-12-11 19:40:17 +00:00
|
|
|
#define ALIGN_LEFT 1
|
|
|
|
#define ALIGN_RIGHT 2
|
|
|
|
#define INVISIBLE 4
|
|
|
|
#define UNSORTABLE 8
|
|
|
|
|
2011-10-02 20:05:12 +00:00
|
|
|
extern GtkTreeViewColumn *tree_view_column(GtkWidget *tree_view, int index, const char *title,
|
2011-12-11 19:40:17 +00:00
|
|
|
data_func_t data_func, unsigned int flags);
|
2011-10-02 20:05:12 +00:00
|
|
|
|
2011-09-20 19:40:34 +00:00
|
|
|
#endif
|