libgeda: Make sure all object fields are initialized
[geda-gaf.git] / gschem / scheme / default-attrib-positions.scm
blob5d3ac14e483f8265ee9bb43fb2be9cdc2caeec98
1 (define default-position-of-text-attributes
2    ; Specifies the default position of text attributes.
3    ; Each list entry is a list specifying the position of a text attribute.
4    ; Dividing each list entry in two lines:
5    ;   - the first line is the attribute matching. It specifies the properties
6    ;     of the object and the attribute that should match in order to use
7    ;     that entry (all the specified properties should match). 
8    ;     It has the following items:
9    ;       - attrib_name: the attribute's name for this entry.
10    ;       - direction: direction of the pin(s) (the arrow points to the inside
11    ;         of the symbol. The direction is specified by one character of
12    ;         v, ^, < or >. This item is a string with one or several direction
13    ;         characters. Including several directions here means that the 
14    ;         object should have pins in all those directions if using this 
15    ;         entry.
16    ;
17    ;       - list of object attribute matching properties. It's a list with 
18    ;         attribute_name, attribute_value pairs. A regular expression can be
19    ;         used in the attribute_values field.
20    ;         There is a special attribute name: "OBJ_TYPE" if you want to check
21    ;         the object type. However, the attribute_value field should be
22    ;         one of the already defined variables: 
23    ;         OBJ_LINE, OBJ_BOX, OBJ_PICTURE, OBJ_CIRCLE, OBJ_NET, OBJ_BUS,
24    ;         OBJ_COMPLEX, OBJ_TEXT, OBJ_PIN, OBJ_ARC, OBJ_PLACEHOLDER
25    ;         converted into strings (for example using the function char2str).
26    ;
27    ;    - the second line defines where and how the attribute will be placed.
28    ;      The attribute is going to be placed at a position of the
29    ;      component, given by the "reference" item.
30    ;      It has the following items:
31    ;        - x_offset, y_offset: the position offset to the reference point.
32    ;          The attribute position is offset by these amounts from the
33    ;          reference point. They can be positive or negative integers.
34    ;        - reference: the component's reference point where to place 
35    ;          the attribute. The reference point is calculated using 
36    ;          component's bounds, so pin's line width, for example, matter.
37    ;          Example: Pin from (100,50) to (400,50), pin's line width is 10.
38    ;            Pin bounds:
39    ;              top: 55
40    ;              bottom: 45
41    ;              left: 95
42    ;              right: 405
43    ;            "Lower left": (95,45)
44    ;          It is a string with the format "horizontal vertical", where:
45    ;            - "horizontal" is one of: "Left",  "Middle", "Right".
46    ;            - "vertical"   is one of: "Lower", "Middle", "Upper".
47    ;          Example: "Lower Right".
48    ;        - alignment: the attribute text's alignment.
49    ;        - angle: the attribute's angle.
50    ;
51    ;       As a special case, the attributes can be automaticaly moved if 
52    ;       they overlap with the pins or the pin connection direction, in
53    ;       order to avoid cluttering the schematic. Note that pinnames are
54    ;       also included when calculing the new position.
55    ;       By pin connection direction I mean the space in front of a pin
56    ;       where a net connecting to that pin is supposed to be drawn 
57    ;       afterwards.
58    ; 
59    ;       For this purpose, two more items are added:
60    ;         - mov_dir: specify the movement directions, or where can the 
61    ;           attribute be moved if overlapping.
62    ;           It is an empty string if no movement is allowed, or a string
63    ;           containing one or several horizontal/vertical directions.
64    ;           Each direction is specified with one character of v,^,< or >.
65    ;
66    ;           When overlapping with vertical pins, the attribute will be
67    ;           moved horizontally (< or > characters).
68    ;           When overlapping with horizontal pins, the attribute will be
69    ;           moved vertically (v or ^ characters).
70    ;
71    ;           Example: "<^" means that the attribute will be moved to the 
72    ;           left if overlapping with vertical pins, or to the top if
73    ;           overlapping horizontal pins.
74    ;
75    ;         - spacing: minimum spacing between the attributes and the pins.
76    ;           It sould be a positive integer number.
77    ;
78    ;         - color: the color to assign to the attribute. A -1 will leave 
79    ;           the color unchanged.
80    ;
81    ;Attrib_name Direct. Attribute_match  <--- first line of each entry.
82    ;X_offset Y_offset Reference       Alignment    Angle Mov_dir  Spacing (>0) Color
83    ;
84   (list 
85    (list 
86     "pinlabel"  ">"  (list "OBJ_TYPE" (char2str OBJ_PIN))
87       50      0       "Lower Right"   "Lower Left"     0      ""   0   9)
88    (list
89     "pinlabel"  "<"  (list "OBJ_TYPE" (char2str OBJ_PIN))
90      -50      0       "Lower Left"    "Lower Right"    0      ""   0   9)
91    (list
92     "pinlabel"  "^"  (list "OBJ_TYPE" (char2str OBJ_PIN))
93        0     50       "Upper Middle"  "Lower Left"    90      ""   0   9)
94    (list
95     "pinlabel"  "v"  (list "OBJ_TYPE" (char2str OBJ_PIN))
96        0    -50       "Lower Middle"  "Lower Right"   90      ""   0   9)
97    (list
98     "pinnumber" ">"  (list "OBJ_TYPE" (char2str OBJ_PIN))
99     -100     50       "Lower Right"   "Lower Right"    0      ""   0  -1)
100    (list
101     "pinnumber" "<"  (list "OBJ_TYPE" (char2str OBJ_PIN))
102      100     50       "Lower Left"    "Lower Left"     0      ""   0  -1)
103    (list
104     "pinnumber" "^"  (list "OBJ_TYPE" (char2str OBJ_PIN))
105      -50   -100       "Upper Middle"  "Lower Right"   90      ""   0  -1)
106    (list 
107     "pinnumber" "v"  (list "OBJ_TYPE" (char2str OBJ_PIN))
108      -50    100       "Lower Middle"  "Lower Left"    90      ""   0  -1)
109    
110      ; Component attributes
111      ;   One direction
112    (list 
113     "refdes"    "<"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
114        0     50       "Upper Middle"  "Lower Middle"   0      ""   0  -1)
115    (list 
116     "value"     "<"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
117        0    -50       "Lower Middle"  "Upper Middle"   0      ""   0  -1)
118    (list 
119     "device"    "<"  (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
120        0    -50       "Lower Middle"  "Upper Middle"   0      ""   0  -1)
121    (list 
122     "refdes"    ">" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
123        0     50       "Upper Middle"  "Lower Middle"   0      ""   0  -1)
124    (list 
125     "value"     ">" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
126        0    -50       "Lower Middle"  "Upper Middle"   0      ""   0  -1)
127    (list 
128     "device"    ">" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
129        0    -50       "Lower Middle"  "Upper Middle"   0      ""   0  -1)
130    (list 
131     "refdes"    "^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
132        0    100       "Middle Left"   "Lower Right"    0      ""   0  -1)
133    (list 
134     "value"     "^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
135        0   -100       "Middle Left"   "Lower Right"    0      ""   0  -1)
136    (list 
137     "device"    "^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
138        0   -100       "Middle Left"   "Lower Right"    0      ""   0  -1)
139    (list 
140     "refdes"    "v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
141        0    100       "Middle Left"   "Lower Right"    0      ""   0  -1)
142    (list 
143     "value"     "v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
144        0   -100       "Middle Left"   "Lower Right"    0      ""   0  -1)
145    (list 
146     "device"    "v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
147        0   -100       "Middle Left"   "Lower Right"    0      ""   0  -1)
148         ;   Two directions
149    (list 
150     "refdes"   "<>" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
151        0     50       "Upper Middle"  "Lower Middle"   0      ""   0  -1)
152    (list 
153     "value"    "<>" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
154        0    -50       "Lower Middle"  "Upper Middle"   0      ""   0  -1)
155    (list 
156     "device"   "<>" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
157        0    -50       "Lower Middle"  "Upper Middle"   0      ""   0  -1)
158    (list 
159     "refdes"   "^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
160       50    100       "Middle Right"  "Lower Left"     0      ""   0  -1)
161    (list 
162     "value"    "^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
163       50   -100       "Middle Right"  "Lower Left"     0      ""   0  -1)
164    (list 
165     "device"   "^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
166       50   -100       "Middle Right"  "Lower Left"     0      ""   0  -1)
167         ;   Three directions
168    (list 
169     "refdes"  "<^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
170      -50    100       "Middle Left"   "Lower Right"    0      ""   0  -1)
171    (list 
172     "value"   "<^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
173      -50   -100       "Middle Left"   "Lower Right"    0      ""   0  -1)
174    (list 
175     "device"  "<^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
176      -50   -100       "Middle Left"   "Lower Right"    0      ""   0  -1)
177    (list 
178     "refdes"  ">^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
179       50    100       "Middle Right"  "Lower Left"     0      ""   0  -1)
180    (list 
181     "value"   ">^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
182       50   -100       "Middle Right"  "Lower Left"     0      ""   0  -1)
183    (list 
184     "device"  ">^v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
185       50   -100       "Middle Right"  "Lower Left"     0      ""   0  -1)
186    (list 
187     "refdes"  "<>v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
188      -50    -50       "Lower Middle"  "Upper Right"    0      ""   0  -1)
189    (list 
190     "value"   "<>v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
191       50    -50       "Lower Middle"  "Upper Left"     0      ""   0  -1)
192    (list 
193     "device"  "<>v" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
194       50    -50       "Lower Middle"  "Upper Left"     0      ""   0  -1)
195    (list 
196     "refdes"  "<>^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
197      -50     50       "Upper Middle"  "Lower Right"    0      ""   0  -1)
198    (list 
199     "value"   "<>^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
200       50     50       "Upper Middle"  "Lower Left"     0      ""   0  -1)
201    (list 
202     "device"  "<>^" (list "OBJ_TYPE" (char2str OBJ_COMPLEX))
203       50     50       "Upper Middle"  "Lower Left"     0      ""   0  -1)
204         ;   Four directions
205    (list 
206     "refdes" "<>^v"(list "OBJ_TYPE" (char2str OBJ_COMPLEX))
207       50     50      "Upper Left"    "Lower Left"     0      "^<" 50  -1)
208    (list 
209     "value"  "<>^v"(list "OBJ_TYPE" (char2str OBJ_COMPLEX))
210       50    -50      "Lower Right"   "Upper Right"    0      "v>" 50  -1)
211    (list 
212     "device" "<>^v"(list "OBJ_TYPE" (char2str OBJ_COMPLEX))
213       50    -50      "Lower Right"   "Upper Right"    0      "v>" 50  -1)
214    
215      ; Net attributes
216      ;   Two directions
217    (list 
218     "netname" "<>" (list "OBJ_TYPE" (char2str OBJ_NET))
219        0     50       "Upper Middle"  "Lower Middle"   0      ""   0  -1)
220    (list 
221     "netname" "^v" (list "OBJ_TYPE" (char2str OBJ_NET))
222      -50      0       "Middle Middle" "Lower Middle"  90      ""   0  -1)
223      ; Bus attributes
224      ;   Two directions
225    (list 
226     "netname" "<>" (list "OBJ_TYPE" (char2str OBJ_BUS))
227        0     50       "Upper Middle"  "Lower Middle"   0      ""   0  -1)
228    (list 
229     "netname" "^v" (list "OBJ_TYPE" (char2str OBJ_BUS))
230      -50      0       "Middle Middle" "Lower Middle"  90      ""   0  -1)
231    ))
233 ; Position of parameters inside default-position-of-text-attributes
234 (define def-attrib-name-pos   0)
235 (define def-direction-pos     1)
236 (define def-attrib-match      2)
237 (define def-x-offset-pos      3)
238 (define def-y-offset-pos      4)
239 (define def-reference-pos     5)
240 (define def-alignment-pos     6)
241 (define def-angle-pos         7)
242 (define def-move-pos          8)
243 (define def-spacing-pos       9)
244 (define def-color-pos        10)