gtk.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. void perf_gtk__signal(int sig);
  27. void perf_gtk__resize_window(GtkWidget *window);
  28. const char *perf_gtk__get_percent_color(double percent);
  29. GtkWidget *perf_gtk__setup_statusbar(void);
  30. #ifdef HAVE_GTK_INFO_BAR
  31. GtkWidget *perf_gtk__setup_info_bar(void);
  32. #else
  33. static inline GtkWidget *perf_gtk__setup_info_bar(void)
  34. {
  35. return NULL;
  36. }
  37. #endif
  38. #endif /* _PERF_GTK_H_ */