diff options
Diffstat (limited to 'trace-compat.c')
-rw-r--r-- | trace-compat.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/trace-compat.c b/trace-compat.c index 5082757..e1652e0 100644 --- a/trace-compat.c +++ b/trace-compat.c | |||
@@ -22,6 +22,10 @@ | |||
22 | * Linux Kernel that were written by Frederic Weisbecker. | 22 | * Linux Kernel that were written by Frederic Weisbecker. |
23 | */ | 23 | */ |
24 | #include "trace-compat.h" | 24 | #include "trace-compat.h" |
25 | #include "trace-gui.h" | ||
26 | #include "trace-cmd.h" | ||
27 | |||
28 | #include <gdk/gdk.h> | ||
25 | 29 | ||
26 | #if GTK_VERSION < CALC_GTK_VERSION(2,18,0) | 30 | #if GTK_VERSION < CALC_GTK_VERSION(2,18,0) |
27 | 31 | ||
@@ -70,6 +74,24 @@ gdouble gtk_adjustment_get_lower(GtkAdjustment *adj) | |||
70 | return adj->lower; | 74 | return adj->lower; |
71 | } | 75 | } |
72 | 76 | ||
77 | gboolean gtk_show_uri(GdkScreen *screen, const gchar *uri, | ||
78 | guint32 timestamp, GError **error) | ||
79 | { | ||
80 | return FALSE; | ||
81 | } | ||
82 | |||
83 | void g_string_vprintf(GString *string, const gchar *format, va_list args) | ||
84 | { | ||
85 | char buf[1024]; | ||
86 | gint len; | ||
87 | |||
88 | len = vsnprintf(buf, 1024, format, args); | ||
89 | if (len >= 1024) | ||
90 | die("compat g_string_vprintf can not process length of %d\n", len); | ||
91 | |||
92 | g_string_printf(string, "%s", buf); | ||
93 | } | ||
94 | |||
73 | #endif /* version < 2.14.0 */ | 95 | #endif /* version < 2.14.0 */ |
74 | 96 | ||
75 | #if GTK_VERSION < CALC_GTK_VERSION(2,12,0) | 97 | #if GTK_VERSION < CALC_GTK_VERSION(2,12,0) |
@@ -79,4 +101,20 @@ GtkWidget *gtk_tree_view_column_get_tree_view(GtkTreeViewColumn *col) | |||
79 | return col->tree_view; | 101 | return col->tree_view; |
80 | } | 102 | } |
81 | 103 | ||
104 | void gtk_widget_set_tooltip_text(GtkWidget *widget, const gchar *text) | ||
105 | { | ||
106 | static GtkTooltips *tooltips; | ||
107 | |||
108 | /* Only works for widgets with windows, sorry */ | ||
109 | if (GTK_WIDGET_NO_WINDOW(widget)) | ||
110 | return; | ||
111 | |||
112 | if (!tooltips) { | ||
113 | tooltips = gtk_tooltips_new(); | ||
114 | gtk_tooltips_enable(tooltips); | ||
115 | } | ||
116 | |||
117 | gtk_tooltips_set_tip(GTK_TOOLTIPS(tooltips), widget, text, text); | ||
118 | } | ||
119 | |||
82 | #endif /* version < 2.12.0 */ | 120 | #endif /* version < 2.12.0 */ |