gtk.h 1.1 KB
Newer Older
1 2 3
#ifndef _PERF_GTK_H_
#define _PERF_GTK_H_ 1

4 5
#include <stdbool.h>

6 7 8 9
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#include <gtk/gtk.h>
#pragma GCC diagnostic error "-Wstrict-prototypes"

10 11 12

struct perf_gtk_context {
	GtkWidget *main_window;
13
	GtkWidget *notebook;
14 15 16 17 18

#ifdef HAVE_GTK_INFO_BAR
	GtkWidget *info_bar;
	GtkWidget *message_label;
#endif
19 20
	GtkWidget *statbar;
	guint statbar_ctx_id;
21 22 23 24 25 26 27 28 29 30 31 32
};

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);

33
void perf_gtk__init_helpline(void);
34
void perf_gtk__init_progress(void);
35
void perf_gtk__init_hpp(void);
36

37 38 39 40 41 42 43 44
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
45 46 47 48 49 50
static inline GtkWidget *perf_gtk__setup_info_bar(void)
{
	return NULL;
}
#endif

51
#endif /* _PERF_GTK_H_ */