162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef _PERF_GTK_H_
362306a36Sopenharmony_ci#define _PERF_GTK_H_ 1
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <stdbool.h>
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#pragma GCC diagnostic ignored "-Wstrict-prototypes"
862306a36Sopenharmony_ci#include <gtk/gtk.h>
962306a36Sopenharmony_ci#pragma GCC diagnostic error "-Wstrict-prototypes"
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cistruct perf_gtk_context {
1362306a36Sopenharmony_ci	GtkWidget *main_window;
1462306a36Sopenharmony_ci	GtkWidget *notebook;
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#ifdef HAVE_GTK_INFO_BAR_SUPPORT
1762306a36Sopenharmony_ci	GtkWidget *info_bar;
1862306a36Sopenharmony_ci	GtkWidget *message_label;
1962306a36Sopenharmony_ci#endif
2062306a36Sopenharmony_ci	GtkWidget *statbar;
2162306a36Sopenharmony_ci	guint statbar_ctx_id;
2262306a36Sopenharmony_ci};
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciint perf_gtk__init(void);
2562306a36Sopenharmony_civoid perf_gtk__exit(bool wait_for_ok);
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ciextern struct perf_gtk_context *pgctx;
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_cistatic inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
3062306a36Sopenharmony_ci{
3162306a36Sopenharmony_ci	return ctx && ctx->main_window;
3262306a36Sopenharmony_ci}
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_cistruct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
3562306a36Sopenharmony_ciint perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_civoid perf_gtk__init_helpline(void);
3862306a36Sopenharmony_civoid gtk_ui_progress__init(void);
3962306a36Sopenharmony_civoid perf_gtk__init_hpp(void);
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_civoid perf_gtk__signal(int sig);
4262306a36Sopenharmony_civoid perf_gtk__resize_window(GtkWidget *window);
4362306a36Sopenharmony_ciconst char *perf_gtk__get_percent_color(double percent);
4462306a36Sopenharmony_ciGtkWidget *perf_gtk__setup_statusbar(void);
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#ifdef HAVE_GTK_INFO_BAR_SUPPORT
4762306a36Sopenharmony_ciGtkWidget *perf_gtk__setup_info_bar(void);
4862306a36Sopenharmony_ci#else
4962306a36Sopenharmony_cistatic inline GtkWidget *perf_gtk__setup_info_bar(void)
5062306a36Sopenharmony_ci{
5162306a36Sopenharmony_ci	return NULL;
5262306a36Sopenharmony_ci}
5362306a36Sopenharmony_ci#endif
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_cistruct evsel;
5662306a36Sopenharmony_cistruct evlist;
5762306a36Sopenharmony_cistruct hist_entry;
5862306a36Sopenharmony_cistruct hist_browser_timer;
5962306a36Sopenharmony_cistruct annotation_options;
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ciint evlist__gtk_browse_hists(struct evlist *evlist, const char *help,
6262306a36Sopenharmony_ci			     struct hist_browser_timer *hbt, float min_pcnt);
6362306a36Sopenharmony_ciint hist_entry__gtk_annotate(struct hist_entry *he,
6462306a36Sopenharmony_ci			     struct evsel *evsel,
6562306a36Sopenharmony_ci			     struct annotation_options *options,
6662306a36Sopenharmony_ci			     struct hist_browser_timer *hbt);
6762306a36Sopenharmony_civoid perf_gtk__show_annotations(void);
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#endif /* _PERF_GTK_H_ */
70