Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _PERF_GTK_H_
0003 #define _PERF_GTK_H_ 1
0004 
0005 #include <stdbool.h>
0006 
0007 #pragma GCC diagnostic ignored "-Wstrict-prototypes"
0008 #include <gtk/gtk.h>
0009 #pragma GCC diagnostic error "-Wstrict-prototypes"
0010 
0011 
0012 struct perf_gtk_context {
0013     GtkWidget *main_window;
0014     GtkWidget *notebook;
0015 
0016 #ifdef HAVE_GTK_INFO_BAR_SUPPORT
0017     GtkWidget *info_bar;
0018     GtkWidget *message_label;
0019 #endif
0020     GtkWidget *statbar;
0021     guint statbar_ctx_id;
0022 };
0023 
0024 int perf_gtk__init(void);
0025 void perf_gtk__exit(bool wait_for_ok);
0026 
0027 extern struct perf_gtk_context *pgctx;
0028 
0029 static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
0030 {
0031     return ctx && ctx->main_window;
0032 }
0033 
0034 struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
0035 int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
0036 
0037 void perf_gtk__init_helpline(void);
0038 void gtk_ui_progress__init(void);
0039 void perf_gtk__init_hpp(void);
0040 
0041 void perf_gtk__signal(int sig);
0042 void perf_gtk__resize_window(GtkWidget *window);
0043 const char *perf_gtk__get_percent_color(double percent);
0044 GtkWidget *perf_gtk__setup_statusbar(void);
0045 
0046 #ifdef HAVE_GTK_INFO_BAR_SUPPORT
0047 GtkWidget *perf_gtk__setup_info_bar(void);
0048 #else
0049 static inline GtkWidget *perf_gtk__setup_info_bar(void)
0050 {
0051     return NULL;
0052 }
0053 #endif
0054 
0055 struct evsel;
0056 struct evlist;
0057 struct hist_entry;
0058 struct hist_browser_timer;
0059 
0060 int evlist__gtk_browse_hists(struct evlist *evlist, const char *help,
0061                  struct hist_browser_timer *hbt, float min_pcnt);
0062 int hist_entry__gtk_annotate(struct hist_entry *he,
0063                  struct evsel *evsel,
0064                  struct hist_browser_timer *hbt);
0065 void perf_gtk__show_annotations(void);
0066 
0067 #endif /* _PERF_GTK_H_ */