Initial commit
This commit is contained in:
62
src/window.hpp
Normal file
62
src/window.hpp
Normal file
@@ -0,0 +1,62 @@
|
||||
#pragma once
|
||||
|
||||
#include "MineField.hpp"
|
||||
#include "gdkmm/pixbuf.h"
|
||||
#include <memory>
|
||||
//#include <gtkmm-4.0/gtkmm/window.h>
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm.h>
|
||||
#include <gdkmm.h>
|
||||
#include <sigc++/sigc++.h>
|
||||
//#include <gtkmm-4.0/gtkmm/togglebutton.h>
|
||||
//#include <gtkmm-4.0/gtkmm/grid.h>
|
||||
#include <gtkmm-4.0/gtkmm/gestureclick.h>
|
||||
//#include <gtkmm-4.0/gtkmm/headerbar.h>
|
||||
// #include <gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h>
|
||||
// #include <gtkmm-4.0/gtkmm/image.h>
|
||||
//#include <gtkmm-4.0/gtkmm/box.h>
|
||||
//#include <gtkmm-4.0/gtkmm/label.h>
|
||||
// #include <glibmm-2.68/glibmm/ustring.h>
|
||||
// #include <glibmm-2.68/glibmm/main.h>
|
||||
// #include <gtkmm-4.0/gtkmm/cssprovider.h>
|
||||
// #include <gtkmm-4.0/gtkmm.h>
|
||||
// #include <gtkmm-4.0/gtkmm/application.h>
|
||||
|
||||
#define PROJECT_NAME "minesweeper"
|
||||
|
||||
|
||||
class MainWindow : public Gtk::Window
|
||||
{
|
||||
Gtk::Box boxV{Gtk::Orientation::VERTICAL};
|
||||
Gtk::Box boxH{Gtk::Orientation::HORIZONTAL};
|
||||
std::vector<std::shared_ptr<Gtk::ToggleButton>> buttons;
|
||||
Gtk::Grid grid;
|
||||
Gtk::HeaderBar bar;
|
||||
Gtk::Button newGameButton;
|
||||
Gtk::Button optionButton;
|
||||
Gtk::Label flagLabel;
|
||||
Gtk::Label clockLabel;
|
||||
MineField field {16, 16, 40};
|
||||
int elapsedTime;
|
||||
bool newGame;
|
||||
std::shared_ptr<Gdk::Pixbuf> m_pixbufBomb;
|
||||
std::shared_ptr<Gdk::Pixbuf> m_pixbufFlag;
|
||||
std::shared_ptr<Gdk::Pixbuf> m_pixbufFlagBomb;
|
||||
void updateCell(int x, int y);
|
||||
void openBombs();
|
||||
void updateFlagsLabel(int flags);
|
||||
|
||||
// sigc::connection clockConn;
|
||||
// void OpenNearCells(int index);
|
||||
// void Explode();
|
||||
// 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();
|
||||
};
|
||||
Reference in New Issue
Block a user