mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Remove even more code and declarations
There's lots more stuff that can go. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f8ba3c7ab6
commit
054406b420
7 changed files with 3 additions and 114 deletions
21
display.h
21
display.h
|
@ -8,10 +8,6 @@ extern "C" {
|
||||||
#define SCALE_SCREEN 1.0
|
#define SCALE_SCREEN 1.0
|
||||||
#define SCALE_PRINT (1.0 / get_screen_dpi())
|
#define SCALE_PRINT (1.0 / get_screen_dpi())
|
||||||
|
|
||||||
extern void repaint_dive(void);
|
|
||||||
extern void do_print(void);
|
|
||||||
|
|
||||||
// Commented out because I don't know how to get the dpi on a paint device yet.
|
|
||||||
extern double get_screen_dpi(void);
|
extern double get_screen_dpi(void);
|
||||||
|
|
||||||
/* Plot info with smoothing, velocity indication
|
/* Plot info with smoothing, velocity indication
|
||||||
|
@ -29,17 +25,7 @@ struct plot_info {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// I'm not sure if this is needed anymore - but keeping this here
|
* handy datastructure to keep all of our scaling data in one place
|
||||||
// so I wont break stuff trying to redo the well.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Cairo scaling really is horribly horribly mis-designed.
|
|
||||||
*
|
|
||||||
* Which is sad, because I really like Cairo otherwise. But
|
|
||||||
* the fact that the line width is scaled with the same scale
|
|
||||||
* as the coordinate system is a f*&%ing disaster. So we
|
|
||||||
* can't use it, and instead have this butt-ugly wrapper thing..
|
|
||||||
*/
|
*/
|
||||||
struct graphics_context {
|
struct graphics_context {
|
||||||
int printer;
|
int printer;
|
||||||
|
@ -52,13 +38,8 @@ struct graphics_context {
|
||||||
|
|
||||||
typedef enum { SC_SCREEN, SC_PRINT } scale_mode_t;
|
typedef enum { SC_SCREEN, SC_PRINT } scale_mode_t;
|
||||||
|
|
||||||
extern void plot(struct graphics_context *gc, struct dive *dive, scale_mode_t scale);
|
|
||||||
extern struct divecomputer *select_dc(struct divecomputer *main);
|
extern struct divecomputer *select_dc(struct divecomputer *main);
|
||||||
extern void init_profile_background(struct graphics_context *gc);
|
|
||||||
extern void attach_tooltip(int x, int y, int w, int h, const char *text, struct event *event);
|
|
||||||
extern void get_plot_details(struct graphics_context *gc, int time, char *buf, int bufsize);
|
extern void get_plot_details(struct graphics_context *gc, int time, char *buf, int bufsize);
|
||||||
extern int x_to_time(double x);
|
|
||||||
extern int x_abs(double x);
|
|
||||||
|
|
||||||
struct options {
|
struct options {
|
||||||
enum { PRETTY, TABLE, TWOPERPAGE } type;
|
enum { PRETTY, TABLE, TWOPERPAGE } type;
|
||||||
|
|
16
dive.h
16
dive.h
|
@ -611,20 +611,6 @@ extern int parse_dm4_buffer(const char *url, const char *buf, int size, struct d
|
||||||
|
|
||||||
extern void parse_file(const char *filename, char **error);
|
extern void parse_file(const char *filename, char **error);
|
||||||
|
|
||||||
extern void show_dive_info(struct dive *);
|
|
||||||
|
|
||||||
extern void show_dive_equipment(struct dive *, int w_idx);
|
|
||||||
extern void clear_equipment_widgets(void);
|
|
||||||
|
|
||||||
extern void show_dive_stats(struct dive *);
|
|
||||||
extern void clear_stats_widgets(void);
|
|
||||||
|
|
||||||
extern void show_gps_locations(void);
|
|
||||||
extern void show_gps_location(struct dive *, void (*callback)(float, float));
|
|
||||||
|
|
||||||
extern void show_yearly_stats(void);
|
|
||||||
|
|
||||||
extern void update_dive(struct dive *new_dive);
|
|
||||||
extern void save_dives(const char *filename);
|
extern void save_dives(const char *filename);
|
||||||
extern void save_dives_logic(const char *filename, bool select_only);
|
extern void save_dives_logic(const char *filename, bool select_only);
|
||||||
extern void save_dive(FILE *f, struct dive *dive);
|
extern void save_dive(FILE *f, struct dive *dive);
|
||||||
|
@ -667,8 +653,6 @@ extern int add_new_dive(struct dive *dive);
|
||||||
extern bool edit_trip(dive_trip_t *trip);
|
extern bool edit_trip(dive_trip_t *trip);
|
||||||
extern int edit_dive_info(struct dive *dive, bool newdive);
|
extern int edit_dive_info(struct dive *dive, bool newdive);
|
||||||
extern int edit_multi_dive_info(struct dive *single_dive);
|
extern int edit_multi_dive_info(struct dive *single_dive);
|
||||||
extern void dive_list_update_dives(void);
|
|
||||||
extern void flush_divelist(struct dive *dive);
|
|
||||||
|
|
||||||
extern void set_dc_nickname(struct dive *dive);
|
extern void set_dc_nickname(struct dive *dive);
|
||||||
extern void set_autogroup(bool value);
|
extern void set_autogroup(bool value);
|
||||||
|
|
46
divelist.c
46
divelist.c
|
@ -22,7 +22,6 @@
|
||||||
* void add_dive_to_trip(struct dive *dive, dive_trip_t *trip)
|
* void add_dive_to_trip(struct dive *dive, dive_trip_t *trip)
|
||||||
* dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive)
|
* dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive)
|
||||||
* void autogroup_dives(void)
|
* void autogroup_dives(void)
|
||||||
* void clear_trip_indexes(void)
|
|
||||||
* void delete_single_dive(int idx)
|
* void delete_single_dive(int idx)
|
||||||
* void add_single_dive(int idx, struct dive *dive)
|
* void add_single_dive(int idx, struct dive *dive)
|
||||||
* void merge_two_dives(struct dive *a, struct dive *b)
|
* void merge_two_dives(struct dive *a, struct dive *b)
|
||||||
|
@ -92,43 +91,6 @@ dive_trip_t *find_trip_by_idx(int idx)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dive_nr_sort(int idx_a, int idx_b, timestamp_t when_a, timestamp_t when_b)
|
|
||||||
{
|
|
||||||
struct dive *a, *b;
|
|
||||||
dive_trip_t *tripa = NULL, *tripb = NULL;
|
|
||||||
|
|
||||||
if (idx_a < 0) {
|
|
||||||
a = NULL;
|
|
||||||
tripa = find_trip_by_idx(idx_a);
|
|
||||||
} else {
|
|
||||||
a = get_dive(idx_a);
|
|
||||||
if (a)
|
|
||||||
tripa = a->divetrip;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx_b < 0) {
|
|
||||||
b = NULL;
|
|
||||||
tripb = find_trip_by_idx(idx_b);
|
|
||||||
} else {
|
|
||||||
b = get_dive(idx_b);
|
|
||||||
if (b)
|
|
||||||
tripb = b->divetrip;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Compare dive dates within the same trip (or when there
|
|
||||||
* are no trips involved at all). But if we have two
|
|
||||||
* different trips use the trip dates for comparison
|
|
||||||
*/
|
|
||||||
if (tripa != tripb) {
|
|
||||||
if (tripa)
|
|
||||||
when_a = tripa->when;
|
|
||||||
if (tripb)
|
|
||||||
when_b = tripb->when;
|
|
||||||
}
|
|
||||||
return when_a - when_b;
|
|
||||||
}
|
|
||||||
|
|
||||||
int trip_has_selected_dives(dive_trip_t *trip)
|
int trip_has_selected_dives(dive_trip_t *trip)
|
||||||
{
|
{
|
||||||
struct dive *dive;
|
struct dive *dive;
|
||||||
|
@ -846,14 +808,6 @@ void autogroup_dives(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_trip_indexes(void)
|
|
||||||
{
|
|
||||||
dive_trip_t *trip;
|
|
||||||
|
|
||||||
for (trip = dive_trip_list; trip != NULL; trip = trip->next)
|
|
||||||
trip->index = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this implements the mechanics of removing the dive from the table,
|
/* this implements the mechanics of removing the dive from the table,
|
||||||
* but doesn't deal with updating dive trips, etc */
|
* but doesn't deal with updating dive trips, etc */
|
||||||
void delete_single_dive(int idx)
|
void delete_single_dive(int idx)
|
||||||
|
|
14
divelist.h
14
divelist.h
|
@ -7,21 +7,11 @@ extern "C" {
|
||||||
|
|
||||||
struct dive;
|
struct dive;
|
||||||
|
|
||||||
extern void report_dives(bool imported, bool prefer_imported);
|
|
||||||
extern void dive_list_update_dives(void);
|
|
||||||
extern void update_dive_list_col_visibility(void);
|
|
||||||
extern void update_dive_list_units(void);
|
|
||||||
extern void flush_divelist(struct dive *);
|
|
||||||
extern void update_cylinder_related_info(struct dive *);
|
extern void update_cylinder_related_info(struct dive *);
|
||||||
extern void mark_divelist_changed(int);
|
extern void mark_divelist_changed(int);
|
||||||
extern int unsaved_changes(void);
|
extern int unsaved_changes(void);
|
||||||
extern void remove_autogen_trips(void);
|
extern void remove_autogen_trips(void);
|
||||||
extern void select_next_dive(void);
|
|
||||||
extern void select_prev_dive(void);
|
|
||||||
extern void show_and_select_dive(struct dive *dive);
|
|
||||||
extern double init_decompression(struct dive * dive);
|
extern double init_decompression(struct dive * dive);
|
||||||
extern void export_all_dives_uddf_cb();
|
|
||||||
extern void upload_all_dives_divelogs_cb();
|
|
||||||
|
|
||||||
/* divelist core logic functions */
|
/* divelist core logic functions */
|
||||||
extern void process_dives(bool imported, bool prefer_imported);
|
extern void process_dives(bool imported, bool prefer_imported);
|
||||||
|
@ -29,9 +19,9 @@ extern char *get_dive_date_string(timestamp_t when);
|
||||||
extern char *get_short_dive_date_string(timestamp_t when);
|
extern char *get_short_dive_date_string(timestamp_t when);
|
||||||
extern char *get_trip_date_string(timestamp_t when, int nr);
|
extern char *get_trip_date_string(timestamp_t when, int nr);
|
||||||
extern char *get_nitrox_string(struct dive *dive);
|
extern char *get_nitrox_string(struct dive *dive);
|
||||||
extern void clear_trip_indexes(void);
|
|
||||||
extern dive_trip_t *find_trip_by_idx(int idx);
|
extern dive_trip_t *find_trip_by_idx(int idx);
|
||||||
extern int dive_nr_sort(int idx_a, int idx_b, timestamp_t when_a, timestamp_t when_b);
|
|
||||||
extern int trip_has_selected_dives(dive_trip_t *trip);
|
extern int trip_has_selected_dives(dive_trip_t *trip);
|
||||||
extern void get_depth_values(int depth, int *depth_int, int *depth_decimal, int *show_decimal);
|
extern void get_depth_values(int depth, int *depth_int, int *depth_decimal, int *show_decimal);
|
||||||
extern void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p);
|
extern void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p);
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
/* equipment.c */
|
/* equipment.c */
|
||||||
/* creates the UI for the equipment page -
|
|
||||||
* controlled through the following interfaces:
|
|
||||||
*
|
|
||||||
* void show_dive_equipment(struct dive *dive, int w_idx)
|
|
||||||
*
|
|
||||||
* called from gtk-ui:
|
|
||||||
* GtkWidget *equipment_widget(int w_idx)
|
|
||||||
*/
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* profile.c */
|
/* profile.c */
|
||||||
/* creates all the necessary data for drawing the dive profile
|
/* creates all the necessary data for drawing the dive profile
|
||||||
* uses cairo to draw it
|
|
||||||
*/
|
*/
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
@ -22,9 +21,6 @@ char dc_number = 0;
|
||||||
|
|
||||||
static struct plot_data *last_pi_entry = NULL;
|
static struct plot_data *last_pi_entry = NULL;
|
||||||
|
|
||||||
#define cairo_set_line_width_scaled(cr, w) \
|
|
||||||
cairo_set_line_width((cr), (w) * plot_scale);
|
|
||||||
|
|
||||||
/* debugging tool - not normally used */
|
/* debugging tool - not normally used */
|
||||||
static void dump_pi (struct plot_info *pi)
|
static void dump_pi (struct plot_info *pi)
|
||||||
{
|
{
|
||||||
|
|
|
@ -321,14 +321,6 @@ void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
|
||||||
plot_pp_text();
|
plot_pp_text();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now shift the translation back by half the margin;
|
|
||||||
* this way we can draw the vertical scales on both sides */
|
|
||||||
//cairo_translate(gc->cr, -drawing_area->x / 2.0, 0);
|
|
||||||
|
|
||||||
//gc->maxx += drawing_area->x;
|
|
||||||
//gc->leftx = -(drawing_area->x / drawing_area->width) / 2.0;
|
|
||||||
//gc->rightx = 1.0 - gc->leftx;
|
|
||||||
|
|
||||||
plot_depth_scale();
|
plot_depth_scale();
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Reference in a new issue