gtk.h 906 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #ifdef HAVE_GTK_INFO_BAR
  10. GtkWidget *info_bar;
  11. GtkWidget *message_label;
  12. #endif
  13. GtkWidget *statbar;
  14. guint statbar_ctx_id;
  15. };
  16. extern struct perf_gtk_context *pgctx;
  17. static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
  18. {
  19. return ctx && ctx->main_window;
  20. }
  21. struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
  22. int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
  23. void perf_gtk__init_helpline(void);
  24. void perf_gtk__init_progress(void);
  25. void perf_gtk__init_hpp(void);
  26. #ifndef HAVE_GTK_INFO_BAR
  27. static inline GtkWidget *perf_gtk__setup_info_bar(void)
  28. {
  29. return NULL;
  30. }
  31. #endif
  32. #endif /* _PERF_GTK_H_ */