gtk.h 1.6 KB

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