blob: 0a9173ff9a61d16e804f27f7e4734b16166f696c [file] [log] [blame]
Pekka Enbergc31a9452012-03-19 15:13:29 -03001#ifndef _PERF_GTK_H_
2#define _PERF_GTK_H_ 1
3
Namhyung Kim42ab68a2012-05-29 13:22:59 +09004#include <stdbool.h>
5
Pekka Enbergc31a9452012-03-19 15:13:29 -03006#pragma GCC diagnostic ignored "-Wstrict-prototypes"
7#include <gtk/gtk.h>
8#pragma GCC diagnostic error "-Wstrict-prototypes"
9
Namhyung Kim42ab68a2012-05-29 13:22:59 +090010
11struct perf_gtk_context {
12 GtkWidget *main_window;
Namhyung Kim7a60ba92013-02-07 18:02:09 +090013 GtkWidget *notebook;
Namhyung Kima6b702c2012-05-29 13:23:01 +090014
Ingo Molnar89fe8082013-09-30 12:07:11 +020015#ifdef HAVE_GTK_INFO_BAR_SUPPORT
Namhyung Kima6b702c2012-05-29 13:23:01 +090016 GtkWidget *info_bar;
17 GtkWidget *message_label;
18#endif
Namhyung Kimb4418c62012-05-29 13:23:00 +090019 GtkWidget *statbar;
20 guint statbar_ctx_id;
Namhyung Kim42ab68a2012-05-29 13:22:59 +090021};
22
Namhyung Kimfc672972013-09-13 15:27:43 +090023int perf_gtk__init(void);
24void perf_gtk__exit(bool wait_for_ok);
25
Namhyung Kim42ab68a2012-05-29 13:22:59 +090026extern struct perf_gtk_context *pgctx;
27
28static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
29{
30 return ctx && ctx->main_window;
31}
32
33struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
34int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
35
Namhyung Kim4bb16462012-08-16 17:14:52 +090036void perf_gtk__init_helpline(void);
Arnaldo Carvalho de Melo4779a2e2013-10-23 14:08:48 -030037void gtk_ui_progress__init(void);
Namhyung Kim12ceade2012-09-03 11:53:10 +090038void perf_gtk__init_hpp(void);
Namhyung Kim4bb16462012-08-16 17:14:52 +090039
Namhyung Kim0da41ce92012-12-21 17:20:13 +090040void perf_gtk__signal(int sig);
41void perf_gtk__resize_window(GtkWidget *window);
42const char *perf_gtk__get_percent_color(double percent);
43GtkWidget *perf_gtk__setup_statusbar(void);
44
Ingo Molnar89fe8082013-09-30 12:07:11 +020045#ifdef HAVE_GTK_INFO_BAR_SUPPORT
Namhyung Kim0da41ce92012-12-21 17:20:13 +090046GtkWidget *perf_gtk__setup_info_bar(void);
47#else
Namhyung Kima6b702c2012-05-29 13:23:01 +090048static inline GtkWidget *perf_gtk__setup_info_bar(void)
49{
50 return NULL;
51}
52#endif
53
Namhyung Kimfc672972013-09-13 15:27:43 +090054struct perf_evsel;
55struct perf_evlist;
56struct hist_entry;
57struct hist_browser_timer;
58
59int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help,
60 struct hist_browser_timer *hbt,
61 float min_pcnt);
62int hist_entry__gtk_annotate(struct hist_entry *he,
63 struct perf_evsel *evsel,
64 struct hist_browser_timer *hbt);
65void perf_gtk__show_annotations(void);
66
Pekka Enbergc31a9452012-03-19 15:13:29 -030067#endif /* _PERF_GTK_H_ */