^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _PERF_GTK_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _PERF_GTK_H_ 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <stdbool.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #pragma GCC diagnostic ignored "-Wstrict-prototypes"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <gtk/gtk.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #pragma GCC diagnostic error "-Wstrict-prototypes"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct perf_gtk_context {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) GtkWidget *main_window;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) GtkWidget *notebook;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #ifdef HAVE_GTK_INFO_BAR_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) GtkWidget *info_bar;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) GtkWidget *message_label;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) GtkWidget *statbar;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) guint statbar_ctx_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) int perf_gtk__init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) void perf_gtk__exit(bool wait_for_ok);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) extern struct perf_gtk_context *pgctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) return ctx && ctx->main_window;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) void perf_gtk__init_helpline(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) void gtk_ui_progress__init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) void perf_gtk__init_hpp(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) void perf_gtk__signal(int sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) void perf_gtk__resize_window(GtkWidget *window);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) const char *perf_gtk__get_percent_color(double percent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) GtkWidget *perf_gtk__setup_statusbar(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #ifdef HAVE_GTK_INFO_BAR_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) GtkWidget *perf_gtk__setup_info_bar(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) static inline GtkWidget *perf_gtk__setup_info_bar(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) struct evsel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) struct evlist;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) struct hist_entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) struct hist_browser_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) int perf_evlist__gtk_browse_hists(struct evlist *evlist, const char *help,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) struct hist_browser_timer *hbt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) float min_pcnt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) int hist_entry__gtk_annotate(struct hist_entry *he,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) struct evsel *evsel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) struct hist_browser_timer *hbt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) void perf_gtk__show_annotations(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #endif /* _PERF_GTK_H_ */