1#ifndef _PERF_GTK_H_
2#define _PERF_GTK_H_ 1
3
4#include <stdbool.h>
5
6#pragma GCC diagnostic ignored "-Wstrict-prototypes"
7#include <gtk/gtk.h>
8#pragma GCC diagnostic error "-Wstrict-prototypes"
9
10
11struct perf_gtk_context {
12	GtkWidget *main_window;
13	GtkWidget *notebook;
14
15#ifdef HAVE_GTK_INFO_BAR
16	GtkWidget *info_bar;
17	GtkWidget *message_label;
18#endif
19	GtkWidget *statbar;
20	guint statbar_ctx_id;
21};
22
23extern struct perf_gtk_context *pgctx;
24
25static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
26{
27	return ctx && ctx->main_window;
28}
29
30struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
31int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
32
33void perf_gtk__init_helpline(void);
34void perf_gtk__init_progress(void);
35void perf_gtk__init_hpp(void);
36
37void perf_gtk__signal(int sig);
38void perf_gtk__resize_window(GtkWidget *window);
39const char *perf_gtk__get_percent_color(double percent);
40GtkWidget *perf_gtk__setup_statusbar(void);
41
42#ifdef HAVE_GTK_INFO_BAR
43GtkWidget *perf_gtk__setup_info_bar(void);
44#else
45static inline GtkWidget *perf_gtk__setup_info_bar(void)
46{
47	return NULL;
48}
49#endif
50
51#endif /* _PERF_GTK_H_ */
52