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

gEDA-cvs: pcb.git: branch: master updated (70d3bfa6da2b72f52a071b2183d21a60d6db44d4)



The branch, master has been updated
       via  70d3bfa6da2b72f52a071b2183d21a60d6db44d4 (commit)
       via  1e6c76cc65aeb54513e45a6162376afbb14dc55e (commit)
       via  c7c2a77d032a061f098cceef2085d482198cf1de (commit)
       via  f48e9b3ee6ffc86f99e44220e575c3a0a04875ed (commit)
      from  be0620e20b85d2d8122383a11fef8646153f7f5d (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
=========

 lib/geda.inc              |    2 +
 src/hid/lesstif/main.c    |   93 +++++++++++++++++++++++++++++++++++----------
 src/hid/lesstif/menu.c    |   10 +++-
 src/hid/lesstif/netlist.c |    2 +-
 4 files changed, 83 insertions(+), 24 deletions(-)


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

commit 70d3bfa6da2b72f52a071b2183d21a60d6db44d4
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Allow zoom-out-past-board for Lesstif
    
    The lesstif GUI has been modified two ways:
    
    1. You may zoom out "past" the board, making the board smaller
    than the window.  Note that the crosshair is still limited to
    the board's extents.
    
    2. You may pan the board so that edges need not be on the edge
    of the window, such as centering an edge for inspection.
    
    Note that the smallest the board can be is 1/10th the window
    size.  While this is arbitrary, it's easily changed if needed,
    and avoids problems with miniscule boards (and thus maxiscule
    coordinate systems).
    
    The 'v' key still zooms the board to fit, but now centers the
    board in the window rather than placing it at the upper left.

:100644 100644 5f497a8... 70a00dc... M	src/hid/lesstif/main.c

commit 1e6c76cc65aeb54513e45a6162376afbb14dc55e
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    ResetConncetions -> ResetConnections
    
    Typo.

:100644 100644 4ddc240... 3645547... M	src/hid/lesstif/netlist.c

commit c7c2a77d032a061f098cceef2085d482198cf1de
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix lesstif segfault in key handling.
    
    When a key handler calls an action, the key table might change
    before the action returns (via nested key handlers), so save a
    pointer to the table we're parsing to ensure it will be around
    when we return.

:100644 100644 6baa016... 6442fcd... M	src/hid/lesstif/menu.c

commit f48e9b3ee6ffc86f99e44220e575c3a0a04875ed
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Add 80-pin headers.
    
    Add 80 pin DIP and Ribbon 0.1" header macros to the usual list.

:100644 100644 347adcf... b2a2310... M	lib/geda.inc

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

commit 70d3bfa6da2b72f52a071b2183d21a60d6db44d4
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Allow zoom-out-past-board for Lesstif
    
    The lesstif GUI has been modified two ways:
    
    1. You may zoom out "past" the board, making the board smaller
    than the window.  Note that the crosshair is still limited to
    the board's extents.
    
    2. You may pan the board so that edges need not be on the edge
    of the window, such as centering an edge for inspection.
    
    Note that the smallest the board can be is 1/10th the window
    size.  While this is arbitrary, it's easily changed if needed,
    and avoids problems with miniscule boards (and thus maxiscule
    coordinate systems).
    
    The 'v' key still zooms the board to fit, but now centers the
    board in the window rather than placing it at the upper left.

diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 5f497a8..70a00dc 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -44,6 +44,9 @@ RCSID ("$Id$");
 #define XtRDouble "Double"
 #endif
 
+/* How big the viewport can be relative to the pcb size.  */
+#define MAX_ZOOM_SCALE	10
+
 typedef struct hid_gc_struct
 {
   HID *me_pointer;
@@ -190,6 +193,7 @@ HID_Attribute lesstif_attribute_list[] = {
 REGISTER_ATTRIBUTES (lesstif_attribute_list)
 
 static void lesstif_use_mask (int use_it);
+static void zoom_max ();
 static void zoom_to (double factor, int x, int y);
 static void zoom_by (double factor, int x, int y);
 static void zoom_toggle (int x, int y);
@@ -337,7 +341,7 @@ PCBChanged (int argc, char **argv, int x, int y)
   stdarg (XmNsliderSize, PCB->MaxHeight ? PCB->MaxHeight : 1);
   stdarg (XmNmaximum, PCB->MaxHeight ? PCB->MaxHeight : 1);
   XtSetValues (vscroll, args, n);
-  zoom_by (1000000, 0, 0);
+  zoom_max ();
 
   hid_action ("NetlistChanged");
   hid_action ("LayersChanged");
@@ -452,7 +456,7 @@ ZoomAction (int argc, char **argv, int x, int y)
     }
   if (argc < 1)
     {
-      zoom_to (1000000, 0, 0);
+      zoom_max ();
       return 0;
     }
   vp = argv[0];
@@ -1131,6 +1135,7 @@ set_scroll (Widget s, int pos, int view, int pcb)
 void
 lesstif_pan_fixup ()
 {
+#if 0
   if (view_left_x > PCB->MaxWidth - (view_width * view_zoom))
     view_left_x = PCB->MaxWidth - (view_width * view_zoom);
   if (view_top_y > PCB->MaxHeight - (view_height * view_zoom))
@@ -1145,6 +1150,7 @@ lesstif_pan_fixup ()
       zoom_by (1, 0, 0);
       return;
     }
+#endif
 
   set_scroll (hscroll, view_left_x, view_width, PCB->MaxWidth);
   set_scroll (vscroll, view_top_y, view_height, PCB->MaxHeight);
@@ -1153,6 +1159,20 @@ lesstif_pan_fixup ()
 }
 
 static void
+zoom_max ()
+{
+  double new_zoom = PCB->MaxWidth / view_width;
+  if (new_zoom < PCB->MaxHeight / view_height)
+    new_zoom = PCB->MaxHeight / view_height;
+
+  view_left_x = -(view_width * new_zoom - PCB->MaxWidth) / 2;
+  view_top_y = -(view_height * new_zoom - PCB->MaxHeight) / 2;
+  view_zoom = new_zoom;
+  pixel_slop = view_zoom;
+  lesstif_pan_fixup ();
+}
+
+static void
 zoom_to (double new_zoom, int x, int y)
 {
   double max_zoom, xfrac, yfrac;
@@ -1170,6 +1190,8 @@ zoom_to (double new_zoom, int x, int y)
   if (max_zoom < PCB->MaxHeight / view_height)
     max_zoom = PCB->MaxHeight / view_height;
 
+  max_zoom *= MAX_ZOOM_SCALE;
+
   if (new_zoom < 1)
     new_zoom = 1;
   if (new_zoom > max_zoom)
@@ -2429,29 +2451,60 @@ idle_proc (XtPointer dummy)
 	}
       XSetForeground (display, bg_gc, bgcolor);
       XFillRectangle (display, main_pixmap, bg_gc, 0, 0, mx, my);
-      if (region.X2 > PCB->MaxWidth || region.Y2 > PCB->MaxHeight)
+
+      if (region.X1 < 0 || region.Y1 < 0
+	  || region.X2 > PCB->MaxWidth || region.Y2 > PCB->MaxHeight)
 	{
+	  int leftmost, rightmost, topmost, bottommost;
+
+	  leftmost = Vx (0);
+	  rightmost = Vx (PCB->MaxWidth);
+	  topmost = Vy (0);
+	  bottommost = Vy (PCB->MaxHeight);
+	  if (leftmost > rightmost) {
+	    int t = leftmost;
+	    leftmost = rightmost;
+	    rightmost = t;
+	  }
+	  if (topmost > bottommost) {
+	    int t = topmost;
+	    topmost = bottommost;
+	    bottommost = t;
+	  }
+	  if (leftmost < 0)
+	    leftmost = 0;
+	  if (topmost < 0)
+	    topmost = 0;
+	  if (rightmost > view_width)
+	    rightmost = view_width;
+	  if (bottommost > view_height)
+	    bottommost = view_height;
+
 	  XSetForeground (display, bg_gc, offlimit_color);
-	  if (region.X2 > PCB->MaxWidth)
-	    {
-	      mx = Vx (PCB->MaxWidth);
-	      if (flip_x)
-		XFillRectangle (display, main_pixmap, bg_gc, 0, 0,
-				mx-1, my);
-	      else
-		XFillRectangle (display, main_pixmap, bg_gc, mx+1, 0,
-				view_width - mx + 1, my);
 
+	  /* L T R
+             L x R
+             L B R */
+
+	  if (leftmost > 0)
+	    {
+	      XFillRectangle (display, main_pixmap, bg_gc, 0, 0,
+			      leftmost, view_height);
+	    }
+	  if (rightmost < view_width)
+	    {
+	      XFillRectangle (display, main_pixmap, bg_gc, rightmost+1, 0,
+			      view_width-rightmost+1, view_height);
+	    }
+	  if (topmost > 0)
+	    {
+	      XFillRectangle (display, main_pixmap, bg_gc, leftmost, 0,
+			      rightmost-leftmost+1, topmost);
 	    }
-	  if (region.Y2 > PCB->MaxHeight)
+	  if (bottommost < view_height)
 	    {
-	      my = Vy (PCB->MaxHeight) + 1;
-	      if (flip_y)
-		XFillRectangle (display, main_pixmap, bg_gc, 0, 0, mx,
-				my-1);
-	      else
-		XFillRectangle (display, main_pixmap, bg_gc, 0, my, mx,
-				view_height - my + 1);
+	      XFillRectangle (display, main_pixmap, bg_gc, leftmost, bottommost+1,
+			      rightmost-leftmost+1, view_height-bottommost+1);
 	    }
 	}
       DrawBackgroundImage();

commit 1e6c76cc65aeb54513e45a6162376afbb14dc55e
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    ResetConncetions -> ResetConnections
    
    Typo.

diff --git a/src/hid/lesstif/netlist.c b/src/hid/lesstif/netlist.c
index 4ddc240..3645547 100644
--- a/src/hid/lesstif/netlist.c
+++ b/src/hid/lesstif/netlist.c
@@ -143,7 +143,7 @@ nbcb_select_common (LibraryMenuTypePtr net, int pos, int select_flag)
       RatFindHook (conn.type, conn.ptr1, conn.ptr2, conn.ptr2, true, true);
 
   SelectConnection (select_flag);
-  ResetConncetions (false);
+  ResetConnections (false);
   FreeConnectionLookupMemory ();
   IncrementUndoSerialNumber ();
   Draw ();

commit c7c2a77d032a061f098cceef2085d482198cf1de
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix lesstif segfault in key handling.
    
    When a key handler calls an action, the key table might change
    before the action returns (via nested key handlers), so save a
    pointer to the table we're parsing to ensure it will be around
    when we return.

diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index 6baa016..6442fcd 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -1098,6 +1098,7 @@ lesstif_key_event (XKeyEvent * e)
   int mods = 0;
   int i, vi;
   static int sorted = 0;
+  acc_table_t *my_table = 0;
 
   if (!sorted)
     {
@@ -1202,10 +1203,13 @@ lesstif_key_event (XKeyEvent * e)
   else
     have_xy = 0;
 
-  for (vi = 1; vi < cur_table[i].u.a.node->c; vi++)
-    if (resource_type (cur_table[i].u.a.node->v[vi]) == 10)
+  /* Parsing actions may not return until more user interaction
+     happens, so remember which table we're scanning.  */
+  my_table = cur_table;
+  for (vi = 1; vi < my_table[i].u.a.node->c; vi++)
+    if (resource_type (my_table[i].u.a.node->v[vi]) == 10)
       if (hid_parse_actions
-	  (cur_table[i].u.a.node->v[vi].value))
+	  (my_table[i].u.a.node->v[vi].value))
 	break;
   cur_table = 0;
   return 1;

commit f48e9b3ee6ffc86f99e44220e575c3a0a04875ed
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Add 80-pin headers.
    
    Add 80 pin DIP and Ribbon 0.1" header macros to the usual list.

diff --git a/lib/geda.inc b/lib/geda.inc
index 347adcf..b2a2310 100644
--- a/lib/geda.inc
+++ b/lib/geda.inc
@@ -793,6 +793,7 @@ define(`PKG_HEADER58_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 29)');
 define(`PKG_HEADER60_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 30)');
 define(`PKG_HEADER62_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 31)');
 define(`PKG_HEADER64_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 32)');
+define(`PKG_HEADER80_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 40)');
 
 #
 ## Header connector, ribbon cable numbering
@@ -830,6 +831,7 @@ define(`PKG_HEADER58_2', `PKG_CONNECTOR(`$1', `$2', `$3', 29, 2)');
 define(`PKG_HEADER60_2', `PKG_CONNECTOR(`$1', `$2', `$3', 30, 2)');
 define(`PKG_HEADER62_2', `PKG_CONNECTOR(`$1', `$2', `$3', 31, 2)');
 define(`PKG_HEADER64_2', `PKG_CONNECTOR(`$1', `$2', `$3', 32, 2)');
+define(`PKG_HEADER80_2', `PKG_CONNECTOR(`$1', `$2', `$3', 40, 2)');
 
 #
 ## Header connector with latches




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