Index: trunk/doc/TODO =================================================================== --- trunk/doc/TODO (revision 29777) +++ trunk/doc/TODO (revision 29778) @@ -13,6 +13,12 @@ + BUG: parametric footprint editor for connector() too big: limit enum text length [report: barjac] - FEATURE: configurable layer keys plus {l l} and {l k} for next and previous layer ml=3411 [report: Gabriel] - FEATURE: new breadboard + - FEATURE: PCB_OBJ_GFX + - operations + - TODO("gfx") + - act_draw() binding + - report plugin + - tool_arrow (resize & move) - FEATURE: hidlib: render pixmap - FEATURE: optional subc pixmaps from attributes - DOC: pool node on how to use pixmap for breadboading Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 29777) +++ trunk/scconfig/Rev.h (revision 29778) @@ -1 +1 @@ -static const int myrev = 29655; +static const int myrev = 29778; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 29777) +++ trunk/scconfig/Rev.tab (revision 29778) @@ -1,3 +1,4 @@ +29778 configure new object type: gfx 29655 configure librnd separation: scconfig hooks code 29647 configure generalize the toolbar code so it can be reused in camv-rnd and sch-rnd 29567 configure import_sch conf changes, new netlist import formats Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 29777) +++ trunk/src/Makefile.in (revision 29778) @@ -200,6 +200,8 @@ obj_arc.o obj_arc_list.o obj_arc_ui.o + obj_gfx.o + obj_gfx_list.o obj_line.o obj_line_drcenf.o obj_line_list.o Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 29777) +++ trunk/src/buffer.c (revision 29778) @@ -51,6 +51,7 @@ #include "obj_subc_op.h" #include "obj_poly_op.h" #include "obj_pstk_op.h" +#include "obj_gfx_op.h" #include "obj_rat_op.h" #include "obj_pstk.h" #include "layer_grp.h" @@ -74,6 +75,7 @@ NULL, NULL, pcb_arcop_add_to_buffer, + pcb_gfxop_add_to_buffer, pcb_ratop_add_to_buffer, NULL, pcb_subcop_add_to_buffer, @@ -90,6 +92,7 @@ NULL, NULL, pcb_arcop_move_buffer, + pcb_gfxop_move_buffer, pcb_ratop_move_buffer, NULL, pcb_subcop_move_buffer, Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 29777) +++ trunk/src/change.c (revision 29778) @@ -47,6 +47,7 @@ #include "obj_poly_op.h" #include "obj_text_op.h" #include "obj_subc_op.h" +#include "obj_gfx_op.h" #include "extobj.h" static const char core_chg_cookie[] = "core: change.c"; @@ -63,6 +64,7 @@ NULL, NULL, pcb_arcop_change_size, + NULL, /* gfx */ NULL, NULL, pcb_subcop_change_size, @@ -79,6 +81,7 @@ NULL, NULL, pcb_arcop_change_size, + NULL, /* gfx */ NULL, NULL, pcb_subcop_change_1st_size, @@ -95,6 +98,7 @@ NULL, NULL, NULL, + NULL, /* gfx */ NULL, NULL, pcb_subcop_change_2nd_size, @@ -111,6 +115,7 @@ NULL, NULL, NULL, + NULL, /* gfx */ NULL, NULL, NULL, @@ -127,6 +132,7 @@ NULL, NULL, NULL, + NULL, /* gfx */ NULL, NULL, NULL, /* subc */ @@ -143,6 +149,7 @@ NULL, NULL, pcb_arcop_change_clear_size, + NULL, /* gfx */ NULL, NULL, pcb_subcop_change_clear_size, @@ -159,6 +166,7 @@ NULL, NULL, NULL, + NULL, /* gfx */ NULL, NULL, pcb_subcop_change_name, @@ -175,6 +183,7 @@ NULL, NULL, NULL, + NULL, /* gfx */ NULL, NULL, pcb_subcop_change_nonetlist, @@ -191,6 +200,7 @@ NULL, NULL, pcb_arcop_change_join, + NULL, /* gfx */ NULL, NULL, NULL, /* subc */ @@ -207,6 +217,7 @@ NULL, NULL, pcb_arcop_set_join, + NULL, /* gfx */ NULL, NULL, NULL, /* subc */ @@ -223,6 +234,7 @@ NULL, NULL, pcb_arcop_clear_join, + NULL, /* gfx */ NULL, NULL, NULL, /* subc */ @@ -239,6 +251,7 @@ NULL, NULL, pcb_arcop_change_radius, + NULL, /* gfx */ NULL, NULL, NULL, /* subc */ @@ -255,6 +268,7 @@ NULL, NULL, pcb_arcop_change_angle, + NULL, /* gfx */ NULL, NULL, NULL, /* subc */ @@ -271,6 +285,7 @@ NULL, NULL, pcb_arcop_change_flag, + pcb_gfxop_change_flag, NULL, NULL, pcb_subcop_change_flag, @@ -287,6 +302,7 @@ NULL, NULL, pcb_arcop_invalidate_label, + pcb_gfxop_invalidate_label, NULL, NULL, /*pcb_subcop_invalidate_flag*/ NULL, Index: trunk/src/change.h =================================================================== --- trunk/src/change.h (revision 29777) +++ trunk/src/change.h (revision 29778) @@ -51,7 +51,7 @@ (PCB_OBJ_PSTK | PCB_OBJ_SUBC | PCB_OBJ_SUBC_PART) #define PCB_CHANGEROT_TYPES \ - (PCB_OBJ_PSTK | PCB_OBJ_TEXT) + (PCB_OBJ_PSTK | PCB_OBJ_TEXT | PCB_OBJ_GFX) /* We include polygons here only to inform the user not to do it that way. */ #define PCB_CHANGECLEARSIZE_TYPES \ Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 29777) +++ trunk/src/crosshair.c (revision 29778) @@ -340,6 +340,14 @@ break; } + case PCB_OBJ_GFX: + { + pcb_gfx_t *gfx = (pcb_gfx_t *)pcb_crosshair.AttachedObject.Ptr2; + pcb_gfx_draw_xor(gfx, dx, dy); + break; + } + + case PCB_OBJ_LINE_POINT: { pcb_line_t *line; @@ -948,6 +956,15 @@ } } + /*** gfx ***/ + ans = PCB_OBJ_VOID; + if (conf_core.editor.snap_pin) + ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_OBJ_GFX | PCB_OBJ_SUBC_PART, &ptr1, &ptr2, &ptr3); + + if (ans == PCB_OBJ_GFX) { + TODO("gfx"); + } + /* Snap to offgrid points on lines. */ if (conf_core.editor.snap_offgrid_line) check_snap_offgrid_line(PCB, &snap_data, nearest_grid_x, nearest_grid_y); Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 29777) +++ trunk/src/data.c (revision 29778) @@ -57,7 +57,7 @@ int pcb_added_lines; -static void pcb_loop_layer(pcb_board_t *pcb, pcb_layer_t *layer, void *ctx, pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb) +static void pcb_loop_layer(pcb_board_t *pcb, pcb_layer_t *layer, void *ctx, pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb, pcb_gfx_cb_t gcb) { if (lacb != NULL) if (lacb(ctx, pcb, layer, 1)) @@ -94,19 +94,28 @@ } PCB_END_LOOP; } + + if (gcb != NULL) { + PCB_GFX_LOOP(layer); + { + gcb(ctx, pcb, layer, gfx); + } + PCB_END_LOOP; + } + if (lacb != NULL) lacb(ctx, pcb, layer, 0); } /* callback based loops */ -void pcb_loop_layers(pcb_board_t *pcb, void *ctx, pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb) +void pcb_loop_layers(pcb_board_t *pcb, void *ctx, pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb, pcb_gfx_cb_t gcb) { - if ((lacb != NULL) || (lcb != NULL) || (acb != NULL) || (tcb != NULL) || (pocb != NULL)) { + if ((lacb != NULL) || (lcb != NULL) || (acb != NULL) || (tcb != NULL) || (pocb != NULL) || (gcb != NULL)) { if (pcb->is_footprint) { int n; pcb_data_t *data = PCB_REAL_DATA(pcb); for(n = 0; n < data->LayerN; n++) - pcb_loop_layer(pcb, &data->Layer[n], ctx, lacb, lcb, acb, tcb, pocb); + pcb_loop_layer(pcb, &data->Layer[n], ctx, lacb, lcb, acb, tcb, pocb, gcb); } else { pcb_layer_it_t it; @@ -113,7 +122,7 @@ pcb_layer_id_t lid; for(lid = pcb_layer_first_all(&pcb->LayerGroups, &it); lid != -1; lid = pcb_layer_next(&it)) { pcb_layer_t *layer = pcb->Data->Layer + lid; - pcb_loop_layer(pcb, layer, ctx, lacb, lcb, acb, tcb, pocb); + pcb_loop_layer(pcb, layer, ctx, lacb, lcb, acb, tcb, pocb, gcb); } } } @@ -142,12 +151,12 @@ } void pcb_loop_all(pcb_board_t *pcb, void *ctx, - pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb, + pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb, pcb_gfx_cb_t gcb, pcb_subc_cb_t scb, pcb_pstk_cb_t pscb ) { - pcb_loop_layers(pcb, ctx, lacb, lcb, acb, tcb, pocb); + pcb_loop_layers(pcb, ctx, lacb, lcb, acb, tcb, pocb, gcb); pcb_loop_subc(pcb, ctx, scb); pcb_loop_pstk(pcb, ctx, pscb); } @@ -593,6 +602,12 @@ pcb_object_operation(&MoveFunctions, &ctx, PCB_OBJ_POLY, layer, polygon, polygon); } PCB_ENDALL_LOOP; + PCB_GFX_ALL_LOOP(data); + { + if (undoable) pcb_undo_add_obj_to_move(PCB_OBJ_GFX, layer, gfx, gfx, dx, dy); + pcb_object_operation(&MoveFunctions, &ctx, PCB_OBJ_GFX, layer, gfx, gfx); + } + PCB_ENDALL_LOOP; } void pcb_data_list_by_flag(pcb_data_t *data, vtp0_t *dst, pcb_objtype_t type, unsigned long mask) @@ -615,6 +630,9 @@ if (type & PCB_OBJ_POLY) PCB_POLY_ALL_LOOP(data); { if ((mask == 0) || (PCB_FLAG_TEST(mask, polygon))) vtp0_append(dst, polygon); } PCB_ENDALL_LOOP; + if (type & PCB_OBJ_GFX) PCB_GFX_ALL_LOOP(data); { + if ((mask == 0) || (PCB_FLAG_TEST(mask, gfx))) vtp0_append(dst, gfx); + } PCB_ENDALL_LOOP; } void pcb_data_list_terms(pcb_data_t *data, vtp0_t *dst, pcb_objtype_t type) @@ -680,6 +698,7 @@ if (types & PCB_OBJ_TEXT) rsearch(ly->text_tree); if (types & PCB_OBJ_POLY) rsearch(ly->polygon_tree); if (types & PCB_OBJ_ARC) rsearch(ly->arc_tree); + if (types & PCB_OBJ_GFX) rsearch(ly->gfx_tree); } return res; @@ -856,7 +875,7 @@ pcb_r_end(&it); } - if ((tmask & (PCB_OBJ_LINE | PCB_OBJ_ARC | PCB_OBJ_POLY | PCB_OBJ_TEXT)) == 0) + if ((tmask & (PCB_OBJ_LINE | PCB_OBJ_ARC | PCB_OBJ_POLY | PCB_OBJ_TEXT | PCB_OBJ_GFX)) == 0) return cnt; /* do not run the layer loop if no layer object is requested */ for(li = 0, l = data->Layer; li < data->LayerN; li++,l++) { @@ -883,6 +902,12 @@ CHK_CLEAR(n); pcb_r_end(&it); } + + if (tmask & PCB_OBJ_GFX) { + for(n = pcb_r_first(l->gfx_tree, &it); n != NULL; n = pcb_r_next(&it)) + CHK_CLEAR(n); + pcb_r_end(&it); + } } return cnt; } @@ -931,6 +956,10 @@ for(n = pcb_r_first(l->text_tree, &it); n != NULL; n = pcb_r_next(&it)) PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); pcb_r_end(&it); + + for(n = pcb_r_first(l->gfx_tree, &it); n != NULL; n = pcb_r_next(&it)) + PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); + pcb_r_end(&it); } } Index: trunk/src/data.h =================================================================== --- trunk/src/data.h (revision 29777) +++ trunk/src/data.h (revision 29778) @@ -96,6 +96,7 @@ typedef void (*pcb_arc_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_arc_t *arc); typedef void (*pcb_text_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_text_t *text); typedef void (*pcb_poly_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_poly_t *poly); +typedef void (*pcb_gfx_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_gfx_t *gfx); /* subc callbacks */ typedef int (*pcb_subc_cb_t)(void *ctx, pcb_board_t *pcb, pcb_subc_t *subc, int enter); @@ -104,7 +105,7 @@ typedef void (*pcb_pstk_cb_t)(void *ctx, pcb_board_t *pcb, pcb_pstk_t *ps); /* Loop over all layer objects on each layer. Layer is the outer loop. */ -void pcb_loop_layers(pcb_board_t *pcb, void *ctx, pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb); +void pcb_loop_layers(pcb_board_t *pcb, void *ctx, pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb, pcb_gfx_cb_t gcb); /* Loop over all subcircuits. */ void pcb_loop_subc(pcb_board_t *pcb, void *ctx, pcb_subc_cb_t scb); @@ -111,7 +112,7 @@ /* Loop over all design objects. (So all the above three in one call.) */ void pcb_loop_all(pcb_board_t *pcb, void *ctx, - pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb, + pcb_layer_cb_t lacb, pcb_line_cb_t lcb, pcb_arc_cb_t acb, pcb_text_cb_t tcb, pcb_poly_cb_t pocb, pcb_gfx_cb_t gcb, pcb_subc_cb_t scb, pcb_pstk_cb_t pscb ); Index: trunk/src/data_it.h =================================================================== --- trunk/src/data_it.h (revision 29777) +++ trunk/src/data_it.h (revision 29778) @@ -45,8 +45,8 @@ } pcb_data_it_t; #define PCB_DATA_IT_TYPES \ - (PCB_OBJ_LINE | PCB_OBJ_TEXT | PCB_OBJ_POLY | PCB_OBJ_ARC | PCB_OBJ_PSTK | \ - PCB_OBJ_SUBC | PCB_OBJ_RAT) + (PCB_OBJ_LINE | PCB_OBJ_TEXT | PCB_OBJ_POLY | PCB_OBJ_ARC | PCB_OBJ_GFX | \ + PCB_OBJ_PSTK | PCB_OBJ_SUBC | PCB_OBJ_RAT) /* Start an iteration on data, looking for any object type listed in mask; returns NULL if nothing is found. The iteration is non-recursive to subcircuits */ @@ -110,6 +110,7 @@ case PCB_OBJ_PSTK: PCB_DATA_IT_GOBJ(it, pcb_pstk_t, padstacklist, padstack); break; case PCB_OBJ_SUBC: PCB_DATA_IT_GOBJ(it, pcb_subc_t, pcb_subclist, subc); break; case PCB_OBJ_RAT: PCB_DATA_IT_GOBJ(it, pcb_rat_t, ratlist, Rat); break; + case PCB_OBJ_GFX: PCB_DATA_IT_LOBJ(it, pcb_gfx_t, gfxlist, Gfx); break; default: assert(!"iterating on invalid type"); return NULL; Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 29777) +++ trunk/src/draw.c (revision 29778) @@ -4,7 +4,7 @@ * pcb-rnd, interactive printed circuit board design * (this file is based on PCB, interactive printed circuit board design) * Copyright (C) 1994,1995,1996, 2003, 2004 Thomas Nau - * Copyright (C) 2017,2018 Tibor 'Igor2' Palinkas + * Copyright (C) 2017,2018,2020 Tibor 'Igor2' Palinkas * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,6 +50,7 @@ #include "obj_poly_draw.h" #include "obj_text_draw.h" #include "obj_subc_parent.h" +#include "obj_gfx_draw.h" #undef NDEBUG #include @@ -760,6 +761,7 @@ pcb_r_search(Layer->line_tree, info->drawn_area, NULL, pcb_line_draw_term_callback, info, NULL); pcb_r_search(Layer->arc_tree, info->drawn_area, NULL, pcb_arc_draw_term_callback, info, NULL); pcb_r_search(Layer->text_tree, info->drawn_area, NULL, pcb_text_draw_term_callback, info, NULL); + pcb_r_search(Layer->gfx_tree, info->drawn_area, NULL, pcb_gfx_draw_callback, info, NULL); delayed_terms_enabled = pcb_false; may_have_delayed = 1; } @@ -767,6 +769,7 @@ pcb_r_search(Layer->line_tree, info->drawn_area, NULL, pcb_line_draw_callback, info, NULL); pcb_r_search(Layer->arc_tree, info->drawn_area, NULL, pcb_arc_draw_callback, info, NULL); pcb_r_search(Layer->text_tree, info->drawn_area, NULL, pcb_text_draw_callback, info, NULL); + pcb_r_search(Layer->gfx_tree, info->drawn_area, NULL, pcb_gfx_draw_callback, info, NULL); } if (may_have_delayed) @@ -882,6 +885,10 @@ for(o = pcb_rtree_first(&it, Layer->text_tree, (pcb_rtree_box_t *)screen); o != NULL; o = pcb_rtree_next(&it)) if (pcb_obj_is_under(o, data)) pcb_text_draw_term_callback((pcb_box_t *)o, &info); + if (Layer->gfx_tree != NULL) + for(o = pcb_rtree_first(&it, Layer->gfx_tree, (pcb_rtree_box_t *)screen); o != NULL; o = pcb_rtree_next(&it)) + if (pcb_obj_is_under(o, data)) + pcb_gfx_draw((pcb_box_t *)o, &info); } else { if (Layer->line_tree != NULL) @@ -896,6 +903,10 @@ for(o = pcb_rtree_first(&it, Layer->text_tree, (pcb_rtree_box_t *)screen); o != NULL; o = pcb_rtree_next(&it)) if (pcb_obj_is_under(o, data)) pcb_text_draw_callback((pcb_box_t *)o, &info); + if (Layer->gfx_tree != NULL) + for(o = pcb_rtree_first(&it, Layer->gfx_tree, (pcb_rtree_box_t *)screen); o != NULL; o = pcb_rtree_next(&it)) + if (pcb_obj_is_under(o, data)) + pcb_gfx_draw_callback((pcb_box_t *)o, &info); } out:; @@ -975,6 +986,9 @@ case PCB_OBJ_ARC: pcb_arc_invalidate_erase((pcb_arc_t *) ptr); break; + case PCB_OBJ_GFX: + pcb_gfx_invalidate_erase((pcb_gfx_t *)ptr); + break; default: pcb_message(PCB_MSG_ERROR, "hace: Internal ERROR, trying to erase an unknown type\n"); } @@ -999,6 +1013,10 @@ if (obj->parent.layer->meta.real.vis) pcb_arc_invalidate_draw(obj->parent.layer, (pcb_arc_t *)obj); break; + case PCB_OBJ_GFX: + if (obj->parent.layer->meta.real.vis) + pcb_gfx_invalidate_draw(obj->parent.layer, (pcb_gfx_t *)obj); + break; case PCB_OBJ_TEXT: if (obj->parent.layer->meta.real.vis) pcb_text_invalidate_draw(obj->parent.layer, (pcb_text_t *)obj); @@ -1036,6 +1054,7 @@ switch(obj->type) { case PCB_OBJ_LINE: pcb_line_draw_label(info, (pcb_line_t *)obj); return; case PCB_OBJ_ARC: pcb_arc_draw_label(info, (pcb_arc_t *)obj); return; + case PCB_OBJ_GFX: pcb_gfx_draw_label(info, (pcb_gfx_t *)obj); return; case PCB_OBJ_POLY: pcb_poly_draw_label(info, (pcb_poly_t *)obj); return; case PCB_OBJ_TEXT: pcb_text_draw_label(info, (pcb_text_t *)obj); return; case PCB_OBJ_PSTK: pcb_pstk_draw_label(info, (pcb_pstk_t *)obj); return; Index: trunk/src/find.h =================================================================== --- trunk/src/find.h (revision 29777) +++ trunk/src/find.h (revision 29778) @@ -105,6 +105,6 @@ #define PCB_LOOKUP_FIRST \ (PCB_OBJ_PSTK | PCB_OBJ_SUBC_PART) #define PCB_LOOKUP_MORE \ - (PCB_OBJ_LINE | PCB_OBJ_RAT | PCB_OBJ_POLY | PCB_OBJ_ARC | PCB_OBJ_SUBC_PART) + (PCB_OBJ_LINE | PCB_OBJ_RAT | PCB_OBJ_POLY | PCB_OBJ_ARC | PCB_OBJ_GFX | PCB_OBJ_SUBC_PART) #endif Index: trunk/src/find_any_isect.c =================================================================== --- trunk/src/find_any_isect.c (revision 29777) +++ trunk/src/find_any_isect.c (revision 29778) @@ -43,6 +43,9 @@ if ((b->type == PCB_OBJ_POLY) && (((pcb_poly_t *)b)->Clipped == NULL)) pcb_poly_init_clip(b->parent.layer->parent.data, b->parent.layer, (pcb_poly_t *)b); + /* NOTE: for the time being GFX is not intersecting with anything because + graphics can't contribute to galvanic connections */ + switch(a->type) { case PCB_OBJ_VOID: return pcb_false; case PCB_OBJ_LINE: @@ -52,6 +55,7 @@ case PCB_OBJ_TEXT: return pcb_isc_text_line((pcb_text_t *)b, (pcb_line_t *)a); case PCB_OBJ_POLY: return pcb_isc_line_poly((pcb_line_t *)a, (pcb_poly_t *)b); case PCB_OBJ_ARC: return pcb_isc_line_arc((pcb_line_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_line_gfx((pcb_line_t *)a, (pcb_gfx_t *)b);*/ case PCB_OBJ_PSTK: return pcb_isc_pstk_line((pcb_pstk_t *)b, (pcb_line_t *)a); case PCB_OBJ_RAT: return pcb_isc_rat_line((pcb_rat_t *)b, (pcb_line_t *)a); default:; @@ -64,6 +68,7 @@ case PCB_OBJ_TEXT: return pcb_isc_text_text((pcb_text_t *)a, (pcb_text_t *)b); case PCB_OBJ_POLY: return pcb_isc_text_poly((pcb_text_t *)a, (pcb_poly_t *)b); case PCB_OBJ_ARC: return pcb_isc_text_arc((pcb_text_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_text_gfx((pcb_text_t *)a, (pcb_gfx_t *)b);*/ case PCB_OBJ_PSTK: return pcb_isc_text_pstk((pcb_text_t *)a, (pcb_pstk_t *)b); case PCB_OBJ_RAT: return pcb_false; /* text is invisible to find for now */ default:; @@ -77,6 +82,7 @@ case PCB_OBJ_TEXT: return pcb_isc_text_poly((pcb_text_t *)b, (pcb_poly_t *)a); case PCB_OBJ_POLY: return pcb_isc_poly_poly((pcb_poly_t *)a, (pcb_poly_t *)b); case PCB_OBJ_ARC: return pcb_isc_arc_poly((pcb_arc_t *)b, (pcb_poly_t *)a); +/* case PCB_OBJ_GFX: return pcb_isc_gfx_poly((pcb_gfx_t *)b, (pcb_poly_t *)a);*/ case PCB_OBJ_PSTK: return pcb_isc_pstk_poly((pcb_pstk_t *)b, (pcb_poly_t *)a); case PCB_OBJ_RAT: return pcb_isc_rat_poly((pcb_rat_t *)b, (pcb_poly_t *)a); default:; @@ -89,11 +95,25 @@ case PCB_OBJ_TEXT: return pcb_isc_text_arc((pcb_text_t *)b, (pcb_arc_t *)a); case PCB_OBJ_POLY: return pcb_isc_arc_poly((pcb_arc_t *)a, (pcb_poly_t *)b); case PCB_OBJ_ARC: return pcb_isc_arc_arc((pcb_arc_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_gfx_arc((pcb_gfx_t *)a, (pcb_arc_t *)b);*/ case PCB_OBJ_PSTK: return pcb_isc_pstk_arc((pcb_pstk_t *)b, (pcb_arc_t *)a); case PCB_OBJ_RAT: return pcb_isc_rat_arc((pcb_rat_t *)b, (pcb_arc_t *)a); default:; } break; +/* case PCB_OBJ_GFX: + switch(b->type) { + case PCB_OBJ_VOID: return pcb_false; + case PCB_OBJ_LINE: return pcb_isc_line_gfx((pcb_line_t *)b, (pcb_gfx_t *)a); + case PCB_OBJ_TEXT: return pcb_isc_text_gfx((pcb_text_t *)b, (pcb_gfx_t *)a); + case PCB_OBJ_POLY: return pcb_isc_gfx_poly((pcb_gfx_t *)a, (pcb_poly_t *)b); + case PCB_OBJ_ARC: return pcb_isc_arc_arc((pcb_arc_t *)a, (pcb_arc_t *)b); + case PCB_OBJ_GFX: return pcb_isc_gfx_gfx((pcb_gfx_t *)a, (pcb_gfx_t *)b); + case PCB_OBJ_PSTK: return pcb_isc_pstk_arc((pcb_pstk_t *)b, (pcb_arc_t *)a); + case PCB_OBJ_RAT: return pcb_isc_rat_arc((pcb_rat_t *)b, (pcb_arc_t *)a); + default:; + } + break;*/ case PCB_OBJ_PSTK: switch(b->type) { case PCB_OBJ_VOID: return pcb_false; @@ -101,6 +121,7 @@ case PCB_OBJ_TEXT: return pcb_isc_text_pstk((pcb_text_t *)b, (pcb_pstk_t *)a); case PCB_OBJ_POLY: return pcb_isc_pstk_poly((pcb_pstk_t *)a, (pcb_poly_t *)b); case PCB_OBJ_ARC: return pcb_isc_pstk_arc((pcb_pstk_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_pstk_gfx((pcb_pstk_t *)a, (pcb_gfx_t *)b);*/ case PCB_OBJ_PSTK: return pcb_isc_pstk_pstk((pcb_pstk_t *)a, (pcb_pstk_t *)b); case PCB_OBJ_RAT: return pcb_isc_pstk_rat((pcb_pstk_t *)a, (pcb_rat_t *)b); default:; @@ -113,6 +134,7 @@ case PCB_OBJ_TEXT: return pcb_false; /* text is invisible to find for now */ case PCB_OBJ_POLY: return pcb_isc_rat_poly((pcb_rat_t *)a, (pcb_poly_t *)b); case PCB_OBJ_ARC: return pcb_isc_rat_arc((pcb_rat_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_rat_gfx((pcb_rat_t *)a, (pcb_gfx_t *)b);*/ case PCB_OBJ_PSTK: return pcb_isc_pstk_rat((pcb_pstk_t *)b, (pcb_rat_t *)a); case PCB_OBJ_RAT: return pcb_isc_rat_rat((pcb_rat_t *)a, (pcb_rat_t *)b); default:; Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 29777) +++ trunk/src/global_typedefs.h (revision 29778) @@ -44,6 +44,7 @@ typedef struct pcb_fontkit_s pcb_fontkit_t; typedef struct pcb_line_s pcb_line_t; typedef struct pcb_arc_s pcb_arc_t; +typedef struct pcb_gfx_s pcb_gfx_t; typedef struct pcb_rat_line_s pcb_rat_t; typedef struct pcb_poly_s pcb_poly_t; Index: trunk/src/insert.c =================================================================== --- trunk/src/insert.c (revision 29777) +++ trunk/src/insert.c (revision 29778) @@ -51,6 +51,7 @@ NULL, NULL, pcb_arc_insert_point, + NULL, /* gfx */ pcb_ratop_insert_point, NULL, NULL, /* subc */ Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 29777) +++ trunk/src/layer.c (revision 29778) @@ -153,6 +153,8 @@ pcb_r_destroy_tree(&layer->text_tree); if (layer->polygon_tree) pcb_r_destroy_tree(&layer->polygon_tree); + if (layer->gfx_tree) + pcb_r_destroy_tree(&layer->gfx_tree); } free((char *)layer->name); memset(layer, 0, sizeof(pcb_layer_t)); @@ -171,6 +173,7 @@ return PCB_RTREE_EMPTY(layer->line_tree) && PCB_RTREE_EMPTY(layer->arc_tree) && + PCB_RTREE_EMPTY(layer->gfx_tree) && PCB_RTREE_EMPTY(layer->polygon_tree) && PCB_RTREE_EMPTY(layer->text_tree); } @@ -1102,11 +1105,13 @@ if (src->arc_tree == NULL) src->arc_tree = pcb_r_create_tree(); if (src->text_tree == NULL) src->text_tree = pcb_r_create_tree(); if (src->polygon_tree == NULL) src->polygon_tree = pcb_r_create_tree(); + if (src->gfx_tree == NULL) src->gfx_tree = pcb_r_create_tree(); dst->line_tree = src->line_tree; dst->arc_tree = src->arc_tree; dst->text_tree = src->text_tree; dst->polygon_tree = src->polygon_tree; + dst->gfx_tree = src->gfx_tree; } Index: trunk/src/layer.h =================================================================== --- trunk/src/layer.h (revision 29777) +++ trunk/src/layer.h (revision 29778) @@ -116,6 +116,7 @@ #include "obj_line_list.h" #include "obj_poly_list.h" #include "obj_text_list.h" +#include "obj_gfx_list.h" struct pcb_layer_s { /* holds information about one layer */ PCB_ANY_OBJ_FIELDS; @@ -124,6 +125,7 @@ textlist_t Text; polylist_t Polygon; arclist_t Arc; + gfxlist_t Gfx; const char *name; /* layer name */ @@ -130,7 +132,7 @@ pcb_layer_combining_t comb; /* how to combine this layer with other layers in the group */ /* for bound layers these point to the board layer's*/ - pcb_rtree_t *line_tree, *text_tree, *polygon_tree, *arc_tree; + pcb_rtree_t *line_tree, *text_tree, *polygon_tree, *arc_tree, *gfx_tree; union { struct { /* A real board layer */ Index: trunk/src/move.c =================================================================== --- trunk/src/move.c (revision 29777) +++ trunk/src/move.c (revision 29778) @@ -48,6 +48,7 @@ #include "obj_poly_op.h" #include "obj_pstk_op.h" #include "obj_rat_op.h" +#include "obj_gfx_op.h" pcb_opfunc_t MoveFunctions = { NULL, /* common_pre */ @@ -58,6 +59,7 @@ pcb_lineop_move_point, pcb_polyop_move_point, pcb_arcop_move, + pcb_gfxop_move, NULL, NULL, pcb_subcop_move, @@ -74,6 +76,7 @@ NULL, NULL, pcb_arcop_move_noclip, + pcb_gfxop_move_noclip, NULL, NULL, NULL, /* subc */ @@ -90,6 +93,7 @@ NULL, NULL, pcb_arcop_clip, + NULL, /* gfx */ NULL, NULL, NULL, /* subc */ @@ -106,6 +110,7 @@ NULL, NULL, pcb_arcop_move_to_layer, + pcb_gfxop_move_to_layer, pcb_ratop_move_to_layer, NULL, NULL, /* subc */ @@ -122,6 +127,7 @@ NULL, NULL, pcb_arcop_copy, + pcb_gfxop_copy, NULL, NULL, pcb_subcop_copy, Index: trunk/src/move.h =================================================================== --- trunk/src/move.h (revision 29777) +++ trunk/src/move.h (revision 29778) @@ -33,10 +33,10 @@ /*** move ***/ #define PCB_MOVE_TYPES \ - (PCB_OBJ_PSTK | PCB_OBJ_LINE | PCB_OBJ_TEXT | PCB_OBJ_SUBC | \ + (PCB_OBJ_PSTK | PCB_OBJ_LINE | PCB_OBJ_TEXT | PCB_OBJ_GFX | PCB_OBJ_SUBC | \ PCB_OBJ_POLY | PCB_OBJ_POLY_POINT | PCB_OBJ_LINE_POINT | PCB_OBJ_ARC | PCB_OBJ_ARC_POINT) #define PCB_MOVETOLAYER_TYPES \ - (PCB_OBJ_LINE | PCB_OBJ_TEXT | PCB_OBJ_POLY | PCB_OBJ_RAT | PCB_OBJ_ARC) + (PCB_OBJ_LINE | PCB_OBJ_TEXT | PCB_OBJ_POLY | PCB_OBJ_RAT | PCB_OBJ_ARC | PCB_OBJ_GFX) /* undoably moves an object by relative DX and DY. Doesn't bump @@ -54,7 +54,7 @@ /*** copy ***/ #define PCB_COPY_TYPES \ (PCB_OBJ_PSTK | PCB_OBJ_LINE | PCB_OBJ_TEXT | \ - PCB_OBJ_SUBC | PCB_OBJ_POLY | PCB_OBJ_ARC) + PCB_OBJ_SUBC | PCB_OBJ_POLY | PCB_OBJ_ARC | PCB_OBJ_GFX) /* Undoably copies (duplicates) an object; the new objects is moved by DX,DY (operation wrapper) */ Index: trunk/src/netlist.c =================================================================== --- trunk/src/netlist.c (revision 29777) +++ trunk/src/netlist.c (revision 29778) @@ -947,6 +947,7 @@ case PCB_OBJ_LINE: case PCB_OBJ_POLY: case PCB_OBJ_TEXT: + case PCB_OBJ_GFX: return pcb_layer_get_group_(obj->parent.layer); case PCB_OBJ_PSTK: if (pcb_pstk_shape((pcb_pstk_t *)obj, PCB_LYT_COPPER | PCB_LYT_TOP, 0) != NULL) Index: trunk/src/obj_common.c =================================================================== --- trunk/src/obj_common.c (revision 29777) +++ trunk/src/obj_common.c (revision 29778) @@ -50,6 +50,7 @@ case PCB_OBJ_POLY: return "polygon"; case PCB_OBJ_ARC: return "arc"; case PCB_OBJ_RAT: return "ratline"; + case PCB_OBJ_GFX: return "gfx"; case PCB_OBJ_PSTK: return "padstack"; case PCB_OBJ_SUBC: return "subcircuit"; case PCB_OBJ_NET: return "net"; @@ -79,6 +80,7 @@ case PCB_OBJ_TEXT: case PCB_OBJ_POLY: case PCB_OBJ_PSTK: + case PCB_OBJ_GFX: *res = ((pcb_any_obj_t *)Ptr2)->bbox_naked; return 0; case PCB_OBJ_SUBC: @@ -388,6 +390,7 @@ case PCB_OBJ_TEXT: pcb_text_pre((pcb_text_t *)o); break; case PCB_OBJ_POLY: pcb_poly_pre((pcb_poly_t *)o); break; case PCB_OBJ_ARC: pcb_arc_pre((pcb_arc_t *)o); break; + case PCB_OBJ_GFX: pcb_gfx_pre((pcb_gfx_t *)o); break; case PCB_OBJ_PSTK: pcb_pstk_pre((pcb_pstk_t *)o); break; default: break; } @@ -400,6 +403,7 @@ case PCB_OBJ_TEXT: pcb_text_post((pcb_text_t *)o); break; case PCB_OBJ_POLY: pcb_poly_post((pcb_poly_t *)o); break; case PCB_OBJ_ARC: pcb_arc_post((pcb_arc_t *)o); break; + case PCB_OBJ_GFX: pcb_arc_post((pcb_gfx_t *)o); break; case PCB_OBJ_PSTK: pcb_pstk_post((pcb_pstk_t *)o); break; default: break; } Index: trunk/src/obj_common.h =================================================================== --- trunk/src/obj_common.h (revision 29777) +++ trunk/src/obj_common.h (revision 29778) @@ -47,8 +47,8 @@ PCB_OBJ_SUBC = 0x0000010, PCB_OBJ_PSTK = 0x0000020, PCB_OBJ_RAT = 0x0000040, + PCB_OBJ_GFX = 0x0000080, - /* more abstract objects */ PCB_OBJ_NET = 0x0001000, PCB_OBJ_NET_TERM = 0x0002000, Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 29777) +++ trunk/src/obj_subc.c (revision 29778) @@ -1058,6 +1058,7 @@ pcb_text_t *text; pcb_poly_t *poly; pcb_arc_t *arc; + pcb_gfx_t *gfx; gdl_iterator_t it; @@ -1093,6 +1094,14 @@ } } + gfxlist_foreach(&sl->Gfx, &it, gfx) { + pcb_object_operation(opfunc, ctx, PCB_OBJ_GFX, sl, gfx, gfx); + if (!PCB_FLAG_TEST(PCB_FLAG_FLOATER, gfx)) { + pcb_box_bump_box_noflt(&sc->BoundingBox, &gfx->BoundingBox); + pcb_box_bump_box_noflt(&sc->bbox_naked, &gfx->bbox_naked); + } + } + } @@ -1254,6 +1263,7 @@ pcb_text_t *text; pcb_poly_t *poly; pcb_arc_t *arc; + pcb_gfx_t *gfx; gdl_iterator_t it; int chg = 0; pcb_data_t *dst_data = dl == NULL ? NULL : dl->parent.data; @@ -1334,6 +1344,22 @@ pcb_poly_ppclear_at(poly, dl); } + gfxlist_foreach(&sl->Gfx, &it, gfx) { + if (src_has_real_layer) { + pcb_r_delete_entry(sl->gfx_tree, (pcb_box_t *)gfx); + chg++; + } + PCB_FLAG_CLEAR(PCB_FLAG_WARN | PCB_FLAG_FOUND | PCB_FLAG_SELECTED, gfx); + if ((move_obj) && (dl != NULL)) { + pcb_gfx_unreg(gfx); + pcb_gfx_reg(dl, gfx); + } + if ((dl != NULL) && (dl->gfx_tree != NULL)) { + pcb_r_insert_entry(dl->gfx_tree, (pcb_box_t *)gfx); + chg++; + } + } + if (!dst_is_pcb) { /* keep only the layer binding match, unbound other aspects */ sl->meta.bound.real = NULL; @@ -1442,6 +1468,7 @@ if (sl->arc_tree == NULL) sl->arc_tree = pcb_r_create_tree(); if (sl->text_tree == NULL) sl->text_tree = pcb_r_create_tree(); if (sl->polygon_tree == NULL) sl->polygon_tree = pcb_r_create_tree(); + if (sl->gfx_tree == NULL) sl->gfx_tree = pcb_r_create_tree(); if (!(sl->meta.bound.type & PCB_LYT_VIRTUAL)) pcb_message(PCB_MSG_ERROR, "Couldn't bind subc layer %s on buffer move\n", sl->name == NULL ? "" : sl->name); } @@ -1547,6 +1574,7 @@ if (dl->arc_tree == NULL) dl->arc_tree = pcb_r_create_tree(); if (dl->text_tree == NULL) dl->text_tree = pcb_r_create_tree(); if (dl->polygon_tree == NULL) dl->polygon_tree = pcb_r_create_tree(); + if (dl->gfx_tree == NULL) dl->gfx_tree = pcb_r_create_tree(); } if (subc_relocate_layer_objs(dl, pcb->Data, sl, src_has_real_layer, 1, 0) > 0) Index: trunk/src/obj_subc_parent.h =================================================================== --- trunk/src/obj_subc_parent.h (revision 29777) +++ trunk/src/obj_subc_parent.h (revision 29778) @@ -74,6 +74,7 @@ case PCB_OBJ_POLY: case PCB_OBJ_TEXT: case PCB_OBJ_ARC: + case PCB_OBJ_GFX: return pcb_lobj_parent_subc(obj->parent_type, &obj->parent); default: Index: trunk/src/operation.c =================================================================== --- trunk/src/operation.c (revision 29777) +++ trunk/src/operation.c (revision 29778) @@ -63,6 +63,11 @@ res = F->Arc(ctx, (pcb_layer_t *)Ptr1, (pcb_arc_t *)Ptr2); break; + case PCB_OBJ_GFX: + if (F->Gfx) + res = F->Gfx(ctx, (pcb_layer_t *)Ptr1, (pcb_gfx_t *)Ptr2); + break; + case PCB_OBJ_LINE_POINT: if (F->LinePoint) res = F->LinePoint(ctx, (pcb_layer_t *)Ptr1, (pcb_line_t *)Ptr2, (pcb_point_t *)Ptr3); @@ -232,6 +237,32 @@ PCB_ENDALL_LOOP; } + /* check gfx */ + if (type & PCB_OBJ_GFX && F->Gfx) { + PCB_GFX_VISIBLE_LOOP(data); + { + if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, gfx)) + continue; + if (!on_locked_too && PCB_FLAG_TEST(PCB_FLAG_LOCK, gfx)) + continue; + if (Reset) { + pcb_undo_add_obj_to_flag(gfx); + PCB_FLAG_CLEAR(PCB_FLAG_SELECTED, gfx); + } + if (F->common_pre != NULL) + if (F->common_pre(ctx, (pcb_any_obj_t *)gfx, NULL) == 1) continue; + if (F->extobj_inhibit_regen) + exto = NULL; + else + exto = pcb_extobj_float_pre((pcb_any_obj_t *)gfx); + F->Gfx(ctx, layer, gfx); + if (exto != NULL) pcb_extobj_float_geo(exto); + if (F->common_post != NULL) F->common_post(ctx, (pcb_any_obj_t *)gfx, NULL); + changed = pcb_true; + } + PCB_ENDALL_LOOP; + } + if ((type & (PCB_OBJ_SUBC | PCB_OBJ_SUBC_PART)) && F->subc) { PCB_SUBC_LOOP(data); { Index: trunk/src/operation.h =================================================================== --- trunk/src/operation.h (revision 29777) +++ trunk/src/operation.h (revision 29778) @@ -150,6 +150,7 @@ void *(*LinePoint)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_line_t *, pcb_point_t *); void *(*Point)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_poly_t *, pcb_point_t *); void *(*Arc)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_arc_t *); + void *(*Gfx)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_gfx_t *); void *(*Rat)(pcb_opctx_t *ctx, pcb_rat_t *); void *(*ArcPoint)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_arc_t *, int *end_id); void *(*subc)(pcb_opctx_t *ctx, pcb_subc_t *); Index: trunk/src/remove.c =================================================================== --- trunk/src/remove.c (revision 29777) +++ trunk/src/remove.c (revision 29778) @@ -41,6 +41,7 @@ #include "obj_rat_op.h" #include "obj_subc_op.h" #include "obj_pstk_op.h" +#include "obj_gfx_op.h" static int remove_pre(pcb_opctx_t *ctx, pcb_any_obj_t *obj, void *ptr3); @@ -53,6 +54,7 @@ pcb_lineop_remove_point, pcb_polyop_remove_point, pcb_arcop_remove, + pcb_gfxop_remove, pcb_ratop_remove, pcb_arcop_remove_point, pcb_subcop_remove, @@ -69,6 +71,7 @@ NULL, pcb_polyop_destroy_point, pcb_arcop_destroy, + pcb_gfxop_destroy, pcb_ratop_destroy, NULL, pcb_subcop_destroy, Index: trunk/src/remove.h =================================================================== --- trunk/src/remove.h (revision 29777) +++ trunk/src/remove.h (revision 29778) @@ -35,7 +35,8 @@ #define PCB_REMOVE_TYPES \ (PCB_OBJ_PSTK | PCB_OBJ_LINE_POINT | PCB_OBJ_LINE | PCB_OBJ_TEXT | PCB_OBJ_SUBC | \ - PCB_OBJ_POLY_POINT | PCB_OBJ_POLY | PCB_OBJ_RAT | PCB_OBJ_ARC | PCB_OBJ_ARC_POINT) + PCB_OBJ_POLY_POINT | PCB_OBJ_POLY | PCB_OBJ_RAT | PCB_OBJ_ARC | PCB_OBJ_GFX \ + | PCB_OBJ_ARC_POINT) pcb_bool pcb_remove_selected(pcb_bool locked_too); Index: trunk/src/rotate.c =================================================================== --- trunk/src/rotate.c (revision 29777) +++ trunk/src/rotate.c (revision 29778) @@ -47,6 +47,7 @@ #include "obj_text_op.h" #include "obj_subc_op.h" #include "obj_pstk_op.h" +#include "obj_gfx_op.h" #include "obj_line_draw.h" #include "obj_rat_draw.h" @@ -60,6 +61,7 @@ pcb_lineop_rotate90_point, NULL, pcb_arcop_rotate90, + pcb_gfxop_rotate90, NULL, NULL, pcb_subcop_rotate90, @@ -76,6 +78,7 @@ NULL, NULL, pcb_arcop_rotate, + pcb_gfxop_rotate, NULL, NULL, pcb_subcop_rotate, Index: trunk/src/rotate.h =================================================================== --- trunk/src/rotate.h (revision 29777) +++ trunk/src/rotate.h (revision 29778) @@ -32,7 +32,7 @@ #include "global_typedefs.h" #include -#define PCB_ROTATE_TYPES (PCB_OBJ_PSTK | PCB_OBJ_SUBC | PCB_OBJ_TEXT | PCB_OBJ_ARC | PCB_OBJ_LINE_POINT | PCB_OBJ_LINE | PCB_OBJ_POLY | PCB_OBJ_FLOATER) +#define PCB_ROTATE_TYPES (PCB_OBJ_PSTK | PCB_OBJ_SUBC | PCB_OBJ_TEXT | PCB_OBJ_ARC | PCB_OBJ_LINE_POINT | PCB_OBJ_LINE | PCB_OBJ_POLY | PCB_OBJ_GFX | PCB_OBJ_FLOATER) /* rotates an object passed; pcb is the parent board or associated board (in case of buffer) */ Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 29777) +++ trunk/src/search.c (revision 29778) @@ -57,6 +57,7 @@ */ static pcb_bool SearchLineByLocation(unsigned long, unsigned long, pcb_layer_t **, pcb_line_t **, pcb_line_t **); static pcb_bool SearchArcByLocation(unsigned long, unsigned long, pcb_layer_t **, pcb_arc_t **, pcb_arc_t **); +static pcb_bool SearchGfxByLocation(unsigned long, unsigned long, pcb_layer_t **, pcb_gfx_t **, pcb_gfx_t **); static pcb_bool SearchRatLineByLocation(unsigned long, unsigned long, pcb_rat_t **, pcb_rat_t **, pcb_rat_t **); static pcb_bool SearchTextByLocation(unsigned long, unsigned long, pcb_layer_t **, pcb_text_t **, pcb_text_t **); static pcb_bool SearchPolygonByLocation(unsigned long, unsigned long, pcb_layer_t **, pcb_poly_t **, pcb_poly_t **); @@ -256,6 +257,44 @@ return pcb_false; } +/* --------------------------------------------------------------------------- + * searches gfx on the SearchLayer + */ +struct gfx_info { + pcb_gfx_t **Gfx, **Dummy; + unsigned long objst, req_flag; + double least; +}; + +static pcb_r_dir_t gfx_callback(const pcb_box_t *box, void *cl) +{ + struct gfx_info *i = (struct gfx_info *)cl; + pcb_gfx_t *g = (pcb_gfx_t *)box; + + TEST_OBJST(i->objst, i->req_flag, l, g, g); + + if (!pcb_is_point_in_gfx(PosX, PosY, SearchRadius, g)) + return 0; + *i->Gfx = g; + *i->Dummy = g; + return PCB_R_DIR_CANCEL; /* found */ +} + +static pcb_bool SearchGfxByLocation(unsigned long objst, unsigned long req_flag, pcb_layer_t **Layer, pcb_gfx_t **gfx, pcb_gfx_t **Dummy) +{ + struct gfx_info info; + + info.Gfx = gfx; + info.Dummy = Dummy; + info.objst = objst; + info.req_flag = req_flag; + + *Layer = SearchLayer; + if (pcb_r_search(SearchLayer->gfx_tree, &SearchBox, NULL, gfx_callback, &info, NULL) != PCB_R_DIR_NOT_FOUND) + return pcb_true; + return pcb_false; +} + static pcb_r_dir_t text_callback(const pcb_box_t * box, void *cl) { pcb_text_t *text = (pcb_text_t *) box; @@ -862,6 +901,15 @@ } /* --------------------------------------------------------------------------- + * checks if an gfx crosses a rectangle (or gfx is within the rectangle) + */ +pcb_bool pcb_is_gfx_in_rectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_gfx_t *gfx) +{ + TODO("gfx"); + return pcb_false; +} + +/* --------------------------------------------------------------------------- * Check if a circle of Radius with center at (X, Y) intersects a line. * Written to enable arbitrary line directions; for rounded/square lines, too. */ @@ -983,6 +1031,12 @@ return PCB_BOX_IN_BOX(&ab, b); } +pcb_bool pcb_gfx_in_box(pcb_gfx_t *gfx, pcb_box_t *b) +{ + pcb_box_t gb = pcb_arc_mini_bbox(gfx); + return PCB_BOX_IN_BOX(&gb, b); +} + /* TODO: this code is BROKEN in the case of non-circular arcs, * and in the case that the arc thickness is greater than * the radius. @@ -1059,6 +1113,13 @@ #undef angle_in_range } +pcb_bool pcb_is_point_in_gfx(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_gfx_t *gfx) +{ + TODO("gfx"); + return pcb_false; +} + + pcb_line_t *pcb_line_center_cross_point(pcb_layer_t *layer, pcb_coord_t x, pcb_coord_t y, pcb_angle_t *ang, pcb_bool no_subc_part, pcb_bool no_term) { pcb_rtree_it_t it; @@ -1136,6 +1197,11 @@ else return PCB_OBJ_POLY; } + + if ((HigherAvail & (PCB_OBJ_PSTK)) == 0 && Type & PCB_OBJ_GFX && + SearchGfxByLocation(objst, req_flag, (pcb_layer_t **)Result1, (pcb_gfx_t **)Result2, (pcb_gfx_t **)Result3)) + return PCB_OBJ_ARC; + } return 0; } @@ -1428,6 +1494,18 @@ PCB_ENDALL_LOOP; } + if (type == PCB_OBJ_GFX) { + PCB_GFX_ALL_LOOP(Base); + { + if (gfx->ID == ID) { + *Result1 = (void *)layer; + *Result2 = *Result3 = (void *)gfx; + return PCB_OBJ_GFX; + } + } + PCB_ENDALL_LOOP; + } + if (type == PCB_OBJ_PSTK) { PCB_PADSTACK_LOOP(Base); { @@ -1644,6 +1722,11 @@ if (res & pcb_RTREE_DIR_STOP) return res; } + if ((type & PCB_OBJ_GFX) && (ly->gfx_tree != NULL)) { + res = pcb_rtree_search_any(ly->gfx_tree, query, NULL, cb, closure, NULL); + if (res & pcb_RTREE_DIR_STOP) + return res; + } } return 0; Index: trunk/src/search.h =================================================================== --- trunk/src/search.h (revision 29777) +++ trunk/src/search.h (revision 29778) @@ -36,6 +36,7 @@ int pcb_lines_intersect(pcb_coord_t ax1, pcb_coord_t ay1, pcb_coord_t ax2, pcb_coord_t ay2, pcb_coord_t bx1, pcb_coord_t by1, pcb_coord_t bx2, pcb_coord_t by2); pcb_bool pcb_arc_in_box(pcb_arc_t *arc, pcb_box_t *b); +pcb_bool pcb_gfx_in_box(pcb_gfx_t *gfx, pcb_box_t *b); #define PCB_SLOP 5 @@ -81,6 +82,9 @@ #define PCB_ARC_IN_BOX(a,b) \ ((PCB_BOX_TOUCHES_BOX(&((a)->BoundingBox), (b))) && (pcb_arc_in_box(a,b))) +#define PCB_GFX_IN_BOX(g,b) \ + ((PCB_BOX_TOUCHES_BOX(&((g)->BoundingBox), (b))) && (pcb_gfx_in_box(g,b))) + /* == the same but accept if any part of the object touches the box == */ #define PCB_POINT_IN_CIRCLE(x, y, cx, cy, r) \ (pcb_distance2(x, y, cx, cy) <= (double)(r) * (double)(r)) @@ -130,7 +134,10 @@ #define PCB_ARC_TOUCHES_BOX(a,b) \ (pcb_is_arc_in_rectangle((b)->X2, (b)->Y2, (b)->X1, (b)->Y1, (a))) +#define PCB_GFX_TOUCHES_BOX(a,b) \ + (pcb_is_gfx_in_rectangle((b)->X2, (b)->Y2, (b)->X1, (b)->Y1, (a))) + /* == the combination of *_IN_* and *_TOUCHES_*: use IN for positive boxes == */ #define PCB_IS_BOX_NEGATIVE(b) (((b)->X2 < (b)->X1) || ((b)->Y2 < (b)->Y1)) @@ -161,13 +168,18 @@ #define PCB_ARC_NEAR_BOX(a,b) \ (PCB_IS_BOX_NEGATIVE(b) ? PCB_ARC_TOUCHES_BOX(a,b) : PCB_ARC_IN_BOX(a,b)) +#define PCB_GFX_NEAR_BOX(a,b) \ + (PCB_IS_BOX_NEGATIVE(b) ? PCB_GFX_TOUCHES_BOX(a,b) : PCB_GFX_IN_BOX(a,b)) + pcb_bool pcb_is_point_on_line(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_line_t *Line); pcb_bool pcb_is_point_on_thinline( pcb_coord_t X, pcb_coord_t Y, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2,pcb_coord_t Y2 ); pcb_bool pcb_is_point_on_line_end(pcb_coord_t X, pcb_coord_t Y, pcb_rat_t *Line); pcb_bool pcb_is_point_on_arc(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_arc_t *Arc); +pcb_bool pcb_is_point_in_gfx(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_gfx_t *gfx); pcb_bool pcb_is_line_in_rectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_line_t *Line); pcb_bool pcb_is_line_in_quadrangle(pcb_point_t p[4], pcb_line_t *Line); pcb_bool pcb_is_arc_in_rectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_arc_t *Arc); +pcb_bool pcb_is_gfx_in_rectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_gfx_t *gfx); pcb_bool pcb_is_point_in_line(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_any_line_t *Pad); pcb_bool pcb_is_point_in_box(pcb_coord_t X, pcb_coord_t Y, pcb_box_t *box, pcb_coord_t Radius); Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 29777) +++ trunk/src/select.c (revision 29778) @@ -53,6 +53,7 @@ #include "obj_text_draw.h" #include "obj_rat_draw.h" #include "obj_pstk_draw.h" +#include "obj_gfx_draw.h" #include @@ -134,6 +135,18 @@ break; } + case PCB_OBJ_GFX: + { + pcb_gfx_t *gfx = (pcb_gfx_t *)ptr2; + + layer = (pcb_layer_t *)ptr1; + pcb_undo_add_obj_to_flag(ptr2); + PCB_FLAG_TOGGLE(PCB_FLAG_SELECTED, gfx); + pcb_gfx_invalidate_draw(layer, gfx); + break; + } + + case PCB_OBJ_SUBC: pcb_subc_select(pcb, (pcb_subc_t *) ptr1, PCB_CHGFLG_TOGGLE, 1); break; @@ -301,6 +314,17 @@ } } PCB_END_LOOP; + PCB_GFX_LOOP(layer); + { + if (PCB_GFX_NEAR_BOX(gfx, Box) + && !PCB_FLAG_TEST(PCB_FLAG_LOCK, gfx) + && PCB_FLAG_TEST(PCB_FLAG_SELECTED, gfx) != Flag) { + append(PCB_OBJ_GFX, layer, gfx); + if (layer->meta.real.vis) + pcb_gfx_invalidate_draw(layer, gfx); + } + } + PCB_END_LOOP; } PCB_END_LOOP; @@ -369,6 +393,7 @@ case PCB_OBJ_TEXT: return PCB_TEXT_NEAR_BOX((pcb_text_t *)obj, box); case PCB_OBJ_POLY: return PCB_POLYGON_NEAR_BOX((pcb_poly_t *)obj, box); case PCB_OBJ_ARC: return PCB_ARC_NEAR_BOX((pcb_arc_t *)obj, box); + case PCB_OBJ_GFX: return PCB_GFX_NEAR_BOX((pcb_gfx_t *)obj, box); case PCB_OBJ_PSTK: return pcb_pstk_near_box((pcb_pstk_t *)obj, box, NULL); case PCB_OBJ_SUBC: return PCB_SUBC_NEAR_BOX((pcb_subc_t *)obj, box); default: return 0; Index: trunk/src/select.h =================================================================== --- trunk/src/select.h (revision 29777) +++ trunk/src/select.h (revision 29778) @@ -34,7 +34,7 @@ #define PCB_SELECT_TYPES \ (PCB_OBJ_LINE | PCB_OBJ_TEXT | PCB_OBJ_POLY | PCB_OBJ_SUBC | \ - PCB_OBJ_PSTK | PCB_OBJ_RAT | PCB_OBJ_ARC) + PCB_OBJ_PSTK | PCB_OBJ_RAT | PCB_OBJ_ARC | PCB_OBJ_GFX) pcb_bool pcb_select_object(pcb_board_t *pcb); pcb_bool pcb_select_block(pcb_board_t *pcb, pcb_box_t *Box, pcb_bool flag, pcb_bool vis_only, pcb_bool invert); Index: trunk/src/undo_old.c =================================================================== --- trunk/src/undo_old.c (revision 29777) +++ trunk/src/undo_old.c (revision 29778) @@ -959,6 +959,7 @@ case PCB_OBJ_ARC: case PCB_OBJ_TEXT: case PCB_OBJ_POLY: + case PCB_OBJ_GFX: subc = pcb_obj_parent_subc(Ptr3); if (subc != NULL) { pcb_term_del(&subc->terminals, o->term, o); Index: trunk/src/view.c =================================================================== --- trunk/src/view.c (revision 29777) +++ trunk/src/view.c (revision 29778) @@ -146,6 +146,7 @@ case PCB_OBJ_POLY: case PCB_OBJ_PSTK: case PCB_OBJ_RAT: + case PCB_OBJ_GFX: idp = pcb_obj2idpath(obj); if (idp == NULL) pcb_message(PCB_MSG_ERROR, "Internal error in pcb_drc_append_obj: can not resolve object id path\n"); Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 29777) +++ trunk/src_plugins/export_openems/export_openems.c (revision 29778) @@ -194,7 +194,7 @@ static void find_origin(wctx_t *ctx) { - pcb_loop_layers(ctx->pcb, ctx, NULL, find_origin_bump, NULL, NULL, NULL); + pcb_loop_layers(ctx->pcb, ctx, NULL, find_origin_bump, NULL, NULL, NULL, NULL); } static void openems_write_tunables(wctx_t *ctx) Index: trunk/src_plugins/lib_netmap/netmap.c =================================================================== --- trunk/src_plugins/lib_netmap/netmap.c (revision 29777) +++ trunk/src_plugins/lib_netmap/netmap.c (revision 29778) @@ -136,6 +136,7 @@ NULL, /* arc */ NULL, /* text */ NULL, /* poly */ + NULL, /* gfx */ list_subc_cb, /* subc */ NULL /* pstk */ ); @@ -147,6 +148,7 @@ list_arc_cb, NULL, /* text */ list_poly_cb, + NULL, /* gfx */ NULL, /* subc */ list_pstk_cb ); Index: trunk/src_plugins/lib_vfs/lib_vfs.c =================================================================== --- trunk/src_plugins/lib_vfs/lib_vfs.c (revision 29777) +++ trunk/src_plugins/lib_vfs/lib_vfs.c (revision 29778) @@ -354,6 +354,8 @@ ty = PCB_OBJ_TEXT; else if ((strncmp(path, "arc/", 4) == 0) || (strcmp(path, "arc") == 0)) ty = PCB_OBJ_ARC; + else if ((strncmp(path, "gfx/", 4) == 0) || (strcmp(path, "gfx") == 0)) + ty = PCB_OBJ_GFX; else return -1; Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 29777) +++ trunk/src_plugins/propedit/propsel.c (revision 29778) @@ -2,7 +2,7 @@ * COPYRIGHT * * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2016,2018,2019 Tibor 'Igor2' Palinkas + * Copyright (C) 2016,2018,2019,2020 Tibor 'Igor2' Palinkas * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -200,6 +200,19 @@ } } +static void map_gfx(pcb_propedit_t *ctx, pcb_gfx_t *gfx) +{ + map_add_prop(ctx, "p/gfx/rot", pcb_angle_t, gfx->rot); + map_common(ctx, (pcb_any_obj_t *)gfx); + map_attr(ctx, &gfx->Attributes); + if (ctx->geo) { + map_add_prop(ctx, "p/gfx/cx", pcb_coord_t, gfx->cx); + map_add_prop(ctx, "p/gfx/cy", pcb_coord_t, gfx->cy); + map_add_prop(ctx, "p/gfx/sx", pcb_coord_t, gfx->sx); + map_add_prop(ctx, "p/gfx/sy", pcb_coord_t, gfx->sy); + } +} + static void map_text(pcb_propedit_t *ctx, pcb_text_t *text) { map_add_prop(ctx, "p/text/scale", int, text->Scale); @@ -291,6 +304,7 @@ return; switch(o->type) { case PCB_OBJ_ARC: map_arc(ctx, (pcb_arc_t *)o); break; + case PCB_OBJ_GFX: map_gfx(ctx, (pcb_gfx_t *)o); break; case PCB_OBJ_LINE: map_line(ctx, (pcb_line_t *)o); break; case PCB_OBJ_POLY: map_poly(ctx, (pcb_poly_t *)o); break; case PCB_OBJ_TEXT: map_text(ctx, (pcb_text_t *)o); break; @@ -581,6 +595,18 @@ } } +static void set_gfx(pcb_propset_ctx_t *st, pcb_gfx_t *gfx) +{ + const char *pn = st->name + 8; + + if (st->is_attr) { + set_attr_obj(st, (pcb_any_obj_t *)gfx); + return; + } + + if (set_common(st, (pcb_any_obj_t *)gfx)) return; +} + static void set_text(pcb_propset_ctx_t *st, pcb_text_t *text) { const char *pn = st->name + 7; @@ -781,6 +807,7 @@ return; switch(o->type) { case PCB_OBJ_ARC: set_arc(ctx, (pcb_arc_t *)o); break; + case PCB_OBJ_GFX: set_gfx(ctx, (pcb_gfx_t *)o); break; case PCB_OBJ_LINE: set_line(ctx, (pcb_line_t *)o); break; case PCB_OBJ_POLY: set_poly(ctx, (pcb_poly_t *)o); break; case PCB_OBJ_TEXT: set_text(ctx, (pcb_text_t *)o); break; Index: trunk/src_plugins/query/query_access.c =================================================================== --- trunk/src_plugins/query/query_access.c (revision 29777) +++ trunk/src_plugins/query/query_access.c (revision 29778) @@ -2,7 +2,7 @@ * COPYRIGHT * * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2016 Tibor 'Igor2' Palinkas + * Copyright (C) 2016,2020 Tibor 'Igor2' Palinkas * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,6 +72,11 @@ APPEND(ctx, ps); } +static void list_gfx_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_gfx_t *gfx) +{ + APPEND(ctx, gfx); +} + static int list_subc_cb(void *ctx, pcb_board_t *pcb, pcb_subc_t *subc, int enter); static int list_data(void *ctx, pcb_board_t *pcb, pcb_data_t *data, int enter, pcb_objtype_t mask) @@ -100,6 +105,14 @@ PCB_ENDALL_LOOP; } + if (mask & PCB_OBJ_GFX) { + PCB_GFX_ALL_LOOP(data); + { + list_gfx_cb(ctx, pcb, layer, gfx); + } + PCB_ENDALL_LOOP; + } + if (mask & PCB_OBJ_LINE) { PCB_LINE_ALL_LOOP(data); { @@ -146,6 +159,7 @@ (mask & PCB_OBJ_ARC) ? list_arc_cb : NULL, (mask & PCB_OBJ_TEXT) ? list_text_cb : NULL, (mask & PCB_OBJ_POLY) ? list_poly_cb : NULL, + (mask & PCB_OBJ_GFX) ? list_gfx_cb : NULL, (mask & PCB_OBJ_SUBC) ? list_subc_cb : NULL, (mask & PCB_OBJ_PSTK) ? list_pstk_cb : NULL ); @@ -488,6 +502,54 @@ PCB_QRY_RET_INV(res); } +static int field_gfx(pcb_any_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res) +{ + pcb_gfx_t *g = (pcb_gfx_t *)obj; + query_fields_keys_t fh1, fh2; + + fld2hash_req(fh1, fld, 0); + + if (fh1 == query_fields_a) { + const char *s2; + fld2str_req(s2, fld, 1); + PCB_QRY_RET_STR(res, pcb_attribute_get(&g->Attributes, s2)); + } + + if (fh1 == query_fields_layer) { + if (obj->parent_type == PCB_PARENT_LAYER) + return field_layer_from_ptr(obj->parent.layer, fld->next, res); + else + PCB_QRY_RET_INV(res); + } + + if (fld->next != NULL) + PCB_QRY_RET_INV(res); + +TODO("gfx"); +#if 0 + switch(fh1) { + case query_fields_length: + PCB_QRY_RET_INT(res, ((pcb_coord_t)pcb_round(pcb_arc_len(a)))); + break; + case query_fields_length2: + { + double l = pcb_arc_len(a); + PCB_QRY_RET_DBL(res, l*l); + } + break; + case query_fields_area: + { + double th = a->Thickness; + double len = pcb_arc_len(a); + PCB_QRY_RET_DBL(res, len * th + th*th/4*M_PI); /* approx */ + } + break; + default:; + } +#endif + PCB_QRY_RET_INV(res); +} + static int field_text(pcb_any_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res) { pcb_text_t *t = (pcb_text_t *)obj; @@ -750,6 +812,7 @@ case PCB_OBJ_TEXT: return field_text(obj, fld, res); case PCB_OBJ_POLY: return field_polygon(obj, fld, res); case PCB_OBJ_ARC: return field_arc(obj, fld, res); + case PCB_OBJ_GFX: return field_gfx(obj, fld, res); case PCB_OBJ_RAT: return field_rat(obj, fld, res); case PCB_OBJ_PSTK: return field_pstk(obj, fld, res); case PCB_OBJ_SUBC: return field_subc(obj, fld, res); Index: trunk/src_plugins/query/query_l.c =================================================================== --- trunk/src_plugins/query/query_l.c (revision 29777) +++ trunk/src_plugins/query/query_l.c (revision 29778) @@ -611,8 +611,8 @@ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 65 -#define YY_END_OF_BUFFER 66 +#define YY_NUM_RULES 66 +#define YY_END_OF_BUFFER 67 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -620,32 +620,33 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[219] = +static const flex_int16_t yy_accept[222] = { 0, - 0, 0, 66, 65, 64, 63, 62, 65, 65, 65, - 62, 62, 58, 62, 65, 62, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 45, 61, - 61, 61, 61, 61, 65, 55, 0, 1, 53, 0, - 2, 59, 60, 58, 57, 54, 56, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 32, - 61, 27, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 9, 61, 47, 61, 61, 61, 61, - 61, 44, 48, 8, 61, 61, 46, 52, 60, 16, + 0, 0, 67, 66, 65, 64, 63, 66, 66, 66, + 63, 63, 59, 63, 66, 63, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 46, + 62, 62, 62, 62, 62, 66, 56, 0, 1, 54, + 0, 2, 60, 61, 59, 58, 55, 57, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 33, 62, 28, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 9, 62, 48, 62, 62, + 62, 62, 62, 45, 49, 8, 62, 62, 47, 53, - 61, 61, 61, 42, 61, 61, 61, 61, 61, 61, - 61, 22, 31, 61, 61, 61, 61, 17, 61, 61, - 61, 33, 61, 61, 28, 61, 61, 61, 61, 3, - 61, 49, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 13, 39, 41, 61, 61, 61, 19, 38, 20, - 14, 25, 61, 61, 61, 50, 61, 6, 5, 51, - 61, 61, 61, 29, 61, 61, 23, 61, 61, 40, - 61, 61, 61, 61, 61, 10, 61, 34, 61, 37, - 35, 61, 61, 61, 61, 61, 61, 61, 61, 4, - 61, 61, 61, 61, 61, 61, 61, 15, 61, 61, + 61, 16, 62, 62, 62, 43, 62, 17, 62, 62, + 62, 62, 62, 62, 23, 32, 62, 62, 62, 62, + 18, 62, 62, 62, 34, 62, 62, 29, 62, 62, + 62, 62, 3, 62, 50, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 13, 40, 42, 62, 62, 62, + 20, 39, 21, 14, 26, 62, 62, 62, 51, 62, + 6, 5, 52, 62, 62, 62, 30, 62, 62, 24, + 62, 62, 41, 62, 62, 62, 62, 62, 10, 62, + 35, 62, 38, 36, 62, 62, 62, 62, 62, 62, + 62, 62, 4, 62, 62, 62, 62, 62, 62, 62, - 26, 7, 43, 36, 61, 24, 61, 18, 61, 61, - 30, 61, 61, 61, 11, 12, 21, 0 + 15, 62, 62, 27, 7, 44, 37, 62, 25, 62, + 19, 62, 62, 31, 62, 62, 62, 11, 12, 22, + 0 } ; static const YY_CHAR yy_ec[256] = @@ -690,102 +691,102 @@ 2, 2, 2, 2, 1 } ; -static const flex_int16_t yy_base[222] = +static const flex_int16_t yy_base[225] = { 0, - 0, 0, 236, 237, 237, 237, 223, 229, 227, 225, - 237, 221, 47, 218, 217, 216, 197, 198, 197, 196, - 0, 209, 195, 44, 45, 42, 42, 48, 207, 42, - 50, 198, 201, 56, 171, 171, 168, 26, 27, 168, - 205, 160, 168, 164, 155, 237, 204, 237, 237, 201, - 237, 197, 196, 72, 237, 237, 237, 0, 189, 51, - 175, 187, 177, 53, 165, 173, 168, 182, 165, 0, - 177, 0, 60, 170, 162, 161, 167, 176, 155, 160, - 155, 156, 155, 237, 134, 0, 146, 34, 131, 131, - 135, 0, 0, 237, 134, 126, 0, 237, 168, 0, + 0, 0, 238, 239, 239, 239, 225, 231, 229, 227, + 239, 223, 47, 220, 219, 218, 199, 200, 199, 198, + 0, 211, 205, 196, 44, 45, 42, 42, 48, 208, + 42, 50, 199, 202, 56, 172, 172, 169, 26, 27, + 169, 206, 161, 169, 165, 156, 239, 205, 239, 239, + 202, 239, 198, 197, 72, 239, 239, 239, 0, 190, + 51, 176, 188, 178, 167, 53, 165, 173, 168, 182, + 165, 0, 177, 0, 60, 170, 162, 161, 167, 176, + 155, 160, 155, 156, 155, 239, 134, 0, 146, 34, + 131, 131, 135, 0, 0, 239, 134, 126, 0, 239, - 145, 149, 146, 0, 143, 155, 150, 153, 152, 145, - 147, 0, 0, 136, 134, 129, 140, 0, 139, 146, - 129, 0, 142, 137, 0, 117, 114, 112, 117, 0, - 102, 0, 112, 101, 123, 133, 131, 130, 117, 115, - 115, 107, 0, 0, 111, 124, 66, 0, 0, 119, - 0, 0, 125, 89, 129, 0, 91, 0, 0, 0, - 110, 121, 104, 0, 106, 110, 111, 101, 115, 0, - 100, 98, 96, 100, 72, 237, 78, 0, 92, 0, - 107, 105, 89, 90, 101, 89, 87, 98, 95, 0, - 72, 70, 80, 79, 73, 79, 76, 0, 77, 65, + 168, 0, 145, 149, 146, 0, 143, 0, 155, 150, + 153, 152, 145, 147, 0, 0, 136, 134, 129, 140, + 0, 139, 146, 129, 0, 142, 137, 0, 117, 114, + 112, 117, 0, 102, 0, 112, 101, 123, 133, 131, + 130, 117, 115, 115, 107, 0, 0, 111, 124, 66, + 0, 0, 119, 0, 0, 125, 89, 129, 0, 91, + 0, 0, 0, 110, 121, 104, 0, 106, 110, 111, + 101, 115, 0, 100, 98, 96, 100, 72, 239, 78, + 0, 92, 0, 107, 105, 89, 90, 101, 89, 87, + 98, 95, 0, 72, 70, 80, 79, 73, 79, 76, - 0, 0, 0, 0, 79, 0, 69, 0, 68, 72, - 0, 61, 60, 58, 0, 0, 0, 237, 107, 109, - 87 + 0, 77, 65, 0, 0, 0, 0, 79, 0, 69, + 0, 68, 72, 0, 61, 60, 58, 0, 0, 0, + 239, 107, 109, 87 } ; -static const flex_int16_t yy_def[222] = +static const flex_int16_t yy_def[225] = { 0, - 218, 1, 218, 218, 218, 218, 218, 219, 218, 220, - 218, 218, 218, 218, 218, 218, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 218, 218, 219, 218, 218, 220, - 218, 218, 218, 218, 218, 218, 218, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 218, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 218, 221, 221, 221, 218, 218, 221, + 221, 1, 221, 221, 221, 221, 221, 222, 221, 223, + 221, 221, 221, 221, 221, 221, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 221, 221, 222, 221, 221, + 223, 221, 221, 221, 221, 221, 221, 221, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 221, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 221, 224, 224, 224, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 218, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 221, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 0, 218, 218, - 218 + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 0, 221, 221, 221 } ; -static const flex_int16_t yy_nxt[293] = +static const flex_int16_t yy_nxt[295] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 21, - 21, 23, 21, 21, 24, 25, 26, 27, 28, 29, - 30, 31, 21, 32, 21, 33, 21, 34, 35, 21, - 21, 36, 21, 21, 37, 38, 39, 40, 41, 42, - 21, 43, 44, 21, 45, 53, 54, 65, 67, 69, - 71, 73, 68, 77, 84, 66, 89, 79, 72, 70, - 90, 91, 128, 92, 78, 74, 114, 80, 75, 81, - 53, 54, 101, 102, 106, 171, 107, 129, 58, 217, - 115, 216, 215, 214, 213, 212, 211, 210, 209, 208, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 21, 24, 21, 21, 25, 26, 27, 28, 29, 30, + 31, 32, 21, 33, 21, 34, 21, 35, 36, 21, + 21, 37, 21, 21, 38, 39, 40, 41, 42, 43, + 21, 44, 45, 21, 46, 54, 55, 67, 69, 71, + 73, 75, 70, 79, 86, 68, 91, 81, 74, 72, + 92, 93, 131, 94, 80, 76, 117, 82, 77, 83, + 54, 55, 103, 104, 109, 174, 110, 132, 59, 220, + 118, 219, 218, 217, 216, 215, 214, 213, 212, 211, - 207, 206, 172, 205, 204, 203, 85, 47, 47, 50, - 50, 202, 201, 200, 199, 198, 197, 196, 195, 194, - 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, - 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, - 173, 170, 169, 168, 167, 166, 165, 164, 163, 162, - 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, - 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, - 141, 140, 139, 138, 137, 136, 135, 99, 134, 133, - 132, 131, 130, 127, 126, 125, 124, 123, 122, 121, - 120, 119, 118, 117, 116, 113, 112, 111, 110, 109, + 210, 209, 175, 208, 207, 206, 87, 48, 48, 51, + 51, 205, 204, 203, 202, 201, 200, 199, 198, 197, + 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, + 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, + 176, 173, 172, 171, 170, 169, 168, 167, 166, 165, + 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, + 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, + 144, 143, 142, 141, 140, 139, 138, 101, 137, 136, + 135, 134, 133, 130, 129, 128, 127, 126, 125, 124, + 123, 122, 121, 120, 119, 116, 115, 114, 113, 112, - 108, 105, 104, 103, 100, 99, 52, 51, 48, 98, - 97, 96, 95, 94, 93, 88, 87, 86, 83, 82, - 76, 64, 63, 62, 61, 60, 59, 57, 56, 55, - 52, 51, 49, 48, 46, 218, 3, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218 + 111, 108, 107, 106, 105, 102, 101, 53, 52, 49, + 100, 99, 98, 97, 96, 95, 90, 89, 88, 85, + 84, 78, 66, 65, 64, 63, 62, 61, 60, 58, + 57, 56, 53, 52, 50, 49, 47, 221, 3, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221 } ; -static const flex_int16_t yy_chk[293] = +static const flex_int16_t yy_chk[295] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -792,33 +793,33 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 13, 13, 24, 25, 26, - 27, 28, 25, 30, 34, 24, 38, 31, 27, 26, - 38, 39, 88, 39, 30, 28, 73, 31, 28, 31, - 54, 54, 60, 60, 64, 147, 64, 88, 221, 214, - 73, 213, 212, 210, 209, 207, 205, 200, 199, 197, + 1, 1, 1, 1, 1, 13, 13, 25, 26, 27, + 28, 29, 26, 31, 35, 25, 39, 32, 28, 27, + 39, 40, 90, 40, 31, 29, 75, 32, 29, 32, + 55, 55, 61, 61, 66, 150, 66, 90, 224, 217, + 75, 216, 215, 213, 212, 210, 208, 203, 202, 200, - 196, 195, 147, 194, 193, 192, 34, 219, 219, 220, - 220, 191, 189, 188, 187, 186, 185, 184, 183, 182, - 181, 179, 177, 175, 174, 173, 172, 171, 169, 168, - 167, 166, 165, 163, 162, 161, 157, 155, 154, 153, - 150, 146, 145, 142, 141, 140, 139, 138, 137, 136, - 135, 134, 133, 131, 129, 128, 127, 126, 124, 123, - 121, 120, 119, 117, 116, 115, 114, 111, 110, 109, - 108, 107, 106, 105, 103, 102, 101, 99, 96, 95, - 91, 90, 89, 87, 85, 83, 82, 81, 80, 79, - 78, 77, 76, 75, 74, 71, 69, 68, 67, 66, + 199, 198, 150, 197, 196, 195, 35, 222, 222, 223, + 223, 194, 192, 191, 190, 189, 188, 187, 186, 185, + 184, 182, 180, 178, 177, 176, 175, 174, 172, 171, + 170, 169, 168, 166, 165, 164, 160, 158, 157, 156, + 153, 149, 148, 145, 144, 143, 142, 141, 140, 139, + 138, 137, 136, 134, 132, 131, 130, 129, 127, 126, + 124, 123, 122, 120, 119, 118, 117, 114, 113, 112, + 111, 110, 109, 107, 105, 104, 103, 101, 98, 97, + 93, 92, 91, 89, 87, 85, 84, 83, 82, 81, + 80, 79, 78, 77, 76, 73, 71, 70, 69, 68, - 65, 63, 62, 61, 59, 53, 52, 50, 47, 45, - 44, 43, 42, 41, 40, 37, 36, 35, 33, 32, - 29, 23, 22, 20, 19, 18, 17, 16, 15, 14, - 12, 10, 9, 8, 7, 3, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218 + 67, 65, 64, 63, 62, 60, 54, 53, 51, 48, + 46, 45, 44, 43, 42, 41, 38, 37, 36, 34, + 33, 30, 24, 23, 22, 20, 19, 18, 17, 16, + 15, 14, 12, 10, 9, 8, 7, 3, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221 } ; @@ -872,8 +873,8 @@ static int qry_yy_input(char *buf, int buflen); static pcb_qry_node_t *make_constant(char *str, long val); #define YY_INPUT(buf, res, buflen) (res = qry_yy_input(buf, buflen)) -#line 876 "query_l.c" #line 877 "query_l.c" +#line 878 "query_l.c" #define INITIAL 0 @@ -1092,7 +1093,7 @@ { #line 40 "query_l.l" -#line 1096 "query_l.c" +#line 1097 "query_l.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1119,13 +1120,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 219 ) + if ( yy_current_state >= 222 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 237 ); + while ( yy_base[yy_current_state] != 239 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1234,12 +1235,12 @@ case 17: YY_RULE_SETUP #line 59 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_OBJ_RAT); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_OBJ_GFX); return T_CONST; } YY_BREAK case 18: YY_RULE_SETUP #line 60 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_OBJ_PSTK); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_OBJ_RAT); return T_CONST; } YY_BREAK case 19: YY_RULE_SETUP @@ -1249,7 +1250,7 @@ case 20: YY_RULE_SETUP #line 62 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_OBJ_SUBC); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_OBJ_PSTK); return T_CONST; } YY_BREAK case 21: YY_RULE_SETUP @@ -1259,22 +1260,22 @@ case 22: YY_RULE_SETUP #line 64 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_OBJ_NET); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_OBJ_SUBC); return T_CONST; } YY_BREAK case 23: YY_RULE_SETUP #line 65 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_OBJ_LAYER); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_OBJ_NET); return T_CONST; } YY_BREAK case 24: YY_RULE_SETUP #line 66 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_OBJ_LAYERGRP); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_OBJ_LAYER); return T_CONST; } YY_BREAK case 25: YY_RULE_SETUP -#line 68 "query_l.l" -{ qry_lval.n = make_constant(yytext, 1); return T_CONST; } +#line 67 "query_l.l" +{ qry_lval.n = make_constant(yytext, PCB_OBJ_LAYERGRP); return T_CONST; } YY_BREAK case 26: YY_RULE_SETUP @@ -1293,8 +1294,8 @@ YY_BREAK case 29: YY_RULE_SETUP -#line 73 "query_l.l" -{ qry_lval.n = make_constant(yytext, 0); return T_CONST; } +#line 72 "query_l.l" +{ qry_lval.n = make_constant(yytext, 1); return T_CONST; } YY_BREAK case 30: YY_RULE_SETUP @@ -1313,18 +1314,18 @@ YY_BREAK case 33: YY_RULE_SETUP -#line 78 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_TOP); return T_CONST; } +#line 77 "query_l.l" +{ qry_lval.n = make_constant(yytext, 0); return T_CONST; } YY_BREAK case 34: YY_RULE_SETUP #line 79 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_BOTTOM); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_LYT_TOP); return T_CONST; } YY_BREAK case 35: YY_RULE_SETUP #line 80 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_INTERN); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_LYT_BOTTOM); return T_CONST; } YY_BREAK case 36: YY_RULE_SETUP @@ -1334,117 +1335,117 @@ case 37: YY_RULE_SETUP #line 82 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_COPPER); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_LYT_INTERN); return T_CONST; } YY_BREAK case 38: YY_RULE_SETUP #line 83 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_SILK); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_LYT_COPPER); return T_CONST; } YY_BREAK case 39: YY_RULE_SETUP #line 84 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_MASK); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_LYT_SILK); return T_CONST; } YY_BREAK case 40: YY_RULE_SETUP #line 85 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_PASTE); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_LYT_MASK); return T_CONST; } YY_BREAK case 41: YY_RULE_SETUP #line 86 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_MECH); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_LYT_PASTE); return T_CONST; } YY_BREAK case 42: YY_RULE_SETUP #line 87 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_DOC); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_LYT_MECH); return T_CONST; } YY_BREAK case 43: YY_RULE_SETUP #line 88 "query_l.l" -{ qry_lval.n = make_constant(yytext, PCB_LYT_BOUNDARY); return T_CONST; } +{ qry_lval.n = make_constant(yytext, PCB_LYT_DOC); return T_CONST; } YY_BREAK case 44: YY_RULE_SETUP -#line 92 "query_l.l" -{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_MM); return T_UNIT; } +#line 89 "query_l.l" +{ qry_lval.n = make_constant(yytext, PCB_LYT_BOUNDARY); return T_CONST; } YY_BREAK case 45: YY_RULE_SETUP #line 93 "query_l.l" -{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_M); return T_UNIT; } +{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_MM); return T_UNIT; } YY_BREAK case 46: YY_RULE_SETUP #line 94 "query_l.l" -{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_UM); return T_UNIT; } +{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_M); return T_UNIT; } YY_BREAK case 47: YY_RULE_SETUP #line 95 "query_l.l" -{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_CM); return T_UNIT; } +{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_UM); return T_UNIT; } YY_BREAK case 48: YY_RULE_SETUP #line 96 "query_l.l" -{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_NM); return T_UNIT; } +{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_CM); return T_UNIT; } YY_BREAK case 49: YY_RULE_SETUP #line 97 "query_l.l" -{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_MIL); return T_UNIT; } +{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_NM); return T_UNIT; } YY_BREAK case 50: YY_RULE_SETUP #line 98 "query_l.l" -{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_IN); return T_UNIT; } +{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_MIL); return T_UNIT; } YY_BREAK case 51: YY_RULE_SETUP -#line 100 "query_l.l" -{ return T_THUS; } +#line 99 "query_l.l" +{ qry_lval.u = get_unit_struct_by_allow(PCB_UNIT_ALLOW_IN); return T_UNIT; } YY_BREAK case 52: YY_RULE_SETUP #line 101 "query_l.l" -{ return T_OR; } +{ return T_THUS; } YY_BREAK case 53: YY_RULE_SETUP #line 102 "query_l.l" -{ return T_AND; } +{ return T_OR; } YY_BREAK case 54: YY_RULE_SETUP #line 103 "query_l.l" -{ return T_EQ; } +{ return T_AND; } YY_BREAK case 55: YY_RULE_SETUP #line 104 "query_l.l" -{ return T_NEQ; } +{ return T_EQ; } YY_BREAK case 56: YY_RULE_SETUP #line 105 "query_l.l" -{ return T_GTEQ; } +{ return T_NEQ; } YY_BREAK case 57: YY_RULE_SETUP #line 106 "query_l.l" -{ return T_LTEQ; } +{ return T_GTEQ; } YY_BREAK case 58: YY_RULE_SETUP -#line 108 "query_l.l" -{ qry_lval.c = strtol(yytext, NULL, 10); return T_INT; } +#line 107 "query_l.l" +{ return T_LTEQ; } YY_BREAK case 59: YY_RULE_SETUP #line 109 "query_l.l" -{ qry_lval.d = strtod(yytext, NULL); return T_DBL; } +{ qry_lval.c = strtol(yytext, NULL, 10); return T_INT; } YY_BREAK case 60: YY_RULE_SETUP @@ -1454,30 +1455,35 @@ case 61: YY_RULE_SETUP #line 111 "query_l.l" -{ qry_lval.s = pcb_strdup(yytext); return T_STR; } +{ qry_lval.d = strtod(yytext, NULL); return T_DBL; } YY_BREAK case 62: YY_RULE_SETUP -#line 113 "query_l.l" -{ return *yytext; } +#line 112 "query_l.l" +{ qry_lval.s = pcb_strdup(yytext); return T_STR; } YY_BREAK case 63: -/* rule 63 can match eol */ YY_RULE_SETUP -#line 115 "query_l.l" -{ return T_NL; } +#line 114 "query_l.l" +{ return *yytext; } YY_BREAK case 64: +/* rule 64 can match eol */ YY_RULE_SETUP #line 116 "query_l.l" -{ continue; } +{ return T_NL; } YY_BREAK case 65: YY_RULE_SETUP -#line 118 "query_l.l" +#line 117 "query_l.l" +{ continue; } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 119 "query_l.l" ECHO; YY_BREAK -#line 1481 "query_l.c" +#line 1487 "query_l.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1774,7 +1780,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 219 ) + if ( yy_current_state >= 222 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -1802,11 +1808,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 219 ) + if ( yy_current_state >= 222 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 218); + yy_is_jam = (yy_current_state == 221); return yy_is_jam ? 0 : yy_current_state; } @@ -2482,7 +2488,7 @@ #define YYTABLES_NAME "yytables" -#line 118 "query_l.l" +#line 119 "query_l.l" static int qry_yy_input(char *buf, int buflen) Index: trunk/src_plugins/query/query_l.h =================================================================== --- trunk/src_plugins/query/query_l.h (revision 29777) +++ trunk/src_plugins/query/query_l.h (revision 29778) @@ -700,7 +700,7 @@ #undef yyTABLES_NAME #endif -#line 118 "query_l.l" +#line 119 "query_l.l" #line 707 "query_l.h" Index: trunk/src_plugins/query/query_l.l =================================================================== --- trunk/src_plugins/query/query_l.l (revision 29777) +++ trunk/src_plugins/query/query_l.l (revision 29778) @@ -56,6 +56,7 @@ "TEXT" { qry_lval.n = make_constant(yytext, PCB_OBJ_TEXT); return T_CONST; } "POLYGON" { qry_lval.n = make_constant(yytext, PCB_OBJ_POLY); return T_CONST; } "ARC" { qry_lval.n = make_constant(yytext, PCB_OBJ_ARC); return T_CONST; } +"GFX" { qry_lval.n = make_constant(yytext, PCB_OBJ_GFX); return T_CONST; } "RAT" { qry_lval.n = make_constant(yytext, PCB_OBJ_RAT); return T_CONST; } "PADSTACK" { qry_lval.n = make_constant(yytext, PCB_OBJ_PSTK); return T_CONST; } "PSTK" { qry_lval.n = make_constant(yytext, PCB_OBJ_PSTK); return T_CONST; }