diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | trace-compat.c | 22 | ||||
-rw-r--r-- | trace-compat.h | 15 | ||||
-rw-r--r-- | trace-view.c | 1 |
4 files changed, 38 insertions, 2 deletions
@@ -40,7 +40,7 @@ trace-graph.o:: $(HEADERS) trace-graph.h | |||
40 | trace-graph-main.o:: $(HEADERS) trace-graph.h | 40 | trace-graph-main.o:: $(HEADERS) trace-graph.h |
41 | kernel-shark.o:: $(HEADERS) kernel-shark.h | 41 | kernel-shark.o:: $(HEADERS) kernel-shark.h |
42 | 42 | ||
43 | TRACE_VIEW_OBJS = trace-view.o trace-view-store.o trace-filter.o | 43 | TRACE_VIEW_OBJS = trace-view.o trace-view-store.o trace-filter.o trace-compat.o |
44 | 44 | ||
45 | trace-cmd:: trace-cmd.o trace-read.o | 45 | trace-cmd:: trace-cmd.o trace-read.o |
46 | $(CC) $^ -rdynamic -o $@ $(LIBS) | 46 | $(CC) $^ -rdynamic -o $@ $(LIBS) |
diff --git a/trace-compat.c b/trace-compat.c index b12af1c..9c1d7e3 100644 --- a/trace-compat.c +++ b/trace-compat.c | |||
@@ -1,5 +1,18 @@ | |||
1 | #include "trace-compat.h" | 1 | #include "trace-compat.h" |
2 | 2 | ||
3 | #if GTK_VERSION < CALC_GTK_VERSION(2,18,0) | ||
4 | |||
5 | void gtk_cell_renderer_get_padding(GtkCellRenderer *cell, | ||
6 | gint *xpad, gint *ypad) | ||
7 | { | ||
8 | if (xpad) | ||
9 | *xpad = cell->xpad; | ||
10 | if (ypad) | ||
11 | *ypad = cell->ypad; | ||
12 | } | ||
13 | |||
14 | #endif /* version < 2.18.0 */ | ||
15 | |||
3 | #if GTK_VERSION < CALC_GTK_VERSION(2,14,0) | 16 | #if GTK_VERSION < CALC_GTK_VERSION(2,14,0) |
4 | 17 | ||
5 | gdouble gtk_adjustment_get_page_size(GtkAdjustment *adj) | 18 | gdouble gtk_adjustment_get_page_size(GtkAdjustment *adj) |
@@ -18,3 +31,12 @@ gdouble gtk_adjustment_get_lower(GtkAdjustment *adj) | |||
18 | } | 31 | } |
19 | 32 | ||
20 | #endif /* version < 2.14.0 */ | 33 | #endif /* version < 2.14.0 */ |
34 | |||
35 | #if GTK_VERSION < CALC_GTK_VERSION(2,12,0) | ||
36 | |||
37 | GtkWidget *gtk_tree_view_column_get_tree_view(GtkTreeViewColumn *col) | ||
38 | { | ||
39 | return col->tree_view; | ||
40 | } | ||
41 | |||
42 | #endif /* version < 2.12.0 */ | ||
diff --git a/trace-compat.h b/trace-compat.h index ffc18c3..381fc6c 100644 --- a/trace-compat.h +++ b/trace-compat.h | |||
@@ -5,12 +5,25 @@ | |||
5 | 5 | ||
6 | #define CALC_GTK_VERSION(maj, min, ext) ((maj << 16) + (min << 8) + ext) | 6 | #define CALC_GTK_VERSION(maj, min, ext) ((maj << 16) + (min << 8) + ext) |
7 | 7 | ||
8 | #if GTK_VERSION < CALC_GTK_VERSION(2,18,0) | ||
9 | |||
10 | void gtk_cell_renderer_get_padding(GtkCellRenderer *cell, | ||
11 | gint *xpad, gint *ypad); | ||
12 | |||
13 | #endif /* version < 2.18.0 */ | ||
14 | |||
8 | #if GTK_VERSION < CALC_GTK_VERSION(2,14,0) | 15 | #if GTK_VERSION < CALC_GTK_VERSION(2,14,0) |
9 | 16 | ||
10 | gdouble gtk_adjustment_get_page_size(GtkAdjustment *adj); | 17 | gdouble gtk_adjustment_get_page_size(GtkAdjustment *adj); |
11 | gdouble gtk_adjustment_get_upper(GtkAdjustment *adj); | 18 | gdouble gtk_adjustment_get_upper(GtkAdjustment *adj); |
12 | gdouble gtk_adjustment_get_lower(GtkAdjustment *adj); | 19 | gdouble gtk_adjustment_get_lower(GtkAdjustment *adj); |
13 | 20 | ||
14 | #endif | 21 | #endif /* version < 2.14.0 */ |
22 | |||
23 | #if GTK_VERSION < CALC_GTK_VERSION(2,12,0) | ||
24 | |||
25 | GtkWidget *gtk_tree_view_column_get_tree_view(GtkTreeViewColumn *col); | ||
26 | |||
27 | #endif /* version < 2.12.0 */ | ||
15 | 28 | ||
16 | #endif /* _TRACE_COMPAT_H */ | 29 | #endif /* _TRACE_COMPAT_H */ |
diff --git a/trace-view.c b/trace-view.c index d4a5bbd..e99a8af 100644 --- a/trace-view.c +++ b/trace-view.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "trace-cmd.h" | 27 | #include "trace-cmd.h" |
28 | #include "trace-local.h" | 28 | #include "trace-local.h" |
29 | #include "trace-view.h" | 29 | #include "trace-view.h" |
30 | #include "trace-compat.h" | ||
30 | 31 | ||
31 | enum { | 32 | enum { |
32 | COL_INDEX, | 33 | COL_INDEX, |