2012-03-20 02:13:29 +08:00
|
|
|
#ifndef _PERF_GTK_H_
|
|
|
|
#define _PERF_GTK_H_ 1
|
|
|
|
|
2012-05-29 12:22:59 +08:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2012-03-20 02:13:29 +08:00
|
|
|
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#pragma GCC diagnostic error "-Wstrict-prototypes"
|
|
|
|
|
2012-05-29 12:22:59 +08:00
|
|
|
|
|
|
|
struct perf_gtk_context {
|
|
|
|
GtkWidget *main_window;
|
2013-02-07 17:02:09 +08:00
|
|
|
GtkWidget *notebook;
|
2012-05-29 12:23:01 +08:00
|
|
|
|
|
|
|
#ifdef HAVE_GTK_INFO_BAR
|
|
|
|
GtkWidget *info_bar;
|
|
|
|
GtkWidget *message_label;
|
|
|
|
#endif
|
2012-05-29 12:23:00 +08:00
|
|
|
GtkWidget *statbar;
|
|
|
|
guint statbar_ctx_id;
|
2012-05-29 12:22:59 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct perf_gtk_context *pgctx;
|
|
|
|
|
|
|
|
static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
|
|
|
|
{
|
|
|
|
return ctx && ctx->main_window;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
|
|
|
|
int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
|
|
|
|
|
2012-08-16 16:14:52 +08:00
|
|
|
void perf_gtk__init_helpline(void);
|
2012-11-13 21:30:33 +08:00
|
|
|
void perf_gtk__init_progress(void);
|
2012-09-03 10:53:10 +08:00
|
|
|
void perf_gtk__init_hpp(void);
|
2012-08-16 16:14:52 +08:00
|
|
|
|
2012-12-21 16:20:13 +08:00
|
|
|
void perf_gtk__signal(int sig);
|
|
|
|
void perf_gtk__resize_window(GtkWidget *window);
|
|
|
|
const char *perf_gtk__get_percent_color(double percent);
|
|
|
|
GtkWidget *perf_gtk__setup_statusbar(void);
|
|
|
|
|
|
|
|
#ifdef HAVE_GTK_INFO_BAR
|
|
|
|
GtkWidget *perf_gtk__setup_info_bar(void);
|
|
|
|
#else
|
2012-05-29 12:23:01 +08:00
|
|
|
static inline GtkWidget *perf_gtk__setup_info_bar(void)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-03-20 02:13:29 +08:00
|
|
|
#endif /* _PERF_GTK_H_ */
|