]> git.cworth.org Git - grrobot/blobdiff - src/grr_board_view.h
* src/grrobot.c (grr_game_read_notices): Call new board_view timer
[grrobot] / src / grr_board_view.h
index f7df6daae9c379e517d07ce1af5efc4f9c228adc..92cf981fc0cf1bbc55c5df2e9f15eda293ee731f 100644 (file)
@@ -33,6 +33,8 @@
 
 #include <rr.h>
 
+#include "grr_icon.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
@@ -50,37 +52,31 @@ struct grr_board_view
     GtkWidget widget;
 
     rr_board_t *board;
-    int owns_board;
+
     int board_width, board_height;
     int board_pad_x, board_pad_y;
 
+    int **damaged;
+
     int cell_width, cell_height;
 
-    /* XXX: Obviously, the rest of this needs to be gutted */
+    rr_robot_t active_robot;
 
-    /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */
-    guint policy : 2;
+    rr_client_t *client;
     
     /* Button currently pressed or 0 if none */
     guint8 button;
     
-    /* Dimensions of dial components */
-    gint radius;
-    gint pointer_width;
-    
-    /* ID of update timer, or 0 if none */
-    guint32 timer;
-    
-    /* Current angle */
-    gfloat angle;
-    gfloat last_angle;
-    
-    /* Old values from adjustment stored so we know when something changes */
-    gfloat old_value;
-    gfloat old_lower;
-    gfloat old_upper;
+    double time;
+    double drift_correct;
+    guint timer;
+
+    grr_icon_t *cell1_icon;
+    grr_icon_t *cell2_icon;
+    grr_icon_t *wall_icon;
 
-    GtkAdjustment *adjustment;
+    grr_icon_t *robot_icon[RR_NUM_ROBOTS];
+    grr_icon_t *target_icon[RR_NUM_TARGETS];
 };
 
 struct grr_board_view_class
@@ -88,10 +84,46 @@ struct grr_board_view_class
     GtkWidgetClass parent_class;
 };
 
-GtkWidget*     grr_board_view_new      (rr_board_t *board);
-GtkType        grr_board_view_get_type (void);
-void           grr_board_view_set_board        (grr_board_view_t *view,
-                                        rr_board_t *board);
+grr_board_view_t *
+grr_board_view_new (rr_board_t *board);
+
+void
+grr_board_view_set_client (grr_board_view_t *view, rr_client_t *client);
+
+GtkType
+grr_board_view_get_type (void);
+
+void
+grr_board_view_set_active_robot (grr_board_view_t *view, rr_robot_t robot);
+
+void
+grr_board_view_move_active (grr_board_view_t *view, rr_direction_t dir);
+
+void
+grr_board_view_undo (grr_board_view_t *view);
+
+void
+grr_board_view_mark_damage (grr_board_view_t *view, int i, int j);
+
+void
+grr_board_view_start_timer (grr_board_view_t *view, double time);
+
+void
+grr_board_view_stop_timer (grr_board_view_t *view);
+
+void
+grr_board_view_reset_timer (grr_board_view_t *view);
+
+void
+grr_board_view_transform_pixel_to_cell (grr_board_view_t *view,
+                                       int pixel_x, int pixel_y,
+                                       int *cell_x, int *cell_y);
+
+void
+grr_board_view_transform_cell_to_pixel (grr_board_view_t *view,
+                                       int cell_x, int cell_y,
+                                       int *pixel_x, int *pixel_y);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */