[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: branch: master updated (1.1.0-20070705-11-g29f4868)
The branch, master has been updated
via 29f4868bb8ac570445da493c69afb91aafcf69d0 (commit)
via f30cf1a2fd45898b62e236116a84059bd0df9544 (commit)
via ecf159040422c5625de6b615c1070b7a1d58c511 (commit)
via 5dc09fc232bf36dc219e86e78bad92631d2c244a (commit)
via 411ddc16df3bf9388d80107503c165a8c88304b1 (commit)
via 841ecec5509d214e633a984124ab33f35d55021e (commit)
via 68b495e6b75b802a9c77889c223d680e8359ce91 (commit)
from 1361831fc9e44bcc719f73d68f4d5b119963bb57 (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
=========
gschem/lib/system-gschemrc.in | 236 +---------------------------
gschem/scheme/Makefile.am | 3 +-
gschem/scheme/auto-place-attribs.scm | 9 +-
gschem/scheme/default-attrib-positions.scm | 234 +++++++++++++++++++++++++++
gschem/src/o_complex.c | 7 +-
gschem/src/x_event.c | 15 ++-
libgeda/include/prototype.h | 1 +
libgeda/src/g_smob.c | 30 ++++
8 files changed, 293 insertions(+), 242 deletions(-)
create mode 100644 gschem/scheme/default-attrib-positions.scm
=================
Commit Messages
=================
commit 29f4868bb8ac570445da493c69afb91aafcf69d0
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Sat Jul 7 01:03:41 2007 +0200
Disable rotating using middle mouse button while copying.
Rotating while copying is still not supported, so it should be disabled.
Now middle mouse button does nothing while copying.
:100644 100644 f26218e... 5730ef7... M gschem/src/x_event.c
commit f30cf1a2fd45898b62e236116a84059bd0df9544
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Sat Jul 7 00:55:05 2007 +0200
Fixed drawing bug when attribute autoplacing is enabled.
When rotating while placing a new component, the refdes was drawn
wrongly, and it was shown fixed in the screen despite the component
being moved.
This was due to attribute autoplacing function was called before drawing
the component. This function erases the old text (which wasn't drawn), thus
drawing the text in the screen permanently.
This fix disables all drawing functions when calling autoplacing function,
and renables them afterwards.
:100644 100644 b3aa1ab... f26218e... M gschem/src/x_event.c
commit ecf159040422c5625de6b615c1070b7a1d58c511
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Sat Jul 7 00:41:05 2007 +0200
Fixed drawing bug when using attribute autoplacing.
When placing a new component, if attribute autoplacing was enabled,
the refdes was drawn wrongly, and it was shown fixed in the screen despite
the component being moved.
This was due to attribute autoplacing function was called before drawing
the component. This function erases the old text (which wasn't drawn), thus
drawing the text in the screen permanently.
This fix disables all drawing functions when calling autoplacing function,
and renables them afterwards.
:100644 100644 73fb006... af99459... M gschem/src/o_complex.c
commit 5dc09fc232bf36dc219e86e78bad92631d2c244a
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Sat Jul 7 00:35:07 2007 +0200
Moved default attrib positions out of system-gschemrc.
All default attribute positions, used for attribute autoplacing, have been
moved into its own file, scheme/default-attrib-positions.scm .
The above file is loaded in system-gschemrc.
:100644 100644 0fb6132... 6985b36... M gschem/lib/system-gschemrc.in
:100644 100644 c02bc9b... 6fdb524... M gschem/scheme/Makefile.am
:000000 100644 0000000... 80a2108... A gschem/scheme/default-attrib-positions.scm
commit 411ddc16df3bf9388d80107503c165a8c88304b1
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Fri Jul 6 23:38:31 2007 +0200
Consider line's width when calculing net directions.
In text autoplacing function get-net-connection-sides, consider line's
width when guessing net directions.
:100644 100644 6fa4c58... be0f623... M gschem/scheme/auto-place-attribs.scm
commit 841ecec5509d214e633a984124ab33f35d55021e
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Fri Jul 6 23:35:59 2007 +0200
Added new scheme function: get-line-width .
Added new scheme function, get-line-width, which returns the line
width used to draw a given object.
:100644 100644 4225762... 471d209... M libgeda/include/prototype.h
:100644 100644 b7bc4d5... fdbfeaf... M libgeda/src/g_smob.c
commit 68b495e6b75b802a9c77889c223d680e8359ce91
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Fri Jul 6 23:13:03 2007 +0200
Display a warning message if can't guess net direction.
In attribute autoplacing, display a warning message if net direction can't
be guessed.
:100644 100644 a3429b7... 6fa4c58... M gschem/scheme/auto-place-attribs.scm
=========
Changes
=========
commit 29f4868bb8ac570445da493c69afb91aafcf69d0
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Sat Jul 7 01:03:41 2007 +0200
Disable rotating using middle mouse button while copying.
Rotating while copying is still not supported, so it should be disabled.
Now middle mouse button does nothing while copying.
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index f26218e..5730ef7 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -829,9 +829,7 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
return(0);
}
- else if ((w_current->event_state == ENDMOVE) ||
- (w_current->event_state == ENDCOPY) ||
- (w_current->event_state == ENDMCOPY) ) {
+ else if (w_current->event_state == ENDMOVE) {
prev_state = w_current->event_state;
o_drawbounding(w_current, NULL,
@@ -859,6 +857,11 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
return(0);
}
+ else if ((w_current->event_state == ENDCOPY) ||
+ (w_current->event_state == ENDMCOPY)) {
+ /* Rotating while copying is still not supported, so do nothing */
+ return 0;
+ }
}
commit f30cf1a2fd45898b62e236116a84059bd0df9544
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Sat Jul 7 00:55:05 2007 +0200
Fixed drawing bug when attribute autoplacing is enabled.
When rotating while placing a new component, the refdes was drawn
wrongly, and it was shown fixed in the screen despite the component
being moved.
This was due to attribute autoplacing function was called before drawing
the component. This function erases the old text (which wasn't drawn), thus
drawing the text in the screen permanently.
This fix disables all drawing functions when calling autoplacing function,
and renables them afterwards.
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index b3aa1ab..f26218e 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -797,8 +797,12 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
o_complex_place_rotate(w_current);
- /* Run the complex place list changed hook */
+ /* Run the complex place list changed hook without redrawing */
+ /* since all objects are being redrawn afterwards */
+ prev_state = w_current->DONT_REDRAW;
+ w_current->DONT_REDRAW = 1;
o_complex_place_changed_run_hook (w_current);
+ w_current->DONT_REDRAW = prev_state;
o_drawbounding(w_current,
NULL,
commit ecf159040422c5625de6b615c1070b7a1d58c511
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Sat Jul 7 00:41:05 2007 +0200
Fixed drawing bug when using attribute autoplacing.
When placing a new component, if attribute autoplacing was enabled,
the refdes was drawn wrongly, and it was shown fixed in the screen despite
the component being moved.
This was due to attribute autoplacing function was called before drawing
the component. This function erases the old text (which wasn't drawn), thus
drawing the text in the screen permanently.
This fix disables all drawing functions when calling autoplacing function,
and renables them afterwards.
diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index 73fb006..af99459 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -129,6 +129,7 @@ void o_complex_start(TOPLEVEL *w_current, int screen_x, int screen_y)
int x, y;
int i, temp;
const CLibSymbol *sym;
+ int redraw_state;
w_current->last_x = w_current->start_x = fix_x(w_current, screen_x);
w_current->last_y = w_current->start_y = fix_y(w_current, screen_y);
@@ -161,8 +162,12 @@ void o_complex_start(TOPLEVEL *w_current, int screen_x, int screen_y)
}
}
- /* Run the complex place list changed hook */
+ /* Run the complex place list changed hook without redrawing */
+ /* since the complex place list is going to be redrawn afterwards */
+ redraw_state = w_current->DONT_REDRAW;
+ w_current->DONT_REDRAW = 1;
o_complex_place_changed_run_hook (w_current);
+ w_current->DONT_REDRAW = redraw_state;
o_drawbounding(w_current,
NULL,
commit 5dc09fc232bf36dc219e86e78bad92631d2c244a
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Sat Jul 7 00:35:07 2007 +0200
Moved default attrib positions out of system-gschemrc.
All default attribute positions, used for attribute autoplacing, have been
moved into its own file, scheme/default-attrib-positions.scm .
The above file is loaded in system-gschemrc.
diff --git a/gschem/lib/system-gschemrc.in b/gschem/lib/system-gschemrc.in
index 0fb6132..6985b36 100644
--- a/gschem/lib/system-gschemrc.in
+++ b/gschem/lib/system-gschemrc.in
@@ -845,239 +845,9 @@
; Attribute autoplacement grid
(define autoplace-attributes-grid 50)
-(define default-position-of-text-attributes
- ; Specifies the default position of text attributes.
- ; Each list entry is a list specifying the position of a text attribute.
- ; Dividing each list entry in two lines:
- ; - the first line is the attribute matching. It specifies the properties
- ; of the object and the attribute that should match in order to use
- ; that entry (all the specified properties should match).
- ; It has the following items:
- ; - attrib_name: the attribute's name for this entry.
- ; - direction: direction of the pin(s) (the arrow points to the inside
- ; of the symbol. The direction is specified by one character of
- ; v, ^, < or >. This item is a string with one or several direction
- ; characters. Including several directions here means that the
- ; object should have pins in all those directions if using this
- ; entry.
- ;
- ; - list of object attribute matching properties. It's a list with
- ; attribute_name, attribute_value pairs. A regular expression can be
- ; used in the attribute_values field.
- ; There is a special attribute name: "OBJ_TYPE" if you want to check
- ; the object type. However, the attribute_value field should be
- ; one of the already defined variables:
- ; OBJ_LINE, OBJ_BOX, OBJ_PICTURE, OBJ_CIRCLE, OBJ_NET, OBJ_BUS,
- ; OBJ_COMPLEX, OBJ_TEXT, OBJ_PIN, OBJ_ARC, OBJ_ROUTE, OBJ_THRU_HOLE,
- ; OBJ_PLACEHOLDER
- ; converted into strings (for example using the function char2str).
- ;
- ; - the second line defines where and how the attribute will be placed.
- ; The attribute is going to be placed at a position of the
- ; component, given by the "reference" item.
- ; It has the following items:
- ; - reference: the component's reference point where to place
- ; the attribute.
- ; It is a string with the format "horizontal vertical", where:
- ; - "horizontal" is one of: "Left", "Middle", "Right".
- ; - "vertical" is one of: "Lower", "Middle", "Upper".
- ; Example: "Lower Right".
- ; - x_offset, y_offset: the position offset to the reference point.
- ; The attribute position is offset by these amounts from the
- ; reference point. They can be positive or negative integers.
- ; - alignment: the attribute text's alignment.
- ; - angle: the attribute's angle.
- ;
- ; As a special case, the attributes can be automaticaly moved if
- ; they overlap with the pins or the pin connection direction, in
- ; order to avoid cluttering the schematic. Note that pinnames are
- ; also included when calculing the new position.
- ; By pin connection direction I mean the space in front of a pin
- ; where a net connecting to that pin is supposed to be drawn
- ; afterwards.
- ;
- ; For this purpose, two more items are added:
- ; - mov_dir: specify the movement directions, or where can the
- ; attribute be moved if overlapping.
- ; It is an empty string if no movement is allowed, or a string
- ; containing one or several horizontal/vertical directions.
- ; Each direction is specified with one character of v,^,< or >.
- ;
- ; When overlapping with vertical pins, the attribute will be
- ; moved horizontally (< or > characters).
- ; When overlapping with horizontal pins, the attribute will be
- ; moved vertically (v or ^ characters).
- ;
- ; Example: "<^" means that the attribute will be moved to the
- ; left if overlapping with vertical pins, or to the top if
- ; overlapping horizontal pins.
- ;
- ; - spacing: minimum spacing between the attributes and the pins.
- ; It sould be a positive integer number.
- ;
- ;Attrib_name Direct. Attribute_match <--- first line of each entry.
- ;X_offset Y_offset Reference Alignment Angle Mov_dir Spacing (>0)
- ;
- (list
- (list
- "pinlabel" ">" (list "OBJ_TYPE" (char2str OBJ_PIN))
- 50 0 "Lower Right" "Lower Left" 0 "" 0)
- (list
- "pinlabel" "<" (list "OBJ_TYPE" (char2str OBJ_PIN))
- -50 0 "Lower Left" "Lower Right" 0 "" 0)
- (list
- "pinlabel" "^" (list "OBJ_TYPE" (char2str OBJ_PIN))
- 0 50 "Upper Middle" "Lower Left" 90 "" 0)
- (list
- "pinlabel" "v" (list "OBJ_TYPE" (char2str OBJ_PIN))
- 0 -50 "Lower Middle" "Lower Right" 90 "" 0)
- (list
- "pinnumber" ">" (list "OBJ_TYPE" (char2str OBJ_PIN))
- -100 50 "Lower Right" "Lower Right" 0 "" 0)
- (list
- "pinnumber" "<" (list "OBJ_TYPE" (char2str OBJ_PIN))
- 100 50 "Lower Left" "Lower Left" 0 "" 0)
- (list
- "pinnumber" "^" (list "OBJ_TYPE" (char2str OBJ_PIN))
- -50 -100 "Upper Middle" "Lower Right" 90 "" 0)
- (list
- "pinnumber" "v" (list "OBJ_TYPE" (char2str OBJ_PIN))
- -50 100 "Lower Middle" "Lower Left" 90 "" 0)
-
- ; Component attributes
- ; One direction
- (list
- "refdes" "<" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
- (list
- "value" "<" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
- (list
- "device" "<" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
- (list
- "refdes" ">" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
- (list
- "value" ">" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
- (list
- "device" ">" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
- (list
- "refdes" "^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 100 "Middle Left" "Lower Right" 0 "" 0)
- (list
- "value" "^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -100 "Middle Left" "Lower Right" 0 "" 0)
- (list
- "device" "^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -100 "Middle Left" "Lower Right" 0 "" 0)
- (list
- "refdes" "v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 100 "Middle Left" "Lower Right" 0 "" 0)
- (list
- "value" "v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -100 "Middle Left" "Lower Right" 0 "" 0)
- (list
- "device" "v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -100 "Middle Left" "Lower Right" 0 "" 0)
- ; Two directions
- (list
- "refdes" "<>" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
- (list
- "value" "<>" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
- (list
- "device" "<>" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
- (list
- "refdes" "^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 100 "Middle Right" "Lower Left" 0 "" 0)
- (list
- "value" "^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 -100 "Middle Right" "Lower Left" 0 "" 0)
- (list
- "device" "^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 -100 "Middle Right" "Lower Left" 0 "" 0)
- ; Three directions
- (list
- "refdes" "<^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- -50 100 "Middle Left" "Lower Right" 0 "" 0)
- (list
- "value" "<^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- -50 -100 "Middle Left" "Lower Right" 0 "" 0)
- (list
- "device" "<^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- -50 -100 "Middle Left" "Lower Right" 0 "" 0)
- (list
- "refdes" ">^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 100 "Middle Right" "Lower Left" 0 "" 0)
- (list
- "value" ">^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 -100 "Middle Right" "Lower Left" 0 "" 0)
- (list
- "device" ">^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 -100 "Middle Right" "Lower Left" 0 "" 0)
- (list
- "refdes" "<>v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- -50 -50 "Lower Middle" "Upper Right" 0 "" 0)
- (list
- "value" "<>v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 -50 "Lower Middle" "Upper Left" 0 "" 0)
- (list
- "device" "<>v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 -50 "Lower Middle" "Upper Left" 0 "" 0)
- (list
- "refdes" "<>^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- -50 50 "Upper Middle" "Lower Right" 0 "" 0)
- (list
- "value" "<>^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 50 "Upper Middle" "Lower Left" 0 "" 0)
- (list
- "device" "<>^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 50 "Upper Middle" "Lower Left" 0 "" 0)
- ; Four directions
- (list
- "refdes" "<>^v"(list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 50 "Upper Left" "Lower Left" 0 "^<" 50)
- (list
- "value" "<>^v"(list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 -50 "Lower Right" "Upper Right" 0 "v>" 50)
- (list
- "device" "<>^v"(list "OBJ_TYPE" (char2str OBJ_COMPLEX))
- 50 -50 "Lower Right" "Upper Right" 0 "v>" 50)
-
- ; Net attributes
- ; Two directions
- (list
- "netname" "<>" (list "OBJ_TYPE" (char2str OBJ_NET))
- 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
- (list
- "netname" "^v" (list "OBJ_TYPE" (char2str OBJ_NET))
- -50 0 "Middle Middle" "Lower Middle" 90 "" 0)
- ; Bus attributes
- ; Two directions
- (list
- "netname" "<>" (list "OBJ_TYPE" (char2str OBJ_BUS))
- 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
- (list
- "netname" "^v" (list "OBJ_TYPE" (char2str OBJ_BUS))
- -50 0 "Middle Middle" "Lower Middle" 90 "" 0)
- ))
-
-; Position of parameters inside default-position-of-text-attributes
-(define def-attrib-name-pos 0)
-(define def-direction-pos 1)
-(define def-attrib-match 2)
-(define def-x-offset-pos 3)
-(define def-y-offset-pos 4)
-(define def-reference-pos 5)
-(define def-alignment-pos 6)
-(define def-angle-pos 7)
-(define def-move-pos 8)
-(define def-spacing-pos 9)
+; Load the default position of attributes, for attribute autoplacing
+; functions.
+(load-from-path "default-attrib-positions.scm")
; Adds the default pin attributes to each newly placed pin.
(define (add-default-pin-attributes object)
diff --git a/gschem/scheme/Makefile.am b/gschem/scheme/Makefile.am
index c02bc9b..6fdb524 100644
--- a/gschem/scheme/Makefile.am
+++ b/gschem/scheme/Makefile.am
@@ -5,7 +5,8 @@
scmdatadir = @GEDADATADIR@/scheme
scmdata_DATA = auto-uref.scm generate_netlist.scm gschem.scm list-keys.scm \
- print-NB-attribs.scm auto-place-attribs.scm pcb.scm
+ print-NB-attribs.scm auto-place-attribs.scm pcb.scm \
+ default-attrib-positions.scm
EXTRA_DIST = $(scmdata_DATA)
diff --git a/gschem/scheme/default-attrib-positions.scm b/gschem/scheme/default-attrib-positions.scm
new file mode 100644
index 0000000..80a2108
--- /dev/null
+++ b/gschem/scheme/default-attrib-positions.scm
@@ -0,0 +1,234 @@
+(define default-position-of-text-attributes
+ ; Specifies the default position of text attributes.
+ ; Each list entry is a list specifying the position of a text attribute.
+ ; Dividing each list entry in two lines:
+ ; - the first line is the attribute matching. It specifies the properties
+ ; of the object and the attribute that should match in order to use
+ ; that entry (all the specified properties should match).
+ ; It has the following items:
+ ; - attrib_name: the attribute's name for this entry.
+ ; - direction: direction of the pin(s) (the arrow points to the inside
+ ; of the symbol. The direction is specified by one character of
+ ; v, ^, < or >. This item is a string with one or several direction
+ ; characters. Including several directions here means that the
+ ; object should have pins in all those directions if using this
+ ; entry.
+ ;
+ ; - list of object attribute matching properties. It's a list with
+ ; attribute_name, attribute_value pairs. A regular expression can be
+ ; used in the attribute_values field.
+ ; There is a special attribute name: "OBJ_TYPE" if you want to check
+ ; the object type. However, the attribute_value field should be
+ ; one of the already defined variables:
+ ; OBJ_LINE, OBJ_BOX, OBJ_PICTURE, OBJ_CIRCLE, OBJ_NET, OBJ_BUS,
+ ; OBJ_COMPLEX, OBJ_TEXT, OBJ_PIN, OBJ_ARC, OBJ_ROUTE, OBJ_THRU_HOLE,
+ ; OBJ_PLACEHOLDER
+ ; converted into strings (for example using the function char2str).
+ ;
+ ; - the second line defines where and how the attribute will be placed.
+ ; The attribute is going to be placed at a position of the
+ ; component, given by the "reference" item.
+ ; It has the following items:
+ ; - reference: the component's reference point where to place
+ ; the attribute.
+ ; It is a string with the format "horizontal vertical", where:
+ ; - "horizontal" is one of: "Left", "Middle", "Right".
+ ; - "vertical" is one of: "Lower", "Middle", "Upper".
+ ; Example: "Lower Right".
+ ; - x_offset, y_offset: the position offset to the reference point.
+ ; The attribute position is offset by these amounts from the
+ ; reference point. They can be positive or negative integers.
+ ; - alignment: the attribute text's alignment.
+ ; - angle: the attribute's angle.
+ ;
+ ; As a special case, the attributes can be automaticaly moved if
+ ; they overlap with the pins or the pin connection direction, in
+ ; order to avoid cluttering the schematic. Note that pinnames are
+ ; also included when calculing the new position.
+ ; By pin connection direction I mean the space in front of a pin
+ ; where a net connecting to that pin is supposed to be drawn
+ ; afterwards.
+ ;
+ ; For this purpose, two more items are added:
+ ; - mov_dir: specify the movement directions, or where can the
+ ; attribute be moved if overlapping.
+ ; It is an empty string if no movement is allowed, or a string
+ ; containing one or several horizontal/vertical directions.
+ ; Each direction is specified with one character of v,^,< or >.
+ ;
+ ; When overlapping with vertical pins, the attribute will be
+ ; moved horizontally (< or > characters).
+ ; When overlapping with horizontal pins, the attribute will be
+ ; moved vertically (v or ^ characters).
+ ;
+ ; Example: "<^" means that the attribute will be moved to the
+ ; left if overlapping with vertical pins, or to the top if
+ ; overlapping horizontal pins.
+ ;
+ ; - spacing: minimum spacing between the attributes and the pins.
+ ; It sould be a positive integer number.
+ ;
+ ;Attrib_name Direct. Attribute_match <--- first line of each entry.
+ ;X_offset Y_offset Reference Alignment Angle Mov_dir Spacing (>0)
+ ;
+ (list
+ (list
+ "pinlabel" ">" (list "OBJ_TYPE" (char2str OBJ_PIN))
+ 50 0 "Lower Right" "Lower Left" 0 "" 0)
+ (list
+ "pinlabel" "<" (list "OBJ_TYPE" (char2str OBJ_PIN))
+ -50 0 "Lower Left" "Lower Right" 0 "" 0)
+ (list
+ "pinlabel" "^" (list "OBJ_TYPE" (char2str OBJ_PIN))
+ 0 50 "Upper Middle" "Lower Left" 90 "" 0)
+ (list
+ "pinlabel" "v" (list "OBJ_TYPE" (char2str OBJ_PIN))
+ 0 -50 "Lower Middle" "Lower Right" 90 "" 0)
+ (list
+ "pinnumber" ">" (list "OBJ_TYPE" (char2str OBJ_PIN))
+ -100 50 "Lower Right" "Lower Right" 0 "" 0)
+ (list
+ "pinnumber" "<" (list "OBJ_TYPE" (char2str OBJ_PIN))
+ 100 50 "Lower Left" "Lower Left" 0 "" 0)
+ (list
+ "pinnumber" "^" (list "OBJ_TYPE" (char2str OBJ_PIN))
+ -50 -100 "Upper Middle" "Lower Right" 90 "" 0)
+ (list
+ "pinnumber" "v" (list "OBJ_TYPE" (char2str OBJ_PIN))
+ -50 100 "Lower Middle" "Lower Left" 90 "" 0)
+
+ ; Component attributes
+ ; One direction
+ (list
+ "refdes" "<" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
+ (list
+ "value" "<" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
+ (list
+ "device" "<" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
+ (list
+ "refdes" ">" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
+ (list
+ "value" ">" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
+ (list
+ "device" ">" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
+ (list
+ "refdes" "^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 100 "Middle Left" "Lower Right" 0 "" 0)
+ (list
+ "value" "^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -100 "Middle Left" "Lower Right" 0 "" 0)
+ (list
+ "device" "^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -100 "Middle Left" "Lower Right" 0 "" 0)
+ (list
+ "refdes" "v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 100 "Middle Left" "Lower Right" 0 "" 0)
+ (list
+ "value" "v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -100 "Middle Left" "Lower Right" 0 "" 0)
+ (list
+ "device" "v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -100 "Middle Left" "Lower Right" 0 "" 0)
+ ; Two directions
+ (list
+ "refdes" "<>" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
+ (list
+ "value" "<>" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
+ (list
+ "device" "<>" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 0 -50 "Lower Middle" "Upper Middle" 0 "" 0)
+ (list
+ "refdes" "^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 100 "Middle Right" "Lower Left" 0 "" 0)
+ (list
+ "value" "^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 -100 "Middle Right" "Lower Left" 0 "" 0)
+ (list
+ "device" "^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 -100 "Middle Right" "Lower Left" 0 "" 0)
+ ; Three directions
+ (list
+ "refdes" "<^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ -50 100 "Middle Left" "Lower Right" 0 "" 0)
+ (list
+ "value" "<^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ -50 -100 "Middle Left" "Lower Right" 0 "" 0)
+ (list
+ "device" "<^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ -50 -100 "Middle Left" "Lower Right" 0 "" 0)
+ (list
+ "refdes" ">^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 100 "Middle Right" "Lower Left" 0 "" 0)
+ (list
+ "value" ">^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 -100 "Middle Right" "Lower Left" 0 "" 0)
+ (list
+ "device" ">^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 -100 "Middle Right" "Lower Left" 0 "" 0)
+ (list
+ "refdes" "<>v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ -50 -50 "Lower Middle" "Upper Right" 0 "" 0)
+ (list
+ "value" "<>v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 -50 "Lower Middle" "Upper Left" 0 "" 0)
+ (list
+ "device" "<>v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 -50 "Lower Middle" "Upper Left" 0 "" 0)
+ (list
+ "refdes" "<>^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ -50 50 "Upper Middle" "Lower Right" 0 "" 0)
+ (list
+ "value" "<>^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 50 "Upper Middle" "Lower Left" 0 "" 0)
+ (list
+ "device" "<>^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 50 "Upper Middle" "Lower Left" 0 "" 0)
+ ; Four directions
+ (list
+ "refdes" "<>^v"(list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 50 "Upper Left" "Lower Left" 0 "^<" 50)
+ (list
+ "value" "<>^v"(list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 -50 "Lower Right" "Upper Right" 0 "v>" 50)
+ (list
+ "device" "<>^v"(list "OBJ_TYPE" (char2str OBJ_COMPLEX))
+ 50 -50 "Lower Right" "Upper Right" 0 "v>" 50)
+
+ ; Net attributes
+ ; Two directions
+ (list
+ "netname" "<>" (list "OBJ_TYPE" (char2str OBJ_NET))
+ 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
+ (list
+ "netname" "^v" (list "OBJ_TYPE" (char2str OBJ_NET))
+ -50 0 "Middle Middle" "Lower Middle" 90 "" 0)
+ ; Bus attributes
+ ; Two directions
+ (list
+ "netname" "<>" (list "OBJ_TYPE" (char2str OBJ_BUS))
+ 0 50 "Upper Middle" "Lower Middle" 0 "" 0)
+ (list
+ "netname" "^v" (list "OBJ_TYPE" (char2str OBJ_BUS))
+ -50 0 "Middle Middle" "Lower Middle" 90 "" 0)
+ ))
+
+; Position of parameters inside default-position-of-text-attributes
+(define def-attrib-name-pos 0)
+(define def-direction-pos 1)
+(define def-attrib-match 2)
+(define def-x-offset-pos 3)
+(define def-y-offset-pos 4)
+(define def-reference-pos 5)
+(define def-alignment-pos 6)
+(define def-angle-pos 7)
+(define def-move-pos 8)
+(define def-spacing-pos 9)
+
commit 411ddc16df3bf9388d80107503c165a8c88304b1
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Fri Jul 6 23:38:31 2007 +0200
Consider line's width when calculing net directions.
In text autoplacing function get-net-connection-sides, consider line's
width when guessing net directions.
diff --git a/gschem/scheme/auto-place-attribs.scm b/gschem/scheme/auto-place-attribs.scm
index 6fa4c58..be0f623 100644
--- a/gschem/scheme/auto-place-attribs.scm
+++ b/gschem/scheme/auto-place-attribs.scm
@@ -90,10 +90,11 @@
(min-y (get-point-of-bound "min-y" bounds))
(max-y (get-point-of-bound "max-y" bounds))
)
- (if (eq? min-x max-x)
+ ; Line's width needs to be considered here.
+ (if (eq? (- max-x min-x) (get-line-width object))
; If the x bounds are the same, this is a vertical segment.
"^v"
- (if (eq? min-y max-y)
+ (if (eq? (- max-y min-y) (get-line-width object))
; If the y bounds are, this is a horizontal segment.
"<>"
; X or Y bounds are not the same. We don't know.
commit 841ecec5509d214e633a984124ab33f35d55021e
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Fri Jul 6 23:35:59 2007 +0200
Added new scheme function: get-line-width .
Added new scheme function, get-line-width, which returns the line
width used to draw a given object.
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 4225762..471d209 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -80,6 +80,7 @@ SCM g_make_object_smob(TOPLEVEL *curr_w, OBJECT *object);
SCM g_get_object_attributes(SCM object_smob);
SCM g_get_attrib_value_by_attrib_name(SCM object_smob, SCM scm_attrib_name);
SCM g_get_object_type(SCM object_smob);
+SCM g_get_line_width(SCM object_smob);
void g_init_object_smob(void);
gboolean g_get_data_from_object_smob(SCM object_smob, TOPLEVEL **toplevel,
OBJECT **object);
diff --git a/libgeda/src/g_smob.c b/libgeda/src/g_smob.c
index b7bc4d5..fdbfeaf 100644
--- a/libgeda/src/g_smob.c
+++ b/libgeda/src/g_smob.c
@@ -630,6 +630,35 @@ SCM g_get_object_type(SCM object_smob)
return returned;
}
+/*! \brief Get the line width used to draw an object.
+ * \par Function Description
+ * This function returns the line width used to draw an object.
+ *
+ * \param [in] object_smob The object smob to get the line width.
+ * \return The line width.
+ * Actually it is the object->line_width.
+ */
+SCM g_get_line_width(SCM object_smob)
+{
+ struct st_object_smob *object_struct;
+ OBJECT *object;
+ SCM returned = SCM_EOL;
+
+ SCM_ASSERT ( SCM_NIMP(object_smob) &&
+ ((long) SCM_CAR(object_smob) == object_smob_tag),
+ object_smob, SCM_ARG1, "get-object-type");
+
+ object_struct = (struct st_object_smob *)SCM_CDR(object_smob);
+
+ g_assert (object_struct && object_struct->object);
+
+ object = (OBJECT *) object_struct->object;
+
+ returned = scm_from_int(object->line_width);
+
+ return returned;
+}
+
/*! \brief Initialize the framework to support an object smob.
* \par Function Description
* Initialize the framework to support an object smob.
@@ -647,6 +676,7 @@ void g_init_object_smob(void)
scm_c_define_gsubr("get-attrib-value-by-attrib-name", 2, 0, 0,
g_get_attrib_value_by_attrib_name);
scm_c_define_gsubr("get-object-type", 1, 0, 0, g_get_object_type);
+ scm_c_define_gsubr("get-line-width", 1, 0, 0, g_get_line_width);
return;
}
commit 68b495e6b75b802a9c77889c223d680e8359ce91
Author: Carlos Nieves Onega <cnieves@xxxxxxxxxx>
Date: Fri Jul 6 23:13:03 2007 +0200
Display a warning message if can't guess net direction.
In attribute autoplacing, display a warning message if net direction can't
be guessed.
diff --git a/gschem/scheme/auto-place-attribs.scm b/gschem/scheme/auto-place-attribs.scm
index a3429b7..6fa4c58 100644
--- a/gschem/scheme/auto-place-attribs.scm
+++ b/gschem/scheme/auto-place-attribs.scm
@@ -97,7 +97,9 @@
; If the y bounds are, this is a horizontal segment.
"<>"
; X or Y bounds are not the same. We don't know.
- ""
+ (begin
+ (display "Warning: get-net-connection-sides: Can't guess net direction.\n")
+ "")
)
)
)
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs