[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.7.0-20110116-23-g0e49b41)
The branch, master has been updated
via 0e49b41b82323f4632410314b680a9d9d6450540 (commit)
via 465db62f713eb8f1f6c73842a166160a24ba18fd (commit)
from de856e25a83158237aaf33f29f024b72944a60fe (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/include/prototype.h | 8 -
gschem/src/o_box.c | 323 +++++++++++++++++++++----------------------
gschem/src/o_circle.c | 314 +++++++++++++++++++++----------------------
gschem/src/o_path.c | 46 +++----
4 files changed, 328 insertions(+), 363 deletions(-)
=================
Commit Messages
=================
commit 0e49b41b82323f4632410314b680a9d9d6450540
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Make object fill functions static inside their o_*.c file
Move the o_*_draw() functions down after the fill functions, so we
don't even have to prototype them in the C file.
:100644 100644 8c3260b... 43e7c43... M gschem/include/prototype.h
:100644 100644 6e86a2d... 6537679... M gschem/src/o_box.c
:100644 100644 347a8d3... 95790b8... M gschem/src/o_circle.c
commit 465db62f713eb8f1f6c73842a166160a24ba18fd
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Remove unused GdkGC and GdkDrawable arguments from fill routines
Also swap the (GSCHEM_TOPLEVEL *) argument to be the first, to better
match other API.
:100644 100644 49c4f7e... 8c3260b... M gschem/include/prototype.h
:100644 100644 61da6f2... 6e86a2d... M gschem/src/o_box.c
:100644 100644 e295ca7... 347a8d3... M gschem/src/o_circle.c
:100644 100644 77063b2... 9e2c03d... M gschem/src/o_path.c
=========
Changes
=========
commit 0e49b41b82323f4632410314b680a9d9d6450540
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Make object fill functions static inside their o_*.c file
Move the o_*_draw() functions down after the fill functions, so we
don't even have to prototype them in the C file.
diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 8c3260b..43e7c43 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -507,10 +507,6 @@ void o_invalidate_glist(GSCHEM_TOPLEVEL *w_current, GList *list);
COLOR *o_drawing_color(GSCHEM_TOPLEVEL *w_current, OBJECT *object);
/* o_box.c */
void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
-void o_box_fill_hollow(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_box_fill_fill(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_box_fill_hatch(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_box_fill_mesh(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
void o_box_invalidate_rubber(GSCHEM_TOPLEVEL *w_current);
void o_box_draw_place(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current);
void o_box_start(GSCHEM_TOPLEVEL *w_current, int x, int y);
@@ -535,10 +531,6 @@ void o_bus_draw_rubber(GSCHEM_TOPLEVEL *w_current);
void o_bus_invalidate_rubber(GSCHEM_TOPLEVEL *w_current);
/* o_circle.c */
void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
-void o_circle_fill_hollow(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_circle_fill_fill(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_circle_fill_hatch(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_circle_fill_mesh(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
void o_circle_invalidate_rubber(GSCHEM_TOPLEVEL *w_current);
void o_circle_draw_place(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current);
void o_circle_start(GSCHEM_TOPLEVEL *w_current, int x, int y);
diff --git a/gschem/src/o_box.c b/gschem/src/o_box.c
index 6e86a2d..6537679 100644
--- a/gschem/src/o_box.c
+++ b/gschem/src/o_box.c
@@ -42,6 +42,148 @@ typedef void (*FILL_FUNC) (GSCHEM_TOPLEVEL *w_current,
gint angle1, gint pitch1,
gint angle2, gint pitch2);
+/*! \brief Placeholder filling function.
+ * \par Function Description
+ * This function does nothing. It has the same prototype as all the
+ * filling functions. It prevent from making a difference between filling
+ * in function #o_box_draw().
+ *
+ * \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
+ * \param [in] box Box definition
+ * \param [in] fill_width BOX pattern fill width.
+ * \param [in] angle1 1st angle for pattern.
+ * \param [in] pitch1 1st pitch for pattern.
+ * \param [in] angle2 2nd angle for pattern.
+ * \param [in] pitch2 2nd pitch for pattern.
+ */
+static void
+o_box_fill_hollow (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, BOX *box,
+ gint fill_width,
+ gint angle1, gint pitch1,
+ gint angle2, gint pitch2)
+{
+}
+
+/*! \brief Fill inside of box with a solid pattern.
+ * \par Function Description
+ * This function fills the inside of the box with a solid pattern.
+ * Parameters <B>angle1</B>, <B>pitch1</B> and <B>angle2</B>,
+ * <B>pitch2</B> and <B>fill_width</B> are unused here but kept for compatibility
+ * with other box filling functions.
+ *
+ * The box is defined in the same way as it is in GDK : one point and
+ * the width and height of the box.
+ *
+ * All parameters are given in pixel.
+ *
+ * \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
+ * \param [in] box Box definition
+ * \param [in] fill_width BOX pattern fill width.
+ * \param [in] angle1 (unused)
+ * \param [in] pitch1 (unused)
+ * \param [in] angle2 (unused)
+ * \param [in] pitch2 (unused)
+ */
+static void
+o_box_fill_fill (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, BOX *box,
+ gint fill_width,
+ gint angle1, gint pitch1,
+ gint angle2, gint pitch2)
+{
+ /* NOP: We'll fill it when we do the stroking */
+}
+
+/*! \brief Fill inside of box with single line pattern.
+ * \par Function Description
+ * This function fills the inside of the box with a pattern made of lines.
+ * The lines are drawn inside the box with an angle <B>angle1</B> from the
+ * horizontal. The distance between two of these lines is given by
+ * <B>pitch1</B> and their width by <B>fill_width</B>.
+ * Parameters <B>angle2</B> and <B>pitch2</B> are unused here but kept for
+ * compatbility with other box filling functions.
+ *
+ * The box is defined in the same way as it is in GDK : one point and the
+ * width and height of the box.
+ *
+ * All parameters are given in pixel.
+ *
+ * Negative or null values for <B>pitch1</B> are not allowed as it leads to
+ * an endless loop.
+ *
+ * \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
+ * \param [in] box Box definition
+ * \param [in] fill_width BOX pattern fill width.
+ * \param [in] angle1 1st angle for pattern.
+ * \param [in] pitch1 1st pitch for pattern.
+ * \param [in] angle2 (unused)
+ * \param [in] pitch2 (unused)
+ */
+static void
+o_box_fill_hatch (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, BOX *box,
+ gint fill_width,
+ gint angle1, gint pitch1,
+ gint angle2, gint pitch2)
+{
+ int i;
+ GArray *lines;
+
+ gschem_cairo_set_source_color (w_current, color);
+
+ lines = g_array_new (FALSE, FALSE, sizeof (LINE));
+ m_hatch_box (box, angle1, pitch1, lines);
+
+ for (i=0; i < lines->len; i++) {
+ LINE *line = &g_array_index (lines, LINE, i);
+
+ gschem_cairo_line (w_current, END_NONE, fill_width, line->x[0], line->y[0],
+ line->x[1], line->y[1]);
+ }
+ gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, fill_width, -1, -1);
+
+ g_array_free (lines, TRUE);
+}
+
+/*! \brief Fill inside of box with mesh pattern.
+ * \par Function Description
+ * This function fills the inside of the box with a pattern made of two
+ * sets of parallel lines in two directions. The first set is drawn inside
+ * the box with an angle <B>angle1</B> from the horizontal. The distance
+ * between two of these lines is given by <B>pitch1</B>.
+ * The second set is drawn inside the box with an angle <B>angle2</B> from
+ * the horizontal. The distance between two of these lines is given
+ * by <B>pitch2</B>.
+ * Every lines have the same width given be <B>fill_width</B>.
+ *
+ * This function simply makes two successive calls to the function
+ * #o_box_fill_hatch() respectively with <B>angle1</B>, <B>pitch1</B> and
+ * <B>angle2</B>, <B>pitch2</B> for parameters.
+ * \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
+ * \param [in] box Box definition
+ * \param [in] fill_width BOX pattern fill width.
+ * \param [in] angle1 1st angle for pattern.
+ * \param [in] pitch1 1st pitch for pattern.
+ * \param [in] angle2 2nd angle for pattern.
+ * \param [in] pitch2 2nd pitch for pattern.
+ */
+static void
+o_box_fill_mesh (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, BOX *box,
+ gint fill_width,
+ gint angle1, gint pitch1,
+ gint angle2, gint pitch2)
+{
+ o_box_fill_hatch (w_current, color, box, fill_width, angle1, pitch1, -1, -1);
+ o_box_fill_hatch (w_current, color, box, fill_width, angle2, pitch2, -1, -1);
+}
+
+
/*! \brief Draw a box on the screen.
* \par Function Description
* This function is used to draw a box on screen. The box is described in
@@ -113,8 +255,8 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
pitch1 = o_current->fill_pitch1;
angle2 = o_current->fill_angle2;
pitch2 = o_current->fill_pitch2;
-
- switch(o_current->fill_type) {
+
+ switch (o_current->fill_type) {
case FILLING_HOLLOW:
angle1 = -1; angle2 = -1;
pitch1 = 1; pitch2 = 1;
@@ -125,13 +267,13 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
*/
fill_func = o_box_fill_hollow;
break;
-
+
case FILLING_FILL:
angle1 = -1; angle2 = -1;
pitch1 = 1; pitch2 = 1;
fill_func = o_box_fill_fill;
break;
-
+
case FILLING_MESH:
fill_func = o_box_fill_mesh;
break;
@@ -141,18 +283,17 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
pitch2 = 1;
fill_func = o_box_fill_hatch;
break;
-
+
case FILLING_VOID:
default:
angle1 = -1; angle2 = -1;
pitch1 = 1; pitch2 = 1;
fill_func = o_box_fill_hollow;
- fprintf(stderr, _("Unknown type for box (fill)!\n"));
+ fprintf (stderr, _("Unknown type for box (fill)!\n"));
}
- if((pitch1 <= 0) || (pitch2 <= 0)) {
+ if ((pitch1 <= 0) || (pitch2 <= 0))
fill_func = o_box_fill_fill;
- }
(*fill_func) (w_current, o_drawing_color (w_current, o_current),
o_current->box, o_current->fill_width,
@@ -173,146 +314,8 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
o_current->line_length,
o_current->line_space);
- if (o_current->selected && w_current->draw_grips) {
+ if (o_current->selected && w_current->draw_grips)
o_box_draw_grips (w_current, o_current);
- }
-}
-
-/*! \brief Placeholder filling function.
- * \par Function Description
- * This function does nothing. It has the same prototype as all the
- * filling functions. It prevent from making a difference between filling
- * in function #o_box_draw().
- *
- * \param [in] w_current Schematic top level
- * \param [in] color Box fill color.
- * \param [in] box Box definition
- * \param [in] fill_width BOX pattern fill width.
- * \param [in] angle1 1st angle for pattern.
- * \param [in] pitch1 1st pitch for pattern.
- * \param [in] angle2 2nd angle for pattern.
- * \param [in] pitch2 2nd pitch for pattern.
- */
-void o_box_fill_hollow (GSCHEM_TOPLEVEL *w_current,
- COLOR *color, BOX *box,
- gint fill_width,
- gint angle1, gint pitch1,
- gint angle2, gint pitch2)
-{
-}
-
-/*! \brief Fill inside of box with a solid pattern.
- * \par Function Description
- * This function fills the inside of the box with a solid pattern.
- * Parameters <B>angle1</B>, <B>pitch1</B> and <B>angle2</B>,
- * <B>pitch2</B> and <B>fill_width</B> are unused here but kept for compatibility
- * with other box filling functions.
- *
- * The box is defined in the same way as it is in GDK : one point and
- * the width and height of the box.
- *
- * All parameters are given in pixel.
- *
- * \param [in] w_current Schematic top level
- * \param [in] color Box fill color.
- * \param [in] box Box definition
- * \param [in] fill_width BOX pattern fill width.
- * \param [in] angle1 (unused)
- * \param [in] pitch1 (unused)
- * \param [in] angle2 (unused)
- * \param [in] pitch2 (unused)
- */
-void o_box_fill_fill (GSCHEM_TOPLEVEL *w_current,
- COLOR *color, BOX *box,
- gint fill_width,
- gint angle1, gint pitch1,
- gint angle2, gint pitch2)
-{
- /* NOP: We'll fill it when we do the stroking */
-}
-
-/*! \brief Fill inside of box with single line pattern.
- * \par Function Description
- * This function fills the inside of the box with a pattern made of lines.
- * The lines are drawn inside the box with an angle <B>angle1</B> from the
- * horizontal. The distance between two of these lines is given by
- * <B>pitch1</B> and their width by <B>fill_width</B>.
- * Parameters <B>angle2</B> and <B>pitch2</B> are unused here but kept for
- * compatbility with other box filling functions.
- *
- * The box is defined in the same way as it is in GDK : one point and the
- * width and height of the box.
- *
- * All parameters are given in pixel.
- *
- * Negative or null values for <B>pitch1</B> are not allowed as it leads to
- * an endless loop.
- *
- * \param [in] w_current Schematic top level
- * \param [in] color Box fill color.
- * \param [in] box Box definition
- * \param [in] fill_width BOX pattern fill width.
- * \param [in] angle1 1st angle for pattern.
- * \param [in] pitch1 1st pitch for pattern.
- * \param [in] angle2 (unused)
- * \param [in] pitch2 (unused)
- */
-void o_box_fill_hatch (GSCHEM_TOPLEVEL *w_current,
- COLOR *color, BOX *box,
- gint fill_width,
- gint angle1, gint pitch1,
- gint angle2, gint pitch2)
-{
- int i;
- GArray *lines;
-
- gschem_cairo_set_source_color (w_current, color);
-
- lines = g_array_new (FALSE, FALSE, sizeof (LINE));
- m_hatch_box (box, angle1, pitch1, lines);
-
- for (i=0; i < lines->len; i++) {
- LINE *line = &g_array_index (lines, LINE, i);
-
- gschem_cairo_line (w_current, END_NONE, fill_width, line->x[0], line->y[0],
- line->x[1], line->y[1]);
- }
- gschem_cairo_stroke (w_current, TYPE_SOLID, END_NONE, fill_width, -1, -1);
-
- g_array_free (lines, TRUE);
-}
-
-/*! \brief Fill inside of box with mesh pattern.
- * \par Function Description
- * This function fills the inside of the box with a pattern made of two
- * sets of parallel lines in two directions. The first set is drawn inside
- * the box with an angle <B>angle1</B> from the horizontal. The distance
- * between two of these lines is given by <B>pitch1</B>.
- * The second set is drawn inside the box with an angle <B>angle2</B> from
- * the horizontal. The distance between two of these lines is given
- * by <B>pitch2</B>.
- * Every lines have the same width given be <B>fill_width</B>.
- *
- * This function simply makes two successive calls to the function
- * #o_box_fill_hatch() respectively with <B>angle1</B>, <B>pitch1</B> and
- * <B>angle2</B>, <B>pitch2</B> for parameters.
- * \param [in] w_current Schematic top level
- * \param [in] color Box fill color.
- * \param [in] box Box definition
- * \param [in] fill_width BOX pattern fill width.
- * \param [in] angle1 1st angle for pattern.
- * \param [in] pitch1 1st pitch for pattern.
- * \param [in] angle2 2nd angle for pattern.
- * \param [in] pitch2 2nd pitch for pattern.
- */
-void o_box_fill_mesh (GSCHEM_TOPLEVEL *w_current,
- COLOR *color, BOX *box,
- gint fill_width,
- gint angle1, gint pitch1,
- gint angle2, gint pitch2)
-{
- o_box_fill_hatch (w_current, color, box, fill_width, angle1, pitch1, -1, -1);
- o_box_fill_hatch (w_current, color, box, fill_width, angle2, pitch2, -1, -1);
}
diff --git a/gschem/src/o_circle.c b/gschem/src/o_circle.c
index 347a8d3..95790b8 100644
--- a/gschem/src/o_circle.c
+++ b/gschem/src/o_circle.c
@@ -34,130 +34,6 @@ typedef void (*FILL_FUNC) (GSCHEM_TOPLEVEL *w_current,
gint angle2, gint pitch2);
-/*! \brief Draw a circle on the screen.
- * \par Function Description
- * This function is used to draw a circle on screen. The circle is described
- * by the OBJECT which is referred by <B>o_current</B>. The display is done
- * according to the current state, given by the GSCHEM_TOPLEVEL object pointed by
- * <B>w_current</B>.
- *
- * It first checks if the OBJECT pointed is valid or not. If not it
- * returns and do not output anything. That should never happen though.
- *
- * \param [in] w_current The GSCHEM_TOPLEVEL object.
- * \param [in] o_current Circle OBJECT to draw.
- */
-void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
-{
- int angle1, pitch1, angle2, pitch2;
- FILL_FUNC fill_func;
-
- if (o_current->circle == NULL) {
- return;
- }
-
-#if DEBUG
- printf("drawing circle\n\n");
-#endif
-
- /*
- * The draw of the circle is divided in two steps : first step is to draw
- * the outline, the second is to draw the filling pattern inside (if any).
- *
- * Finally the function takes care of the grips.
- */
-
- /*
- * The values needed for the fill operation are taken from the
- * <B>o_current</B> pointed OBJECT. It include the type of fill required, the
- * width of the lines (if the fill use line) and angles and pitchs for hatch
- * based filling.
- *
- * Once again the width of the line is important as if it is equal to 0 it
- * may not be displayed. That is definetely not what we are looking for.
- *
- * Depending on the type of fill that has to be used inside the circle the
- * right function is called. Values of <B>angle1</B>, <B>angle2</B>,
- * <B>pitch1</B> and <B>pitch2</B> are adapted to the type of filling. The
- * possible functions are the following : #o_circle_fill_hollow(),
- * #o_circle_fill_fill(), #o_circle_fill_mesh() and #o_circle_fill_hatch().
- *
- * The combination <B>pitch1</B> <= 0 and <B>pitch2</B> <= 0 is avoided as it
- * lead to an endless loop in function called after. It happens when the
- * zoom factor is too small for two lines separated by the pitch to be
- * distinct. If such a case is encountered the circle is filled hollow
- * (e.q. not filled).
- */
-
- angle1 = o_current->fill_angle1;
- pitch1 = o_current->fill_pitch1;
- angle2 = o_current->fill_angle2;
- pitch2 = o_current->fill_pitch2;
-
- switch(o_current->fill_type) {
- case FILLING_HOLLOW:
- angle1 = -1; angle2 = -1;
- pitch1 = 1; pitch2 = 1;
- /*
- * this function is empty ! however if it do not use it we have to add
- * a test before the call. Simply putting a return here instead is not
- * possible as it would prevent any hollow circle from having its grips
- */
- fill_func = o_circle_fill_hollow;
- break;
-
- case FILLING_FILL:
- angle1 = -1; angle2 = -1;
- pitch1 = 1; pitch2 = 1;
- fill_func = o_circle_fill_fill;
- break;
-
- case FILLING_MESH:
- fill_func = o_circle_fill_mesh;
- break;
-
- case FILLING_HATCH:
- angle2 = -1;
- pitch2 = 1;
- fill_func = o_circle_fill_hatch;
- break;
-
- case FILLING_VOID:
- default:
- angle1 = -1; angle2 = -1;
- pitch1 = 1; pitch2 = 1;
- fill_func = o_circle_fill_hollow;
- fprintf(stderr, _("Unknown type for circle (fill)!\n"));
- }
-
- if((pitch1 <= 0) || (pitch2 <= 0)) {
- fill_func = o_circle_fill_fill;
- }
-
- (*fill_func) (w_current, o_drawing_color (w_current, o_current),
- o_current->circle, o_current->fill_width,
- angle1, pitch1, angle2, pitch2);
-
- gschem_cairo_arc (w_current, o_current->line_width,
- o_current->circle->center_x,
- o_current->circle->center_y,
- o_current->circle->radius, 0, 360);
-
- gschem_cairo_set_source_color (w_current,
- o_drawing_color (w_current, o_current));
- if (o_current->fill_type == FILLING_FILL)
- cairo_fill_preserve (w_current->cr);
- gschem_cairo_stroke (w_current, o_current->line_type,
- o_current->line_end,
- o_current->line_width,
- o_current->line_length,
- o_current->line_space);
-
- if (o_current->selected && w_current->draw_grips) {
- o_circle_draw_grips (w_current, o_current);
- }
-}
-
/*! \brief Placeholder filling function.
* \par Function Description
* This function does nothing. It has the same prototype as all the filling
@@ -176,11 +52,12 @@ void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
* \param [in] angle2 2nd angle for pattern.
* \param [in] pitch2 2nd pitch for pattern.
*/
-void o_circle_fill_hollow (GSCHEM_TOPLEVEL *w_current,
- COLOR *color, CIRCLE *circle,
- gint fill_width,
- gint angle1, gint pitch1,
- gint angle2, gint pitch2)
+static void
+o_circle_fill_hollow (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, CIRCLE *circle,
+ gint fill_width,
+ gint angle1, gint pitch1,
+ gint angle2, gint pitch2)
{
}
@@ -207,11 +84,12 @@ void o_circle_fill_hollow (GSCHEM_TOPLEVEL *w_current,
* \param [in] angle2 (unused)
* \param [in] pitch2 (unused)
*/
-void o_circle_fill_fill (GSCHEM_TOPLEVEL *w_current,
- COLOR *color, CIRCLE *circle,
- gint fill_width,
- gint angle1, gint pitch1,
- gint angle2, gint pitch2)
+static void
+o_circle_fill_fill (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, CIRCLE *circle,
+ gint fill_width,
+ gint angle1, gint pitch1,
+ gint angle2, gint pitch2)
{
/* NOP: We'll fill it when we do the stroking */
}
@@ -246,11 +124,12 @@ void o_circle_fill_fill (GSCHEM_TOPLEVEL *w_current,
* \param [in] angle2 (unused)
* \param [in] pitch2 (unused)
*/
-void o_circle_fill_hatch (GSCHEM_TOPLEVEL *w_current,
- COLOR *color, CIRCLE *circle,
- gint fill_width,
- gint angle1, gint pitch1,
- gint angle2, gint pitch2)
+static void
+o_circle_fill_hatch (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, CIRCLE *circle,
+ gint fill_width,
+ gint angle1, gint pitch1,
+ gint angle2, gint pitch2)
{
int i;
GArray *lines;
@@ -298,11 +177,12 @@ void o_circle_fill_hatch (GSCHEM_TOPLEVEL *w_current,
* \param [in] angle2 2nd angle for pattern.
* \param [in] pitch2 2nd pitch for pattern.
*/
-void o_circle_fill_mesh (GSCHEM_TOPLEVEL *w_current,
- COLOR *color, CIRCLE *circle,
- gint fill_width,
- gint angle1, gint pitch1,
- gint angle2, gint pitch2)
+static void
+o_circle_fill_mesh (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, CIRCLE *circle,
+ gint fill_width,
+ gint angle1, gint pitch1,
+ gint angle2, gint pitch2)
{
o_circle_fill_hatch (w_current, color, circle,
fill_width, angle1, pitch1, -1, -1);
@@ -312,6 +192,125 @@ void o_circle_fill_mesh (GSCHEM_TOPLEVEL *w_current,
}
+/*! \brief Draw a circle on the screen.
+ * \par Function Description
+ * This function is used to draw a circle on screen. The circle is described
+ * by the OBJECT which is referred by <B>o_current</B>. The display is done
+ * according to the current state, given by the GSCHEM_TOPLEVEL object pointed by
+ * <B>w_current</B>.
+ *
+ * It first checks if the OBJECT pointed is valid or not. If not it
+ * returns and do not output anything. That should never happen though.
+ *
+ * \param [in] w_current The GSCHEM_TOPLEVEL object.
+ * \param [in] o_current Circle OBJECT to draw.
+ */
+void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
+{
+ int angle1, pitch1, angle2, pitch2;
+ FILL_FUNC fill_func;
+
+ if (o_current->circle == NULL) {
+ return;
+ }
+
+ /*
+ * The draw of the circle is divided in two steps : first step is to draw
+ * the outline, the second is to draw the filling pattern inside (if any).
+ *
+ * Finally the function takes care of the grips.
+ */
+
+ /*
+ * The values needed for the fill operation are taken from the
+ * <B>o_current</B> pointed OBJECT. It include the type of fill required, the
+ * width of the lines (if the fill use line) and angles and pitchs for hatch
+ * based filling.
+ *
+ * Once again the width of the line is important as if it is equal to 0 it
+ * may not be displayed. That is definetely not what we are looking for.
+ *
+ * Depending on the type of fill that has to be used inside the circle the
+ * right function is called. Values of <B>angle1</B>, <B>angle2</B>,
+ * <B>pitch1</B> and <B>pitch2</B> are adapted to the type of filling. The
+ * possible functions are the following : #o_circle_fill_hollow(),
+ * #o_circle_fill_fill(), #o_circle_fill_mesh() and #o_circle_fill_hatch().
+ *
+ * The combination <B>pitch1</B> <= 0 and <B>pitch2</B> <= 0 is avoided as it
+ * lead to an endless loop in function called after. It happens when the
+ * zoom factor is too small for two lines separated by the pitch to be
+ * distinct. If such a case is encountered the circle is filled hollow
+ * (e.q. not filled).
+ */
+
+ angle1 = o_current->fill_angle1;
+ pitch1 = o_current->fill_pitch1;
+ angle2 = o_current->fill_angle2;
+ pitch2 = o_current->fill_pitch2;
+
+ switch(o_current->fill_type) {
+ case FILLING_HOLLOW:
+ angle1 = -1; angle2 = -1;
+ pitch1 = 1; pitch2 = 1;
+ /*
+ * this function is empty ! however if it do not use it we have to add
+ * a test before the call. Simply putting a return here instead is not
+ * possible as it would prevent any hollow circle from having its grips
+ */
+ fill_func = o_circle_fill_hollow;
+ break;
+
+ case FILLING_FILL:
+ angle1 = -1; angle2 = -1;
+ pitch1 = 1; pitch2 = 1;
+ fill_func = o_circle_fill_fill;
+ break;
+
+ case FILLING_MESH:
+ fill_func = o_circle_fill_mesh;
+ break;
+
+ case FILLING_HATCH:
+ angle2 = -1;
+ pitch2 = 1;
+ fill_func = o_circle_fill_hatch;
+ break;
+
+ case FILLING_VOID:
+ default:
+ angle1 = -1; angle2 = -1;
+ pitch1 = 1; pitch2 = 1;
+ fill_func = o_circle_fill_hollow;
+ fprintf (stderr, _("Unknown type for circle (fill)!\n"));
+ }
+
+ if ((pitch1 <= 0) || (pitch2 <= 0))
+ fill_func = o_circle_fill_fill;
+
+ (*fill_func) (w_current, o_drawing_color (w_current, o_current),
+ o_current->circle, o_current->fill_width,
+ angle1, pitch1, angle2, pitch2);
+
+ gschem_cairo_arc (w_current, o_current->line_width,
+ o_current->circle->center_x,
+ o_current->circle->center_y,
+ o_current->circle->radius, 0, 360);
+
+ gschem_cairo_set_source_color (w_current,
+ o_drawing_color (w_current, o_current));
+ if (o_current->fill_type == FILLING_FILL)
+ cairo_fill_preserve (w_current->cr);
+ gschem_cairo_stroke (w_current, o_current->line_type,
+ o_current->line_end,
+ o_current->line_width,
+ o_current->line_length,
+ o_current->line_space);
+
+ if (o_current->selected && w_current->draw_grips)
+ o_circle_draw_grips (w_current, o_current);
+}
+
+
/*! \todo Finish function documentation!!!
* \brief
* \par Function Description
commit 465db62f713eb8f1f6c73842a166160a24ba18fd
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Remove unused GdkGC and GdkDrawable arguments from fill routines
Also swap the (GSCHEM_TOPLEVEL *) argument to be the first, to better
match other API.
diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 49c4f7e..8c3260b 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -507,10 +507,10 @@ void o_invalidate_glist(GSCHEM_TOPLEVEL *w_current, GList *list);
COLOR *o_drawing_color(GSCHEM_TOPLEVEL *w_current, OBJECT *object);
/* o_box.c */
void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
-void o_box_fill_hollow(GdkDrawable *w, GdkGC *gc, COLOR *color, GSCHEM_TOPLEVEL *w_current, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_box_fill_fill(GdkDrawable *w, GdkGC *gc, COLOR *color, GSCHEM_TOPLEVEL *w_current, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_box_fill_hatch(GdkDrawable *w, GdkGC *gc, COLOR *color, GSCHEM_TOPLEVEL *w_current, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_box_fill_mesh(GdkDrawable *w, GdkGC *gc, COLOR *color, GSCHEM_TOPLEVEL *w_current, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
+void o_box_fill_hollow(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
+void o_box_fill_fill(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
+void o_box_fill_hatch(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
+void o_box_fill_mesh(GSCHEM_TOPLEVEL *w_current, COLOR *color, BOX *box, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
void o_box_invalidate_rubber(GSCHEM_TOPLEVEL *w_current);
void o_box_draw_place(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current);
void o_box_start(GSCHEM_TOPLEVEL *w_current, int x, int y);
@@ -535,10 +535,10 @@ void o_bus_draw_rubber(GSCHEM_TOPLEVEL *w_current);
void o_bus_invalidate_rubber(GSCHEM_TOPLEVEL *w_current);
/* o_circle.c */
void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
-void o_circle_fill_hollow(GdkDrawable *w, GdkGC *gc, COLOR *color, GSCHEM_TOPLEVEL *w_current, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_circle_fill_fill(GdkDrawable *w, GdkGC *gc, COLOR *color, GSCHEM_TOPLEVEL *w_current, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_circle_fill_hatch(GdkDrawable *w, GdkGC *gc, COLOR *color, GSCHEM_TOPLEVEL *w_current, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
-void o_circle_fill_mesh(GdkDrawable *w, GdkGC *gc, COLOR *color, GSCHEM_TOPLEVEL *w_current, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
+void o_circle_fill_hollow(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
+void o_circle_fill_fill(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
+void o_circle_fill_hatch(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
+void o_circle_fill_mesh(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2);
void o_circle_invalidate_rubber(GSCHEM_TOPLEVEL *w_current);
void o_circle_draw_place(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current);
void o_circle_start(GSCHEM_TOPLEVEL *w_current, int x, int y);
diff --git a/gschem/src/o_box.c b/gschem/src/o_box.c
index 61da6f2..6e86a2d 100644
--- a/gschem/src/o_box.c
+++ b/gschem/src/o_box.c
@@ -36,10 +36,11 @@
#define GET_BOX_TOP(w) \
max((w)->first_wy, (w)->second_wy)
-typedef void (*FILL_FUNC)( GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, BOX *box,
- gint fill_width, gint angle1, gint pitch1,
- gint angle2, gint pitch2 );
+typedef void (*FILL_FUNC) (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, BOX *box,
+ gint fill_width,
+ gint angle1, gint pitch1,
+ gint angle2, gint pitch2);
/*! \brief Draw a box on the screen.
* \par Function Description
@@ -153,10 +154,9 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
fill_func = o_box_fill_fill;
}
- (*fill_func) (w_current->drawable, w_current->gc,
- o_drawing_color (w_current, o_current),
- w_current, o_current->box,
- o_current->fill_width, angle1, pitch1, angle2, pitch2);
+ (*fill_func) (w_current, o_drawing_color (w_current, o_current),
+ o_current->box, o_current->fill_width,
+ angle1, pitch1, angle2, pitch2);
gschem_cairo_set_source_color (w_current,
o_drawing_color (w_current, o_current));
@@ -184,10 +184,8 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
* filling functions. It prevent from making a difference between filling
* in function #o_box_draw().
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Box fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
* \param [in] box Box definition
* \param [in] fill_width BOX pattern fill width.
* \param [in] angle1 1st angle for pattern.
@@ -195,8 +193,8 @@ void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
* \param [in] angle2 2nd angle for pattern.
* \param [in] pitch2 2nd pitch for pattern.
*/
-void o_box_fill_hollow (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, BOX *box,
+void o_box_fill_hollow (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, BOX *box,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
@@ -215,10 +213,8 @@ void o_box_fill_hollow (GdkDrawable *w, GdkGC *gc, COLOR *color,
*
* All parameters are given in pixel.
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Box fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
* \param [in] box Box definition
* \param [in] fill_width BOX pattern fill width.
* \param [in] angle1 (unused)
@@ -226,8 +222,8 @@ void o_box_fill_hollow (GdkDrawable *w, GdkGC *gc, COLOR *color,
* \param [in] angle2 (unused)
* \param [in] pitch2 (unused)
*/
-void o_box_fill_fill (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, BOX *box,
+void o_box_fill_fill (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, BOX *box,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
@@ -252,10 +248,8 @@ void o_box_fill_fill (GdkDrawable *w, GdkGC *gc, COLOR *color,
* Negative or null values for <B>pitch1</B> are not allowed as it leads to
* an endless loop.
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Box fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
* \param [in] box Box definition
* \param [in] fill_width BOX pattern fill width.
* \param [in] angle1 1st angle for pattern.
@@ -263,8 +257,8 @@ void o_box_fill_fill (GdkDrawable *w, GdkGC *gc, COLOR *color,
* \param [in] angle2 (unused)
* \param [in] pitch2 (unused)
*/
-void o_box_fill_hatch (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, BOX *box,
+void o_box_fill_hatch (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, BOX *box,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
@@ -302,10 +296,8 @@ void o_box_fill_hatch (GdkDrawable *w, GdkGC *gc, COLOR *color,
* This function simply makes two successive calls to the function
* #o_box_fill_hatch() respectively with <B>angle1</B>, <B>pitch1</B> and
* <B>angle2</B>, <B>pitch2</B> for parameters.
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Box fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
* \param [in] box Box definition
* \param [in] fill_width BOX pattern fill width.
* \param [in] angle1 1st angle for pattern.
@@ -313,16 +305,14 @@ void o_box_fill_hatch (GdkDrawable *w, GdkGC *gc, COLOR *color,
* \param [in] angle2 2nd angle for pattern.
* \param [in] pitch2 2nd pitch for pattern.
*/
-void o_box_fill_mesh (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, BOX *box,
+void o_box_fill_mesh (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, BOX *box,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
{
- o_box_fill_hatch (w, gc, color, w_current, box,
- fill_width, angle1, pitch1, -1, -1);
- o_box_fill_hatch (w, gc, color, w_current, box,
- fill_width, angle2, pitch2, -1, -1);
+ o_box_fill_hatch (w_current, color, box, fill_width, angle1, pitch1, -1, -1);
+ o_box_fill_hatch (w_current, color, box, fill_width, angle2, pitch2, -1, -1);
}
diff --git a/gschem/src/o_circle.c b/gschem/src/o_circle.c
index e295ca7..347a8d3 100644
--- a/gschem/src/o_circle.c
+++ b/gschem/src/o_circle.c
@@ -28,10 +28,10 @@
#endif
-typedef void (*FILL_FUNC)( GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, CIRCLE *circle,
+typedef void (*FILL_FUNC) (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, CIRCLE *circle,
gint fill_width, gint angle1, gint pitch1,
- gint angle2, gint pitch2 );
+ gint angle2, gint pitch2);
/*! \brief Draw a circle on the screen.
@@ -134,10 +134,9 @@ void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
fill_func = o_circle_fill_fill;
}
- (*fill_func) (w_current->drawable, w_current->gc,
- o_drawing_color (w_current, o_current),
- w_current, o_current->circle,
- o_current->fill_width, angle1, pitch1, angle2, pitch2);
+ (*fill_func) (w_current, o_drawing_color (w_current, o_current),
+ o_current->circle, o_current->fill_width,
+ angle1, pitch1, angle2, pitch2);
gschem_cairo_arc (w_current, o_current->line_width,
o_current->circle->center_x,
@@ -168,10 +167,8 @@ void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
* The unit for <B>width</B>, <B>pitch1</B> and <B>pitch2</B> is pixel and unit
* for <B>angle1</B> and <B>angle2</B> is degree.
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Circle fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Circle fill color.
* \param [in] circle Circle to be drawn
* \param [in] fill_width
* \param [in] angle1 1st angle for pattern.
@@ -179,8 +176,8 @@ void o_circle_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
* \param [in] angle2 2nd angle for pattern.
* \param [in] pitch2 2nd pitch for pattern.
*/
-void o_circle_fill_hollow (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, CIRCLE *circle,
+void o_circle_fill_hollow (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, CIRCLE *circle,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
@@ -201,10 +198,8 @@ void o_circle_fill_hollow (GdkDrawable *w, GdkGC *gc, COLOR *color,
* The unit for <B>width</B>, <B>pitch1</B> and <B>pitch2</B> is pixel and unit
* for <B>angle1</B> and <B>angle2</B> is degree.
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Circle fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Circle fill color.
* \param [in] circle Circle to be drawn
* \param [in] fill_width
* \param [in] angle1 (unused)
@@ -212,8 +207,8 @@ void o_circle_fill_hollow (GdkDrawable *w, GdkGC *gc, COLOR *color,
* \param [in] angle2 (unused)
* \param [in] pitch2 (unused)
*/
-void o_circle_fill_fill (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, CIRCLE *circle,
+void o_circle_fill_fill (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, CIRCLE *circle,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
@@ -242,10 +237,8 @@ void o_circle_fill_fill (GdkDrawable *w, GdkGC *gc, COLOR *color,
* Negative or null values for <B>pitch1</B> are not allowed as it leads to
* an endless loop.
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Circle fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Circle fill color.
* \param [in] circle Circle to be drawn
* \param [in] fill_width
* \param [in] angle1 1st angle for pattern.
@@ -253,8 +246,8 @@ void o_circle_fill_fill (GdkDrawable *w, GdkGC *gc, COLOR *color,
* \param [in] angle2 (unused)
* \param [in] pitch2 (unused)
*/
-void o_circle_fill_hatch (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, CIRCLE *circle,
+void o_circle_fill_hatch (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, CIRCLE *circle,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
@@ -296,10 +289,8 @@ void o_circle_fill_hatch (GdkDrawable *w, GdkGC *gc, COLOR *color,
* #o_circle_fill_hatch() respectively with <B>angle1</B>, <B>pitch1</B> and
* <B>angle2</B>, <B>pitch2</B> for parameters.
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Circle fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Circle fill color.
* \param [in] circle Circle to be drawn
* \param [in] fill_width
* \param [in] angle1 1st angle for pattern.
@@ -307,15 +298,15 @@ void o_circle_fill_hatch (GdkDrawable *w, GdkGC *gc, COLOR *color,
* \param [in] angle2 2nd angle for pattern.
* \param [in] pitch2 2nd pitch for pattern.
*/
-void o_circle_fill_mesh (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, CIRCLE *circle,
+void o_circle_fill_mesh (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, CIRCLE *circle,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
{
- o_circle_fill_hatch (w, gc, color, w_current, circle,
+ o_circle_fill_hatch (w_current, color, circle,
fill_width, angle1, pitch1, -1, -1);
- o_circle_fill_hatch (w, gc, color, w_current, circle,
+ o_circle_fill_hatch (w_current, color, circle,
fill_width, angle2, pitch2, -1, -1);
}
diff --git a/gschem/src/o_path.c b/gschem/src/o_path.c
index 77063b2..9e2c03d 100644
--- a/gschem/src/o_path.c
+++ b/gschem/src/o_path.c
@@ -32,8 +32,8 @@
#define NUM_BEZIER_SEGMENTS 100
-typedef void (*FILL_FUNC) (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_currentm, PATH *path,
+typedef void (*FILL_FUNC) (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, PATH *path,
gint fill_width,
gint angle1, gint pitch1, gint angle2, gint pitch2);
@@ -160,10 +160,8 @@ static PATH *path_copy_modify (PATH *path, int dx, int dy,
* filling functions. It prevent from making a difference between filling
* in function #o_path_draw().
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Box fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
* \param [in] path The PATH object to draw
* \param [in] fill_width PATH pattern fill width.
* \param [in] angle1 1st angle for pattern.
@@ -171,8 +169,8 @@ static PATH *path_copy_modify (PATH *path, int dx, int dy,
* \param [in] angle2 2nd angle for pattern.
* \param [in] pitch2 2nd pitch for pattern.
*/
-static void o_path_fill_hollow (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, PATH *path,
+static void o_path_fill_hollow (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, PATH *path,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
@@ -187,10 +185,8 @@ static void o_path_fill_hollow (GdkDrawable *w, GdkGC *gc, COLOR *color,
* <B>pitch2</B> and <B>fill_width</B> are unused here but kept for compatibility
* with other path filling functions.
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Box fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
* \param [in] path The PATH object to draw
* \param [in] fill_width PATH pattern fill width.
* \param [in] angle1 (unused)
@@ -198,8 +194,8 @@ static void o_path_fill_hollow (GdkDrawable *w, GdkGC *gc, COLOR *color,
* \param [in] angle2 (unused)
* \param [in] pitch2 (unused)
*/
-static void o_path_fill_fill (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, PATH *path,
+static void o_path_fill_fill (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, PATH *path,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
@@ -216,10 +212,8 @@ static void o_path_fill_fill (GdkDrawable *w, GdkGC *gc, COLOR *color,
* Parameters <B>angle2</B> and <B>pitch2</B> are unused here but kept for
* compatbility with other path filling functions.
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Box fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
* \param [in] path The PATH object to draw
* \param [in] fill_width PATH pattern fill width.
* \param [in] angle1 1st angle for pattern.
@@ -227,8 +221,8 @@ static void o_path_fill_fill (GdkDrawable *w, GdkGC *gc, COLOR *color,
* \param [in] angle2 (unused)
* \param [in] pitch2 (unused)
*/
-static void o_path_fill_hatch (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, PATH *path,
+static void o_path_fill_hatch (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, PATH *path,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
@@ -263,10 +257,8 @@ static void o_path_fill_hatch (GdkDrawable *w, GdkGC *gc, COLOR *color,
* the horizontal. The distance between two of these lines is given
* by <B>pitch2</B>.
*
- * \param [in] w GdkDrawable to draw in.
- * \param [in] gc GdkGC graphics context to draw on.
- * \param [in] color Box fill color.
* \param [in] w_current Schematic top level
+ * \param [in] color Box fill color.
* \param [in] path The PATH object to draw
* \param [in] fill_width PATH pattern fill width.
* \param [in] angle1 1st angle for pattern.
@@ -274,15 +266,15 @@ static void o_path_fill_hatch (GdkDrawable *w, GdkGC *gc, COLOR *color,
* \param [in] angle2 2nd angle for pattern.
* \param [in] pitch2 2nd pitch for pattern.
*/
-static void o_path_fill_mesh (GdkDrawable *w, GdkGC *gc, COLOR *color,
- GSCHEM_TOPLEVEL *w_current, PATH *path,
+static void o_path_fill_mesh (GSCHEM_TOPLEVEL *w_current,
+ COLOR *color, PATH *path,
gint fill_width,
gint angle1, gint pitch1,
gint angle2, gint pitch2)
{
- o_path_fill_hatch (w, gc, color, w_current, path,
+ o_path_fill_hatch (w_current, color, path,
fill_width, angle1, pitch1, -1, -1);
- o_path_fill_hatch (w, gc, color, w_current, path,
+ o_path_fill_hatch (w_current, color, path,
fill_width, angle2, pitch2, -1, -1);
}
@@ -352,10 +344,8 @@ void o_path_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
fill_func = o_path_fill_fill;
}
- (*fill_func) (w_current->drawable, w_current->gc,
- o_drawing_color (w_current, o_current),
- w_current, path, o_current->fill_width,
- angle1, pitch1, angle2, pitch2);
+ (*fill_func) (w_current, o_drawing_color (w_current, o_current),
+ path, o_current->fill_width, angle1, pitch1, angle2, pitch2);
path_path (w_current, o_current);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs