[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (6bbcd9e693a26816abccbd8acdb95100d23c01f9)



The branch, master has been updated
       via  6bbcd9e693a26816abccbd8acdb95100d23c01f9 (commit)
       via  ff9abb9212b375ee7affdffe17803039a8525cfc (commit)
      from  be3aec15d207ca92ee23553c93cce957751343eb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/gtk/gtkhid-gdk.c        |   37 +------------
 src/hid/gtk/gtkhid-gl.c         |   35 ------------
 src/hid/gtk/gtkhid-main.c       |   16 +-----
 src/hid/gtk/gui-config.c        |   15 -----
 src/hid/gtk/gui-output-events.c |  112 ---------------------------------------
 src/hid/gtk/gui.h               |    5 +-
 6 files changed, 5 insertions(+), 215 deletions(-)


=================
 Commit Messages
=================

commit 6bbcd9e693a26816abccbd8acdb95100d23c01f9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove misplaced (and redundant) hidgl_flush_triangles() call.
    
    If we were to flush the triangle buffer in ghid_show_crosshair(), we
    should do it before we set XOR mode on the GL context (assuming the
    buffer might be dirty when we are called), and we should do it after
    we finish drawing (if we wish to leave the buffer clean when we return).
    
    The location the flush was in before this commit is just plain wrong.
    
    As we currently have flushes of the triangle buffer wrapping the call
    to ghid_show_crosshair(), just leave the flushing out of this function.
    
    Does this commit message provide an adequate example of simple patch,
    complex commit message phenomenon?

:100644 100644 d82d800... 1f51fc1... M	src/hid/gtk/gtkhid-gl.c

commit ff9abb9212b375ee7affdffe17803039a8525cfc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove auto-pan feature (kill it with fire).
    
    This seems to be fairly universally unpopular on geda-user, and its
    implementation is a little fragile, often leading the board to pan off
    to some corner of the board as the poor user reaches for the layer
    selector or a menu without having remembered to click the feature off.
    
    The fact that the pan direction and speed was set the instant you leave
    the drawing window also made it particularly unhelpful. A proper
    implementation should have grabbed the mouse - or at least implemented
    some buffer zone in which the mouse could be used to give feedback on
    the pan direction.

:100644 100644 96e54a6... 2d2d4c7... M	src/hid/gtk/gtkhid-gdk.c
:100644 100644 f5a99a9... d82d800... M	src/hid/gtk/gtkhid-gl.c
:100644 100644 79987ff... 4383ee5... M	src/hid/gtk/gtkhid-main.c
:100644 100644 698f57a... dba0635... M	src/hid/gtk/gui-config.c
:100644 100644 c483c3c... 20e8e03... M	src/hid/gtk/gui-output-events.c
:100644 100644 dede39c... 5ba5aeb... M	src/hid/gtk/gui.h

=========
 Changes
=========

commit 6bbcd9e693a26816abccbd8acdb95100d23c01f9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove misplaced (and redundant) hidgl_flush_triangles() call.
    
    If we were to flush the triangle buffer in ghid_show_crosshair(), we
    should do it before we set XOR mode on the GL context (assuming the
    buffer might be dirty when we are called), and we should do it after
    we finish drawing (if we wish to leave the buffer clean when we return).
    
    The location the flush was in before this commit is just plain wrong.
    
    As we currently have flushes of the triangle buffer wrapping the call
    to ghid_show_crosshair(), just leave the flushing out of this function.
    
    Does this commit message provide an adequate example of simple patch,
    complex commit message phenomenon?

diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index d82d800..1f51fc1 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -760,8 +760,6 @@ ghid_show_crosshair (gboolean paint_new_location)
   glEnable (GL_COLOR_LOGIC_OP);
   glLogicOp (GL_XOR);
 
-  hidgl_flush_triangles (&buffer);
-
   glColor3f (cross_color.red / 65535.,
              cross_color.green / 65535.,
              cross_color.blue / 65535.);

commit ff9abb9212b375ee7affdffe17803039a8525cfc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove auto-pan feature (kill it with fire).
    
    This seems to be fairly universally unpopular on geda-user, and its
    implementation is a little fragile, often leading the board to pan off
    to some corner of the board as the poor user reaches for the layer
    selector or a menu without having remembered to click the feature off.
    
    The fact that the pan direction and speed was set the instant you leave
    the drawing window also made it particularly unhelpful. A proper
    implementation should have grabbed the mouse - or at least implemented
    some buffer zone in which the mouse could be used to give feedback on
    the pan direction.

diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 96e54a6..2d2d4c7 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -1017,9 +1017,6 @@ draw_crosshair (GdkGC *xor_gc, gint x, gint y)
   prev = Crosshair.shape;
 }
 
-#define VCW 16
-#define VCD 8
-
 static void
 show_crosshair (gboolean paint_new_location)
 {
@@ -1028,7 +1025,6 @@ show_crosshair (gboolean paint_new_location)
   GtkStyle *style = gtk_widget_get_style (gport->drawing_area);
   gint x, y;
   static gint x_prev = -1, y_prev = -1;
-  static gboolean draw_markers, draw_markers_prev = FALSE;
   static GdkGC *xor_gc;
   static GdkColor cross_color;
 
@@ -1051,45 +1047,16 @@ show_crosshair (gboolean paint_new_location)
   gdk_gc_set_foreground (xor_gc, &cross_color);
 
   if (x_prev >= 0 && !paint_new_location)
-    {
-      draw_crosshair (xor_gc, x_prev, y_prev);
-      if (draw_markers_prev)
-        {
-          gdk_draw_rectangle (window, xor_gc, TRUE,
-                              0, y_prev - VCD, VCD, VCW);
-          gdk_draw_rectangle (window, xor_gc, TRUE,
-                              gport->width - VCD, y_prev - VCD, VCD, VCW);
-          gdk_draw_rectangle (window, xor_gc, TRUE,
-                              x_prev - VCD, 0, VCW, VCD);
-          gdk_draw_rectangle (window, xor_gc, TRUE,
-                              x_prev - VCD, gport->height - VCD, VCW, VCD);
-        }
-    }
+    draw_crosshair (xor_gc, x_prev, y_prev);
 
   if (x >= 0 && paint_new_location)
     {
       draw_crosshair (xor_gc, x, y);
-      draw_markers = ghidgui->auto_pan_on && have_crosshair_attachments ();
-      if (draw_markers)
-        {
-          gdk_draw_rectangle (window, xor_gc, TRUE,
-                              0, y - VCD, VCD, VCW);
-          gdk_draw_rectangle (window, xor_gc, TRUE,
-                              gport->width - VCD, y - VCD, VCD, VCW);
-          gdk_draw_rectangle (window, xor_gc, TRUE,
-                              x - VCD, 0, VCW, VCD);
-          gdk_draw_rectangle (window, xor_gc, TRUE,
-                              x - VCD, gport->height - VCD, VCW, VCD);
-        }
       x_prev = x;
       y_prev = y;
-      draw_markers_prev = draw_markers;
     }
   else
-    {
-      x_prev = y_prev = -1;
-      draw_markers_prev = FALSE;
-    }
+    x_prev = y_prev = -1;
 }
 
 void
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index f5a99a9..d82d800 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -737,16 +737,10 @@ draw_crosshair (gint x, gint y, gint z)
   prev = Crosshair.shape;
 }
 
-#define VCW 16 /* Crosshair pan-marker width in pixels */
-#define VCD 8  /* Crosshair pan-marker depth in pixels */
-
 void
 ghid_show_crosshair (gboolean paint_new_location)
 {
   gint x, y, z;
-  gboolean draw_markers;
-  int vcw = VCW * gport->view.coord_per_px;
-  int vcd = VCD * gport->view.coord_per_px;
   static int done_once = 0;
   static GdkColor cross_color;
 
@@ -779,33 +773,6 @@ ghid_show_crosshair (gboolean paint_new_location)
       glEnd ();
     }
 
-  draw_markers = ghidgui->auto_pan_on && have_crosshair_attachments ();
-  if (x >= 0 && paint_new_location && draw_markers)
-    {
-      glBegin (GL_QUADS);
-      glVertex3i (SIDE_X (gport->view.x0),                            y - vcd,       z);
-      glVertex3i (SIDE_X (gport->view.x0),                            y - vcd + vcw, z);
-      glVertex3i (SIDE_X (gport->view.x0 + vcd),                      y - vcd + vcw, z);
-      glVertex3i (SIDE_X (gport->view.x0 + vcd),                      y - vcd,       z);
-
-      glVertex3i (SIDE_X (gport->view.x0 + gport->view.width),        y - vcd,       z);
-      glVertex3i (SIDE_X (gport->view.x0 + gport->view.width),        y - vcd + vcw, z);
-      glVertex3i (SIDE_X (gport->view.x0 + gport->view.width - vcd),  y - vcd + vcw, z);
-      glVertex3i (SIDE_X (gport->view.x0 + gport->view.width - vcd),  y - vcd,       z);
-
-      glVertex3i (x - vcd,       SIDE_Y (gport->view.y0),                            z);
-      glVertex3i (x - vcd,       SIDE_Y (gport->view.y0 + vcd),                      z);
-      glVertex3i (x - vcd + vcw, SIDE_Y (gport->view.y0 + vcd),                      z);
-      glVertex3i (x - vcd + vcw, SIDE_Y (gport->view.y0),                            z);
-
-      glVertex3i (x - vcd,       SIDE_Y (gport->view.y0 + gport->view.height - vcd), z);
-      glVertex3i (x - vcd,       SIDE_Y (gport->view.y0 + gport->view.height),       z);
-      glVertex3i (x - vcd + vcw, SIDE_Y (gport->view.y0 + gport->view.height),       z);
-      glVertex3i (x - vcd + vcw, SIDE_Y (gport->view.y0 + gport->view.height - vcd), z);
-
-      glEnd ();
-    }
-
   glDisable (GL_COLOR_LOGIC_OP);
 }
 
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 79987ff..4383ee5 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -1893,15 +1893,13 @@ N_("Start or stop panning (Mode = 1 to start, 0 to stop)\n"
 /* %start-doc actions Pan
 
 Start or stop panning.  To start call with Mode = 1, to stop call with
-Mode = 0.  If the Mode is turned on and off with the cross hairs at
-the same coordinates, the auto pan mode is toggled.
+Mode = 0.
 
 %end-doc */
 
 static int
 PanAction (int argc, char **argv, Coord x, Coord y)
 {
-  static int on_x, on_y;
   int mode;
 
   if (!ghidgui)
@@ -1921,18 +1919,6 @@ PanAction (int argc, char **argv, Coord x, Coord y)
 
   gport->panning = mode;
 
-  if (mode == 1)
-    {
-      on_x = x;
-      on_y = y;
-    }
-  else if (x == on_x && y == on_y)
-    {
-      notify_crosshair_change (false);
-      ghidgui->auto_pan_on = !ghidgui->auto_pan_on;
-      notify_crosshair_change (true);
-    }
-
   return 0;
 }
 
diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c
index 698f57a..dba0635 100644
--- a/src/hid/gtk/gui-config.c
+++ b/src/hid/gtk/gui-config.c
@@ -128,7 +128,6 @@ static ConfigAttribute config_attributes[] = {
   {"grid", CONFIG_Unused, NULL},
 
   {"history-size", CONFIG_Integer, &_ghidgui.history_size},
-  {"auto-pan-speed", CONFIG_Integer, &_ghidgui.auto_pan_speed},
   {"top-window-width", CONFIG_Integer, &_ghidgui.top_window_width},
   {"top-window-height", CONFIG_Integer, &_ghidgui.top_window_height},
   {"log-window-width", CONFIG_Integer, &_ghidgui.log_window_width},
@@ -256,8 +255,6 @@ ghid_config_init (void)
 
   ghidgui->n_mode_button_columns = 3;
   ghidgui->small_label_markup = TRUE;
-  ghidgui->auto_pan_on = TRUE;
-  ghidgui->auto_pan_speed = 3;
   ghidgui->history_size = 5;
   dup_string (&color_file, "");
 
@@ -866,14 +863,6 @@ config_history_spin_button_cb (GtkSpinButton * spin_button, gpointer data)
 }
 
 static void
-config_auto_pan_speed_spin_button_cb (GtkSpinButton * spin_button,
-				      gpointer data)
-{
-  ghidgui->auto_pan_speed = gtk_spin_button_get_value_as_int (spin_button);
-  ghidgui->config_modified = TRUE;
-}
-
-static void
 config_general_tab_create (GtkWidget * tab_vbox)
 {
   GtkWidget *vbox;
@@ -912,10 +901,6 @@ config_general_tab_create (GtkWidget * tab_vbox)
 		    5.0, 25.0, 1.0, 1.0, 0, 0,
 		    config_history_spin_button_cb, NULL, FALSE,
 		    _("Number of commands to remember in the history list"));
-  ghid_spin_button (vbox, NULL, ghidgui->auto_pan_speed,
-		    1.0, 10.0, 1.0, 1.0, 0, 0,
-		    config_auto_pan_speed_spin_button_cb, NULL, FALSE,
-		    _("Auto pan speed"));
 }
 
 
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index c483c3c..20e8e03 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -52,7 +52,6 @@
 
 #define TOOLTIP_UPDATE_DELAY 200
 
-static gint x_pan_speed, y_pan_speed;
 void
 ghid_port_ranges_changed (void)
 {
@@ -149,45 +148,6 @@ ghid_note_event_location (GdkEventButton * ev)
   return moved;
 }
 
-gboolean
-have_crosshair_attachments (void)
-{
-  gboolean result = FALSE;
-
-  switch (Settings.Mode)
-    {
-    case COPY_MODE:
-    case MOVE_MODE:
-    case INSERTPOINT_MODE:
-      if (Crosshair.AttachedObject.Type != NO_TYPE)
-	result = TRUE;
-      break;
-    case PASTEBUFFER_MODE:
-    case VIA_MODE:
-      result = TRUE;
-      break;
-    case POLYGON_MODE:
-    case POLYGONHOLE_MODE:
-      if (Crosshair.AttachedLine.State != STATE_FIRST)
-	result = TRUE;
-      break;
-    case ARC_MODE:
-      if (Crosshair.AttachedBox.State != STATE_FIRST)
-	result = TRUE;
-      break;
-    case LINE_MODE:
-      if (Crosshair.AttachedLine.State != STATE_FIRST)
-	result = TRUE;
-      break;
-    default:
-      if (Crosshair.AttachedBox.State == STATE_SECOND
-	  || Crosshair.AttachedBox.State == STATE_THIRD)
-	result = TRUE;
-      break;
-    }
-  return result;
-}
-
 static gboolean
 ghid_idle_cb (gpointer data)
 {
@@ -603,26 +563,10 @@ ghid_port_window_enter_cb (GtkWidget * widget,
   return FALSE;
 }
 
-static gboolean
-ghid_pan_idle_cb (gpointer data)
-{
-  gdouble dx = 0, dy = 0;
-
-  if (gport->has_entered)
-    return FALSE;
-
-  dy = gport->view.coord_per_px * y_pan_speed;
-  dx = gport->view.coord_per_px * x_pan_speed;
-  ghid_pan_view_rel (dx, dy);
-  return TRUE;
-}
-
 gint
 ghid_port_window_leave_cb (GtkWidget * widget, 
                            GdkEventCrossing * ev, GHidPort * out)
 {
-  Coord x0, y0, x, y, dx, dy, w, h;
-  
   /* printf("leave mode: %d detail: %d\n", ev->mode, ev->detail); */
 
   /* Window leave events can also be triggered because of focus grabs. Some
@@ -637,62 +581,6 @@ ghid_port_window_leave_cb (GtkWidget * widget,
       return FALSE;
     }
 
-  if(out->has_entered && !ghidgui->in_popup)
-    {
-      /* if actively drawing, start scrolling */
-
-      if (have_crosshair_attachments () && ghidgui->auto_pan_on)
-	{
-	  /* GdkEvent coords are set to 0,0 at leave events, so must figure
-	     |  out edge the cursor left.
-	   */
-	  w = ghid_port.width * out->view.coord_per_px;
-	  h = ghid_port.height * out->view.coord_per_px;
-
-	  x0 = EVENT_TO_PCB_X (0);
-	  y0 = EVENT_TO_PCB_Y (0);
-	  ghid_get_coords (NULL, &x, &y);
-	  x -= x0;
-	  y -= y0;
-
-	  if (gport->view.flip_x)
-	      x = -x;
-	  if (gport->view.flip_y)
-	      y = -y;
-
-	  dx = w - x;
-	  dy = h - y;
-
-	  x_pan_speed = y_pan_speed = 2 * ghidgui->auto_pan_speed;
-
-	  if (x < dx)
-	    {
-	      x_pan_speed = -x_pan_speed;
-	      dx = x;
-	    }
-	  if (y < dy)
-	    {
-	      y_pan_speed = -y_pan_speed;
-	      dy = y;
-	    }
-	  if (dx < dy)
-	    {
-	      if (dy < h / 3)
-		y_pan_speed = y_pan_speed - (3 * dy * y_pan_speed) / h;
-	      else
-		y_pan_speed = 0;
-	    }
-	  else
-	    {
-	      if (dx < w / 3)
-		x_pan_speed = x_pan_speed - (3 * dx * x_pan_speed) / w;
-	      else
-		x_pan_speed = 0;
-	    }
-	  g_idle_add (ghid_pan_idle_cb, NULL);
-	}
-    }
-
   out->has_entered = FALSE;
 
   ghid_screen_update ();
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index dede39c..5ba5aeb 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -127,7 +127,7 @@ typedef struct
 
   gboolean adjustment_changed_holdoff,
     command_entry_status_line_active,
-    auto_pan_on, in_popup;
+    in_popup;
 
   gboolean config_modified,
     small_label_markup,
@@ -147,7 +147,7 @@ typedef struct
     keyref_window_height,
     library_window_width,
     library_window_height,
-    netlist_window_height, history_size, settings_mode, auto_pan_speed;
+    netlist_window_height, history_size, settings_mode;
 }
 GhidGui;
 
@@ -277,7 +277,6 @@ void ghid_port_ranges_changed (void);
 void ghid_port_ranges_scale (void);
 
 gboolean ghid_note_event_location (GdkEventButton * ev);
-gboolean have_crosshair_attachments (void);
 gboolean ghid_port_key_press_cb (GtkWidget * drawing_area,
 				 GdkEventKey * kev, gpointer data);
 gboolean ghid_port_key_release_cb (GtkWidget * drawing_area,




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs