blob: 687af0bba1878de6838206864a5e7b7d061a859e [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 Kima6b702c2012-05-29 13:23:01 +090013
14#ifdef HAVE_GTK_INFO_BAR
15 GtkWidget *info_bar;
16 GtkWidget *message_label;
17#endif
Namhyung Kimb4418c62012-05-29 13:23:00 +090018 GtkWidget *statbar;
19 guint statbar_ctx_id;
Namhyung Kim42ab68a2012-05-29 13:22:59 +090020};
21
22extern struct perf_gtk_context *pgctx;
23
24static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
25{
26 return ctx && ctx->main_window;
27}
28
29struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
30int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
31
Namhyung Kim4bb16462012-08-16 17:14:52 +090032void perf_gtk__init_helpline(void);
Namhyung Kim12ceade2012-09-03 11:53:10 +090033void perf_gtk__init_hpp(void);
Namhyung Kim4bb16462012-08-16 17:14:52 +090034
Namhyung Kima6b702c2012-05-29 13:23:01 +090035#ifndef HAVE_GTK_INFO_BAR
36static inline GtkWidget *perf_gtk__setup_info_bar(void)
37{
38 return NULL;
39}
40#endif
41
Pekka Enbergc31a9452012-03-19 15:13:29 -030042#endif /* _PERF_GTK_H_ */