blob: 856320e2cc05c796a5774de845f24fda78dcef3e [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 Kima7535792012-11-13 22:30:33 +090033void perf_gtk__init_progress(void);
Namhyung Kim12ceade2012-09-03 11:53:10 +090034void perf_gtk__init_hpp(void);
Namhyung Kim4bb16462012-08-16 17:14:52 +090035
Namhyung Kima6b702c2012-05-29 13:23:01 +090036#ifndef HAVE_GTK_INFO_BAR
37static inline GtkWidget *perf_gtk__setup_info_bar(void)
38{
39 return NULL;
40}
41#endif
42
Pekka Enbergc31a9452012-03-19 15:13:29 -030043#endif /* _PERF_GTK_H_ */