/*
 * File:    bombs.h
 * Purpose: main application module, generated by wxBuilder.
 */

#ifndef _INC_BOMBS_H
#define _INC_BOMBS_H

#include "game.h"

/*
 * Forward declarations of all top-level window classes.
 */
class  BombsFrameClass;
class  AboutFrameClass;

/*
 * Class representing the entire Application
 */
class AppClass: public wxApp
{
 public:
  BombsFrameClass *BombsFrame;
  AboutFrameClass *AboutFrame;
  int level;
  BombsGame Game;

  wxFrame *OnInit(void);
  Bool ParseCommandLine(void);
};

extern AppClass theApp;

class BombsCanvasClass;

class BombsFrameClass: public wxFrame
{
 private:
 protected:
 public:
  // Subwindows for reference within the program.
  BombsCanvasClass *BombsCanvas;
  wxMenuBar *menuBar;

  // Constructor and destructor
  BombsFrameClass(wxFrame *parent, char *title, int x, int y, int width, int height, long style, char *name);
  ~BombsFrameClass(void);

 Bool OnClose(void);
 void OnSize(int w, int h);
 void OnMenuCommand(int commandId);
};

/* Menu identifiers
 */
// File
#define BOMBSFRAMECLASS_FILE 1
// E&xit
#define IDM_EXIT 2
// About...
#define IDM_ABOUT 3
// Game
#define BOMBSFRAMECLASS_GAME 4
// &Restart
#define IDM_RESTART 5
// &Easy
#define IDM_EASY 6
// &Medium
#define IDM_MEDIUM 7
// &Difficult
#define IDM_DIFFICULT 8

/* Toolbar identifiers
 */

class BombsCanvasClass: public wxCanvas
{
 private:
 protected:
 public:
   int field_width, field_height;
   int x_cell, y_cell;
   wxBitmap *bmp;
  // Constructor and destructor
  BombsCanvasClass(wxFrame *parent, int x, int y, int width, int height, long style, char *name);
  ~BombsCanvasClass(void);

 void OnSize(int w, int h);
 void OnPaint(void);
 void DrawField(wxDC *, int xc1, int yc1, int xc2, int yc2);
 void Refresh(int xc1, int yc1, int xc2, int yc2);
 void OnEvent(wxMouseEvent& event);
 void OnChar(wxKeyEvent& event);
 void UpdateFieldSize();
};

class AboutPanelClass;

class AboutFrameClass: public wxFrame
{
 private:
 protected:
 public:
  // Subwindows for reference within the program.
  AboutPanelClass *AboutPanel;

  // Constructor and destructor
  AboutFrameClass(wxFrame *parent, char *title, int x, int y, int width, int height, long style, char *name);
  ~AboutFrameClass(void);

 Bool OnClose(void);
 void OnSize(int w, int h);
 void OnMenuCommand(int commandId);
};

/* Menu identifiers
 */

/* Toolbar identifiers
 */

class AboutPanelClass: public wxPanel
{
 private:
 protected:
 public:
  // Panel items for reference within the program.
  wxMessage *message_line_1;
  wxMessage *message_line_2;
  wxMessage *message_line_3;
  wxMessage *message_line_4;
  wxButton *AboutButton;

  // Possible bitmaps for buttons.

  // Constructor and destructor
  AboutPanelClass(wxFrame *parent, int x, int y, int width, int height, long style, char *name);
  ~AboutPanelClass(void);

 void OnSize(int w, int h);
};

void ButtonProc13(wxButton& but, wxCommandEvent& event);

/* The following sizes should probably be redefined */
/* dimensions of a scroll unit, in pixels */
#define X_UNIT 4
#define Y_UNIT 4

/* the dimensions of a cell, in scroll units are in
 * BombsCanvasClass::x_cell and y_cell
 */


#define BOMBS_FONT wxFont(14, wxROMAN, wxNORMAL, wxNORMAL)

#endif /* mutual exclusion */

