Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] (PR#2756) unification of update_line
Home

[Freeciv-Dev] (PR#2756) unification of update_line

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2756) unification of update_line
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 7 Jan 2003 14:24:01 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Here's a patch to move update_line into mapctrl_common, as suggested in
PR#2753.

jason


Index: client/mapctrl_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapctrl_common.c,v
retrieving revision 1.4
diff -u -r1.4 mapctrl_common.c
--- client/mapctrl_common.c     2003/01/01 11:51:32     1.4
+++ client/mapctrl_common.c     2003/01/07 22:22:41
@@ -77,3 +77,21 @@
     }
   }
 }
+
+/**************************************************************************
+  Update the goto/patrol line to the given map canvas location.
+**************************************************************************/
+void update_line(int canvas_x, int canvas_y)
+{
+  int x, y, old_x, old_y;
+
+  if ((hover_state == HOVER_GOTO || hover_state == HOVER_PATROL)
+      && draw_goto_line) {
+    get_map_xy(canvas_x, canvas_y, &x, &y);
+
+    get_line_dest(&old_x, &old_y);
+    if (!same_pos(old_x, old_y, x, y)) {
+      draw_line(x, y);
+    }
+  }
+}
Index: client/mapctrl_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapctrl_common.h,v
retrieving revision 1.1
diff -u -r1.1 mapctrl_common.h
--- client/mapctrl_common.h     2002/08/24 14:37:34     1.1
+++ client/mapctrl_common.h     2003/01/07 22:22:41
@@ -18,5 +18,6 @@
 
 bool get_turn_done_button_state(void);
 void update_turn_done_button_state(void);
+void update_line(int canvas_x, int canvas_y);
 
 #endif /* FC__MAPVIEW_COMMON_H */
Index: client/gui-gtk/mapctrl.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapctrl.c,v
retrieving revision 1.71
diff -u -r1.71 mapctrl.c
--- client/gui-gtk/mapctrl.c    2003/01/05 15:34:05     1.71
+++ client/gui-gtk/mapctrl.c    2003/01/07 22:22:41
@@ -335,24 +335,6 @@
 /**************************************************************************
 ...
 **************************************************************************/
-void update_line(int window_x, int window_y)
-{
-  int x, y, old_x, old_y;
-
-  if ((hover_state == HOVER_GOTO || hover_state == HOVER_PATROL)
-      && draw_goto_line) {
-    get_map_xy(window_x, window_y, &x, &y);
-
-    get_line_dest(&old_x, &old_y);
-    if (!same_pos(old_x, old_y, x, y)) {
-      draw_line(x, y);
-    }
-  }
-}
-
-/**************************************************************************
-...
-**************************************************************************/
 gint move_mapcanvas(GtkWidget *widget, GdkEventButton *event)
 {
   update_line(event->x, event->y);
Index: client/gui-gtk/mapctrl.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapctrl.h,v
retrieving revision 1.10
diff -u -r1.10 mapctrl.h
--- client/gui-gtk/mapctrl.h    2002/08/27 21:15:40     1.10
+++ client/gui-gtk/mapctrl.h    2003/01/07 22:22:41
@@ -27,7 +27,6 @@
 gint butt_down_wakeup(GtkWidget *w, GdkEventButton *ev);
 gint butt_down_overviewcanvas(GtkWidget *w, GdkEventButton *ev);
 gint move_mapcanvas(GtkWidget *widget, GdkEventButton *event);
-void update_line(int window_x, int window_y);
 
 void center_on_unit(void);
 void focus_to_next_unit(void);
Index: client/gui-gtk-2.0/mapctrl.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapctrl.c,v
retrieving revision 1.13
diff -u -r1.13 mapctrl.c
--- client/gui-gtk-2.0/mapctrl.c        2003/01/05 15:34:05     1.13
+++ client/gui-gtk-2.0/mapctrl.c        2003/01/07 22:22:41
@@ -329,24 +329,6 @@
 /**************************************************************************
 ...
 **************************************************************************/
-void update_line(int window_x, int window_y)
-{
-  int x, y, old_x, old_y;
-
-  if ((hover_state == HOVER_GOTO || hover_state == HOVER_PATROL)
-      && draw_goto_line) {
-    get_map_xy(window_x, window_y, &x, &y);
-
-    get_line_dest(&old_x, &old_y);
-    if (!same_pos(old_x, old_y, x, y)) {
-      draw_line(x, y);
-    }
-  }
-}
-
-/**************************************************************************
-...
-**************************************************************************/
 gboolean move_mapcanvas(GtkWidget *widget, GdkEventMotion *event, gpointer 
data)
 {
   update_line(event->x, event->y);
Index: client/gui-gtk-2.0/mapctrl.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapctrl.h,v
retrieving revision 1.2
diff -u -r1.2 mapctrl.h
--- client/gui-gtk-2.0/mapctrl.h        2002/06/10 02:13:54     1.2
+++ client/gui-gtk-2.0/mapctrl.h        2003/01/07 22:22:41
@@ -26,7 +26,6 @@
 gboolean butt_down_wakeup(GtkWidget *w, GdkEventButton *ev, gpointer data);
 gboolean butt_down_overviewcanvas(GtkWidget *w, GdkEventButton *ev, gpointer 
data);
 gboolean move_mapcanvas(GtkWidget *widget, GdkEventMotion *event, gpointer 
data);
-void update_line(int window_x, int window_y);
 
 void center_on_unit(void);
 void focus_to_next_unit(void);
Index: client/gui-mui/mapctrl.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/mapctrl.c,v
retrieving revision 1.13
diff -u -r1.13 mapctrl.c
--- client/gui-mui/mapctrl.c    2002/11/14 09:14:57     1.13
+++ client/gui-mui/mapctrl.c    2003/01/07 22:22:41
@@ -106,25 +106,6 @@
   return 0;
 }
 
-
-/**************************************************************************
-...
-**************************************************************************/
-void update_line(int window_x, int window_y)
-{
-  int x, y, old_x, old_y;
-
-  if ((hover_state == HOVER_GOTO || hover_state == HOVER_PATROL)
-      && draw_goto_line) {
-    get_map_xy(window_x, window_y, &x, &y);
-
-    get_line_dest(&old_x, &old_y);
-    if (!same_pos(old_x, old_y, x, y)) {
-      draw_line(x, y);
-    }
-  }
-}
-
 /**************************************************************************
 ...
 **************************************************************************/
Index: client/gui-xaw/mapctrl.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapctrl.c,v
retrieving revision 1.61
diff -u -r1.61 mapctrl.c
--- client/gui-xaw/mapctrl.c    2003/01/07 22:10:34     1.61
+++ client/gui-xaw/mapctrl.c    2003/01/07 22:22:41
@@ -278,24 +278,6 @@
 /**************************************************************************
 ...
 **************************************************************************/
-void update_line(int window_x, int window_y)
-{
-  int x, y, old_x, old_y;
-
-  if ((hover_state == HOVER_GOTO || hover_state == HOVER_PATROL)
-      && draw_goto_line) {
-    get_map_xy(window_x, window_y, &x, &y);
-
-    get_line_dest(&old_x, &old_y);
-    if (!same_pos(old_x, old_y, x, y)) {
-      draw_line(x, y);
-    }
-  }
-}
-
-/**************************************************************************
-...
-**************************************************************************/
 void create_line_at_mouse_pos(void)
 {
   Bool on_same_screen;
Index: client/gui-xaw/mapctrl.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapctrl.h,v
retrieving revision 1.13
diff -u -r1.13 mapctrl.h
--- client/gui-xaw/mapctrl.h    2001/02/14 21:31:45     1.13
+++ client/gui-xaw/mapctrl.h    2003/01/07 22:22:41
@@ -28,8 +28,6 @@
 void focus_to_next_unit(void);
 void center_on_unit(void);
 
-void update_line(int window_x, int window_y);
-
 extern int city_workers_color;
 
 #endif  /* FC__MAPCTRL_H */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2756) unification of update_line, Jason Short via RT <=