[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.7.2-20111231-124-g0110f9c)
The branch, master has been updated
via 0110f9ce43676a340474e58d09fdec8494dabdf2 (commit)
via 0826a4cbcacf4773f723c258ad08cafbceb5cf15 (commit)
via cafda92f02bdb40fa683784bd3da6fb26127a8fb (commit)
via 33b172da8156de9373445b45f752fa949ec0f6fc (commit)
from 76b184e54eecc95bde3a3de5d47a7fa58338a8c5 (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/src/gschem_cairo.c | 6 +-
gschem/src/o_net.c | 7 ++-
gschem/src/o_pin.c | 7 ++-
gschem/src/x_dialog.c | 99 +++++++++++++++++++++++++++++++------
libgeda/include/libgeda/struct.h | 2 +-
libgeda/include/prototype_priv.h | 40 ++++++++--------
libgeda/share/prolog.ps | 17 ++++--
libgeda/src/f_print.c | 9 ----
libgeda/src/o_arc_basic.c | 66 ++++++++++++++-----------
libgeda/src/o_basic.c | 37 ++++++++++++++
libgeda/src/o_box_basic.c | 65 ++++++++++++++-----------
libgeda/src/o_bus_basic.c | 4 +-
libgeda/src/o_circle_basic.c | 36 ++++++++------
libgeda/src/o_line_basic.c | 44 ++++++++++-------
libgeda/src/o_net_basic.c | 2 +-
libgeda/src/o_path_basic.c | 2 +-
libgeda/src/o_picture.c | 6 +-
libgeda/src/o_pin_basic.c | 4 +-
18 files changed, 292 insertions(+), 161 deletions(-)
=================
Commit Messages
=================
commit 0110f9ce43676a340474e58d09fdec8494dabdf2
Author: Vladimir Zhbanov <vzhbanov@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: fixed Postscript output of dots for some line types
:100644 100644 5acfd46... 1c5cb80... M libgeda/share/prolog.ps
commit 0826a4cbcacf4773f723c258ad08cafbceb5cf15
Author: Vladimir Zhbanov <vzhbanov@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Printing using capstyle corresponding to object line end
Use correct capstyle for each object instead of using one capstyle for
all objects.
Changed printing functions for of different objects. Added reasonable
defaults in some cases:
square caps for buses (as used for line ends displaying)
butt caps for solid circles and for hatches
default caps (from output-capstyle option) for nets and pins
default caps (from line ends) for arcs, boxes, circles, and lines
Additionally fixed lines' capstyle of placeholder for missing picture.
:100644 100644 00d00f0... 87f58b8... M libgeda/include/prototype_priv.h
:100644 100644 b8bb242... 5acfd46... M libgeda/share/prolog.ps
:100644 100644 a8a8261... 473b3a0... M libgeda/src/f_print.c
:100644 100644 7586e1c... 2655912... M libgeda/src/o_arc_basic.c
:100644 100644 c956441... 05ca5f6... M libgeda/src/o_box_basic.c
:100644 100644 58d4db6... ac0682c... M libgeda/src/o_bus_basic.c
:100644 100644 faba12c... 497c967... M libgeda/src/o_circle_basic.c
:100644 100644 950d505... 5a16054... M libgeda/src/o_line_basic.c
:100644 100644 96f0638... b6b4412... M libgeda/src/o_net_basic.c
:100644 100644 b9c8899... 33def94... M libgeda/src/o_picture.c
:100644 100644 a1e1c2c... 22bef1c... M libgeda/src/o_pin_basic.c
commit cafda92f02bdb40fa683784bd3da6fb26127a8fb
Author: Vladimir Zhbanov <vzhbanov@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Use appropriate line end to display different objects
Use available code for dashed lines in cairo_gschem.c.
For others I've made special functions to convert value set by
'output-capstyle' option for gschem (LINE_END <-> CAPSTYLE). Now this
option is also used to display objects. It's done to have no difference
between screen view and Postscript output. That is I want to have
'WYSIWYG' possibility. I use the same default style of all objects'
line ends (excluding buses).
:100644 100644 4e35da0... 7a22a06... M gschem/src/gschem_cairo.c
:100644 100644 290ca09... d4f7eaa... M gschem/src/o_net.c
:100644 100644 db6fc6b... cf81718... M gschem/src/o_pin.c
:100644 100644 2461889... 7586e1c... M libgeda/src/o_arc_basic.c
:100644 100644 bbbd477... 9970648... M libgeda/src/o_basic.c
:100644 100644 6246f66... c956441... M libgeda/src/o_box_basic.c
:100644 100644 e534bc4... faba12c... M libgeda/src/o_circle_basic.c
:100644 100644 e156b7d... 950d505... M libgeda/src/o_line_basic.c
:100644 100644 df94ee8... 301791d... M libgeda/src/o_path_basic.c
commit 33b172da8156de9373445b45f752fa949ec0f6fc
Author: Vladimir Zhbanov <vzhbanov@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Added line end (capstyle) menu for the line type dialog
Handling of the menu is similar to handling of the line type menu.
Important: In order to have it working I have had to change OBJECT_END
type definition.
'optionmenu' variable name is changed to 'type_menu' to distinguish
between it and the 'end_menu'.
:100644 100644 ab4379b... 9526848... M gschem/src/x_dialog.c
:100644 100644 e0a448c... ab2bf95... M libgeda/include/libgeda/struct.h
=========
Changes
=========
commit 0110f9ce43676a340474e58d09fdec8494dabdf2
Author: Vladimir Zhbanov <vzhbanov@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: fixed Postscript output of dots for some line types
diff --git a/libgeda/share/prolog.ps b/libgeda/share/prolog.ps
index 5acfd46..1c5cb80 100644
--- a/libgeda/share/prolog.ps
+++ b/libgeda/share/prolog.ps
@@ -53,7 +53,7 @@
/y 0 def
/dashedarc {
setlinecap
- dup /width exch def
+ dup 2.0 div /width exch def
setlinewidth
/r exch def
/y exch def
commit 0826a4cbcacf4773f723c258ad08cafbceb5cf15
Author: Vladimir Zhbanov <vzhbanov@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Printing using capstyle corresponding to object line end
Use correct capstyle for each object instead of using one capstyle for
all objects.
Changed printing functions for of different objects. Added reasonable
defaults in some cases:
square caps for buses (as used for line ends displaying)
butt caps for solid circles and for hatches
default caps (from output-capstyle option) for nets and pins
default caps (from line ends) for arcs, boxes, circles, and lines
Additionally fixed lines' capstyle of placeholder for missing picture.
diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index 00d00f0..87f58b8 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -73,11 +73,11 @@ void m_transform_translate(TRANSFORM *transform, gdouble dx, gdouble dy);
OBJECT *o_arc_read(TOPLEVEL *toplevel, const char buf[], unsigned int release_ver, unsigned int fileformat_ver, GError **err);
char *o_arc_save(TOPLEVEL *toplevel, OBJECT *object);
void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
-void o_arc_print_solid(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int length, int space, int origin_x, int origin_y);
-void o_arc_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int length, int space, int origin_x, int origin_y);
-void o_arc_print_dashed(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int length, int space, int origin_x, int origin_y);
-void o_arc_print_center(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int length, int space, int origin_x, int origin_y);
-void o_arc_print_phantom(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int length, int space, int origin_x, int origin_y);
+void o_arc_print_solid(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_arc_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_arc_print_dashed(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_arc_print_center(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_arc_print_phantom(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int angle1, int angle2, int color, int arc_width, int capstyle, int length, int space, int origin_x, int origin_y);
double o_arc_shortest_distance(OBJECT *object, int x, int y, int force_soild);
gboolean o_arc_within_sweep(ARC *arc, gint x, gint y);
void world_get_arc_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *top, int *right, int *bottom);
@@ -103,11 +103,11 @@ void o_emit_change_notify(TOPLEVEL *toplevel, OBJECT *object);
OBJECT *o_box_read(TOPLEVEL *toplevel, const char buf[], unsigned int release_ver, unsigned int fileformat_ver, GError **err);
char *o_box_save(TOPLEVEL *toplevel, OBJECT *object);
void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
-void o_box_print_solid(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int length, int space, int origin_x, int origin_y);
-void o_box_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int length, int space, int origin_x, int origin_y);
-void o_box_print_dashed(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int length, int space, int origin_x, int origin_y);
-void o_box_print_center(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int length, int space, int origin_x, int origin_y);
-void o_box_print_phantom(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int length, int space, int origin_x, int origin_y);
+void o_box_print_solid(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_box_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_box_print_dashed(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_box_print_center(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_box_print_phantom(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
void o_box_print_filled(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2, int origin_x, int origin_y);
void o_box_print_mesh(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2, int origin_x, int origin_y);
void o_box_print_hatch(TOPLEVEL *toplevel, FILE *fp, int x, int y, int width, int height, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2, int origin_x, int origin_y);
@@ -128,11 +128,11 @@ void o_bus_recalc(TOPLEVEL *toplevel, OBJECT *o_current);
OBJECT *o_circle_read(TOPLEVEL *toplevel, const char buf[], unsigned int release_ver, unsigned int fileformat_ver, GError **err);
char *o_circle_save(TOPLEVEL *toplevel, OBJECT *object);
void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
-void o_circle_print_solid(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space, int origin_x, int origin_y);
-void o_circle_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space, int origin_x, int origin_y);
-void o_circle_print_dashed(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space, int origin_x, int origin_y);
-void o_circle_print_center(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space, int origin_x, int origin_y);
-void o_circle_print_phantom(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space, int origin_x, int origin_y);
+void o_circle_print_solid(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_circle_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_circle_print_dashed(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_circle_print_center(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_circle_print_phantom(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int capstyle, int length, int space, int origin_x, int origin_y);
void o_circle_print_filled(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2, int origin_x, int origin_y);
void o_circle_print_mesh(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2, int origin_x, int origin_y);
void o_circle_print_hatch(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2, int origin_x, int origin_y);
@@ -154,11 +154,11 @@ GList *o_complex_get_promotable (TOPLEVEL *toplevel, OBJECT *object, int detach)
OBJECT *o_line_read(TOPLEVEL *toplevel, const const char buf[], unsigned int release_ver, unsigned int fileformat_ver, GError **err);
char *o_line_save(TOPLEVEL *toplevel, OBJECT *object);
void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y);
-void o_line_print_solid(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int length, int space, int origin_x, int origin_y);
-void o_line_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int length, int space, int origin_x, int origin_y);
-void o_line_print_dashed(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int length, int space, int origin_x, int origin_y);
-void o_line_print_center(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int length, int space, int origin_x, int origin_y);
-void o_line_print_phantom(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int length, int space, int origin_x, int origin_y);
+void o_line_print_solid(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_line_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_line_print_dashed(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_line_print_center(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
+void o_line_print_phantom(TOPLEVEL *toplevel, FILE *fp, int x1, int y1, int x2, int y2, int color, int line_width, int capstyle, int length, int space, int origin_x, int origin_y);
double o_line_shortest_distance(OBJECT *object, int x, int y, int force_soild);
void world_get_line_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *top, int *right, int *bottom);
gboolean o_line_get_position(TOPLEVEL *toplevel, gint *x, gint *y, OBJECT *object);
diff --git a/libgeda/share/prolog.ps b/libgeda/share/prolog.ps
index b8bb242..5acfd46 100644
--- a/libgeda/share/prolog.ps
+++ b/libgeda/share/prolog.ps
@@ -3,8 +3,9 @@
% Draw a line from the second coordinate to the first
-% x2 y2 x1 y1 width line -
+% x2 y2 x1 y1 width capstyle line -
/line {
+ setlinecap
setlinewidth
% pop off first element and moveto
moveto
@@ -23,9 +24,10 @@
% Draw a dot-dashed line, a bunch of lined segments,
% if the array element only has length two, draw a dot.
-% [ [x2 y2 x1 y1] [x4 y4 x3 y3] [x5 y5] ... ] width dashed -
+% [ [x2 y2 x1 y1] [x4 y4 x3 y3] [x5 y5] ... ] width capstyle dashed -
/width 0 def
/dashed {
+ setlinecap
dup 2.0 div /width exch def
setlinewidth
% pop off each line segment and draw it as a dot or as a line
@@ -37,18 +39,20 @@
} bind def
% Draw an arc segment
-% x y r ang1 ang2 width darc -
+% x y r ang1 ang2 width capstyle darc -
/darc {
+ setlinecap
setlinewidth
arc stroke
} bind def
% Draw a series of arc segment bits, if the array element only has a single
% element in it, draw a dot.
-% [ [sa1 ea1] [sa2 ea2] ... ] x y r width dashedarc -
+% [ [sa1 ea1] [sa2 ea2] ... ] x y r width capstyle dashedarc -
/x 0 def
/y 0 def
/dashedarc {
+ setlinecap
dup /width exch def
setlinewidth
/r exch def
@@ -84,8 +88,9 @@
} bind def
% Draw a box
-% width height x y linethickness box -
+% width height x y linethickness capstyle box -
/box {
+ setlinecap
setlinewidth
moveto
exch dup 0 rlineto % w h, h w w 0 -- Draw bottom line
diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index a8a8261..473b3a0 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -561,15 +561,6 @@ int f_print_stream(TOPLEVEL *toplevel, PAGE *page, FILE *fp)
}
- /* Set line end style */
- if (toplevel->print_output_capstyle == BUTT_CAP) {
- fprintf(fp, "0 setlinecap\n");
- } else if (toplevel->print_output_capstyle == SQUARE_CAP) {
- fprintf(fp, "2 setlinecap\n");
- } else if (toplevel->print_output_capstyle == ROUND_CAP) {
- fprintf(fp, "1 setlinecap\n");
- }
-
/* Apply mils to postscript native units scaling to CTM */
fprintf(fp,"%f %f scale\n",
72.0 / 1000.0 , 72.0 / 1000.0);
diff --git a/libgeda/src/o_arc_basic.c b/libgeda/src/o_arc_basic.c
index 7586e1c..2655912 100644
--- a/libgeda/src/o_arc_basic.c
+++ b/libgeda/src/o_arc_basic.c
@@ -103,7 +103,7 @@ OBJECT *o_arc_new(TOPLEVEL *toplevel,
o_get_line_end(toplevel->print_output_capstyle), TYPE_SOLID, 0, -1, -1);
o_set_fill_options(toplevel, new_node,
FILLING_HOLLOW, -1, -1, -1, -1, -1);
-
+
o_arc_recalc(toplevel, new_node);
/* new_node->graphical = arc; eventually */
@@ -609,6 +609,7 @@ void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
{
int x, y, radius, start_angle, end_angle;
int color;
+ int capstyle;
int arc_width, space, length;
void (*outl_func)() = NULL;
@@ -616,13 +617,14 @@ void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
printf("got null in o_arc_print\n");
return;
}
-
+
x = o_current->arc->x;
y = o_current->arc->y;
radius = o_current->arc->width / 2;
start_angle = o_current->arc->start_angle;
end_angle = o_current->arc->end_angle;
color = o_current->color;
+ capstyle = o_get_capstyle (o_current->line_end);
/*! \note
* Depending on the type of the line for this particular arc, the
@@ -694,7 +696,7 @@ void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
(*outl_func)(toplevel, fp,
x - origin_x, y - origin_x, radius,
start_angle, end_angle,
- color, arc_width, length, space, origin_x, origin_y);
+ color, arc_width, capstyle, length, space, origin_x, origin_y);
}
@@ -719,6 +721,7 @@ void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
* \param [in] angle2
* \param [in] color
* \param [in] arc_width
+ * \param [in] capstyle
* \param [in] length
* \param [in] space
* \param [in] origin_x
@@ -728,7 +731,7 @@ void o_arc_print_solid(TOPLEVEL *toplevel, FILE *fp,
int x, int y, int radius,
int angle1, int angle2,
int color,
- int arc_width, int length, int space,
+ int arc_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
f_print_set_color(toplevel, fp, color);
@@ -739,9 +742,9 @@ void o_arc_print_solid(TOPLEVEL *toplevel, FILE *fp,
angle2 = -angle2;
}
- fprintf(fp, "%d %d %d %d %d %d darc\n",
+ fprintf(fp, "%d %d %d %d %d %d %d darc\n",
x,y, radius, angle1, angle1 + angle2,
- arc_width);
+ arc_width, capstyle);
}
@@ -770,6 +773,7 @@ void o_arc_print_solid(TOPLEVEL *toplevel, FILE *fp,
* \param [in] angle2
* \param [in] color
* \param [in] arc_width
+ * \param [in] capstyle
* \param [in] length
* \param [in] space
* \param [in] origin_x
@@ -779,7 +783,7 @@ void o_arc_print_dotted(TOPLEVEL *toplevel, FILE *fp,
int x, int y, int radius,
int angle1, int angle2,
int color,
- int arc_width, int length, int space,
+ int arc_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
int da, d;
@@ -813,7 +817,7 @@ void o_arc_print_dotted(TOPLEVEL *toplevel, FILE *fp,
x, y, radius,
angle1, angle2,
color,
- arc_width, length, space, origin_x, origin_y);
+ arc_width, capstyle, length, space, origin_x, origin_y);
return;
}
@@ -827,8 +831,8 @@ void o_arc_print_dotted(TOPLEVEL *toplevel, FILE *fp,
d = d + da;
}
- fprintf(fp,"] %d %d %d %d dashedarc %% dotted\n",
- x,y, radius, arc_width);
+ fprintf(fp,"] %d %d %d %d %d dashedarc %% dotted\n",
+ x,y, radius, arc_width, capstyle);
}
/*! \brief
@@ -854,6 +858,7 @@ void o_arc_print_dotted(TOPLEVEL *toplevel, FILE *fp,
* \param [in] angle2
* \param [in] color
* \param [in] arc_width
+ * \param [in] capstyle
* \param [in] length
* \param [in] space
* \param [in] origin_x
@@ -863,13 +868,13 @@ void o_arc_print_dashed(TOPLEVEL *toplevel, FILE *fp,
int x, int y, int radius,
int angle1, int angle2,
int color,
- int arc_width, int length, int space,
+ int arc_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
int da, db, a1, d;
f_print_set_color(toplevel, fp, color);
-
+
/*! \note
* Depending on the radius of the arc, the <B>space</B> (resp. <B>length</B>)
* parameter is changed into a small angle <B>da</B> (resp. <B>db</B>).
@@ -900,10 +905,10 @@ void o_arc_print_dashed(TOPLEVEL *toplevel, FILE *fp,
x, y, radius,
angle1, angle2,
color,
- arc_width, length, space, origin_x, origin_y);
+ arc_width, capstyle, length, space, origin_x, origin_y);
return;
}
-
+
fprintf(fp,"[");
d = angle1;
while ((d + da + db) < (angle1 + angle2)) {
@@ -931,8 +936,8 @@ void o_arc_print_dashed(TOPLEVEL *toplevel, FILE *fp,
a1, a1+da);
- fprintf(fp,"] %d %d %d %d dashedarc %% dashed\n",
- x,y, radius, arc_width);
+ fprintf(fp,"] %d %d %d %d %d dashedarc %% dashed\n",
+ x,y, radius, arc_width, capstyle);
}
@@ -959,6 +964,7 @@ void o_arc_print_dashed(TOPLEVEL *toplevel, FILE *fp,
* \param [in] angle2
* \param [in] color
* \param [in] arc_width
+ * \param [in] capstyle
* \param [in] length
* \param [in] space
* \param [in] origin_x
@@ -968,7 +974,7 @@ void o_arc_print_center(TOPLEVEL *toplevel, FILE *fp,
int x, int y, int radius,
int angle1, int angle2,
int color,
- int arc_width, int length, int space,
+ int arc_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
int da, db, a1, d;
@@ -1005,10 +1011,10 @@ void o_arc_print_center(TOPLEVEL *toplevel, FILE *fp,
x, y, radius,
angle1, angle2,
color,
- arc_width, length, space, origin_x, origin_y);
+ arc_width, capstyle, length, space, origin_x, origin_y);
return;
}
-
+
fprintf(fp, "[");
d = angle1;
while ((d + da + 2 * db) < (angle1 + angle2)) {
@@ -1054,9 +1060,9 @@ void o_arc_print_center(TOPLEVEL *toplevel, FILE *fp,
fprintf(fp,"[%d] ",d);
}
-
- fprintf(fp,"] %d %d %d %d dashedarc %% center\n",
- x,y, radius, arc_width);
+
+ fprintf(fp,"] %d %d %d %d %d dashedarc %% center\n",
+ x,y, radius, arc_width, capstyle);
}
/*! \note
@@ -1087,6 +1093,7 @@ void o_arc_print_center(TOPLEVEL *toplevel, FILE *fp,
* \param [in] angle2
* \param [in] color
* \param [in] arc_width
+ * \param [in] capstyle
* \param [in] length
* \param [in] space
* \param [in] origin_x
@@ -1096,7 +1103,7 @@ void o_arc_print_phantom(TOPLEVEL *toplevel, FILE *fp,
int x, int y, int radius,
int angle1, int angle2,
int color,
- int arc_width, int length, int space,
+ int arc_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
int da, db, a1, d;
@@ -1133,7 +1140,7 @@ void o_arc_print_phantom(TOPLEVEL *toplevel, FILE *fp,
x, y, radius,
angle1, angle2,
color,
- arc_width, length, space, origin_x, origin_y);
+ arc_width, capstyle, length, space, origin_x, origin_y);
return;
}
@@ -1205,12 +1212,11 @@ void o_arc_print_phantom(TOPLEVEL *toplevel, FILE *fp,
*/
fprintf(fp,"[%d] ",d);
-
-
+
}
-
- fprintf(fp,"] %d %d %d %d dashedarc %% phantom\n",
- x,y, radius, arc_width);
+
+ fprintf(fp,"] %d %d %d %d %d dashedarc %% phantom\n",
+ x,y, radius, arc_width, capstyle);
}
/*! \brief Calculates the distance between the given point and the closest
diff --git a/libgeda/src/o_box_basic.c b/libgeda/src/o_box_basic.c
index c956441..05ca5f6 100644
--- a/libgeda/src/o_box_basic.c
+++ b/libgeda/src/o_box_basic.c
@@ -672,7 +672,7 @@ void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
{
int x, y, width, height;
int color;
- int line_width, length, space;
+ int line_width, capstyle, length, space;
int fill_width, angle1, pitch1, angle2, pitch2;
void (*outl_func)() = NULL;
void (*fill_func)() = NULL;
@@ -687,6 +687,7 @@ void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
width = abs(o_current->box->lower_x - o_current->box->upper_x);
height = abs(o_current->box->lower_y - o_current->box->upper_y);
color = o_current->color;
+ capstyle = o_get_capstyle (o_current->line_end);
/*! \note
* Depending on the type of the line for this particular box, the
@@ -753,6 +754,7 @@ void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
x, y, width, height,
color,
line_width,
+ capstyle,
length, space,
origin_x, origin_y);
@@ -841,6 +843,7 @@ void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
* \param [in] height Height of BOX.
* \param [in] color BOX color.
* \param [in] line_width BOX Line width.
+ * \param [in] capstyle BOX Line capstyle.
* \param [in] length Dashed line length.
* \param [in] space Amount of space between dashes.
* \param [in] origin_x Page x coordinate to place BOX OBJECT.
@@ -851,7 +854,7 @@ o_box_print_solid(TOPLEVEL *toplevel, FILE *fp,
int x, int y,
int width, int height,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
int x1, y1;
@@ -864,22 +867,22 @@ o_box_print_solid(TOPLEVEL *toplevel, FILE *fp,
o_line_print_solid(toplevel, fp,
x1, y1, x1 + width, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_solid(toplevel, fp,
x1 + width, y1, x1 + width, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_solid(toplevel, fp,
x1 + width, y1 + height, x1, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_solid(toplevel, fp,
x1, y1 + height, x1, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
}
@@ -905,6 +908,7 @@ o_box_print_solid(TOPLEVEL *toplevel, FILE *fp,
* \param [in] height Height of BOX.
* \param [in] color BOX color.
* \param [in] line_width BOX Line width.
+ * \param [in] capstyle BOX Line capstyle.
* \param [in] length Dashed line length.
* \param [in] space Amount of space between dashes.
* \param [in] origin_x Page x coordinate to place BOX OBJECT.
@@ -914,7 +918,7 @@ void o_box_print_dotted(TOPLEVEL *toplevel, FILE *fp,
int x, int y,
int width, int height,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
int x1, y1;
@@ -927,22 +931,22 @@ void o_box_print_dotted(TOPLEVEL *toplevel, FILE *fp,
o_line_print_dotted(toplevel, fp,
x1, y1, x1 + width, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_dotted(toplevel, fp,
x1 + width, y1, x1 + width, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_dotted(toplevel, fp,
x1 + width, y1 + height, x1, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_dotted(toplevel, fp,
x1, y1 + height, x1, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
}
@@ -967,6 +971,7 @@ void o_box_print_dotted(TOPLEVEL *toplevel, FILE *fp,
* \param [in] height Height of BOX.
* \param [in] color BOX color.
* \param [in] line_width BOX Line width.
+ * \param [in] capstyle BOX Line capstyle.
* \param [in] length Dashed line length.
* \param [in] space Amount of space between dashes.
* \param [in] origin_x Page x coordinate to place BOX OBJECT.
@@ -976,7 +981,7 @@ void o_box_print_dashed(TOPLEVEL *toplevel, FILE *fp,
int x, int y,
int width, int height,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
int x1, y1;
@@ -990,22 +995,22 @@ void o_box_print_dashed(TOPLEVEL *toplevel, FILE *fp,
o_line_print_dashed(toplevel, fp,
x1, y1, x1 + width, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_dashed(toplevel, fp,
x1 + width, y1, x1 + width, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_dashed(toplevel, fp,
x1 + width, y1 + height, x1, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_dashed(toplevel, fp,
x1, y1 + height, x1, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
}
@@ -1030,6 +1035,7 @@ void o_box_print_dashed(TOPLEVEL *toplevel, FILE *fp,
* \param [in] height Height of BOX.
* \param [in] color BOX color.
* \param [in] line_width BOX Line width.
+ * \param [in] capstyle BOX Line capstyle.
* \param [in] length Dashed line length.
* \param [in] space Amount of space between dashes.
* \param [in] origin_x Page x coordinate to place BOX OBJECT.
@@ -1039,7 +1045,7 @@ void o_box_print_center(TOPLEVEL *toplevel, FILE *fp,
int x, int y,
int width, int height,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
int x1, y1;
@@ -1052,22 +1058,22 @@ void o_box_print_center(TOPLEVEL *toplevel, FILE *fp,
o_line_print_center(toplevel, fp,
x1, y1, x1 + width, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_center(toplevel, fp,
x1 + width, y1, x1 + width, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_center(toplevel, fp,
x1 + width, y1 + height, x1, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_center(toplevel, fp,
x1, y1 + height, x1, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
}
@@ -1092,6 +1098,7 @@ void o_box_print_center(TOPLEVEL *toplevel, FILE *fp,
* \param [in] height Height of BOX.
* \param [in] color BOX color.
* \param [in] line_width BOX Line width.
+ * \param [in] capstyle BOX Line capstyle.
* \param [in] length Dashed line length.
* \param [in] space Amount of space between dashes.
* \param [in] origin_x Page x coordinate to place BOX OBJECT.
@@ -1101,7 +1108,7 @@ void o_box_print_phantom(TOPLEVEL *toplevel, FILE *fp,
int x, int y,
int width, int height,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
int x1, y1;
@@ -1114,22 +1121,22 @@ void o_box_print_phantom(TOPLEVEL *toplevel, FILE *fp,
o_line_print_phantom(toplevel, fp,
x1, y1, x1 + width, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_phantom(toplevel, fp,
x1 + width, y1, x1 + width, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_phantom(toplevel, fp,
x1 + width, y1 + height, x1, y1 + height,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
o_line_print_phantom(toplevel, fp,
x1, y1 + height, x1, y1,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
}
@@ -1305,10 +1312,10 @@ void o_box_print_hatch(TOPLEVEL *toplevel, FILE *fp,
for(index=0; index<lines->len; index++) {
LINE *line = &g_array_index(lines, LINE, index);
- fprintf(fp,"%d %d %d %d %d line\n",
+ fprintf(fp,"%d %d %d %d %d %d line\n",
line->x[0], line->y[0],
line->x[1], line->y[1],
- fill_width);
+ fill_width, BUTT_CAP);
}
g_array_free(lines, TRUE);
diff --git a/libgeda/src/o_bus_basic.c b/libgeda/src/o_bus_basic.c
index 58d4db6..ac0682c 100644
--- a/libgeda/src/o_bus_basic.c
+++ b/libgeda/src/o_bus_basic.c
@@ -304,8 +304,8 @@ void o_bus_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
x2 = o_current->line->x[1]-origin_x,
y2 = o_current->line->y[1]-origin_y;
- fprintf(fp, "%d %d %d %d %d line\n",
- x1,y1,x2,y2,bus_width);
+ fprintf(fp, "%d %d %d %d %d %d line\n",
+ x1,y1,x2,y2,bus_width,SQUARE_CAP);
}
diff --git a/libgeda/src/o_circle_basic.c b/libgeda/src/o_circle_basic.c
index faba12c..497c967 100644
--- a/libgeda/src/o_circle_basic.c
+++ b/libgeda/src/o_circle_basic.c
@@ -580,7 +580,7 @@ void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
{
int x, y, radius;
int color;
- int circle_width, length, space;
+ int circle_width, capstyle, length, space;
int fill_width, angle1, pitch1, angle2, pitch2;
void (*outl_func)() = NULL;
void (*fill_func)() = NULL;
@@ -595,6 +595,7 @@ void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
radius = o_current->circle->radius;
color = o_current->color;
+ capstyle = o_get_capstyle (o_current->line_end);
/*
* Depending on the type of the line for this particular circle, the
@@ -660,7 +661,7 @@ void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
x - origin_x, y - origin_y,
radius,
color,
- circle_width, length, space,
+ circle_width, capstyle, length, space,
origin_x, origin_y);
/*
@@ -747,6 +748,7 @@ void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
* \param [in] radius Circle radius.
* \param [in] color Circle color.
* \param [in] circle_width Width of circle.
+ * \param [in] capstyle Capstyle of circle lines.
* \param [in] length (unused).
* \param [in] space (unused).
* \param [in] origin_x Page x coordinate to place circle OBJECT.
@@ -755,7 +757,7 @@ void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
void o_circle_print_solid(TOPLEVEL *toplevel, FILE *fp,
int x, int y, int radius,
int color,
- int circle_width, int length, int space,
+ int circle_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
@@ -763,7 +765,7 @@ void o_circle_print_solid(TOPLEVEL *toplevel, FILE *fp,
x, y, radius,
0, FULL_CIRCLE / 64,
color,
- circle_width, -1, -1,
+ circle_width, BUTT_CAP, -1, -1,
origin_x, origin_y);
}
@@ -790,6 +792,7 @@ void o_circle_print_solid(TOPLEVEL *toplevel, FILE *fp,
* \param [in] radius Circle radius.
* \param [in] color Circle color.
* \param [in] circle_width Width of circle.
+ * \param [in] capstyle Capstyle of circle lines.
* \param [in] length (unused).
* \param [in] space Space between dots.
* \param [in] origin_x Page x coordinate to place circle OBJECT.
@@ -798,7 +801,7 @@ void o_circle_print_solid(TOPLEVEL *toplevel, FILE *fp,
void o_circle_print_dotted(TOPLEVEL *toplevel, FILE *fp,
int x, int y, int radius,
int color,
- int circle_width, int length, int space,
+ int circle_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
@@ -806,7 +809,7 @@ void o_circle_print_dotted(TOPLEVEL *toplevel, FILE *fp,
x, y, radius,
0, FULL_CIRCLE / 64,
color,
- circle_width, -1, space,
+ circle_width, capstyle, -1, space,
origin_x, origin_y);
}
@@ -831,6 +834,7 @@ void o_circle_print_dotted(TOPLEVEL *toplevel, FILE *fp,
* \param [in] radius Circle radius.
* \param [in] color Circle color.
* \param [in] circle_width Width of circle.
+ * \param [in] capstyle Capstyle of circle lines.
* \param [in] length Length of dashed lines.
* \param [in] space Space between dashes.
* \param [in] origin_x Page x coordinate to place circle OBJECT.
@@ -840,7 +844,7 @@ void o_circle_print_dashed(TOPLEVEL *toplevel, FILE *fp,
int x, int y,
int radius,
int color,
- int circle_width, int length, int space,
+ int circle_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
@@ -848,7 +852,7 @@ void o_circle_print_dashed(TOPLEVEL *toplevel, FILE *fp,
x, y, radius,
0, FULL_CIRCLE / 64,
color,
- circle_width, length, space,
+ circle_width, capstyle, length, space,
origin_x, origin_y);
}
@@ -873,6 +877,7 @@ void o_circle_print_dashed(TOPLEVEL *toplevel, FILE *fp,
* \param [in] radius Circle radius.
* \param [in] color Circle color.
* \param [in] circle_width Width of circle.
+ * \param [in] capstyle Capstyle of circle lines.
* \param [in] length Length of dashed lines.
* \param [in] space Space between dashes.
* \param [in] origin_x Page x coordinate to place circle OBJECT.
@@ -882,7 +887,7 @@ void o_circle_print_center(TOPLEVEL *toplevel, FILE *fp,
int x, int y,
int radius,
int color,
- int circle_width, int length, int space,
+ int circle_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
@@ -890,7 +895,7 @@ void o_circle_print_center(TOPLEVEL *toplevel, FILE *fp,
x, y, radius,
0, FULL_CIRCLE / 64,
color,
- circle_width, length, space,
+ circle_width, capstyle, length, space,
origin_x, origin_y);
}
@@ -915,6 +920,7 @@ void o_circle_print_center(TOPLEVEL *toplevel, FILE *fp,
* \param [in] radius Circle radius.
* \param [in] color Circle color.
* \param [in] circle_width Width of circle.
+ * \param [in] capstyle Capstyle of circle lines.
* \param [in] length Length of dashed lines.
* \param [in] space Space between dashes.
* \param [in] origin_x Page x coordinate to place circle OBJECT.
@@ -924,7 +930,7 @@ void o_circle_print_phantom(TOPLEVEL *toplevel, FILE *fp,
int x, int y,
int radius,
int color,
- int circle_width, int length, int space,
+ int circle_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
@@ -932,7 +938,7 @@ void o_circle_print_phantom(TOPLEVEL *toplevel, FILE *fp,
x, y, radius,
0, FULL_CIRCLE / 64,
color,
- circle_width, length, space,
+ circle_width, capstyle, length, space,
origin_x, origin_y);
}
@@ -1096,10 +1102,10 @@ void o_circle_print_hatch(TOPLEVEL *toplevel, FILE *fp,
for(index=0; index<lines->len; index++) {
LINE *line = &g_array_index(lines, LINE, index);
- fprintf(fp,"%d %d %d %d %d line\n",
+ fprintf(fp,"%d %d %d %d %d %d line\n",
line->x[0], line->y[0],
line->x[1], line->y[1],
- fill_width);
+ fill_width, BUTT_CAP);
}
g_array_free(lines, TRUE);
diff --git a/libgeda/src/o_line_basic.c b/libgeda/src/o_line_basic.c
index 950d505..5a16054 100644
--- a/libgeda/src/o_line_basic.c
+++ b/libgeda/src/o_line_basic.c
@@ -532,9 +532,10 @@ void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
{
int x1, y1, x2, y2;
int color;
+ int capstyle;
int line_width, length, space;
void (*outl_func)() = NULL;
-
+
if (o_current == NULL) {
printf("got null in o_line_print\n");
return;
@@ -545,6 +546,7 @@ void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
x2 = o_current->line->x[1];
y2 = o_current->line->y[1];
color = o_current->color;
+ capstyle = o_get_capstyle (o_current->line_end);
/*
* Depending on the type of the line for this particular line, the
@@ -610,7 +612,7 @@ void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
x1 - origin_x, y1 - origin_y,
x2 - origin_x, y2 - origin_y,
color,
- line_width, length, space,
+ line_width, capstyle, length, space,
origin_x, origin_y);
}
@@ -631,6 +633,7 @@ void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
* \param [in] y2 Lower y coordinate.
* \param [in] color Line color.
* \param [in] line_width Width of line.
+ * \param [in] capstyle Capstyle of line.
* \param [in] length (unused).
* \param [in] space (unused).
* \param [in] origin_x Page x coordinate to place line OBJECT.
@@ -639,13 +642,13 @@ void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
void o_line_print_solid(TOPLEVEL *toplevel, FILE *fp,
int x1, int y1, int x2, int y2,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
f_print_set_color(toplevel, fp, color);
-
- fprintf(fp,"%d %d %d %d %d line\n",
- x1,y1,x2,y2, line_width);
+
+ fprintf(fp,"%d %d %d %d %d %d line\n",
+ x1,y1,x2,y2, line_width, capstyle);
}
/*! \brief Print a dotted line to Postscript document.
@@ -672,6 +675,7 @@ void o_line_print_solid(TOPLEVEL *toplevel, FILE *fp,
* \param [in] y2 Lower y coordinate.
* \param [in] color Line color.
* \param [in] line_width Width of line.
+ * \param [in] capstyle Capstyle of circle lines.
* \param [in] length (unused).
* \param [in] space Space between dots.
* \param [in] origin_x Page x coordinate to place line OBJECT.
@@ -680,7 +684,7 @@ void o_line_print_solid(TOPLEVEL *toplevel, FILE *fp,
void o_line_print_dotted(TOPLEVEL *toplevel, FILE *fp,
int x1, int y1, int x2, int y2,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
double dx, dy, l, d;
@@ -724,9 +728,8 @@ void o_line_print_dotted(TOPLEVEL *toplevel, FILE *fp,
xa = xa + dx1;
ya = ya + dy1;
}
-
- fprintf(fp,"] %d dashed\n",line_width);
-
+
+ fprintf(fp,"] %d %d dashed\n", line_width, capstyle);
}
@@ -753,6 +756,7 @@ void o_line_print_dotted(TOPLEVEL *toplevel, FILE *fp,
* \param [in] y2 Lower y coordinate.
* \param [in] color Line color.
* \param [in] line_width Width of line.
+ * \param [in] capstyle Capstyle of line.
* \param [in] length Length of a dash.
* \param [in] space Space between dashes.
* \param [in] origin_x Page x coordinate to place line OBJECT.
@@ -761,7 +765,7 @@ void o_line_print_dotted(TOPLEVEL *toplevel, FILE *fp,
void o_line_print_dashed(TOPLEVEL *toplevel, FILE *fp,
int x1, int y1, int x2, int y2,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
double dx, dy, l, d;
@@ -828,7 +832,7 @@ void o_line_print_dashed(TOPLEVEL *toplevel, FILE *fp,
(int) xa, (int) ya,
(int) xb, (int) yb);
- fprintf(fp,"] %d dashed\n", line_width);
+ fprintf(fp,"] %d %d dashed\n", line_width, capstyle);
}
@@ -856,6 +860,7 @@ void o_line_print_dashed(TOPLEVEL *toplevel, FILE *fp,
* \param [in] y2 Lower y coordinate.
* \param [in] color Line color.
* \param [in] line_width Width of line.
+ * \param [in] capstyle Capstyle of line.
* \param [in] length Length of a dash.
* \param [in] space Space between dashes.
* \param [in] origin_x Page x coordinate to place line OBJECT.
@@ -864,7 +869,7 @@ void o_line_print_dashed(TOPLEVEL *toplevel, FILE *fp,
void o_line_print_center(TOPLEVEL *toplevel, FILE *fp,
int x1, int y1, int x2, int y2,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
double dx, dy, l, d;
@@ -955,8 +960,8 @@ void o_line_print_center(TOPLEVEL *toplevel, FILE *fp,
(int) xb, (int) yb);
}
-
- fprintf(fp,"] %d dashed\n", line_width);
+
+ fprintf(fp,"] %d %d dashed\n", line_width, capstyle);
/*
* A dot is represented by a filled circle. Position of the circle is
@@ -988,6 +993,7 @@ void o_line_print_center(TOPLEVEL *toplevel, FILE *fp,
* \param [in] y2 Lower y coordinate.
* \param [in] color Line color.
* \param [in] line_width Width of line.
+ * \param [in] capstyle Capstyle of line.
* \param [in] length Length of a dash.
* \param [in] space Space between dashes.
* \param [in] origin_x Page x coordinate to place line OBJECT.
@@ -996,7 +1002,7 @@ void o_line_print_center(TOPLEVEL *toplevel, FILE *fp,
void o_line_print_phantom(TOPLEVEL *toplevel, FILE *fp,
int x1, int y1, int x2, int y2,
int color,
- int line_width, int length, int space,
+ int line_width, int capstyle, int length, int space,
int origin_x, int origin_y)
{
double dx, dy, l, d;
@@ -1117,8 +1123,8 @@ void o_line_print_phantom(TOPLEVEL *toplevel, FILE *fp,
}
}
-
- fprintf(fp,"] %d dashed\n", line_width);
+
+ fprintf(fp,"] %d %d dashed\n", line_width, capstyle);
}
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index 96f0638..b6b4412 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -287,7 +287,7 @@ void o_net_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
x2 = o_current->line->x[1] - origin_x,
y2 = o_current->line->y[1] - origin_y;
- fprintf(fp, "%d %d %d %d %d line\n", x1,y1,x2,y2,net_width);
+ fprintf(fp, "%d %d %d %d %d %d line\n", x1,y1,x2,y2,net_width,toplevel->print_output_capstyle);
}
diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c
index b9c8899..33def94 100644
--- a/libgeda/src/o_picture.c
+++ b/libgeda/src/o_picture.c
@@ -881,11 +881,11 @@ void o_picture_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
if (image == NULL) {
int line_width = (toplevel->line_style == THICK) ? LINE_WIDTH : 2;
o_box_print_solid (toplevel, fp, x1, y1, width, height,
- DEFAULT_COLOR, line_width, -1, -1, -1, -1);
+ DEFAULT_COLOR, line_width, SQUARE_CAP, -1, -1, -1, -1);
o_line_print_solid (toplevel, fp, x1, y1, x1+width, y1+height,
- DEFAULT_COLOR, line_width, -1, -1, -1, -1);
+ DEFAULT_COLOR, line_width, ROUND_CAP, -1, -1, -1, -1);
o_line_print_solid (toplevel, fp, x1+width, y1, x1, y1+height,
- DEFAULT_COLOR, line_width, -1, -1, -1, -1);
+ DEFAULT_COLOR, line_width, ROUND_CAP, -1, -1, -1, -1);
return;
}
diff --git a/libgeda/src/o_pin_basic.c b/libgeda/src/o_pin_basic.c
index a1e1c2c..22bef1c 100644
--- a/libgeda/src/o_pin_basic.c
+++ b/libgeda/src/o_pin_basic.c
@@ -303,8 +303,8 @@ void o_pin_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
pin_width = o_current->line_width;
}
- fprintf(fp, "%d %d %d %d %d line\n",x1,y1,x2,y2,pin_width);
-
+ fprintf(fp, "%d %d %d %d %d %d line\n",x1,y1,x2,y2,pin_width,toplevel->print_output_capstyle);
+
}
/*! \brief rotate a pin object around a centerpoint
commit cafda92f02bdb40fa683784bd3da6fb26127a8fb
Author: Vladimir Zhbanov <vzhbanov@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Use appropriate line end to display different objects
Use available code for dashed lines in cairo_gschem.c.
For others I've made special functions to convert value set by
'output-capstyle' option for gschem (LINE_END <-> CAPSTYLE). Now this
option is also used to display objects. It's done to have no difference
between screen view and Postscript output. That is I want to have
'WYSIWYG' possibility. I use the same default style of all objects'
line ends (excluding buses).
diff --git a/gschem/src/gschem_cairo.c b/gschem/src/gschem_cairo.c
index 4e35da0..7a22a06 100644
--- a/gschem/src/gschem_cairo.c
+++ b/gschem/src/gschem_cairo.c
@@ -342,7 +342,7 @@ void gschem_cairo_stroke (GSCHEM_TOPLEVEL *w_current, int line_type, int line_en
num_dashes = 2;
cairo_set_dash (w_current->cr, dashes, num_dashes, 0.);
- cairo_set_line_cap (w_current->cr, CAIRO_LINE_CAP_BUTT);
+ cairo_set_line_cap (w_current->cr, cap);
cairo_stroke (w_current->cr);
break;
@@ -352,7 +352,7 @@ void gschem_cairo_stroke (GSCHEM_TOPLEVEL *w_current, int line_type, int line_en
num_dashes = 2;
cairo_set_dash (w_current->cr, dashes, num_dashes, 0.);
- cairo_set_line_cap (w_current->cr, CAIRO_LINE_CAP_BUTT);
+ cairo_set_line_cap (w_current->cr, cap);
cairo_stroke_preserve (w_current->cr);
dashes[0] = 0; /* DOT */
@@ -370,7 +370,7 @@ void gschem_cairo_stroke (GSCHEM_TOPLEVEL *w_current, int line_type, int line_en
num_dashes = 2;
cairo_set_dash (w_current->cr, dashes, num_dashes, 0.);
- cairo_set_line_cap (w_current->cr, CAIRO_LINE_CAP_BUTT);
+ cairo_set_line_cap (w_current->cr, cap);
cairo_stroke_preserve (w_current->cr);
dashes[0] = 0; /* DOT */
diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index 290ca09..d4f7eaa 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -75,6 +75,7 @@ void o_net_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
TOPLEVEL *toplevel = w_current->toplevel;
int x1, y1, x2, y2;
int size = 0;
+ OBJECT_END end;
#if NET_DEBUG /* debug */
char *tempstring;
@@ -97,10 +98,12 @@ void o_net_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
if (toplevel->net_style == THICK)
size = NET_WIDTH;
- gschem_cairo_line (w_current, END_SQUARE, size, x1, y1, x2, y2);
+ end = o_get_line_end (toplevel->print_output_capstyle);
+
+ gschem_cairo_line (w_current, end, size, x1, y1, x2, y2);
gschem_cairo_set_source_color (w_current,
o_drawing_color (w_current, o_current));
- gschem_cairo_stroke (w_current, TYPE_SOLID, END_SQUARE, size, -1, -1);
+ gschem_cairo_stroke (w_current, TYPE_SOLID, end, size, -1, -1);
if (o_current->selected && w_current->draw_grips) {
o_line_draw_grips (w_current, o_current);
diff --git a/gschem/src/o_pin.c b/gschem/src/o_pin.c
index db6fc6b..cf81718 100644
--- a/gschem/src/o_pin.c
+++ b/gschem/src/o_pin.c
@@ -38,6 +38,7 @@ void o_pin_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
TOPLEVEL *toplevel = w_current->toplevel;
int x1, y1, x2, y2;
int size = 0;
+ OBJECT_END end;
if (o_current->line == NULL) {
return;
@@ -51,11 +52,13 @@ void o_pin_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
if (toplevel->pin_style == THICK)
size = o_current->line_width;
- gschem_cairo_line (w_current, END_NONE, size, x1, y1, x2, y2);
+ end = o_get_line_end (toplevel->print_output_capstyle);
+
+ gschem_cairo_line (w_current, end, size, x1, y1, x2, y2);
gschem_cairo_set_source_color (w_current,
o_drawing_color (w_current, o_current));
- gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, size, -1, -1);
+ gschem_cairo_stroke (w_current, TYPE_SOLID, end, size, -1, -1);
/* draw the cue directly */
o_cue_draw_lowlevel(w_current, o_current, o_current->whichend);
diff --git a/libgeda/src/o_arc_basic.c b/libgeda/src/o_arc_basic.c
index 2461889..7586e1c 100644
--- a/libgeda/src/o_arc_basic.c
+++ b/libgeda/src/o_arc_basic.c
@@ -100,7 +100,7 @@ OBJECT *o_arc_new(TOPLEVEL *toplevel,
/* Default init */
o_set_line_options(toplevel, new_node,
- END_NONE, TYPE_SOLID, 0, -1, -1);
+ o_get_line_end(toplevel->print_output_capstyle), TYPE_SOLID, 0, -1, -1);
o_set_fill_options(toplevel, new_node,
FILLING_HOLLOW, -1, -1, -1, -1, -1);
diff --git a/libgeda/src/o_basic.c b/libgeda/src/o_basic.c
index bbbd477..9970648 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -822,3 +822,40 @@ o_set_visibility (TOPLEVEL *toplevel, OBJECT *object, int visibility)
o_bounds_invalidate (toplevel, object);
}
}
+
+/*! \brief Get capstyle for printing of an object.
+ * \par Function Description
+ * This function gets the object's capstyle for printing from its line end.
+ * See #OBJECT_END for information on valid line end values.
+ *
+ * \param [in] end Line end value of the object
+ *
+ * \todo Change this function to use it also in gschem_cairo.c
+ */
+int o_get_capstyle (OBJECT_END end)
+{
+ switch(end) {
+ case(END_NONE): return BUTT_CAP; break;
+ case(END_SQUARE): return SQUARE_CAP; break;
+ case(END_ROUND): return ROUND_CAP; break;
+ default: return BUTT_CAP; break;
+ }
+}
+
+/*! \brief Get line end using capstyle value.
+ * \par Function Description
+ * This function gets the object's line end value based on capstyle value
+ * used for Postscript printing.
+ * See also information on 'output-capstyle' gschem configuration option.
+ *
+ * \param [in] capstyle
+ */
+OBJECT_END o_get_line_end (int capstyle)
+{
+ switch(capstyle) {
+ case(BUTT_CAP): return END_NONE; break;
+ case(SQUARE_CAP): return END_SQUARE; break;
+ case(ROUND_CAP): return END_ROUND; break;
+ default: return END_NONE; break;
+ }
+}
diff --git a/libgeda/src/o_box_basic.c b/libgeda/src/o_box_basic.c
index 6246f66..c956441 100644
--- a/libgeda/src/o_box_basic.c
+++ b/libgeda/src/o_box_basic.c
@@ -79,7 +79,7 @@ OBJECT *o_box_new(TOPLEVEL *toplevel,
/* line type and filling initialized to default */
o_set_line_options(toplevel, new_node,
- END_NONE, TYPE_SOLID, 0, -1, -1);
+ o_get_line_end(toplevel->print_output_capstyle), TYPE_SOLID, 0, -1, -1);
o_set_fill_options(toplevel, new_node,
FILLING_HOLLOW, -1, -1, -1, -1, -1);
diff --git a/libgeda/src/o_circle_basic.c b/libgeda/src/o_circle_basic.c
index e534bc4..faba12c 100644
--- a/libgeda/src/o_circle_basic.c
+++ b/libgeda/src/o_circle_basic.c
@@ -93,7 +93,7 @@ OBJECT *o_circle_new(TOPLEVEL *toplevel,
/* line type and filling initialized to default */
o_set_line_options(toplevel, new_node,
- END_NONE, TYPE_SOLID, 0, -1, -1);
+ o_get_line_end(toplevel->print_output_capstyle), TYPE_SOLID, 0, -1, -1);
o_set_fill_options(toplevel, new_node,
FILLING_HOLLOW, -1, -1, -1, -1, -1);
diff --git a/libgeda/src/o_line_basic.c b/libgeda/src/o_line_basic.c
index e156b7d..950d505 100644
--- a/libgeda/src/o_line_basic.c
+++ b/libgeda/src/o_line_basic.c
@@ -81,7 +81,7 @@ OBJECT *o_line_new(TOPLEVEL *toplevel,
/* line type and filling initialized to default */
o_set_line_options(toplevel, new_node,
- END_NONE, TYPE_SOLID, 0, -1, -1);
+ o_get_line_end(toplevel->print_output_capstyle), TYPE_SOLID, 0, -1, -1);
o_set_fill_options(toplevel, new_node,
FILLING_HOLLOW, -1, -1, -1, -1, -1);
diff --git a/libgeda/src/o_path_basic.c b/libgeda/src/o_path_basic.c
index df94ee8..301791d 100644
--- a/libgeda/src/o_path_basic.c
+++ b/libgeda/src/o_path_basic.c
@@ -84,7 +84,7 @@ OBJECT *o_path_new (TOPLEVEL *toplevel,
/* path type and filling initialized to default */
o_set_line_options (toplevel, new_node,
- END_NONE, TYPE_SOLID, 0, -1, -1);
+ o_get_line_end(toplevel->print_output_capstyle), TYPE_SOLID, 0, -1, -1);
o_set_fill_options (toplevel, new_node,
FILLING_HOLLOW, -1, -1, -1, -1, -1);
commit 33b172da8156de9373445b45f752fa949ec0f6fc
Author: Vladimir Zhbanov <vzhbanov@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Added line end (capstyle) menu for the line type dialog
Handling of the menu is similar to handling of the line type menu.
Important: In order to have it working I have had to change OBJECT_END
type definition.
'optionmenu' variable name is changed to 'type_menu' to distinguish
between it and the 'end_menu'.
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index ab4379b..9526848 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -43,6 +43,7 @@
static GtkWidget* create_menu_linetype (GSCHEM_TOPLEVEL *w_current);
static gint line_type_dialog_linetype_change (GtkWidget *w, gpointer data);
static void line_type_dialog_ok (GtkWidget *w, gpointer data);
+static GtkWidget* create_menu_lineend (GSCHEM_TOPLEVEL *w_current);
static GtkWidget* create_menu_filltype (GSCHEM_TOPLEVEL *w_current);
static gint fill_type_dialog_filltype_change(GtkWidget *w, gpointer data);
@@ -55,6 +56,7 @@ struct line_type_data {
GtkWidget *line_type;
GtkWidget *length_entry;
GtkWidget *space_entry;
+ GtkWidget *line_end;
GSCHEM_TOPLEVEL *w_current;
};
@@ -611,6 +613,41 @@ static GtkWidget *create_menu_linetype (GSCHEM_TOPLEVEL *w_current)
return(menu);
}
+/*! \brief Create line end menu for the line type dialog
+ * \par Function Description
+ * This function creates a GtkMenu with different line end (capstyle) entries.
+ */
+static GtkWidget *create_menu_lineend (GSCHEM_TOPLEVEL *w_current)
+{
+ GtkWidget *menu;
+ GSList *group;
+ struct line_end {
+ gchar *str;
+ OBJECT_END end;
+ } types[] = { { N_("Butt"), END_NONE },
+ { N_("Square"), END_SQUARE },
+ { N_("Round"), END_ROUND },
+ { N_("*unchanged*"), END_VOID } };
+ gint i;
+
+ menu = gtk_menu_new ();
+ group = NULL;
+
+ for (i = 0; i < sizeof (types) / sizeof (struct line_end); i++) {
+ GtkWidget *menuitem;
+
+ menuitem = gtk_radio_menu_item_new_with_label (group, _(types[i].str));
+ group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
+ gtk_menu_append (GTK_MENU (menu), menuitem);
+ gtk_object_set_data (GTK_OBJECT(menuitem), "lineend",
+ GINT_TO_POINTER (types[i].end));
+ gtk_widget_show (menuitem);
+ }
+
+ return(menu);
+}
+
+
/*! \brief get the linetype data from selected objects
* \par Function Description
* Get linetype information over all selected objects.
@@ -618,7 +655,7 @@ static GtkWidget *create_menu_linetype (GSCHEM_TOPLEVEL *w_current)
* return -2 in that variable.
* \param [in] selection the selection list
* \param [out] end OBJECT_END type
- * \param [out] type OBJECT_FILLING type
+ * \param [out] type OBJECT_TYPE type
* \param [out] width line width
* \param [out] length length of each line
* \param [out] space space between points and lines
@@ -641,7 +678,7 @@ static gboolean selection_get_line_type(GList *selection,
&owidth, &olength, &ospace))
continue;
- if (found == FALSE) { /* first object with filltype */
+ if (found == FALSE) { /* first object with linetype */
found = TRUE;
*end = oend;
*type = otype;
@@ -655,20 +692,21 @@ static gboolean selection_get_line_type(GList *selection,
if (*width != owidth) *width = -2;
if (*length != olength) *length = -2;
if (*space != ospace) *space = -2;
+ if (*end != oend) *end = -2;
}
}
return found;
}
-
+
/*! \brief set the linetype in the linetype dialog
* \par Function Description
* Set all widgets in the linetype dialog. Variables marked with the
* invalid value -2 are set to *unchanged*.
* \param [in] line_type_data dialog structure
- * \param [in] end OBJECT_END type (currently not used)
- * \param [in] type OBJECT_FILLING type
+ * \param [in] end OBJECT_END type
+ * \param [in] type OBJECT_TYPE type
* \param [in] width fill width.
* \param [in] length length of each line
* \param [in] space space between points and lines
@@ -713,8 +751,14 @@ static void line_type_dialog_set_values(struct line_type_data *line_type_data,
gtk_entry_select_region (GTK_ENTRY (line_type_data->space_entry),
0, strlen (text));
g_free(text);
+
+ if (end == -2)
+ end = END_VOID;
+ gtk_option_menu_set_history(GTK_OPTION_MENU(line_type_data->line_end), end);
+ menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(line_type_data->line_end));
+ menuitem = gtk_menu_get_active(GTK_MENU(menu));
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
}
-
/*! \brief Callback function for the linetype menu item in the line type dialog
* \par Function Description
@@ -777,6 +821,7 @@ static void line_type_dialog_ok(GtkWidget *w, gpointer data)
OBJECT *object;
const gchar *width_str, *length_str, *space_str;
OBJECT_TYPE type;
+ OBJECT_END end;
gint width, length, space;
OBJECT_TYPE otype;
OBJECT_END oend;
@@ -804,7 +849,17 @@ static void line_type_dialog_ok(GtkWidget *w, gpointer data)
line_type_data->line_type))))), "linetype"));
if (type == TYPE_ERASE)
type = -1;
-
+
+ end = GPOINTER_TO_INT(
+ gtk_object_get_data (
+ GTK_OBJECT (
+ gtk_menu_get_active (
+ GTK_MENU (gtk_option_menu_get_menu (
+ GTK_OPTION_MENU (
+ line_type_data->line_end))))), "lineend"));
+ if (end == END_VOID)
+ end = -1;
+
/* convert the options to integers (-1 means unchanged) */
width = g_strcasecmp (width_str,
_("*unchanged*")) ? atoi (width_str) : -1;
@@ -819,11 +874,11 @@ static void line_type_dialog_ok(GtkWidget *w, gpointer data)
&owidth, &olength, &ospace))
continue;
- /* oend is not in the dialog, yet */
otype = type == -1 ? otype : type;
owidth = width == -1 ? owidth : width;
olength = length == -1 ? olength : length;
ospace = space == -1 ? ospace : space;
+ oend = end == -1 ? oend : end;
/* set all not required options to -1 and
set nice parameters if not provided by the user */
@@ -890,10 +945,11 @@ void line_type_dialog (GSCHEM_TOPLEVEL *w_current)
{
GtkWidget *dialog;
GtkWidget *vbox;
- GtkWidget *optionmenu = NULL;
+ GtkWidget *type_menu = NULL;
GtkWidget *length_entry = NULL;
GtkWidget *space_entry = NULL;
GtkWidget *width_entry = NULL;
+ GtkWidget *end_menu = NULL;
GtkWidget *table;
GtkWidget *label;
struct line_type_data *line_type_data;
@@ -949,7 +1005,7 @@ void line_type_dialog (GSCHEM_TOPLEVEL *w_current)
gtk_misc_set_alignment(GTK_MISC(label),0,0);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); */
- table = gtk_table_new (4, 2, FALSE);
+ table = gtk_table_new (5, 2, FALSE);
gtk_table_set_row_spacings(GTK_TABLE(table), DIALOG_V_SPACING);
gtk_table_set_col_spacings(GTK_TABLE(table), DIALOG_H_SPACING);
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
@@ -970,10 +1026,14 @@ void line_type_dialog (GSCHEM_TOPLEVEL *w_current)
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_table_attach(GTK_TABLE(table), label, 0,1,3,4, GTK_FILL,0,0,0);
- optionmenu = gtk_option_menu_new ();
- gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu),
+ label = gtk_label_new (_("Cap style:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+ gtk_table_attach(GTK_TABLE(table), label, 0,1,4,5, GTK_FILL,0,0,0);
+
+ type_menu = gtk_option_menu_new ();
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(type_menu),
create_menu_linetype (w_current));
- gtk_table_attach_defaults(GTK_TABLE(table), optionmenu,
+ gtk_table_attach_defaults(GTK_TABLE(table), type_menu,
1,2,0,1);
width_entry = gtk_entry_new();
@@ -982,7 +1042,7 @@ void line_type_dialog (GSCHEM_TOPLEVEL *w_current)
gtk_table_attach_defaults(GTK_TABLE(table), width_entry,
1,2,1,2);
- g_signal_connect(G_OBJECT (optionmenu), "changed",
+ g_signal_connect(G_OBJECT (type_menu), "changed",
G_CALLBACK (line_type_dialog_linetype_change),
line_type_data);
@@ -998,12 +1058,19 @@ void line_type_dialog (GSCHEM_TOPLEVEL *w_current)
gtk_table_attach_defaults(GTK_TABLE(table), space_entry,
1,2,3,4);
+ end_menu = gtk_option_menu_new ();
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(end_menu),
+ create_menu_lineend (w_current));
+ gtk_table_attach_defaults(GTK_TABLE(table), end_menu,
+ 1,2,4,5);
+
/* populate the data structure */
line_type_data->dialog = dialog;
line_type_data->width_entry = width_entry;
- line_type_data->line_type = optionmenu;
+ line_type_data->line_type = type_menu;
line_type_data->length_entry = length_entry;
line_type_data->space_entry = space_entry;
+ line_type_data->line_end = end_menu;
line_type_data->w_current = w_current;
@@ -1012,7 +1079,7 @@ void line_type_dialog (GSCHEM_TOPLEVEL *w_current)
width, length, space);
/* calling it once will set the dash space/length activity */
- line_type_dialog_linetype_change(optionmenu, line_type_data);
+ line_type_dialog_linetype_change(type_menu, line_type_data);
gtk_widget_grab_focus(width_entry);
gtk_widget_show_all (dialog);
diff --git a/libgeda/include/libgeda/struct.h b/libgeda/include/libgeda/struct.h
index e0a448c..ab2bf95 100644
--- a/libgeda/include/libgeda/struct.h
+++ b/libgeda/include/libgeda/struct.h
@@ -78,7 +78,7 @@ typedef enum { F_OPEN_RC = 1,
} FOpenFlags;
/*! \brief line end style for an open line of an object */
-typedef enum {END_NONE, END_SQUARE, END_ROUND} OBJECT_END;
+typedef enum {END_NONE, END_SQUARE, END_ROUND, END_VOID} OBJECT_END;
/*! \brief line style of lines, rect, circles, arcs */
typedef enum {TYPE_SOLID, TYPE_DOTTED, TYPE_DASHED, TYPE_CENTER, TYPE_PHANTOM, TYPE_ERASE} OBJECT_TYPE;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs