gtk.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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
  11. GtkWidget *info_bar;
  12. GtkWidget *message_label;
  13. #endif
  14. GtkWidget *statbar;
  15. guint statbar_ctx_id;
  16. };
  17. extern struct perf_gtk_context *pgctx;
  18. static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
  19. {
  20. return ctx && ctx->main_window;
  21. }
  22. struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
  23. int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
  24. void perf_gtk__init_helpline(void);
  25. void perf_gtk__init_progress(void);
  26. void perf_gtk__init_hpp(void);
  27. void perf_gtk__signal(int sig);
  28. void perf_gtk__resize_window(GtkWidget *window);
  29. const char *perf_gtk__get_percent_color(double percent);
  30. GtkWidget *perf_gtk__setup_statusbar(void);
  31. #ifdef HAVE_GTK_INFO_BAR
  32. GtkWidget *perf_gtk__setup_info_bar(void);
  33. #else
  34. static inline GtkWidget *perf_gtk__setup_info_bar(void)
  35. {
  36. return NULL;
  37. }
  38. #endif
  39. #endif /* _PERF_GTK_H_ */