gtk.h 1.6 KB

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