gtk.h 802 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifndef HAVE_GTK_INFO_BAR
  24. static inline GtkWidget *perf_gtk__setup_info_bar(void)
  25. {
  26. return NULL;
  27. }
  28. #endif
  29. #endif /* _PERF_GTK_H_ */