Namhyung Kim | ba47a14 | 2012-05-29 13:22:58 +0900 | [diff] [blame] | 1 | #include "../util.h" |
| 2 | #include "../../util/debug.h" |
| 3 | #include "gtk.h" |
| 4 | |
| 5 | |
Namhyung Kim | 42ab68a | 2012-05-29 13:22:59 +0900 | [diff] [blame^] | 6 | struct perf_gtk_context *pgctx; |
| 7 | |
| 8 | struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window) |
| 9 | { |
| 10 | struct perf_gtk_context *ctx; |
| 11 | |
| 12 | ctx = malloc(sizeof(*pgctx)); |
| 13 | if (ctx) |
| 14 | ctx->main_window = window; |
| 15 | |
| 16 | return ctx; |
| 17 | } |
| 18 | |
| 19 | int perf_gtk__deactivate_context(struct perf_gtk_context **ctx) |
| 20 | { |
| 21 | if (!perf_gtk__is_active_context(*ctx)) |
| 22 | return -1; |
| 23 | |
| 24 | free(*ctx); |
| 25 | *ctx = NULL; |
| 26 | return 0; |
| 27 | } |
| 28 | |
Namhyung Kim | ba47a14 | 2012-05-29 13:22:58 +0900 | [diff] [blame] | 29 | /* |
| 30 | * FIXME: Functions below should be implemented properly. |
| 31 | * For now, just add stubs for NO_NEWT=1 build. |
| 32 | */ |
| 33 | #ifdef NO_NEWT_SUPPORT |
| 34 | int ui_helpline__show_help(const char *format __used, va_list ap __used) |
| 35 | { |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | void ui_progress__update(u64 curr __used, u64 total __used, |
| 40 | const char *title __used) |
| 41 | { |
| 42 | } |
| 43 | #endif |