gtk.h 839 B

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