Pekka Enberg | c31a945 | 2012-03-19 15:13:29 -0300 | [diff] [blame] | 1 | #ifndef _PERF_GTK_H_ |
| 2 | #define _PERF_GTK_H_ 1 |
| 3 | |
Namhyung Kim | 42ab68a | 2012-05-29 13:22:59 +0900 | [diff] [blame] | 4 | #include <stdbool.h> |
| 5 | |
Pekka Enberg | c31a945 | 2012-03-19 15:13:29 -0300 | [diff] [blame] | 6 | #pragma GCC diagnostic ignored "-Wstrict-prototypes" |
| 7 | #include <gtk/gtk.h> |
| 8 | #pragma GCC diagnostic error "-Wstrict-prototypes" |
| 9 | |
Namhyung Kim | 42ab68a | 2012-05-29 13:22:59 +0900 | [diff] [blame] | 10 | |
| 11 | struct perf_gtk_context { |
| 12 | GtkWidget *main_window; |
Namhyung Kim | a6b702c | 2012-05-29 13:23:01 +0900 | [diff] [blame] | 13 | |
| 14 | #ifdef HAVE_GTK_INFO_BAR |
| 15 | GtkWidget *info_bar; |
| 16 | GtkWidget *message_label; |
| 17 | #endif |
Namhyung Kim | b4418c6 | 2012-05-29 13:23:00 +0900 | [diff] [blame] | 18 | GtkWidget *statbar; |
| 19 | guint statbar_ctx_id; |
Namhyung Kim | 42ab68a | 2012-05-29 13:22:59 +0900 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | extern struct perf_gtk_context *pgctx; |
| 23 | |
| 24 | static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx) |
| 25 | { |
| 26 | return ctx && ctx->main_window; |
| 27 | } |
| 28 | |
| 29 | struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window); |
| 30 | int perf_gtk__deactivate_context(struct perf_gtk_context **ctx); |
| 31 | |
Namhyung Kim | 4bb1646 | 2012-08-16 17:14:52 +0900 | [diff] [blame] | 32 | void perf_gtk__init_helpline(void); |
Namhyung Kim | a753579 | 2012-11-13 22:30:33 +0900 | [diff] [blame] | 33 | void perf_gtk__init_progress(void); |
Namhyung Kim | 12ceade | 2012-09-03 11:53:10 +0900 | [diff] [blame] | 34 | void perf_gtk__init_hpp(void); |
Namhyung Kim | 4bb1646 | 2012-08-16 17:14:52 +0900 | [diff] [blame] | 35 | |
Namhyung Kim | a6b702c | 2012-05-29 13:23:01 +0900 | [diff] [blame] | 36 | #ifndef HAVE_GTK_INFO_BAR |
| 37 | static inline GtkWidget *perf_gtk__setup_info_bar(void) |
| 38 | { |
| 39 | return NULL; |
| 40 | } |
| 41 | #endif |
| 42 | |
Pekka Enberg | c31a945 | 2012-03-19 15:13:29 -0300 | [diff] [blame] | 43 | #endif /* _PERF_GTK_H_ */ |