TimerMiniWindow.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #include "TimerMiniWindow.h"
  2. struct _TimerMiniWindow {
  3. GtkWindow parent;
  4. GtkWidget *startStopButton;
  5. GtkWidget *saveButton;
  6. GtkWidget *expandButton;
  7. GtkWidget *timerLabel;
  8. GtkWidget *timerButton;
  9. GtkWidget *nameBox;
  10. };
  11. G_DEFINE_TYPE(TimerMiniWindow, timer_mini_window, GTK_TYPE_WINDOW);
  12. TimerMiniWindow *timer_mini_window_new() {
  13. return g_object_new(TIMER_TYPE_MINI_WINDOW, NULL);
  14. }
  15. GtkLabel *timer_mini_window_get_timer_label(TimerMiniWindow *self) {
  16. return GTK_LABEL(self->timerLabel);
  17. }
  18. GtkButton *timer_mini_window_get_timer_button(TimerMiniWindow *self) {
  19. return GTK_BUTTON(self->timerButton);
  20. }
  21. GtkButton *timer_mini_window_get_start_stop_button(TimerMiniWindow *self) {
  22. return GTK_BUTTON(self->startStopButton);
  23. }
  24. GtkButton *timer_mini_window_get_save_button(TimerMiniWindow *self) {
  25. return GTK_BUTTON(self->saveButton);
  26. }
  27. GtkButton *timer_mini_window_get_expand_button(TimerMiniWindow *self) {
  28. return GTK_BUTTON(self->expandButton);
  29. }
  30. GtkComboBoxText *timer_mini_window_get_name_box(TimerMiniWindow *self) {
  31. return GTK_COMBO_BOX_TEXT(self->nameBox);
  32. }
  33. void timer_mini_window_class_init(TimerMiniWindowClass *class) {
  34. gtk_widget_class_set_template_from_resource(
  35. GTK_WIDGET_CLASS(class), "/zander/practicetimer/ui/mini-window.glade");
  36. gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
  37. TimerMiniWindow, startStopButton);
  38. gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
  39. TimerMiniWindow, saveButton);
  40. gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
  41. TimerMiniWindow, expandButton);
  42. gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
  43. TimerMiniWindow, timerLabel);
  44. gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
  45. TimerMiniWindow, nameBox);
  46. gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
  47. TimerMiniWindow, timerButton);
  48. }
  49. void timer_mini_window_init(TimerMiniWindow *self) {
  50. gtk_widget_init_template(GTK_WIDGET(self));
  51. }