From a8babcc60495ba159023be09075d241490742bcd Mon Sep 17 00:00:00 2001 From: Bernd Jendrissek Date: Mon, 16 Jan 2017 03:12:12 +0200 Subject: [PATCH] Stop pretending to use an explicit printing origin. The origin was inconsistently applied, and in any case was always a logical (0, 0) in practice when it got passed down to per-object printing methods, since the Postscript output translates all prior output away from the given origin. --- libgeda/include/prototype_priv.h | 73 ++++++++++++----------- libgeda/src/f_print.c | 49 +++++----------- libgeda/src/o_arc_basic.c | 42 ++++--------- libgeda/src/o_box_basic.c | 123 +++++++++++---------------------------- libgeda/src/o_bus_basic.c | 10 +--- libgeda/src/o_circle_basic.c | 90 +++++++--------------------- libgeda/src/o_line_basic.c | 36 +++--------- libgeda/src/o_net_basic.c | 10 +--- libgeda/src/o_path_basic.c | 97 +++++++++--------------------- libgeda/src/o_picture.c | 4 +- libgeda/src/o_pin_basic.c | 10 +--- libgeda/src/o_text_basic.c | 10 +--- 12 files changed, 164 insertions(+), 390 deletions(-) diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h index 6858abcdb..ef6aec5f5 100644 --- a/libgeda/include/prototype_priv.h +++ b/libgeda/include/prototype_priv.h @@ -99,12 +99,12 @@ void m_transform_translate(TRANSFORM *transform, gdouble dx, gdouble dy); /* o_arc_basic.c */ OBJECT *o_arc_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver); char *o_arc_save(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(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current); +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); +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); +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); +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); +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); gdouble o_arc_shortest_distance(ARC const *arc, gint x, gint y); gboolean o_arc_within_sweep(ARC const *arc, gint x, gint y); void world_get_arc_bounds(OBJECT *object, int *left, int *top, int *right, int *bottom); @@ -120,37 +120,37 @@ gchar *o_save_attribs(GList *attribs); /* o_box_basic.c */ OBJECT *o_box_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver); char *o_box_save(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_filled(TOPLEVEL *toplevel, OBJECT *o_current, 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, OBJECT *o_current, 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, OBJECT *o_current, 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(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current); +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); +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); +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); +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); +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); +void o_box_print_filled(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int x, int y, int width, int height, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2); +void o_box_print_mesh(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int x, int y, int width, int height, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2); +void o_box_print_hatch(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int x, int y, int width, int height, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2); gdouble o_box_shortest_distance(BOX const *box, gint x, gint y); void world_get_box_bounds(OBJECT *object, int *left, int *top, int *right, int *bottom); /* o_bus_basic.c */ OBJECT *o_bus_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver); char *o_bus_save(OBJECT *object); -void o_bus_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y); +void o_bus_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current); void world_get_bus_bounds(OBJECT *object, int *left, int *top, int *right, int *bottom); void o_bus_recalc(OBJECT *o_current); /* o_circle_basic.c */ OBJECT *o_circle_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver); char *o_circle_save(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_filled(TOPLEVEL *toplevel, OBJECT *o_current, 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, OBJECT *o_current, 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, OBJECT *o_current, 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(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); +void o_circle_print_dotted(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space); +void o_circle_print_dashed(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space); +void o_circle_print_center(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space); +void o_circle_print_phantom(TOPLEVEL *toplevel, FILE *fp, int x, int y, int radius, int color, int circle_width, int length, int space); +void o_circle_print_filled(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int x, int y, int radius, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2); +void o_circle_print_mesh(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int x, int y, int radius, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2); +void o_circle_print_hatch(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int x, int y, int radius, int color, int fill_width, int angle1, int pitch1, int angle2, int pitch2); gdouble o_circle_shortest_distance(CIRCLE const *circle, gint x, gint y); void world_get_circle_bounds(OBJECT *object, int *left, int *top, int *right, int *bottom); @@ -163,12 +163,12 @@ void world_get_complex_bounds(OBJECT *complex, int *left, int *top, int *right, /* o_line_basic.c */ OBJECT *o_line_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver); char *o_line_save(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(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); +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); +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); +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); +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); gdouble o_line_shortest_distance_raw(int x1, int y1, int x2, int y2, gint x, gint y); gdouble o_line_shortest_distance(LINE const *line, gint x, gint y); void world_get_line_bounds(OBJECT *object, int *left, int *top, int *right, int *bottom); @@ -177,14 +177,14 @@ void o_line_recalc(OBJECT *o_current); /* o_net_basic.c */ OBJECT *o_net_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver); char *o_net_save(OBJECT *object); -void o_net_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y); +void o_net_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current); void world_get_net_bounds(OBJECT *object, int *left, int *top, int *right, int *bottom); void o_net_recalc(OBJECT *o_current); /* o_path_basic.c */ OBJECT *o_path_read(TOPLEVEL *toplevel, const char *first_line, TextBuffer *tb, unsigned int release_ver, unsigned int fileformat_ver); char *o_path_save(OBJECT *object); -void o_path_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y); +void o_path_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current); gdouble o_path_shortest_distance(OBJECT const *object, gint x, gint y); void world_get_path_bounds(OBJECT *object, int *left, int *top, int *right, int *bottom); @@ -196,15 +196,14 @@ OBJECT *o_picture_read(TOPLEVEL *toplevel, unsigned int release_ver, unsigned int fileformat_ver); char *o_picture_save(OBJECT *object); -void o_picture_print(FILE *fp, OBJECT *o_current, - int origin_x, int origin_y); +void o_picture_print(FILE *fp, OBJECT *o_current); gdouble o_picture_shortest_distance(PICTURE const *picture, gint x, gint y); void world_get_picture_bounds(OBJECT *object, int *left, int *top, int *right, int *bottom); /* o_pin_basic.c */ OBJECT *o_pin_read(TOPLEVEL *toplevel, char buf[], unsigned int release_ver, unsigned int fileformat_ver); char *o_pin_save(OBJECT *object); -void o_pin_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y); +void o_pin_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current); void world_get_pin_bounds(OBJECT *object, int *left, int *top, int *right, int *bottom); void o_pin_recalc(OBJECT *o_current); @@ -216,7 +215,7 @@ OBJECT *o_text_read(TOPLEVEL *toplevel, unsigned int fileformat_ver); char *o_text_save(OBJECT *object); void o_text_print_text_string(FILE *fp, char *string, int unicode_count, gunichar *unicode_table); -void o_text_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y, int unicode_count, gunichar *unicode_table); +void o_text_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int unicode_count, gunichar *unicode_table); gdouble o_text_shortest_distance(TEXT const *text, gint x, gint y); int world_get_text_bounds(OBJECT *o_current, int *left, int *top, int *right, int *bottom); diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c index 788640afb..e8ac267bd 100644 --- a/libgeda/src/f_print.c +++ b/libgeda/src/f_print.c @@ -230,54 +230,39 @@ void f_print_objects(TOPLEVEL *toplevel, FILE *fp, OBJECT *head, int unicode_count, gunichar *unicode_table) { OBJECT *o_current=NULL; - int origin_x, origin_y; - - origin_x = start_x; - origin_y = start_y; if (head == NULL) { return; } /* Apply a translation to move the origin to where we want it */ - if (origin_x != 0 || origin_y != 0) { - fprintf(fp, "%d %d translate\n", -origin_x, -origin_y); + if (start_x != 0 || start_y != 0) { + fprintf(fp, "%d %d translate\n", -start_x, -start_y); } - - /* no longer change the coords, the postscript translate takes care - * of this */ - origin_x = 0; - origin_y = 0; - o_current = head; while ( o_current != NULL ) { if (o_current->type != OBJ_HEAD) { switch (o_current->type) { case(OBJ_LINE): - o_line_print(toplevel, fp, o_current, - origin_x, origin_y); + o_line_print(toplevel, fp, o_current); break; case(OBJ_NET): - o_net_print(toplevel, fp, o_current, - origin_x, origin_y); + o_net_print(toplevel, fp, o_current); break; case(OBJ_BUS): - o_bus_print(toplevel, fp, o_current, - origin_x, origin_y); + o_bus_print(toplevel, fp, o_current); break; case(OBJ_BOX): - o_box_print(toplevel, fp, o_current, - origin_x, origin_y); + o_box_print(toplevel, fp, o_current); break; case(OBJ_CIRCLE): - o_circle_print(toplevel, fp, o_current, - origin_x, origin_y); + o_circle_print(toplevel, fp, o_current); break; case(OBJ_COMPLEX): @@ -286,7 +271,7 @@ void f_print_objects(TOPLEVEL *toplevel, FILE *fp, OBJECT *head, f_print_objects(toplevel, fp, o_current->complex->prim_objs, - origin_x, origin_y, scale, + 0, 0, scale, unicode_count, unicode_table); fprintf(fp, "grestore\n"); break; @@ -316,15 +301,14 @@ void f_print_objects(TOPLEVEL *toplevel, FILE *fp, OBJECT *head, /* Output vectors */ f_print_objects(toplevel, fp, - o_current->text-> - prim_objs, - origin_x, origin_y, + o_current->text->prim_objs, + 0, 0, scale, unicode_count, unicode_table); } else { /* Output text */ o_text_print(toplevel, fp, o_current, - origin_x, origin_y, unicode_count, unicode_table); + unicode_count, unicode_table); } fprintf(fp, "grestore\n"); @@ -333,22 +317,19 @@ void f_print_objects(TOPLEVEL *toplevel, FILE *fp, OBJECT *head, case(OBJ_PATH): - o_path_print(toplevel, fp, o_current, - origin_x, origin_y); + o_path_print(toplevel, fp, o_current); break; case(OBJ_PIN): - o_pin_print(toplevel, fp, o_current, - origin_x, origin_y); + o_pin_print(toplevel, fp, o_current); break; case(OBJ_ARC): - o_arc_print(toplevel, fp, o_current, - origin_x, origin_y); + o_arc_print(toplevel, fp, o_current); break; case(OBJ_PICTURE): - o_picture_print(fp, o_current, origin_x, origin_y); + o_picture_print(fp, o_current); break; default: diff --git a/libgeda/src/o_arc_basic.c b/libgeda/src/o_arc_basic.c index 76031879b..15da9ef7f 100644 --- a/libgeda/src/o_arc_basic.c +++ b/libgeda/src/o_arc_basic.c @@ -715,11 +715,8 @@ void world_get_arc_bounds(OBJECT *object, int *left, * \param [in] toplevel The TOPLEVEL object. * \param [in] fp The postscript document to print to. * \param [in] o_current - * \param [in] origin_x - * \param [in] origin_y */ -void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, - int origin_x, int origin_y) +void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current) { int x, y, radius, start_angle, end_angle; int color; @@ -806,9 +803,9 @@ void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, } (*outl_func)(toplevel, fp, - x - origin_x, y - origin_x, radius, + x, y, radius, start_angle, end_angle, - color, arc_width, length, space, origin_x, origin_y); + color, arc_width, length, space); } @@ -835,15 +832,12 @@ void o_arc_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, * \param [in] arc_width * \param [in] length * \param [in] space - * \param [in] origin_x - * \param [in] 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) + int arc_width, int length, int space) { if (toplevel->print_color) { f_print_set_color(fp, color); @@ -888,15 +882,12 @@ void o_arc_print_solid(TOPLEVEL *toplevel, FILE *fp, * \param [in] arc_width * \param [in] length * \param [in] space - * \param [in] origin_x - * \param [in] 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) + int arc_width, int length, int space) { int da, d; @@ -932,7 +923,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, length, space); return; } @@ -975,15 +966,12 @@ void o_arc_print_dotted(TOPLEVEL *toplevel, FILE *fp, * \param [in] arc_width * \param [in] length * \param [in] space - * \param [in] origin_x - * \param [in] 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) + int arc_width, int length, int space) { int da, db, a1, d; @@ -1021,7 +1009,7 @@ 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, length, space); return; } @@ -1081,15 +1069,12 @@ void o_arc_print_dashed(TOPLEVEL *toplevel, FILE *fp, * \param [in] arc_width * \param [in] length * \param [in] space - * \param [in] origin_x - * \param [in] 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) + int arc_width, int length, int space) { int da, db, a1, d; @@ -1127,7 +1112,7 @@ 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, length, space); return; } @@ -1203,15 +1188,12 @@ void o_arc_print_center(TOPLEVEL *toplevel, FILE *fp, * \param [in] arc_width * \param [in] length * \param [in] space - * \param [in] origin_x - * \param [in] 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) + int arc_width, int length, int space) { int da, db, a1, d; @@ -1249,7 +1231,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, length, space); return; } diff --git a/libgeda/src/o_box_basic.c b/libgeda/src/o_box_basic.c index 6f10224b7..fe30a8365 100644 --- a/libgeda/src/o_box_basic.c +++ b/libgeda/src/o_box_basic.c @@ -650,11 +650,8 @@ static int o_box_grip_move(OBJECT *o, int whichone, int x, int y) * \param [in] toplevel The TOPLEVEL object. * \param [in] fp FILE pointer to Postscript document. * \param [in] o_current BOX OBJECT to write to document. - * \param [in] origin_x Page x coordinate to place BOX OBJECT. - * \param [in] origin_y Page y coordinate to place BOX OBJECT. */ -void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, - int origin_x, int origin_y) +void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current) { int x, y, width, height; int color; @@ -739,8 +736,7 @@ void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, x, y, width, height, color, line_width, - length, space, - origin_x, origin_y); + length, space); /*! \note * If the filling type of the box is not HOLLOW, the appropriate @@ -801,8 +797,7 @@ void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, x, y, width, height, color, fill_width, - angle1, pitch1, angle2, pitch2, - origin_x, origin_y); + angle1, pitch1, angle2, pitch2); } } @@ -830,8 +825,6 @@ void o_box_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, * \param [in] line_width BOX Line width. * \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. - * \param [in] origin_y Page y coordinate to place BOX OBJECT. * * \par Author's Note * PB : parameter filled removed @@ -841,8 +834,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 origin_x, int origin_y) + int line_width, int length, int space) { int x1, y1; @@ -856,23 +848,19 @@ o_box_print_solid(TOPLEVEL *toplevel, FILE *fp, o_line_print_solid(toplevel, fp, x1, y1, x1 + width, y1, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_solid(toplevel, fp, x1 + width, y1, x1 + width, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_solid(toplevel, fp, x1 + width, y1 + height, x1, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_solid(toplevel, fp, x1, y1 + height, x1, y1, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); } /*! \brief Print a dotted BOX to Postscript document. @@ -899,8 +887,6 @@ o_box_print_solid(TOPLEVEL *toplevel, FILE *fp, * \param [in] line_width BOX Line width. * \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. - * \param [in] origin_y Page y coordinate to place BOX OBJECT. * * \par Author's Note * PB : parameter filled removed @@ -910,8 +896,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 origin_x, int origin_y) + int line_width, int length, int space) { int x1, y1; @@ -925,23 +910,19 @@ 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, - origin_x, origin_y); + line_width, length, space); o_line_print_dotted(toplevel, fp, x1 + width, y1, x1 + width, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_dotted(toplevel, fp, x1 + width, y1 + height, x1, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_dotted(toplevel, fp, x1, y1 + height, x1, y1, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); } /*! \brief Print a dashed BOX to Postscript document. @@ -967,8 +948,6 @@ void o_box_print_dotted(TOPLEVEL *toplevel, FILE *fp, * \param [in] line_width BOX Line width. * \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. - * \param [in] origin_y Page y coordinate to place BOX OBJECT. * * \par Author's Note * PB : parameter filled removed @@ -978,8 +957,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 origin_x, int origin_y) + int line_width, int length, int space) { int x1, y1; @@ -994,23 +972,19 @@ 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, - origin_x, origin_y); + line_width, length, space); o_line_print_dashed(toplevel, fp, x1 + width, y1, x1 + width, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_dashed(toplevel, fp, x1 + width, y1 + height, x1, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_dashed(toplevel, fp, x1, y1 + height, x1, y1, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); } /*! \brief Print centered line type BOX to Postscript document. @@ -1036,8 +1010,6 @@ void o_box_print_dashed(TOPLEVEL *toplevel, FILE *fp, * \param [in] line_width BOX Line width. * \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. - * \param [in] origin_y Page y coordinate to place BOX OBJECT. * * \par Author's note * PB : parameter filled removed @@ -1047,8 +1019,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 origin_x, int origin_y) + int line_width, int length, int space) { int x1, y1; @@ -1062,23 +1033,19 @@ 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, - origin_x, origin_y); + line_width, length, space); o_line_print_center(toplevel, fp, x1 + width, y1, x1 + width, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_center(toplevel, fp, x1 + width, y1 + height, x1, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_center(toplevel, fp, x1, y1 + height, x1, y1, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); } /*! \brief Print phantom line type BOX to Postscript document. @@ -1104,8 +1071,6 @@ void o_box_print_center(TOPLEVEL *toplevel, FILE *fp, * \param [in] line_width BOX Line width. * \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. - * \param [in] origin_y Page y coordinate to place BOX OBJECT. * * \par Author's note * PB : parameter filled removed @@ -1115,8 +1080,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 origin_x, int origin_y) + int line_width, int length, int space) { int x1, y1; @@ -1130,23 +1094,19 @@ 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, - origin_x, origin_y); + line_width, length, space); o_line_print_phantom(toplevel, fp, x1 + width, y1, x1 + width, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_phantom(toplevel, fp, x1 + width, y1 + height, x1, y1 + height, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); o_line_print_phantom(toplevel, fp, x1, y1 + height, x1, y1, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); } /*! \brief Print a solid pattern BOX to Postscript document. @@ -1179,8 +1139,6 @@ void o_box_print_phantom(TOPLEVEL *toplevel, FILE *fp, * \param [in] pitch1 (unused). * \param [in] angle2 (unused). * \param [in] pitch2 (unused). - * \param [in] origin_x Page x coordinate to place BOX OBJECT. - * \param [in] origin_y Page y coordinate to place BOX OBJECT. */ void o_box_print_filled(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int x, int y, @@ -1188,8 +1146,7 @@ void o_box_print_filled(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int color, int fill_width, int angle1, int pitch1, - int angle2, int pitch2, - int origin_x, int origin_y) + int angle2, int pitch2) { int x1, y1; @@ -1199,10 +1156,7 @@ void o_box_print_filled(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, x1 = x; y1 = y-height; /* move the origin to 0, 0*/ - fprintf(fp, "%d %d %d %d fbox\n", - width, height, - x1-origin_x, y1-origin_y); - + fprintf(fp, "%d %d %d %d fbox\n", width, height, x1, y1); } /*! \brief Print a mesh pattern BOX to Postscript document. @@ -1234,8 +1188,6 @@ void o_box_print_filled(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, * \param [in] pitch1 1st pitch for mesh pattern. * \param [in] angle2 2nd angle for mesh pattern. * \param [in] pitch2 2nd pitch for mesh pattern. - * \param [in] origin_x Page x coordinate to place BOX OBJECT. - * \param [in] origin_y Page y coordinate to place BOX OBJECT. */ void o_box_print_mesh(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int x, int y, @@ -1243,22 +1195,18 @@ void o_box_print_mesh(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int color, int fill_width, int angle1, int pitch1, - int angle2, int pitch2, - int origin_x, int origin_y) + int angle2, int pitch2) { o_box_print_hatch(toplevel, o_current, fp, x, y, width, height, color, fill_width, - angle1, pitch1, -1, -1, - origin_x, origin_y); + angle1, pitch1, -1, -1); o_box_print_hatch(toplevel, o_current, fp, x, y, width, height, color, fill_width, - angle2, pitch2, -1, -1, - origin_x, origin_y); - + angle2, pitch2, -1, -1); } /*! \brief Print a hatch pattern BOX to Postscript document. @@ -1290,8 +1238,6 @@ void o_box_print_mesh(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, * \param [in] pitch1 Pitch of hatch pattern. * \param [in] angle2 (unused). * \param [in] pitch2 (unused). - * \param [in] origin_x Page x coordinate to place BOX OBJECT. - * \param [in] origin_y Page y coordinate to place BOX OBJECT. */ void o_box_print_hatch(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int x, int y, @@ -1299,8 +1245,7 @@ void o_box_print_hatch(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, int color, int fill_width, int angle1, int pitch1, - int angle2, int pitch2, - int origin_x, int origin_y) + int angle2, int pitch2) { GArray *lines; diff --git a/libgeda/src/o_bus_basic.c b/libgeda/src/o_bus_basic.c index 5358a6256..f3857d18d 100644 --- a/libgeda/src/o_bus_basic.c +++ b/libgeda/src/o_bus_basic.c @@ -281,11 +281,8 @@ OBJECT *o_bus_copy(TOPLEVEL *toplevel, OBJECT *o_current) * \param [in] toplevel The TOPLEVEL object * \param [in] fp pointer to a FILE structure * \param [in] o_current The OBJECT to print - * \param [in] origin_x x-coord of the postscript origin - * \param [in] origin_y y-coord of the postscript origin */ -void o_bus_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, - int origin_x, int origin_y) +void o_bus_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current) { int bus_width; int x1, y1; @@ -308,10 +305,7 @@ void o_bus_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, s_basic_get_grip(o_current, GRIP_1, &x1, &y1); s_basic_get_grip(o_current, GRIP_2, &x2, &y2); - fprintf(fp, "%d %d %d %d %d line\n", - x1 - origin_x, y1 - origin_y, - x2 - origin_x, y2 - origin_y, - bus_width); + fprintf(fp, "%d %d %d %d %d line\n", x1, y1, x2, y2, bus_width); } diff --git a/libgeda/src/o_circle_basic.c b/libgeda/src/o_circle_basic.c index 9b91f25d0..61989095b 100644 --- a/libgeda/src/o_circle_basic.c +++ b/libgeda/src/o_circle_basic.c @@ -621,11 +621,8 @@ void world_get_circle_bounds(OBJECT *object, int *left, * \param [in] toplevel The TOPLEVEL object. * \param [in] fp FILE pointer to Postscript document. * \param [in] o_current Circle OBJECT to write to document. - * \param [in] origin_x Page x coordinate to place circle OBJECT. - * \param [in] origin_y Page y coordinate to place circle OBJECT. */ -void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, - int origin_x, int origin_y) +void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current) { int x, y, radius; int color; @@ -706,11 +703,10 @@ void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, } (*outl_func)(toplevel, fp, - x - origin_x, y - origin_y, + x, y, radius, color, - circle_width, length, space, - origin_x, origin_y); + circle_width, length, space); /* * If the filling type of the circle is not HOLLOW, the appropriate @@ -770,8 +766,7 @@ void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, x, y, radius, color, fill_width, - angle1, pitch1, angle2, pitch2, - origin_x, origin_y); + angle1, pitch1, angle2, pitch2); } } @@ -798,23 +793,17 @@ void o_circle_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, * \param [in] circle_width Width of circle. * \param [in] length (unused). * \param [in] space (unused). - * \param [in] origin_x Page x coordinate to place circle OBJECT. - * \param [in] origin_y Page y coordinate to place circle OBJECT. */ 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) + int circle_width, int length, int space) { - o_arc_print_solid(toplevel, fp, x, y, radius, 0, FULL_CIRCLE / 64, color, - circle_width, -1, -1, - origin_x, origin_y); - + circle_width, -1, -1); } @@ -841,23 +830,17 @@ void o_circle_print_solid(TOPLEVEL *toplevel, FILE *fp, * \param [in] circle_width Width of circle. * \param [in] length (unused). * \param [in] space Space between dots. - * \param [in] origin_x Page x coordinate to place circle OBJECT. - * \param [in] origin_y Page y coordinate to place circle OBJECT. */ 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) + int circle_width, int length, int space) { - o_arc_print_dotted(toplevel, fp, x, y, radius, 0, FULL_CIRCLE / 64, color, - circle_width, -1, space, - origin_x, origin_y); - + circle_width, -1, space); } /*! \brief Print a dashed circle to Postscript document. @@ -882,24 +865,18 @@ void o_circle_print_dotted(TOPLEVEL *toplevel, FILE *fp, * \param [in] circle_width Width of circle. * \param [in] length Length of dashed lines. * \param [in] space Space between dashes. - * \param [in] origin_x Page x coordinate to place circle OBJECT. - * \param [in] origin_y Page y coordinate to place circle OBJECT. */ 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) + int circle_width, int length, int space) { - o_arc_print_dashed(toplevel, fp, x, y, radius, 0, FULL_CIRCLE / 64, color, - circle_width, length, space, - origin_x, origin_y); - + circle_width, length, space); } /*! \brief Print a centered line type circle to Postscript document. @@ -924,24 +901,18 @@ void o_circle_print_dashed(TOPLEVEL *toplevel, FILE *fp, * \param [in] circle_width Width of circle. * \param [in] length Length of dashed lines. * \param [in] space Space between dashes. - * \param [in] origin_x Page x coordinate to place circle OBJECT. - * \param [in] origin_y Page y coordinate to place circle OBJECT. */ 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) + int circle_width, int length, int space) { - o_arc_print_center(toplevel, fp, x, y, radius, 0, FULL_CIRCLE / 64, color, - circle_width, length, space, - origin_x, origin_y); - + circle_width, length, space); } /*! \brief Print a phantom line type circle to Postscript document. @@ -966,24 +937,18 @@ void o_circle_print_center(TOPLEVEL *toplevel, FILE *fp, * \param [in] circle_width Width of circle. * \param [in] length Length of dashed lines. * \param [in] space Space between dashes. - * \param [in] origin_x Page x coordinate to place circle OBJECT. - * \param [in] origin_y Page y coordinate to place circle OBJECT. */ 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) + int circle_width, int length, int space) { - o_arc_print_phantom(toplevel, fp, x, y, radius, 0, FULL_CIRCLE / 64, color, - circle_width, length, space, - origin_x, origin_y); - + circle_width, length, space); } /*! \brief Print a solid pattern circle to Postscript document. @@ -1011,25 +976,19 @@ void o_circle_print_phantom(TOPLEVEL *toplevel, FILE *fp, * \param [in] pitch1 (unused). * \param [in] angle2 (unused). * \param [in] pitch2 (unused). - * \param [in] origin_x Page x coordinate to place circle OBJECT. - * \param [in] origin_y Page y coordinate to place circle OBJECT. */ void o_circle_print_filled(TOPLEVEL *toplevel, OBJECT *o_current, 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) + int angle2, int pitch2) { if (toplevel->print_color) { f_print_set_color(fp, color); } - fprintf(fp, "%d %d %d dot\n", - x-origin_x, y-origin_y, - radius); - + fprintf(fp, "%d %d %d dot\n", x, y, radius); } /*! \brief Print a mesh pattern circle to Postscript document. @@ -1060,32 +1019,26 @@ void o_circle_print_filled(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, * \param [in] pitch1 1st pitch for mesh pattern. * \param [in] angle2 2nd angle for mesh pattern. * \param [in] pitch2 2nd pitch for mesh pattern. - * \param [in] origin_x Page x coordinate to place circle OBJECT. - * \param [in] origin_y Page y coordinate to place circle OBJECT. */ void o_circle_print_mesh(TOPLEVEL *toplevel, OBJECT *o_current, 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) + int angle2, int pitch2) { o_circle_print_hatch(toplevel, o_current, fp, x, y, radius, color, fill_width, angle1, pitch1, - -1, -1, - origin_x, origin_y); + -1, -1); o_circle_print_hatch(toplevel, o_current, fp, x, y, radius, color, fill_width, angle2, pitch2, - -1, -1, - origin_x, origin_y); - + -1, -1); } /*! \brief Print a hatch pattern circle to Postscript document. @@ -1116,16 +1069,13 @@ void o_circle_print_mesh(TOPLEVEL *toplevel, OBJECT *o_current, FILE *fp, * \param [in] pitch1 Pitch for hatch pattern. * \param [in] angle2 (unused). * \param [in] pitch2 (unused). - * \param [in] origin_x Page x coordinate to place circle OBJECT. - * \param [in] origin_y Page y coordinate to place circle OBJECT. */ void o_circle_print_hatch(TOPLEVEL *toplevel, OBJECT *o_current, 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) + int angle2, int pitch2) { GArray *lines; diff --git a/libgeda/src/o_line_basic.c b/libgeda/src/o_line_basic.c index a7bceb783..4295e7dc4 100644 --- a/libgeda/src/o_line_basic.c +++ b/libgeda/src/o_line_basic.c @@ -590,11 +590,8 @@ void world_get_line_bounds(OBJECT *object, * \param [in] toplevel The TOPLEVEL object. * \param [in] fp FILE pointer to Postscript document. * \param [in] o_current Line OBJECT to write to document. - * \param [in] origin_x Page x coordinate to place line OBJECT. - * \param [in] origin_y Page y coordinate to place line OBJECT. */ -void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, - int origin_x, int origin_y) +void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current) { int x1, y1, x2, y2; int color; @@ -673,11 +670,9 @@ void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, } (*outl_func)(toplevel, fp, - x1 - origin_x, y1 - origin_y, - x2 - origin_x, y2 - origin_y, + x1, y1, x2, y2, color, - line_width, length, space, - origin_x, origin_y); + line_width, length, space); } /*! \brief Print a solid line to Postscript document. @@ -699,14 +694,11 @@ void o_line_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, * \param [in] line_width Width of line. * \param [in] length (unused). * \param [in] space (unused). - * \param [in] origin_x Page x coordinate to place line OBJECT. - * \param [in] origin_y Page y coordinate to place line OBJECT. */ 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) + int line_width, int length, int space) { if (toplevel->print_color) { f_print_set_color(fp, color); @@ -742,14 +734,11 @@ void o_line_print_solid(TOPLEVEL *toplevel, FILE *fp, * \param [in] line_width Width of line. * \param [in] length (unused). * \param [in] space Space between dots. - * \param [in] origin_x Page x coordinate to place line OBJECT. - * \param [in] origin_y Page y coordinate to place line OBJECT. */ 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) + int line_width, int length, int space) { double dx, dy, l, d; double dx1, dy1; @@ -825,14 +814,11 @@ void o_line_print_dotted(TOPLEVEL *toplevel, FILE *fp, * \param [in] line_width Width 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. - * \param [in] origin_y Page y coordinate to place line OBJECT. */ 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) + int line_width, int length, int space) { double dx, dy, l, d; double dx1, dy1, dx2, dy2; @@ -930,14 +916,11 @@ void o_line_print_dashed(TOPLEVEL *toplevel, FILE *fp, * \param [in] line_width Width 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. - * \param [in] origin_y Page y coordinate to place line OBJECT. */ 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) + int line_width, int length, int space) { double dx, dy, l, d; double dx1, dy1, dx2, dy2; @@ -1064,14 +1047,11 @@ void o_line_print_center(TOPLEVEL *toplevel, FILE *fp, * \param [in] line_width Width 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. - * \param [in] origin_y Page y coordinate to place line OBJECT. */ 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) + int line_width, int length, int space) { double dx, dy, l, d; double dx1, dy1, dx2, dy2; diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c index 04cc30f74..596d28c09 100644 --- a/libgeda/src/o_net_basic.c +++ b/libgeda/src/o_net_basic.c @@ -263,11 +263,8 @@ OBJECT *o_net_copy(TOPLEVEL *toplevel, OBJECT *o_current) * \param [in] toplevel The TOPLEVEL object * \param [in] fp pointer to a FILE structure * \param [in] o_current The OBJECT to print - * \param [in] origin_x x-coord of the postscript origin - * \param [in] origin_y y-coord of the postscript origin */ -void o_net_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, - int origin_x, int origin_y) +void o_net_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current) { int net_width; int x1, y1; @@ -290,10 +287,7 @@ void o_net_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, s_basic_get_grip(o_current, GRIP_1, &x1, &y1); s_basic_get_grip(o_current, GRIP_2, &x2, &y2); - fprintf(fp, "%d %d %d %d %d line\n", - x1 - origin_x, y1 - origin_y, - x2 - origin_x, y2 - origin_y, - net_width); + fprintf(fp, "%d %d %d %d %d line\n", x1, y1, x2, y2, net_width); } diff --git a/libgeda/src/o_path_basic.c b/libgeda/src/o_path_basic.c index 5728e1a17..9c4084bf7 100644 --- a/libgeda/src/o_path_basic.c +++ b/libgeda/src/o_path_basic.c @@ -42,17 +42,12 @@ static int o_path_grip_move(OBJECT *o, int whichone, int x, int y); /*! Default setting for path draw function. */ void (*path_draw_func)() = NULL; - typedef void (*DRAW_FUNC) (FILE *fp, PATH *path, - int line_width, int length, int space, - int origin_x, int origin_y); - + int line_width, int length, int space); typedef void (*FILL_FUNC) (FILE *fp, PATH *path, int fill_width, - int angle1, int pitch1, int angle2, int pitch2, - int origin_x, int origin_y); - + int angle1, int pitch1, int angle2, int pitch2); /*! \brief Create and add path OBJECT to list. * \par Function Description @@ -676,12 +671,9 @@ static int o_path_grip_move(OBJECT *o, int whichone, int x, int y) * \param [in] line_width PATH Line width. * \param [in] length Dashed line length. * \param [in] space Amount of space between dashes. - * \param [in] origin_x Page x coordinate to place PATH OBJECT. - * \param [in] origin_y Page y coordinate to place PATH OBJECT. */ static void o_path_print_solid (FILE *fp, PATH *path, - int line_width, int length, int space, - int origin_x, int origin_y) + int line_width, int length, int space) { int i; @@ -696,18 +688,16 @@ static void o_path_print_solid (FILE *fp, PATH *path, fprintf (fp, "closepath "); /* Fall through */ case PATH_MOVETO_OPEN: - fprintf (fp, "%i %i moveto", - section->x3 - origin_x, section->y3 - origin_y); + fprintf(fp, "%i %i moveto", section->x3, section->y3); break; case PATH_CURVETO: fprintf (fp, "%i %i %i %i %i %i curveto", - section->x1 - origin_x, section->y1 - origin_y, - section->x2 - origin_x, section->y2 - origin_y, - section->x3 - origin_x, section->y3 - origin_y); + section->x1, section->y1, + section->x2, section->y2, + section->x3, section->y3); break; case PATH_LINETO: - fprintf (fp, "%i %i lineto", - section->x3 - origin_x, section->y3 - origin_y); + fprintf(fp, "%i %i lineto", section->x3, section->y3); break; case PATH_END: fprintf (fp, "closepath "); @@ -732,14 +722,11 @@ static void o_path_print_solid (FILE *fp, PATH *path, * \param [in] line_width PATH Line width * \param [in] length Dashed line length * \param [in] space Amount of space between dashes - * \param [in] origin_x Page x coordinate to place PATH OBJECT - * \param [in] origin_y Page y coordinate to place PATH OBJECT */ static void o_path_print_dotted (FILE *fp, PATH *path, - int line_width, int length, int space, - int origin_x, int origin_y) + int line_width, int length, int space) { - o_path_print_solid (fp, path, line_width, length, space, origin_x, origin_y); + o_path_print_solid(fp, path, line_width, length, space); } @@ -755,14 +742,11 @@ static void o_path_print_dotted (FILE *fp, PATH *path, * \param [in] line_width PATH Line width. * \param [in] length Dashed line length. * \param [in] space Amount of space between dashes. - * \param [in] origin_x Page x coordinate to place PATH OBJECT. - * \param [in] origin_y Page y coordinate to place PATH OBJECT. */ static void o_path_print_dashed (FILE *fp, PATH *path, - int line_width, int length, int space, - int origin_x, int origin_y) + int line_width, int length, int space) { - o_path_print_solid (fp, path, line_width, length, space, origin_x, origin_y); + o_path_print_solid(fp, path, line_width, length, space); } @@ -778,14 +762,12 @@ static void o_path_print_dashed (FILE *fp, PATH *path, * \param [in] line_width PATH Line width * \param [in] length Dashed line length * \param [in] space Amount of space between dashes - * \param [in] origin_x Page x coordinate to place PATH OBJECT - * \param [in] origin_y Page y coordinate to place PATH OBJECT */ static void o_path_print_center (FILE *fp, PATH *path, int line_width, int length, - int space, int origin_x, int origin_y) + int space) { - o_path_print_solid (fp, path, line_width, length, space, origin_x, origin_y); + o_path_print_solid(fp, path, line_width, length, space); } @@ -801,14 +783,12 @@ static void o_path_print_center (FILE *fp, PATH *path, * \param [in] line_width PATH Line width * \param [in] length Dashed line length * \param [in] space Amount of space between dashes - * \param [in] origin_x Page x coordinate to place PATH OBJECT - * \param [in] origin_y Page y coordinate to place PATH OBJECT */ static void o_path_print_phantom (FILE *fp, PATH *path, int line_width, int length, - int space, int origin_x, int origin_y) + int space) { - o_path_print_solid (fp, path, line_width, length, space, origin_x, origin_y); + o_path_print_solid(fp, path, line_width, length, space); } @@ -829,13 +809,10 @@ static void o_path_print_phantom (FILE *fp, PATH *path, * \param [in] pitch1 (unused) * \param [in] angle2 (unused) * \param [in] pitch2 (unused) - * \param [in] origin_x Page x coordinate to place PATH OBJECT - * \param [in] origin_y Page y coordinate to place PATH OBJECT */ static void o_path_print_filled (FILE *fp, PATH *path, int fill_width, - int angle1, int pitch1, int angle2, int pitch2, - int origin_x, int origin_y) + int angle1, int pitch1, int angle2, int pitch2) { int i; @@ -850,18 +827,16 @@ static void o_path_print_filled (FILE *fp, PATH *path, fprintf (fp, "closepath "); /* Fall through */ case PATH_MOVETO_OPEN: - fprintf (fp, "%i %i moveto", - section->x3 - origin_x, section->y3 - origin_y); + fprintf(fp, "%i %i moveto", section->x3, section->y3); break; case PATH_CURVETO: fprintf (fp, "%i %i %i %i %i %i curveto", - section->x1 - origin_x, section->y1 - origin_y, - section->x2 - origin_x, section->y2 - origin_y, - section->x3 - origin_x, section->y3 - origin_y); + section->x1, section->y1, + section->x2, section->y2, + section->x3, section->y3); break; case PATH_LINETO: - fprintf (fp, "%i %i lineto", - section->x3 - origin_x, section->y3 - origin_y); + fprintf(fp, "%i %i lineto", section->x3, section->y3); break; case PATH_END: fprintf (fp, "closepath "); @@ -893,13 +868,10 @@ static void o_path_print_filled (FILE *fp, PATH *path, * \param [in] pitch1 Pitch of hatch pattern * \param [in] angle2 (unused) * \param [in] pitch2 (unused) - * \param [in] origin_x Page x coordinate to place PATH OBJECT - * \param [in] origin_y Page y coordinate to place PATH OBJECT */ static void o_path_print_hatch (FILE *fp, PATH *path, int fill_width, - int angle1, int pitch1, int angle2, int pitch2, - int origin_x, int origin_y) + int angle1, int pitch1, int angle2, int pitch2) { GArray *lines; @@ -932,19 +904,13 @@ static void o_path_print_hatch (FILE *fp, PATH *path, * \param [in] pitch1 1st pitch for mesh pattern * \param [in] angle2 2nd angle for mesh pattern * \param [in] pitch2 2nd pitch for mesh pattern - * \param [in] origin_x Page x coordinate to place PATH OBJECT - * \param [in] origin_y Page y coordinate to place PATH OBJECT */ static void o_path_print_mesh (FILE *fp, PATH *path, int fill_width, - int angle1, int pitch1, int angle2, int pitch2, - int origin_x, int origin_y) + int angle1, int pitch1, int angle2, int pitch2) { - o_path_print_hatch (fp, path, fill_width, - angle1, pitch1, -1, -1, origin_x, origin_y); - - o_path_print_hatch (fp, path, fill_width, - angle2, pitch2, -1, -1, origin_x, origin_y); + o_path_print_hatch(fp, path, fill_width, angle1, pitch1, -1, -1); + o_path_print_hatch(fp, path, fill_width, angle2, pitch2, -1, -1); } @@ -957,11 +923,8 @@ static void o_path_print_mesh (FILE *fp, PATH *path, * \param [in] toplevel The TOPLEVEL object. * \param [in] fp FILE pointer to Postscript document. * \param [in] o_current PATH OBJECT to write to document. - * \param [in] origin_x Page x coordinate to place PATH OBJECT. - * \param [in] origin_y Page y coordinate to place PATH OBJECT. */ -void o_path_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, - int origin_x, int origin_y) +void o_path_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current) { int line_width, length, space; int fill_width, angle1, pitch1, angle2, pitch2; @@ -1034,8 +997,7 @@ void o_path_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, f_print_set_line_width (fp, line_width); - (*outl_func) (fp, o_current->path, line_width, - length, space, origin_x, origin_y); + (*outl_func)(fp, o_current->path, line_width, length, space); /*! \note * If the filling type of the path is not HOLLOW, the appropriate @@ -1093,7 +1055,7 @@ void o_path_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, } (*fill_func) (fp, o_current->path, fill_width, - angle1, pitch1, angle2, pitch2, origin_x, origin_y); + angle1, pitch1, angle2, pitch2); } } @@ -1154,4 +1116,3 @@ gdouble o_path_shortest_distance (OBJECT const *object, gint x, gint y) return shortest; } - diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c index 16fad33c1..f45e13623 100644 --- a/libgeda/src/o_picture.c +++ b/libgeda/src/o_picture.c @@ -978,10 +978,8 @@ guint8 *o_picture_mask_data(GdkPixbuf *image) * * \param [in] fp FILE pointer to Postscript document. * \param [in] o_current Picture OBJECT to write to document. - * \param [in] origin_x Page x coordinate to place picture OBJECT. - * \param [in] origin_y Page y coordinate to place picture OBJECT. */ -void o_picture_print(FILE *fp, OBJECT *o_current, int origin_x, int origin_y) +void o_picture_print(FILE *fp, OBJECT *o_current) { int x1, y1, x, y; int height, width; diff --git a/libgeda/src/o_pin_basic.c b/libgeda/src/o_pin_basic.c index 6bccbb53b..ed5989078 100644 --- a/libgeda/src/o_pin_basic.c +++ b/libgeda/src/o_pin_basic.c @@ -296,11 +296,8 @@ OBJECT *o_pin_copy(TOPLEVEL *toplevel, OBJECT *o_current) * \param [in] toplevel The TOPLEVEL object * \param [in] fp pointer to a FILE structure * \param [in] o_current The OBJECT to print - * \param [in] origin_x x-coord of the postscript origin - * \param [in] origin_y y-coord of the postscript origin */ -void o_pin_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, - int origin_x, int origin_y) +void o_pin_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current) { int pin_width; int x1, y1; @@ -322,10 +319,7 @@ void o_pin_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, pin_width = PIN_WIDTH; } - fprintf(fp, "%d %d %d %d %d line\n", - x1 - origin_x, y1 - origin_y, - x2 - origin_x, y2 - origin_y, - pin_width); + fprintf(fp, "%d %d %d %d %d line\n", x1, y1, x2, y2, pin_width); } /*! \brief rotate a pin object around a centerpoint diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c index c13059107..f7fc340a8 100644 --- a/libgeda/src/o_text_basic.c +++ b/libgeda/src/o_text_basic.c @@ -1147,21 +1147,21 @@ OBJECT *o_text_read(TOPLEVEL *toplevel, if (fileformat_ver >= 1) { sscanf(first_line, "%c %d %d %d %d %d %d %d %d %d\n", &type, &x, &y, &color, &size, - &visibility, &show_name_value, + &visibility, &show_name_value, &angle, &alignment, &num_lines); } else if (release_ver < VERSION_20000220) { /* yes, above less than (not less than and equal) is correct. The format */ /* change occurred in 20000220 */ sscanf(first_line, "%c %d %d %d %d %d %d %d\n", &type, &x, &y, &color, &size, - &visibility, &show_name_value, + &visibility, &show_name_value, &angle); alignment = LOWER_LEFT; /* older versions didn't have this */ num_lines = 1; /* only support a single line */ } else { sscanf(first_line, "%c %d %d %d %d %d %d %d %d\n", &type, &x, &y, &color, &size, - &visibility, &show_name_value, + &visibility, &show_name_value, &angle, &alignment); num_lines = 1; /* only support a single line */ } @@ -1171,7 +1171,6 @@ OBJECT *o_text_read(TOPLEVEL *toplevel, } switch(angle) { - case(0): case(90): case(180): @@ -1595,13 +1594,10 @@ void o_text_print_text_string(FILE *fp, char *string, int unicode_count, * \param [in] toplevel The TOPLEVEL object * \param [in] fp pointer to a FILE structure * \param [in] o_current The OBJECT to print - * \param [in] origin_x x-coord of the postscript origin - * \param [in] origin_y y-coord of the postscript origin * \param [in] unicode_count Number of items in the unicode table * \param [in] unicode_table Table of unicode items */ void o_text_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, - int origin_x, int origin_y, int unicode_count, gunichar *unicode_table) { int alignment; -- 2.11.4.GIT