#pragma once #include "glibmm/dispatcher.h" #include "minefield.hpp" #include #include #include #include #include #include #include #define PROJECT_NAME "minesweeper" class MainWindow : public Gtk::Window { Gtk::Box boxV{Gtk::Orientation::VERTICAL}; Gtk::Box boxH{Gtk::Orientation::HORIZONTAL}; std::vector> buttons; Gtk::Grid grid; Gtk::HeaderBar bar; Gtk::Button newGameButton; Gtk::Button optionButton; Gtk::Label flagLabel; Gtk::Label clockLabel; MineField field {16, 16, 1}; int m_elapsedTime; bool newGame; std::shared_ptr m_textureBomb; std::shared_ptr m_textureFlag; std::shared_ptr m_textureFlagBomb; void updateCell(int x, int y); void openBombs(); void updateFlagsLabel(int flags); void updateClockLabel(); void handleClockSig(size_t); void gameWon(); void gameOver(); sigc::connection clockSignalConn; Glib::Dispatcher m_clockDispatch; // void OpenNearCells(int index); // void Explode();xo // bool AllCellsOpened(); public: MainWindow(); // void OnNewButtonClick(); void OnCellClick(int x, int y); void OnCellRightClick(int n_press, double n_x, double n_y, int index); // void ShowGameWonAnimation(); // void ApplyStyles(); // bool UpdateClockLabel(); };