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

gEDA-cvs: pcb.git: branch: master updated (42b463193c8d4f5e000713920e5d9b207ac37031)



The branch, master has been updated
       via  42b463193c8d4f5e000713920e5d9b207ac37031 (commit)
      from  d9271d3d92b5513c7cec40c4bf1ae6d98f352a9b (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/gui-netlist-window.c |   28 ++++++++++++++++++-
 src/select.c                     |   54 --------------------------------------
 src/select.h                     |    1 -
 3 files changed, 26 insertions(+), 57 deletions(-)


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

commit 42b463193c8d4f5e000713920e5d9b207ac37031
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Move the SelectPin() function into the file of its only caller.
    
    The new function is in hid/gtk/gui-netlist-window.c, and is called
    toggle_pin_selected ().
    
    Whilst we're at it, simplify the function, removing its always-
    constant argument and condense the redrawing calls.

:100644 100644 31caa2e... ea7cef5... M	src/hid/gtk/gui-netlist-window.c
:100644 100644 8dfe270... 96db234... M	src/select.c
:100644 100644 e24ab82... 0e12cc2... M	src/select.h

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

commit 42b463193c8d4f5e000713920e5d9b207ac37031
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Move the SelectPin() function into the file of its only caller.
    
    The new function is in hid/gtk/gui-netlist-window.c, and is called
    toggle_pin_selected ().
    
    Whilst we're at it, simplify the function, removing its always-
    constant argument and condense the redrawing calls.

diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index 31caa2e..ea7cef5 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -207,6 +207,30 @@ node_model_update (LibraryMenuType * menu)
     g_object_unref (G_OBJECT (model));
 }
 
+static void
+toggle_pin_selected (LibraryEntryType *entry)
+{
+  ConnectionType conn;
+
+  if (!SeekPad (entry, &conn, false))
+    return;
+
+  AddObjectToFlagUndoList (conn.type, conn.ptr1, conn.ptr2, conn.ptr2);
+  TOGGLE_FLAG (SELECTEDFLAG, (AnyObjectType *)conn.ptr2);
+  DrawObject (conn.type, conn.ptr1, conn.ptr2);
+
+  if (conn.type == PIN_TYPE)
+    {
+      PinTypePtr pin = (PinTypePtr) conn.ptr2;
+      CenterDisplay (pin->X, pin->Y);
+    }
+  else if (conn.type == PAD_TYPE)
+    {
+      PadTypePtr pad = (PadTypePtr) conn.ptr2;
+      CenterDisplay (pad->Point1.X, pad->Point1.Y);
+    }
+}
+
 
 /* Callback when the user clicks on a PCB node in the right node treeview.
  */
@@ -234,7 +258,7 @@ node_selection_changed_cb (GtkTreeSelection * selection, gpointer data)
       |  if off here will get our on/off toggling out of sync.
       */
       if (node_net == node_selected_net)
-	SelectPin (node, TRUE);
+        toggle_pin_selected (node);
       g_free (node_name);
       node_name = NULL;
     }
@@ -259,7 +283,7 @@ node_selection_changed_cb (GtkTreeSelection * selection, gpointer data)
 
   /* Now just toggle a select of the node on the layout and pan.
    */
-  SelectPin (node, TRUE);
+  toggle_pin_selected (node);
   IncrementUndoSerialNumber ();
 	margin = gport->view_width / 20;
 	if (   Crosshair.X < gport->view_x0 + margin
diff --git a/src/select.c b/src/select.c
index 8dfe270..96db234 100644
--- a/src/select.c
+++ b/src/select.c
@@ -61,60 +61,6 @@
 
 RCSID ("$Id$");
 
-
-
-/* ---------------------------------------------------------------------------
- * toggle selection of pin
- * This SelectPin function was moved to here from the original netlist.c
- * as part of the gui code separation for the Gtk port. SelectPin() is
- * written by and is Copyright (C) 1998, 1999, 2000, 2001 harry eaton
- */
-void
-SelectPin (LibraryEntryTypePtr entry, bool toggle)
-{
-  ConnectionType conn;
-
-  if (SeekPad (entry, &conn, false))
-    {
-      switch (conn.type)
-	{
-	case PIN_TYPE:
-	  {
-	    PinTypePtr pin = (PinTypePtr) conn.ptr2;
-
-	    AddObjectToFlagUndoList (PIN_TYPE, conn.ptr1, conn.ptr2,
-				     conn.ptr2);
-	    if (toggle)
-	      {
-		TOGGLE_FLAG (SELECTEDFLAG, pin);
-		CenterDisplay (pin->X, pin->Y);
-	      }
-	    else
-	      SET_FLAG (SELECTEDFLAG, pin);
-	    DrawPin (pin);
-	    break;
-	  }
-	case PAD_TYPE:
-	  {
-	    PadTypePtr pad = (PadTypePtr) conn.ptr2;
-
-	    AddObjectToFlagUndoList (PAD_TYPE, conn.ptr1, conn.ptr2,
-				     conn.ptr2);
-	    if (toggle)
-	      {
-		TOGGLE_FLAG (SELECTEDFLAG, pad);
-		CenterDisplay (pad->Point1.X, pad->Point1.Y);
-	      }
-	    else
-	      SET_FLAG (SELECTEDFLAG, pad);
-	    DrawPad (pad);
-	    break;
-	  }
-	}
-    }
-}
-
-
 /* ---------------------------------------------------------------------------
  * toggles the selection of any kind of object
  * the different types are defined by search.h
diff --git a/src/select.h b/src/select.h
index e24ab82..0e12cc2 100644
--- a/src/select.h
+++ b/src/select.h
@@ -37,7 +37,6 @@
 	(VIA_TYPE | LINE_TYPE | TEXT_TYPE | POLYGON_TYPE | ELEMENT_TYPE |	\
 	 PIN_TYPE | PAD_TYPE | ELEMENTNAME_TYPE | RATLINE_TYPE | ARC_TYPE)
 
-void SelectPin (LibraryEntryTypePtr entry, bool toggle);
 bool SelectObject (void);
 bool SelectBlock (BoxTypePtr, bool);
 bool SelectedOperation (ObjectFunctionTypePtr, bool, int);




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