source: golgotha/src/golg/editor/dialogs/path_win.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 14 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 2.3 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef PATH_WIN_HH
10#define PATH_WIN_HH
11
12#include "math/num_type.hh"
13#include "gui/butbox.hh"
14#include "window/window.hh"
15#include "image/image32.hh"
16
17class g1_path_tool_window_class : public i4_button_box_class
18{
19protected:
20  i4_image_class *grade_icon[4], *size_icon[2];
21  i4_const_str *grade_help[4], *size_help[2];
22public:
23  g1_path_tool_window_class(i4_graphical_style_class *style, i4_event_handler_class *send_to,
24                            int buttons, i4_image_class **img, i4_const_str **help_names);
25 
26  char *name() { return "path_tool_win"; }
27};
28
29class g1_map_class;
30class g1_critical_graph_class;
31class g1_critical_map_maker_class;
32class g1_astar_map_solver_class;
33class g1_breadth_first_graph_solver_class;
34
35class g1_path_window_class : public i4_parent_window_class
36{
37protected:
38  i4_image_class *start_icon, *dest_icon, *crit_icon;
39  int last_x, last_y;
40  int map_changed;
41
42  i4_float point[1024];
43  w16 points;
44 
45public:
46  enum { CELL_SIZE=3 };
47
48  class coord
49  {
50  public:
51    w16 x,y;
52
53    coord() : x(0), y(0) {}
54  } start, dest;      // path to solve
55
56  int mode;                  // current lay down mode from tool window
57 
58  w16 grade;
59  w8 size;
60  w8 tofrom;
61  g1_map_class *map;
62  g1_critical_graph_class *critical_graph;
63 
64  g1_critical_map_maker_class *maker;
65  g1_astar_map_solver_class *solvemap;
66  g1_breadth_first_graph_solver_class *solvegraph;
67 
68  i4_image32 *bitmap;
69
70  g1_path_window_class(g1_map_class *map, i4_image_class **icons);
71  ~g1_path_window_class();
72
73  w32 critical_color(w16 x, w16 y);
74 
75  void solve();
76  void changed() { map_changed = 1; request_redraw(); }
77
78  void draw_to_bitmap();
79  void parent_draw(i4_draw_context_class &context);
80  virtual void receive_event(i4_event *ev);
81
82 
83  char *name() { return "path_win"; }
84};
85
86#endif
Note: See TracBrowser for help on using the repository browser.