Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4773) +++ trunk/src/action_helper.c (revision 4774) @@ -79,8 +79,8 @@ *y = ((TextTypePtr) ptr2)->Y; break; case PCB_TYPE_ELEMENT: - *x = ((ElementTypePtr) ptr2)->MarkX; - *y = ((ElementTypePtr) ptr2)->MarkY; + *x = ((pcb_element_t *) ptr2)->MarkX; + *y = ((pcb_element_t *) ptr2)->MarkY; break; case PCB_TYPE_POLYGON: *x = ((pcb_polygon_t *) ptr2)->Points[0].X; @@ -704,7 +704,7 @@ { type = SearchScreen(Note.X, Note.Y, PCB_TYPEMASK_LOCK, &ptr1, &ptr2, &ptr3); if (type == PCB_TYPE_ELEMENT) { - ElementTypePtr element = (ElementTypePtr) ptr2; + pcb_element_t *element = (pcb_element_t *) ptr2; TOGGLE_FLAG(PCB_FLAG_LOCK, element); PIN_LOOP(element); @@ -1079,13 +1079,13 @@ case PCB_MODE_PASTE_BUFFER: { TextType estr[MAX_ELEMENTNAMES]; - ElementTypePtr e = 0; + pcb_element_t *e = 0; if (gui->shift_is_pressed()) { int type = SearchScreen(Note.X, Note.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3); if (type == PCB_TYPE_ELEMENT) { - e = (ElementTypePtr) ptr1; + e = (pcb_element_t *) ptr1; if (e) { int i; @@ -1103,7 +1103,7 @@ &ptr3); if (type == PCB_TYPE_ELEMENT && ptr1) { int i, save_n; - e = (ElementTypePtr) ptr1; + e = (pcb_element_t *) ptr1; save_n = NAME_INDEX(); Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4773) +++ trunk/src/buffer.c (revision 4774) @@ -154,7 +154,7 @@ const char *name = ACTION_ARG(0); const char *refdes = ACTION_ARG(1); const char *value = ACTION_ARG(2); - ElementTypePtr e; + pcb_element_t *e; if (!name) AFAIL(loadfootprint); Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 4773) +++ trunk/src/change.c (revision 4774) @@ -1227,7 +1227,7 @@ break; case PCB_TYPE_ELEMENT: - name = gui->prompt_for(_("Elementname:"), EMPTY(ELEMENT_NAME(PCB, (ElementTypePtr) Ptr2))); + name = gui->prompt_for(_("Elementname:"), EMPTY(ELEMENT_NAME(PCB, (pcb_element_t *) Ptr2))); break; } if (name) { Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 4773) +++ trunk/src/crosshair.c (revision 4774) @@ -54,7 +54,7 @@ * some local prototypes */ static void XORPolygon(pcb_polygon_t *, Coord, Coord, int); -static void XORDrawElement(ElementTypePtr, Coord, Coord); +static void XORDrawElement(pcb_element_t *, Coord, Coord); static void XORDrawBuffer(pcb_buffer_t *); static void XORDrawInsertPointObject(void); static void XORDrawMoveOrCopyObject(void); @@ -207,7 +207,7 @@ /* --------------------------------------------------------------------------- * draws the elements of a loaded circuit which is to be merged in */ -static void XORDrawElement(ElementTypePtr Element, Coord DX, Coord DY) +static void XORDrawElement(pcb_element_t *Element, Coord DX, Coord DY) { /* if no silkscreen, draw the bounding box */ if (arclist_length(&Element->Arc) == 0 && linelist_length(&Element->Line) == 0) { @@ -432,7 +432,7 @@ case PCB_TYPE_ELEMENT_NAME: { /* locate the element "mark" and draw an association line from crosshair to it */ - ElementTypePtr element = (ElementTypePtr) Crosshair.AttachedObject.Ptr1; + pcb_element_t *element = (pcb_element_t *) Crosshair.AttachedObject.Ptr1; gui->draw_line(Crosshair.GC, element->MarkX, element->MarkY, Crosshair.X, Crosshair.Y); /* fall through to move the text as a box outline */ @@ -449,7 +449,7 @@ case PCB_TYPE_PAD: case PCB_TYPE_PIN: case PCB_TYPE_ELEMENT: - XORDrawElement((ElementTypePtr) Crosshair.AttachedObject.Ptr2, dx, dy); + XORDrawElement((pcb_element_t *) Crosshair.AttachedObject.Ptr2, dx, dy); break; } @@ -1028,7 +1028,7 @@ ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3); if (ans & PCB_TYPE_ELEMENT) { - ElementType *el = (ElementType *) ptr1; + pcb_element_t *el = (pcb_element_t *) ptr1; check_snap_object(&snap_data, el->MarkX, el->MarkY, pcb_false); } Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 4773) +++ trunk/src/data.c (revision 4774) @@ -197,7 +197,7 @@ FreeElementMemory(element); } END_LOOP; - list_map0(&data->Element, ElementType, RemoveFreeElement); + list_map0(&data->Element, pcb_element_t, RemoveFreeElement); list_map0(&data->Rat, pcb_rat_t, RemoveFreeRat); for (layer = data->Layer, i = 0; i < MAX_LAYER + 2; layer++, i++) { Index: trunk/src/data.h =================================================================== --- trunk/src/data.h (revision 4773) +++ trunk/src/data.h (revision 4774) @@ -95,12 +95,12 @@ typedef void (*pcb_poly_cb_t)(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_polygon_t *poly); /* element callbacks */ -typedef int (*pcb_element_cb_t)(void *ctx, pcb_board_t *pcb, ElementType *element, int enter); -typedef void (*pcb_eline_cb_t)(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_line_t *line); -typedef void (*pcb_earc_cb_t)(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_arc_t *arc); -typedef void (*pcb_etext_cb_t)(void *ctx, pcb_board_t *pcb, ElementType *element, TextType *text); -typedef void (*pcb_epin_cb_t)(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pin_t *pin); -typedef void (*pcb_epad_cb_t)(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pad_t *pad); +typedef int (*pcb_element_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, int enter); +typedef void (*pcb_eline_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line); +typedef void (*pcb_earc_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc); +typedef void (*pcb_etext_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, TextType *text); +typedef void (*pcb_epin_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin); +typedef void (*pcb_epad_cb_t)(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad); /* via callbacks */ typedef void (*pcb_via_cb_t)(void *ctx, pcb_board_t *pcb, pcb_pin_t *via); Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 4773) +++ trunk/src/draw.c (revision 4774) @@ -506,7 +506,7 @@ ErasePolygon((pcb_polygon_t *) ptr); break; case PCB_TYPE_ELEMENT: - EraseElement((ElementTypePtr) ptr); + EraseElement((pcb_element_t *) ptr); break; case PCB_TYPE_LINE: case PCB_TYPE_ELEMENT_LINE: @@ -550,8 +550,8 @@ DrawPolygon((pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr2); break; case PCB_TYPE_ELEMENT: - if (PCB->ElementOn && (FRONT((ElementTypePtr) ptr2) || PCB->InvisibleObjectsOn)) - DrawElement((ElementTypePtr) ptr2); + if (PCB->ElementOn && (FRONT((pcb_element_t *) ptr2) || PCB->InvisibleObjectsOn)) + DrawElement((pcb_element_t *) ptr2); break; case PCB_TYPE_RATLINE: if (PCB->RatOn) @@ -566,8 +566,8 @@ DrawPad((pcb_pad_t *) ptr2); break; case PCB_TYPE_ELEMENT_NAME: - if (PCB->ElementOn && (FRONT((ElementTypePtr) ptr2) || PCB->InvisibleObjectsOn)) - DrawElementName((ElementTypePtr) ptr1); + if (PCB->ElementOn && (FRONT((pcb_element_t *) ptr2) || PCB->InvisibleObjectsOn)) + DrawElementName((pcb_element_t *) ptr1); break; } } @@ -590,7 +590,7 @@ if (item) { pcb_draw_doing_pinout = pcb_true; - draw_element((ElementType *) item); + draw_element((pcb_element_t *) item); pcb_draw_doing_pinout = pcb_false; } else Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 4773) +++ trunk/src/file_act.c (revision 4774) @@ -300,13 +300,13 @@ } if (strcasecmp(function, "ElementConnections") == 0) { - ElementTypePtr element; + pcb_element_t *element; void *ptrtmp; FILE *fp; pcb_bool result; if ((SearchScreen(Crosshair.X, Crosshair.Y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) { - element = (ElementTypePtr) ptrtmp; + element = (pcb_element_t *) ptrtmp; if ((fp = CheckAndOpenFile(name, pcb_true, pcb_false, &result, NULL)) != NULL) { LookupElementConnections(element, fp); fclose(fp); Index: trunk/src/find.c =================================================================== --- trunk/src/find.c (revision 4773) +++ trunk/src/find.c (revision 4774) @@ -162,12 +162,12 @@ static pcb_bool LookupLOConnectionsToRatEnd(pcb_point_t *, pcb_cardinal_t); static pcb_bool IsRatPointOnLineEnd(pcb_point_t *, pcb_line_t *); static pcb_bool ArcArcIntersect(pcb_arc_t *, pcb_arc_t *); -static pcb_bool PrintElementConnections(ElementTypePtr, FILE *, pcb_bool); +static pcb_bool PrintElementConnections(pcb_element_t *, FILE *, pcb_bool); static pcb_bool ListsEmpty(pcb_bool); static pcb_bool DoIt(pcb_bool, pcb_bool); -static void PrintElementNameList(ElementTypePtr, FILE *); -static void PrintConnectionElementName(ElementTypePtr, FILE *); -static void PrintConnectionListEntry(char *, ElementTypePtr, pcb_bool, FILE *); +static void PrintElementNameList(pcb_element_t *, FILE *); +static void PrintConnectionElementName(pcb_element_t *, FILE *); +static void PrintConnectionListEntry(char *, pcb_element_t *, pcb_bool, FILE *); static void PrintPadConnections(pcb_cardinal_t, FILE *, pcb_bool); static void PrintPinConnections(FILE *, pcb_bool); static void DumpList(void); Index: trunk/src/find.h =================================================================== --- trunk/src/find.h (revision 4773) +++ trunk/src/find.h (revision 4774) @@ -66,7 +66,7 @@ pcb_bool LinePadIntersect(pcb_line_t *, pcb_pad_t *); pcb_bool ArcPadIntersect(pcb_arc_t *, pcb_pad_t *); pcb_bool IsPolygonInPolygon(pcb_polygon_t *, pcb_polygon_t *); -void LookupElementConnections(ElementTypePtr, FILE *); +void LookupElementConnections(pcb_element_t *, FILE *); void LookupConnectionsToAllElements(FILE *); void LookupConnection(Coord, Coord, pcb_bool, Coord, int); void LookupConnectionByPin(int type, void *ptr1); Index: trunk/src/find_debug.c =================================================================== --- trunk/src/find_debug.c (revision 4773) +++ trunk/src/find_debug.c (revision 4774) @@ -30,7 +30,7 @@ /* --------------------------------------------------------------------------- * writes the several names of an element to a file */ -static void PrintElementNameList(ElementTypePtr Element, FILE * FP) +static void PrintElementNameList(pcb_element_t *Element, FILE * FP) { fputc('(', FP); PrintQuotedString(FP, (char *) EMPTY(DESCRIPTION_NAME(Element))); @@ -45,7 +45,7 @@ /* --------------------------------------------------------------------------- * writes the several names of an element to a file */ -static void PrintConnectionElementName(ElementTypePtr Element, FILE * FP) +static void PrintConnectionElementName(pcb_element_t *Element, FILE * FP) { fputs("Element", FP); PrintElementNameList(Element, FP); @@ -55,7 +55,7 @@ /* --------------------------------------------------------------------------- * prints one {pin,pad,via}/element entry of connection lists */ -static void PrintConnectionListEntry(char *ObjName, ElementTypePtr Element, pcb_bool FirstOne, FILE * FP) +static void PrintConnectionListEntry(char *ObjName, pcb_element_t *Element, pcb_bool FirstOne, FILE * FP) { if (FirstOne) { fputc('\t', FP); @@ -100,7 +100,7 @@ for (i = IsFirst ? 1 : 0; i < PadList[Layer].Number; i++) { ptr = PADLIST_ENTRY(Layer, i); if (ptr != NULL) - PrintConnectionListEntry((char *) EMPTY(ptr->Name), (ElementTypePtr) ptr->Element, pcb_false, FP); + PrintConnectionListEntry((char *) EMPTY(ptr->Name), (pcb_element_t *) ptr->Element, pcb_false, FP); else printf("Skipping NULL ptr in 2nd part of PrintPadConnections\n"); } @@ -130,6 +130,6 @@ for (i = IsFirst ? 1 : 0; i < PVList.Number; i++) { /* get the elements name or assume that its a via */ pv = PVLIST_ENTRY(i); - PrintConnectionListEntry((char *) EMPTY(pv->Name), (ElementTypePtr) pv->Element, pcb_false, FP); + PrintConnectionListEntry((char *) EMPTY(pv->Name), (pcb_element_t *) pv->Element, pcb_false, FP); } } Index: trunk/src/find_drc.c =================================================================== --- trunk/src/find_drc.c (revision 4773) +++ trunk/src/find_drc.c (revision 4774) @@ -168,7 +168,7 @@ } case PCB_TYPE_ELEMENT: { - ElementTypePtr element = (ElementTypePtr) thing_ptr3; + pcb_element_t *element = (pcb_element_t *) thing_ptr3; *x = element->MarkX; *y = element->MarkY; break; Index: trunk/src/find_lookup.c =================================================================== --- trunk/src/find_lookup.c (revision 4773) +++ trunk/src/find_lookup.c (revision 4774) @@ -571,7 +571,7 @@ internal connection group number, they are connected */ ic = GET_INTCONN(orig_pin); if ((info.pv.Element != NULL) && (ic > 0)) { - ElementType *e = info.pv.Element; + pcb_element_t *e = info.pv.Element; PIN_LOOP(e); { if ((orig_pin != pin) && (ic == GET_INTCONN(pin))) { @@ -1224,7 +1224,7 @@ internal connection group number, they are connected */ ic = GET_INTCONN(Pad); if ((Pad->Element != NULL) && (ic > 0)) { - ElementType *e = Pad->Element; + pcb_element_t *e = Pad->Element; pcb_pad_t *orig_pad = Pad; int tlayer = -1; Index: trunk/src/find_print.c =================================================================== --- trunk/src/find_print.c (revision 4773) +++ trunk/src/find_print.c (revision 4774) @@ -32,7 +32,7 @@ /* --------------------------------------------------------------------------- * prints all unused pins of an element to file FP */ -static pcb_bool PrintAndSelectUnusedPinsAndPadsOfElement(ElementTypePtr Element, FILE * FP) +static pcb_bool PrintAndSelectUnusedPinsAndPadsOfElement(pcb_element_t *Element, FILE * FP) { pcb_bool first = pcb_true; pcb_cardinal_t number; @@ -157,7 +157,7 @@ * The result is written to file FP * Returns pcb_true if operation was aborted */ -static pcb_bool PrintElementConnections(ElementTypePtr Element, FILE * FP, pcb_bool AndDraw) +static pcb_bool PrintElementConnections(pcb_element_t *Element, FILE * FP, pcb_bool AndDraw) { PrintConnectionElementName(Element, FP); @@ -241,7 +241,7 @@ /* --------------------------------------------------------------------------- * find all connections to pins within one element */ -void LookupElementConnections(ElementTypePtr Element, FILE * FP) +void LookupElementConnections(pcb_element_t *Element, FILE * FP) { /* reset all currently marked connections */ User = pcb_true; Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 4773) +++ trunk/src/global_typedefs.h (revision 4774) @@ -44,7 +44,7 @@ typedef struct pin_st pcb_pin_t; typedef struct pcb_rtree_s pcb_rtree_t; typedef struct pcb_ratspatch_line_s pcb_ratspatch_line_t; -typedef struct element_st ElementType, *ElementTypePtr, **ElementTypeHandle; +typedef struct pcb_element_s pcb_element_t; typedef struct pcb_text_s TextType, *TextTypePtr; typedef struct plug_io_s plug_io_t; Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 4773) +++ trunk/src/gui_act.c (revision 4774) @@ -436,13 +436,13 @@ /* display the pinout of an element */ case F_Pinout: { - ElementTypePtr element; + pcb_element_t *element; void *ptrtmp; Coord x, y; gui->get_coords(_("Click on an element"), &x, &y); if ((SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) { - element = (ElementTypePtr) ptrtmp; + element = (pcb_element_t *) ptrtmp; gui->show_item(element); } break; @@ -459,7 +459,7 @@ PCB_TYPE_ELEMENT | PCB_TYPE_PIN | PCB_TYPE_PAD | PCB_TYPE_VIA, (void **) &ptr1, (void **) &ptr2, (void **) &ptr3)) { case PCB_TYPE_ELEMENT: - PIN_LOOP((ElementTypePtr) ptr1); + PIN_LOOP((pcb_element_t *) ptr1); { if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, pin)) ErasePinName(pin); @@ -469,7 +469,7 @@ TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, pin); } END_LOOP; - PAD_LOOP((ElementTypePtr) ptr1); + PAD_LOOP((pcb_element_t *) ptr1); { if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, pad)) ErasePadName(pad); @@ -919,9 +919,9 @@ gui->get_coords(_("Select an Object"), &x, &y); if ((type = SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { AddObjectToFlagUndoList(type, ptr1, ptr2, ptr3); - EraseElementName((ElementTypePtr) ptr2); - TOGGLE_FLAG(PCB_FLAG_HIDENAME, (ElementTypePtr) ptr2); - DrawElementName((ElementTypePtr) ptr2); + EraseElementName((pcb_element_t *) ptr2); + TOGGLE_FLAG(PCB_FLAG_HIDENAME, (pcb_element_t *) ptr2); + DrawElementName((pcb_element_t *) ptr2); Draw(); IncrementUndoSerialNumber(); } Index: trunk/src/ht_element.c =================================================================== --- trunk/src/ht_element.c (revision 4773) +++ trunk/src/ht_element.c (revision 4774) @@ -34,7 +34,7 @@ #define h_str(s) ((s) == NULL ? 0 : strhash(s)) -int pcb_pin_eq(const ElementType *e1, const pcb_pin_t *p1, const ElementType *e2, const pcb_pin_t *p2) +int pcb_pin_eq(const pcb_element_t *e1, const pcb_pin_t *p1, const pcb_element_t *e2, const pcb_pin_t *p2) { if (neq(p1, p2, Thickness) || neq(p1, p2, Clearance)) return 0; if (neq(p1, p2, Mask) || neq(p1, p2, DrillingHole)) return 0; @@ -44,7 +44,7 @@ return 1; } -unsigned int pcb_pin_hash(const ElementType *e, const pcb_pin_t *p) +unsigned int pcb_pin_hash(const pcb_element_t *e, const pcb_pin_t *p) { return h_coord(p->Thickness) ^ h_coord(p->Clearance) ^ @@ -53,7 +53,7 @@ h_str(p->Name) ^ h_str(p->Number); } -int pcb_pad_eq(const ElementType *e1, const pcb_pad_t *p1, const ElementType *e2, const pcb_pad_t *p2) +int pcb_pad_eq(const pcb_element_t *e1, const pcb_pad_t *p1, const pcb_element_t *e2, const pcb_pad_t *p2) { if (neq(p1, p2, Thickness) || neq(p1, p2, Clearance)) return 0; if (neqox(e1, p1, e2, p2, Point1.X) || neqoy(e1, p1, e2, p2, Point1.Y)) return 0; @@ -64,7 +64,7 @@ return 1; } -unsigned int pcb_pad_hash(const ElementType *e, const pcb_pad_t *p) +unsigned int pcb_pad_hash(const pcb_element_t *e, const pcb_pad_t *p) { return h_coord(p->Thickness) ^ h_coord(p->Clearance) ^ @@ -75,7 +75,7 @@ } -int pcb_line_eq(const ElementType *e1, const pcb_line_t *l1, const ElementType *e2, const pcb_line_t *l2) +int pcb_line_eq(const pcb_element_t *e1, const pcb_line_t *l1, const pcb_element_t *e2, const pcb_line_t *l2) { if (neq(l1, l2, Thickness) || neq(l1, l2, Clearance)) return 0; if (neqox(e1, l1, e2, l2, Point1.X) || neqoy(e1, l1, e2, l2, Point1.Y)) return 0; @@ -85,7 +85,7 @@ } -unsigned int pcb_line_hash(const ElementType *e, const pcb_line_t *l) +unsigned int pcb_line_hash(const pcb_element_t *e, const pcb_line_t *l) { return h_coord(l->Thickness) ^ h_coord(l->Clearance) ^ @@ -94,7 +94,7 @@ h_str(l->Number); } -int pcb_arc_eq(const ElementType *e1, const pcb_arc_t *a1, const ElementType *e2, const pcb_arc_t *a2) +int pcb_arc_eq(const pcb_element_t *e1, const pcb_arc_t *a1, const pcb_element_t *e2, const pcb_arc_t *a2) { if (neq(a1, a2, Thickness) || neq(a1, a2, Clearance)) return 0; if (neq(a1, a2, Width) || neq(a1, a2, Height)) return 0; @@ -104,7 +104,7 @@ return 1; } -unsigned int pcb_arc_hash(const ElementType *e, const pcb_arc_t *a) +unsigned int pcb_arc_hash(const pcb_element_t *e, const pcb_arc_t *a) { return h_coord(a->Thickness) ^ h_coord(a->Clearance) ^ @@ -116,7 +116,7 @@ #undef h_coord #undef neq -unsigned int pcb_element_hash(const ElementType *e) +unsigned int pcb_element_hash(const pcb_element_t *e) { unsigned int val = 0; gdl_iterator_t it; @@ -152,7 +152,7 @@ return val; } -int pcb_element_eq(const ElementType *e1, const ElementType *e2) +int pcb_element_eq(const pcb_element_t *e1, const pcb_element_t *e2) { /* Require the same objects in the same order - bail out at the first mismatch */ Index: trunk/src/ht_element.h =================================================================== --- trunk/src/ht_element.h (revision 4773) +++ trunk/src/ht_element.h (revision 4774) @@ -2,7 +2,7 @@ #define PCB_HT_ELEMENT_H /* hash instance */ -typedef const ElementType *htep_key_t; +typedef const pcb_element_t *htep_key_t; typedef int htep_value_t; #define HT(x) htep_ ## x #include Index: trunk/src/netlist.c =================================================================== --- trunk/src/netlist.c (revision 4773) +++ trunk/src/netlist.c (revision 4774) @@ -222,7 +222,7 @@ LibraryMenuTypePtr pcb_netlist_find_net4pin(pcb_board_t *pcb, const pcb_pin_t *pin) { - const ElementType *e = pin->Element; + const pcb_element_t *e = pin->Element; if (e == NULL) return NULL; @@ -233,7 +233,7 @@ LibraryMenuTypePtr pcb_netlist_find_net4pad(pcb_board_t *pcb, const pcb_pad_t *pad) { - const ElementType *e = pad->Element; + const pcb_element_t *e = pad->Element; if (e == NULL) return NULL; Index: trunk/src/obj_any.h =================================================================== --- trunk/src/obj_any.h (revision 4773) +++ trunk/src/obj_any.h (revision 4774) @@ -87,7 +87,7 @@ pcb_pad_t *pad; pcb_pin_t *pin; pcb_pin_t *via; - ElementType *element; + pcb_element_t *element; pcb_net_t *net; pcb_layer_t *layer; } data; @@ -97,7 +97,7 @@ void *any; pcb_layer_t *layer; pcb_data_t *data; - ElementType *element; + pcb_element_t *element; } parent; gdl_elem_t link; }; Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 4773) +++ trunk/src/obj_arc.c (revision 4774) @@ -55,7 +55,7 @@ return new_obj; } -pcb_arc_t *GetElementArcMemory(ElementType *Element) +pcb_arc_t *GetElementArcMemory(pcb_element_t *Element) { pcb_arc_t *arc = calloc(sizeof(pcb_arc_t), 1); Index: trunk/src/obj_arc.h =================================================================== --- trunk/src/obj_arc.h (revision 4773) +++ trunk/src/obj_arc.h (revision 4774) @@ -43,7 +43,7 @@ /*** Memory ***/ pcb_arc_t *GetArcMemory(pcb_layer_t *); -pcb_arc_t *GetElementArcMemory(ElementType *Element); +pcb_arc_t *GetElementArcMemory(pcb_element_t *Element); void RemoveFreeArc(pcb_arc_t *data); /*** Utility ***/ Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4773) +++ trunk/src/obj_elem.c (revision 4774) @@ -59,17 +59,17 @@ /*** allocation ***/ /* get next slot for an element, allocates memory if necessary */ -ElementType *GetElementMemory(pcb_data_t * data) +pcb_element_t *GetElementMemory(pcb_data_t * data) { - ElementType *new_obj; + pcb_element_t *new_obj; - new_obj = calloc(sizeof(ElementType), 1); + new_obj = calloc(sizeof(pcb_element_t), 1); elementlist_append(&data->Element, new_obj); return new_obj; } -void RemoveFreeElement(ElementType * data) +void RemoveFreeElement(pcb_element_t * data) { elementlist_remove(data); free(data); @@ -76,7 +76,7 @@ } /* frees memory used by an element */ -void FreeElementMemory(ElementType * element) +void FreeElementMemory(pcb_element_t * element) { if (element == NULL) return; @@ -105,10 +105,10 @@ list_map0(&element->Arc, pcb_arc_t, RemoveFreeArc); FreeAttributeListMemory(&element->Attributes); - reset_obj_mem(ElementType, element); + reset_obj_mem(pcb_element_t, element); } -pcb_line_t *GetElementLineMemory(ElementType *Element) +pcb_line_t *GetElementLineMemory(pcb_element_t *Element) { pcb_line_t *line = calloc(sizeof(pcb_line_t), 1); linelist_append(&Element->Line, line); @@ -124,7 +124,7 @@ */ pcb_bool LoadElementToBuffer(pcb_buffer_t *Buffer, const char *Name) { - ElementTypePtr element; + pcb_element_t *element; ClearBuffer(Buffer); if (!ParseElement(Buffer->Data, Name)) { @@ -160,7 +160,7 @@ /* break buffer element into pieces */ pcb_bool SmashBufferElement(pcb_buffer_t *Buffer) { - ElementTypePtr element; + pcb_element_t *element; pcb_cardinal_t group; pcb_layer_t *clayer, *slayer; @@ -255,7 +255,7 @@ /* convert buffer contents into an element */ pcb_bool ConvertBufferToElement(pcb_buffer_t *Buffer) { - ElementTypePtr Element; + pcb_element_t *Element; pcb_cardinal_t group; pcb_cardinal_t pin_n = 1; pcb_bool hasParts = pcb_false, crooked = pcb_false; @@ -391,7 +391,7 @@ return (pcb_true); } -void FreeRotateElementLowLevel(pcb_data_t *Data, ElementTypePtr Element, Coord X, Coord Y, double cosa, double sina, Angle angle) +void FreeRotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord X, Coord Y, double cosa, double sina, Angle angle) { /* solder side objects need a different orientation */ @@ -448,7 +448,7 @@ } /* changes the side of the board an element is on; returns pcb_true if done */ -pcb_bool ChangeElementSide(ElementTypePtr Element, Coord yoff) +pcb_bool ChangeElementSide(pcb_element_t *Element, Coord yoff) { if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (pcb_false); @@ -481,7 +481,7 @@ } /* changes the layout-name of an element */ -char *ChangeElementText(pcb_board_t * pcb, pcb_data_t * data, ElementTypePtr Element, int which, char *new_name) +char *ChangeElementText(pcb_board_t * pcb, pcb_data_t * data, pcb_element_t *Element, int which, char *new_name) { char *old = Element->Name[which].TextString; @@ -506,7 +506,7 @@ } /* copies data from one element to another and creates the destination; if necessary */ -ElementTypePtr CopyElementLowLevel(pcb_data_t *Data, ElementTypePtr Dest, ElementTypePtr Src, pcb_bool uniqueName, Coord dx, Coord dy) +pcb_element_t *CopyElementLowLevel(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, Coord dx, Coord dy) { int i; /* release old memory if necessary */ @@ -562,7 +562,7 @@ } /* creates an new element; memory is allocated if needed */ -ElementTypePtr CreateNewElement(pcb_data_t *Data, ElementTypePtr Element, +pcb_element_t *CreateNewElement(pcb_data_t *Data, pcb_element_t *Element, pcb_font_t *PCBFont, FlagType Flags, char *Description, char *NameOnPCB, char *Value, Coord TextX, Coord TextY, pcb_uint8_t Direction, int TextScale, FlagType TextFlags, pcb_bool uniqueName) @@ -595,7 +595,7 @@ } /* creates a new arc in an element */ -pcb_arc_t *CreateNewArcInElement(ElementTypePtr Element, Coord X, Coord Y, +pcb_arc_t *CreateNewArcInElement(pcb_element_t *Element, Coord X, Coord Y, Coord Width, Coord Height, Angle angle, Angle delta, Coord Thickness) { pcb_arc_t *arc = GetElementArcMemory(Element); @@ -623,7 +623,7 @@ } /* creates a new line for an element */ -pcb_line_t *CreateNewLineInElement(ElementTypePtr Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness) +pcb_line_t *CreateNewLineInElement(pcb_element_t *Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness) { pcb_line_t *line; @@ -662,7 +662,7 @@ } /* mirrors the coordinates of an element; an additional offset is passed */ -void MirrorElementCoordinates(pcb_data_t *Data, ElementTypePtr Element, Coord yoff) +void MirrorElementCoordinates(pcb_data_t *Data, pcb_element_t *Element, Coord yoff) { r_delete_element(Data, Element); ELEMENTLINE_LOOP(Element); @@ -716,7 +716,7 @@ } /* sets the bounding box of an elements */ -void SetElementBoundingBox(pcb_data_t *Data, ElementTypePtr Element, pcb_font_t *Font) +void SetElementBoundingBox(pcb_data_t *Data, pcb_element_t *Element, pcb_font_t *Font) { pcb_box_t *box, *vbox; @@ -902,7 +902,7 @@ } } -void r_delete_element(pcb_data_t * data, ElementType * element) +void r_delete_element(pcb_data_t * data, pcb_element_t * element) { r_delete_entry(data->element_tree, (pcb_box_t *) element); PIN_LOOP(element); @@ -928,7 +928,7 @@ * indication of absolute rotation; only relative rotation is * meaningful. */ -int ElementOrientation(ElementType * e) +int ElementOrientation(pcb_element_t * e) { Coord pin1x, pin1y, pin2x, pin2y, dx, dy; pcb_bool found_pin1 = 0; @@ -991,7 +991,7 @@ } /* moves a element by +-X and +-Y */ -void MoveElementLowLevel(pcb_data_t *Data, ElementTypePtr Element, Coord DX, Coord DY) +void MoveElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord DX, Coord DY) { if (Data) r_delete_entry(Data->element_tree, (pcb_box_t *) Element); @@ -1047,7 +1047,7 @@ r_insert_entry(Data->element_tree, (pcb_box_t *) Element, 0); } -void *RemoveElement(ElementTypePtr Element) +void *RemoveElement(pcb_element_t *Element) { pcb_opctx_t ctx; @@ -1059,7 +1059,7 @@ } /* rotate an element in 90 degree steps */ -void RotateElementLowLevel(pcb_data_t *Data, ElementTypePtr Element, Coord X, Coord Y, unsigned Number) +void RotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord X, Coord Y, unsigned Number) { /* solder side objects need a different orientation */ @@ -1110,9 +1110,9 @@ /*** ops ***/ /* copies a element to buffer */ -void *AddElementToBuffer(pcb_opctx_t *ctx, ElementTypePtr Element) +void *AddElementToBuffer(pcb_opctx_t *ctx, pcb_element_t *Element) { - ElementTypePtr element; + pcb_element_t *element; element = GetElementMemory(ctx->buffer.dst); CopyElementLowLevel(ctx->buffer.dst, element, Element, pcb_false, 0, 0); @@ -1138,7 +1138,7 @@ } /* moves a element to buffer without allocating memory for pins/names */ -void *MoveElementToBuffer(pcb_opctx_t *ctx, ElementType * element) +void *MoveElementToBuffer(pcb_opctx_t *ctx, pcb_element_t * element) { /* * Delete the element from the source (remove it from trees, @@ -1181,7 +1181,7 @@ /* changes the drilling hole of all pins of an element; returns pcb_true if changed */ -void *ChangeElement2ndSize(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ChangeElement2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element) { pcb_bool changed = pcb_false; Coord value; @@ -1215,7 +1215,7 @@ } /* changes ring dia of all pins of an element; returns pcb_true if changed */ -void *ChangeElement1stSize(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ChangeElement1stSize(pcb_opctx_t *ctx, pcb_element_t *Element) { pcb_bool changed = pcb_false; Coord value; @@ -1247,7 +1247,7 @@ } /* changes the clearance of all pins of an element; returns pcb_true if changed */ -void *ChangeElementClearSize(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ChangeElementClearSize(pcb_opctx_t *ctx, pcb_element_t *Element) { pcb_bool changed = pcb_false; Coord value; @@ -1305,7 +1305,7 @@ } /* changes the scaling factor of an element's outline; returns pcb_true if changed */ -void *ChangeElementSize(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ChangeElementSize(pcb_opctx_t *ctx, pcb_element_t *Element) { Coord value; pcb_bool changed = pcb_false; @@ -1343,7 +1343,7 @@ } /* changes the scaling factor of a elementname object; returns pcb_true if changed */ -void *ChangeElementNameSize(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ChangeElementNameSize(pcb_opctx_t *ctx, pcb_element_t *Element) { int value = ctx->chgsize.absolute ? PCB_COORD_TO_MIL(ctx->chgsize.absolute) : DESCRIPTION_TEXT(Element).Scale + PCB_COORD_TO_MIL(ctx->chgsize.delta); @@ -1368,7 +1368,7 @@ } -void *ChangeElementName(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ChangeElementName(pcb_opctx_t *ctx, pcb_element_t *Element) { if (TEST_FLAG(PCB_FLAG_LOCK, &Element->Name[0])) return (NULL); @@ -1382,7 +1382,7 @@ return ChangeElementText(PCB, PCB->Data, Element, NAME_INDEX(), ctx->chgname.new_name); } -void *ChangeElementNonetlist(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ChangeElementNonetlist(pcb_opctx_t *ctx, pcb_element_t *Element) { if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); @@ -1392,7 +1392,7 @@ /* changes the square flag of all pins on an element */ -void *ChangeElementSquare(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ChangeElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element) { void *ans = NULL; @@ -1412,7 +1412,7 @@ } /* sets the square flag of all pins on an element */ -void *SetElementSquare(pcb_opctx_t *ctx, ElementTypePtr Element) +void *SetElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element) { void *ans = NULL; @@ -1432,7 +1432,7 @@ } /* clears the square flag of all pins on an element */ -void *ClrElementSquare(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ClrElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element) { void *ans = NULL; @@ -1452,7 +1452,7 @@ } /* changes the octagon flags of all pins of an element */ -void *ChangeElementOctagon(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ChangeElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element) { void *result = NULL; @@ -1468,7 +1468,7 @@ } /* sets the octagon flags of all pins of an element */ -void *SetElementOctagon(pcb_opctx_t *ctx, ElementTypePtr Element) +void *SetElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element) { void *result = NULL; @@ -1484,7 +1484,7 @@ } /* clears the octagon flags of all pins of an element */ -void *ClrElementOctagon(pcb_opctx_t *ctx, ElementTypePtr Element) +void *ClrElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element) { void *result = NULL; @@ -1500,7 +1500,7 @@ } /* copies an element onto the PCB. Then does a draw. */ -void *CopyElement(pcb_opctx_t *ctx, ElementTypePtr Element) +void *CopyElement(pcb_opctx_t *ctx, pcb_element_t *Element) { #ifdef DEBUG @@ -1507,7 +1507,7 @@ printf("Entered CopyElement, trying to copy element %s\n", Element->Name[1].TextString); #endif - ElementTypePtr element = CopyElementLowLevel(PCB->Data, + pcb_element_t *element = CopyElementLowLevel(PCB->Data, NULL, Element, conf_core.editor.unique_names, ctx->copy.DeltaX, ctx->copy.DeltaY); @@ -1528,7 +1528,7 @@ } /* moves all names of an element to a new position */ -void *MoveElementName(pcb_opctx_t *ctx, ElementTypePtr Element) +void *MoveElementName(pcb_opctx_t *ctx, pcb_element_t *Element) { if (PCB->ElementOn && (FRONT(Element) || PCB->InvisibleObjectsOn)) { EraseElementName(Element); @@ -1559,7 +1559,7 @@ } /* moves an element */ -void *MoveElement(pcb_opctx_t *ctx, ElementTypePtr Element) +void *MoveElement(pcb_opctx_t *ctx, pcb_element_t *Element) { pcb_bool didDraw = pcb_false; @@ -1585,7 +1585,7 @@ } /* destroys a element */ -void *DestroyElement(pcb_opctx_t *ctx, ElementTypePtr Element) +void *DestroyElement(pcb_opctx_t *ctx, pcb_element_t *Element) { if (ctx->remove.destroy_target->element_tree) r_delete_entry(ctx->remove.destroy_target->element_tree, (pcb_box_t *) Element); @@ -1617,7 +1617,7 @@ } /* removes an element */ -void *RemoveElement_op(pcb_opctx_t *ctx, ElementTypePtr Element) +void *RemoveElement_op(pcb_opctx_t *ctx, pcb_element_t *Element) { /* erase from screen */ if ((PCB->ElementOn || PCB->PinOn) && (FRONT(Element) || PCB->InvisibleObjectsOn)) { @@ -1630,7 +1630,7 @@ } /* rotates an element */ -void *RotateElement(pcb_opctx_t *ctx, ElementTypePtr Element) +void *RotateElement(pcb_opctx_t *ctx, pcb_element_t *Element) { EraseElement(Element); RotateElementLowLevel(PCB->Data, Element, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number); @@ -1642,7 +1642,7 @@ /* ---------------------------------------------------------------------- * rotates the name of an element */ -void *RotateElementName(pcb_opctx_t *ctx, ElementTypePtr Element) +void *RotateElementName(pcb_opctx_t *ctx, pcb_element_t *Element) { EraseElementName(Element); ELEMENTTEXT_LOOP(Element); @@ -1658,7 +1658,7 @@ } /*** draw ***/ -void draw_element_name(ElementType * element) +void draw_element_name(pcb_element_t * element) { if ((conf_core.editor.hide_names && gui->gui) || TEST_FLAG(PCB_FLAG_HIDENAME, element)) return; @@ -1683,7 +1683,7 @@ r_dir_t draw_element_name_callback(const pcb_box_t * b, void *cl) { TextTypePtr text = (TextTypePtr) b; - ElementTypePtr element = (ElementTypePtr) text->Element; + pcb_element_t *element = (pcb_element_t *) text->Element; int *side = cl; if (TEST_FLAG(PCB_FLAG_HIDENAME, element)) @@ -1694,7 +1694,7 @@ return R_DIR_NOT_FOUND; } -void draw_element_pins_and_pads(ElementType * element) +void draw_element_pins_and_pads(pcb_element_t * element) { PAD_LOOP(element); { @@ -1710,7 +1710,7 @@ } -void draw_element_package(ElementType * element) +void draw_element_package(pcb_element_t * element) { /* set color and draw lines, arcs, text and pins */ if (pcb_draw_doing_pinout || pcb_draw_doing_assy) @@ -1735,7 +1735,7 @@ END_LOOP; } -void draw_element(ElementTypePtr element) +void draw_element(pcb_element_t *element) { draw_element_package(element); draw_element_name(element); @@ -1744,7 +1744,7 @@ r_dir_t draw_element_callback(const pcb_box_t * b, void *cl) { - ElementTypePtr element = (ElementTypePtr) b; + pcb_element_t *element = (pcb_element_t *) b; int *side = cl; if (ON_SIDE(element, *side)) @@ -1752,7 +1752,7 @@ return R_DIR_FOUND_CONTINUE; } -static void DrawEMark(ElementTypePtr e, Coord X, Coord Y, pcb_bool invisible) +static void DrawEMark(pcb_element_t *e, Coord X, Coord Y, pcb_bool invisible) { Coord mark_size = EMARK_SIZE; if (!PCB->InvisibleObjectsOn && invisible) @@ -1792,13 +1792,13 @@ r_dir_t draw_element_mark_callback(const pcb_box_t * b, void *cl) { - ElementTypePtr element = (ElementTypePtr) b; + pcb_element_t *element = (pcb_element_t *) b; DrawEMark(element, element->MarkX, element->MarkY, !FRONT(element)); return R_DIR_FOUND_CONTINUE; } -void EraseElement(ElementTypePtr Element) +void EraseElement(pcb_element_t *Element) { ELEMENTLINE_LOOP(Element); { @@ -1815,7 +1815,7 @@ EraseFlags(&Element->Flags); } -void EraseElementPinsAndPads(ElementTypePtr Element) +void EraseElementPinsAndPads(pcb_element_t *Element) { PIN_LOOP(Element); { @@ -1829,7 +1829,7 @@ END_LOOP; } -void EraseElementName(ElementTypePtr Element) +void EraseElementName(pcb_element_t *Element) { if (TEST_FLAG(PCB_FLAG_HIDENAME, Element)) { return; @@ -1837,7 +1837,7 @@ DrawText(NULL, &ELEMENT_TEXT(PCB, Element)); } -void DrawElement(ElementTypePtr Element) +void DrawElement(pcb_element_t *Element) { DrawElementPackage(Element); DrawElementName(Element); @@ -1844,7 +1844,7 @@ DrawElementPinsAndPads(Element); } -void DrawElementName(ElementTypePtr Element) +void DrawElementName(pcb_element_t *Element) { if (TEST_FLAG(PCB_FLAG_HIDENAME, Element)) return; @@ -1851,7 +1851,7 @@ DrawText(NULL, &ELEMENT_TEXT(PCB, Element)); } -void DrawElementPackage(ElementTypePtr Element) +void DrawElementPackage(pcb_element_t *Element) { ELEMENTLINE_LOOP(Element); { @@ -1865,7 +1865,7 @@ END_LOOP; } -void DrawElementPinsAndPads(ElementTypePtr Element) +void DrawElementPinsAndPads(pcb_element_t *Element) { PAD_LOOP(Element); { Index: trunk/src/obj_elem.h =================================================================== --- trunk/src/obj_elem.h (revision 4773) +++ trunk/src/obj_elem.h (revision 4774) @@ -37,7 +37,7 @@ #include "obj_text.h" -struct element_st { +struct pcb_element_s { ANYOBJECTFIELDS; TextType Name[MAX_ELEMENTNAMES]; /* the elements names: description text, name on PCB second, value third - see NAME_INDEX() below */ Coord MarkX, MarkY; /* position mark */ @@ -49,10 +49,10 @@ gdl_elem_t link; }; -ElementType *GetElementMemory(pcb_data_t * data); -void RemoveFreeElement(ElementType * data); -void FreeElementMemory(ElementType * element); -pcb_line_t *GetElementLineMemory(ElementType *Element); +pcb_element_t *GetElementMemory(pcb_data_t * data); +void RemoveFreeElement(pcb_element_t * data); +void FreeElementMemory(pcb_element_t * element); +pcb_line_t *GetElementLineMemory(pcb_element_t *Element); pcb_bool LoadElementToBuffer(pcb_buffer_t *Buffer, const char *Name); @@ -59,32 +59,32 @@ int LoadFootprintByName(pcb_buffer_t *Buffer, const char *Footprint); pcb_bool SmashBufferElement(pcb_buffer_t *Buffer); pcb_bool ConvertBufferToElement(pcb_buffer_t *Buffer); -void FreeRotateElementLowLevel(pcb_data_t *Data, ElementTypePtr Element, Coord X, Coord Y, double cosa, double sina, Angle angle); -pcb_bool ChangeElementSide(ElementTypePtr Element, Coord yoff); +void FreeRotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord X, Coord Y, double cosa, double sina, Angle angle); +pcb_bool ChangeElementSide(pcb_element_t *Element, Coord yoff); pcb_bool ChangeSelectedElementSide(void); -ElementTypePtr CopyElementLowLevel(pcb_data_t *Data, ElementTypePtr Dest, ElementTypePtr Src, pcb_bool uniqueName, Coord dx, Coord dy); -void SetElementBoundingBox(pcb_data_t *Data, ElementTypePtr Element, pcb_font_t *Font); +pcb_element_t *CopyElementLowLevel(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, Coord dx, Coord dy); +void SetElementBoundingBox(pcb_data_t *Data, pcb_element_t *Element, pcb_font_t *Font); char *UniqueElementName(pcb_data_t *Data, char *Name); -void r_delete_element(pcb_data_t * data, ElementType * element); +void r_delete_element(pcb_data_t * data, pcb_element_t * element); /* Return a relative rotation for an element, useful only for comparing two similar footprints. */ -int ElementOrientation(ElementType * e); +int ElementOrientation(pcb_element_t * e); -void MoveElementLowLevel(pcb_data_t *Data, ElementTypePtr Element, Coord DX, Coord DY); -void *RemoveElement(ElementTypePtr Element); -void RotateElementLowLevel(pcb_data_t *Data, ElementTypePtr Element, Coord X, Coord Y, unsigned Number); -void MirrorElementCoordinates(pcb_data_t *Data, ElementTypePtr Element, Coord yoff); +void MoveElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord DX, Coord DY); +void *RemoveElement(pcb_element_t *Element); +void RotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord X, Coord Y, unsigned Number); +void MirrorElementCoordinates(pcb_data_t *Data, pcb_element_t *Element, Coord yoff); -ElementTypePtr CreateNewElement(pcb_data_t *Data, ElementTypePtr Element, +pcb_element_t *CreateNewElement(pcb_data_t *Data, pcb_element_t *Element, pcb_font_t *PCBFont, FlagType Flags, char *Description, char *NameOnPCB, char *Value, Coord TextX, Coord TextY, pcb_uint8_t Direction, int TextScale, FlagType TextFlags, pcb_bool uniqueName); -pcb_arc_t *CreateNewArcInElement(ElementTypePtr Element, Coord X, Coord Y, +pcb_arc_t *CreateNewArcInElement(pcb_element_t *Element, Coord X, Coord Y, Coord Width, Coord Height, Angle angle, Angle delta, Coord Thickness); -pcb_line_t *CreateNewLineInElement(ElementTypePtr Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness); +pcb_line_t *CreateNewLineInElement(pcb_element_t *Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness); void AddTextToElement(TextTypePtr Text, pcb_font_t *PCBFont, Coord X, Coord Y, unsigned Direction, char *TextString, int Scale, FlagType Flags); @@ -93,7 +93,7 @@ /* Change the specified text on an element, either on the board (give PCB, PCB->Data) or in a buffer (give NULL, Buffer->Data). The old string is returned, and must be properly freed by the caller. */ -char *ChangeElementText(pcb_board_t * pcb, pcb_data_t * data, ElementTypePtr Element, int which, char *new_name); +char *ChangeElementText(pcb_board_t * pcb, pcb_data_t * data, pcb_element_t *Element, int which, char *new_name); /* --------------------------------------------------------------------------- @@ -117,7 +117,7 @@ /*** loops ***/ #define ELEMENT_LOOP(top) do { \ - ElementType *element; \ + pcb_element_t *element; \ gdl_iterator_t __it__; \ pinlist_foreach(&(top)->Element, &__it__, element) { Index: trunk/src/obj_elem_draw.h =================================================================== --- trunk/src/obj_elem_draw.h (revision 4773) +++ trunk/src/obj_elem_draw.h (revision 4774) @@ -33,16 +33,16 @@ r_dir_t draw_element_callback(const pcb_box_t * b, void *cl); #endif -void draw_element_package(ElementType * element); -void draw_element_name(ElementType * element); -void draw_element_pins_and_pads(ElementType * element); -void draw_element(ElementTypePtr element); +void draw_element_package(pcb_element_t * element); +void draw_element_name(pcb_element_t * element); +void draw_element_pins_and_pads(pcb_element_t * element); +void draw_element(pcb_element_t *element); -void EraseElement(ElementTypePtr Element); -void EraseElementPinsAndPads(ElementTypePtr Element); -void EraseElementName(ElementTypePtr Element); +void EraseElement(pcb_element_t *Element); +void EraseElementPinsAndPads(pcb_element_t *Element); +void EraseElementName(pcb_element_t *Element); -void DrawElement(ElementTypePtr Element); -void DrawElementName(ElementTypePtr Element); -void DrawElementPackage(ElementTypePtr Element); -void DrawElementPinsAndPads(ElementTypePtr Element); +void DrawElement(pcb_element_t *Element); +void DrawElementName(pcb_element_t *Element); +void DrawElementPackage(pcb_element_t *Element); +void DrawElementPinsAndPads(pcb_element_t *Element); Index: trunk/src/obj_elem_list.h =================================================================== --- trunk/src/obj_elem_list.h (revision 4773) +++ trunk/src/obj_elem_list.h (revision 4774) @@ -28,7 +28,7 @@ /* List of Elements */ #define TDL(x) elementlist_ ## x #define TDL_LIST_T elementlist_t -#define TDL_ITEM_T ElementType +#define TDL_ITEM_T pcb_element_t #define TDL_FIELD link #define TDL_SIZE_T size_t #define TDL_FUNC @@ -41,10 +41,10 @@ /* Calculate a hash value using the content of the element. The hash value represents the actual content of an element */ -unsigned int pcb_element_hash(const ElementType *e); +unsigned int pcb_element_hash(const pcb_element_t *e); /* Compare two elements and return 1 if they contain the same objects. */ -int pcb_element_eq(const ElementType *e1, const ElementType *e2); +int pcb_element_eq(const pcb_element_t *e1, const pcb_element_t *e2); /* Create a new local variable to be used for deduplication */ #define elementlist_dedup_initializer(state) htep_t *state = NULL; Index: trunk/src/obj_elem_op.h =================================================================== --- trunk/src/obj_elem_op.h (revision 4773) +++ trunk/src/obj_elem_op.h (revision 4774) @@ -28,26 +28,26 @@ #include "operation.h" -void *AddElementToBuffer(pcb_opctx_t *ctx, ElementTypePtr Element); -void *MoveElementToBuffer(pcb_opctx_t *ctx, ElementType * element); -void *ClrElementOctagon(pcb_opctx_t *ctx, ElementTypePtr Element); -void *SetElementOctagon(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ChangeElementOctagon(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ClrElementSquare(pcb_opctx_t *ctx, ElementTypePtr Element); -void *SetElementSquare(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ChangeElementSquare(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ChangeElementNonetlist(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ChangeElementName(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ChangeElementNameSize(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ChangeElementSize(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ChangeElementClearSize(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ChangeElement1stSize(pcb_opctx_t *ctx, ElementTypePtr Element); -void *ChangeElement2ndSize(pcb_opctx_t *ctx, ElementTypePtr Element); -void *CopyElement(pcb_opctx_t *ctx, ElementTypePtr Element); -void *MoveElementName(pcb_opctx_t *ctx, ElementTypePtr Element); -void *MoveElement(pcb_opctx_t *ctx, ElementTypePtr Element); -void *DestroyElement(pcb_opctx_t *ctx, ElementTypePtr Element); -void *RemoveElement_op(pcb_opctx_t *ctx, ElementTypePtr Element); -void *RotateElement(pcb_opctx_t *ctx, ElementTypePtr Element); -void *RotateElementName(pcb_opctx_t *ctx, ElementTypePtr Element); +void *AddElementToBuffer(pcb_opctx_t *ctx, pcb_element_t *Element); +void *MoveElementToBuffer(pcb_opctx_t *ctx, pcb_element_t * element); +void *ClrElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element); +void *SetElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ChangeElementOctagon(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ClrElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element); +void *SetElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ChangeElementSquare(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ChangeElementNonetlist(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ChangeElementName(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ChangeElementNameSize(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ChangeElementSize(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ChangeElementClearSize(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ChangeElement1stSize(pcb_opctx_t *ctx, pcb_element_t *Element); +void *ChangeElement2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element); +void *CopyElement(pcb_opctx_t *ctx, pcb_element_t *Element); +void *MoveElementName(pcb_opctx_t *ctx, pcb_element_t *Element); +void *MoveElement(pcb_opctx_t *ctx, pcb_element_t *Element); +void *DestroyElement(pcb_opctx_t *ctx, pcb_element_t *Element); +void *RemoveElement_op(pcb_opctx_t *ctx, pcb_element_t *Element); +void *RotateElement(pcb_opctx_t *ctx, pcb_element_t *Element); +void *RotateElementName(pcb_opctx_t *ctx, pcb_element_t *Element); Index: trunk/src/obj_pad.c =================================================================== --- trunk/src/obj_pad.c (revision 4773) +++ trunk/src/obj_pad.c (revision 4774) @@ -47,7 +47,7 @@ /*** allocation ***/ /* get next slot for a pad, allocates memory if necessary */ -pcb_pad_t *GetPadMemory(ElementType * element) +pcb_pad_t *GetPadMemory(pcb_element_t * element) { pcb_pad_t *new_obj; @@ -66,7 +66,7 @@ /*** utility ***/ /* creates a new pad in an element */ -pcb_pad_t *CreateNewPad(ElementTypePtr Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, Coord Mask, char *Name, char *Number, FlagType Flags) +pcb_pad_t *CreateNewPad(pcb_element_t *Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, Coord Mask, char *Name, char *Number, FlagType Flags) { pcb_pad_t *pad = GetPadMemory(Element); @@ -155,7 +155,7 @@ /*** ops ***/ /* changes the size of a pad */ -void *ChangePadSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad) +void *ChangePadSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Thickness + ctx->chgsize.delta; @@ -179,7 +179,7 @@ } /* changes the clearance size of a pad */ -void *ChangePadClearSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad) +void *ChangePadClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Clearance + ctx->chgsize.delta; @@ -207,7 +207,7 @@ } /* changes the name of a pad */ -void *ChangePadName(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad) +void *ChangePadName(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { char *old = Pad->Name; @@ -223,7 +223,7 @@ } /* changes the number of a pad */ -void *ChangePadNum(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad) +void *ChangePadNum(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { char *old = Pad->Number; @@ -239,7 +239,7 @@ } /* changes the square flag of a pad */ -void *ChangePadSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad) +void *ChangePadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { if (TEST_FLAG(PCB_FLAG_LOCK, Pad)) return (NULL); @@ -255,7 +255,7 @@ } /* sets the square flag of a pad */ -void *SetPadSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad) +void *SetPadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { if (TEST_FLAG(PCB_FLAG_LOCK, Pad) || TEST_FLAG(PCB_FLAG_SQUARE, Pad)) @@ -266,7 +266,7 @@ /* clears the square flag of a pad */ -void *ClrPadSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad) +void *ClrPadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { if (TEST_FLAG(PCB_FLAG_LOCK, Pad) || !TEST_FLAG(PCB_FLAG_SQUARE, Pad)) @@ -276,7 +276,7 @@ } /* changes the mask size of a pad */ -void *ChangePadMaskSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad) +void *ChangePadMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Mask + ctx->chgsize.delta; Index: trunk/src/obj_pad.h =================================================================== --- trunk/src/obj_pad.h (revision 4773) +++ trunk/src/obj_pad.h (revision 4774) @@ -41,10 +41,10 @@ }; -pcb_pad_t *GetPadMemory(ElementType * element); +pcb_pad_t *GetPadMemory(pcb_element_t * element); void RemoveFreePad(pcb_pad_t * data); -pcb_pad_t *CreateNewPad(ElementTypePtr Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, Coord Mask, char *Name, char *Number, FlagType Flags); +pcb_pad_t *CreateNewPad(pcb_element_t *Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, Coord Mask, char *Name, char *Number, FlagType Flags); void SetPadBoundingBox(pcb_pad_t *Pad); pcb_bool ChangePaste(pcb_pad_t *Pad); Index: trunk/src/obj_pad_op.h =================================================================== --- trunk/src/obj_pad_op.h (revision 4773) +++ trunk/src/obj_pad_op.h (revision 4774) @@ -28,14 +28,14 @@ #include "operation.h" -void *ChangePadSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad); -void *ChangePadClearSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad); -void *ChangePadName(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad); -void *ChangePadNum(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad); -void *ChangePadSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad); -void *SetPadSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad); -void *ClrPadSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad); -void *ChangePadMaskSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pad_t *Pad); +void *ChangePadSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad); +void *ChangePadClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad); +void *ChangePadName(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad); +void *ChangePadNum(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad); +void *ChangePadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad); +void *SetPadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad); +void *ClrPadSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad); +void *ChangePadMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad); Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 4773) +++ trunk/src/obj_pinvia.c (revision 4774) @@ -64,7 +64,7 @@ } /* get next slot for a pin, allocates memory if necessary */ -pcb_pin_t *GetPinMemory(ElementType * element) +pcb_pin_t *GetPinMemory(pcb_element_t * element) { pcb_pin_t *new_obj; @@ -138,7 +138,7 @@ } /* creates a new pin in an element */ -pcb_pin_t *CreateNewPin(ElementTypePtr Element, Coord X, Coord Y, Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, char *Name, char *Number, FlagType Flags) +pcb_pin_t *CreateNewPin(pcb_element_t *Element, Coord X, Coord Y, Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, char *Name, char *Number, FlagType Flags) { pcb_pin_t *pin = GetPinMemory(Element); @@ -273,7 +273,7 @@ } /* changes the thermal on a pin */ -void *ChangePinThermal(pcb_opctx_t *ctx, ElementTypePtr element, pcb_pin_t *Pin) +void *ChangePinThermal(pcb_opctx_t *ctx, pcb_element_t *element, pcb_pin_t *Pin) { AddObjectToClearPolyUndoList(PCB_TYPE_PIN, element, Pin, Pin, pcb_false); RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, CURRENT, Pin); @@ -341,7 +341,7 @@ } /* changes the drilling hole of a pin */ -void *ChangePin2ndSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ChangePin2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->DrillingHole + ctx->chgsize.delta; @@ -397,7 +397,7 @@ /* changes the size of a pin */ -void *ChangePinSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ChangePinSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Thickness + ctx->chgsize.delta; @@ -422,7 +422,7 @@ } /* changes the clearance size of a pin */ -void *ChangePinClearSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ChangePinClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Clearance + ctx->chgsize.delta; @@ -465,7 +465,7 @@ } /* changes the name of a pin */ -void *ChangePinName(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ChangePinName(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { char *old = Pin->Name; @@ -481,7 +481,7 @@ } /* changes the number of a pin */ -void *ChangePinNum(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ChangePinNum(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { char *old = Pin->Number; @@ -519,7 +519,7 @@ } /* changes the square flag of a pin */ -void *ChangePinSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ChangePinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); @@ -540,7 +540,7 @@ } /* sets the square flag of a pin */ -void *SetPinSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *SetPinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || TEST_FLAG(PCB_FLAG_SQUARE, Pin)) return (NULL); @@ -549,7 +549,7 @@ } /* clears the square flag of a pin */ -void *ClrPinSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ClrPinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || !TEST_FLAG(PCB_FLAG_SQUARE, Pin)) return (NULL); @@ -592,7 +592,7 @@ } /* changes the octagon flag of a pin */ -void *ChangePinOctagon(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ChangePinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); @@ -608,7 +608,7 @@ } /* sets the octagon flag of a pin */ -void *SetPinOctagon(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *SetPinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || TEST_FLAG(PCB_FLAG_OCTAGON, Pin)) return (NULL); @@ -617,7 +617,7 @@ } /* clears the octagon flag of a pin */ -void *ClrPinOctagon(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ClrPinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || !TEST_FLAG(PCB_FLAG_OCTAGON, Pin)) return (NULL); @@ -660,7 +660,7 @@ } /* changes the mask size of a pin */ -void *ChangePinMaskSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin) +void *ChangePinMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Mask + ctx->chgsize.delta; Index: trunk/src/obj_pinvia.h =================================================================== --- trunk/src/obj_pinvia.h (revision 4773) +++ trunk/src/obj_pinvia.h (revision 4774) @@ -44,11 +44,11 @@ pcb_pin_t *GetViaMemory(pcb_data_t * data); void RemoveFreeVia(pcb_pin_t * data); -pcb_pin_t *GetPinMemory(ElementType * element); +pcb_pin_t *GetPinMemory(pcb_element_t * element); void RemoveFreePin(pcb_pin_t * data); pcb_pin_t *CreateNewVia(pcb_data_t *Data, Coord X, Coord Y, Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, const char *Name, FlagType Flags); -pcb_pin_t *CreateNewPin(ElementTypePtr Element, Coord X, Coord Y, Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, char *Name, char *Number, FlagType Flags); +pcb_pin_t *CreateNewPin(pcb_element_t *Element, Coord X, Coord Y, Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, char *Name, char *Number, FlagType Flags); void pcb_add_via(pcb_data_t *Data, pcb_pin_t *Via); void SetPinBoundingBox(pcb_pin_t *Pin); pcb_bool ChangeHole(pcb_pin_t *Via); Index: trunk/src/obj_pinvia_op.h =================================================================== --- trunk/src/obj_pinvia_op.h (revision 4773) +++ trunk/src/obj_pinvia_op.h (revision 4774) @@ -31,28 +31,28 @@ void *AddViaToBuffer(pcb_opctx_t *ctx, pcb_pin_t *Via); void *MoveViaToBuffer(pcb_opctx_t *ctx, pcb_pin_t * via); void *ChangeViaThermal(pcb_opctx_t *ctx, pcb_pin_t *Via); -void *ChangePinThermal(pcb_opctx_t *ctx, ElementTypePtr element, pcb_pin_t *Pin); +void *ChangePinThermal(pcb_opctx_t *ctx, pcb_element_t *element, pcb_pin_t *Pin); void *ChangeViaSize(pcb_opctx_t *ctx, pcb_pin_t *Via); void *ChangeVia2ndSize(pcb_opctx_t *ctx, pcb_pin_t *Via); -void *ChangePin2ndSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); +void *ChangePin2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); void *ChangeViaClearSize(pcb_opctx_t *ctx, pcb_pin_t *Via); -void *ChangePinSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); -void *ChangePinClearSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); +void *ChangePinSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); +void *ChangePinClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); void *ChangeViaName(pcb_opctx_t *ctx, pcb_pin_t *Via); -void *ChangePinName(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); -void *ChangePinNum(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); +void *ChangePinName(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); +void *ChangePinNum(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); void *ChangeViaSquare(pcb_opctx_t *ctx, pcb_pin_t *Via); -void *ChangePinSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); -void *SetPinSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); -void *ClrPinSquare(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); +void *ChangePinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); +void *SetPinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); +void *ClrPinSquare(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); void *ChangeViaOctagon(pcb_opctx_t *ctx, pcb_pin_t *Via); void *SetViaOctagon(pcb_opctx_t *ctx, pcb_pin_t *Via); void *ClrViaOctagon(pcb_opctx_t *ctx, pcb_pin_t *Via); -void *ChangePinOctagon(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); -void *SetPinOctagon(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); -void *ClrPinOctagon(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); +void *ChangePinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); +void *SetPinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); +void *ClrPinOctagon(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); pcb_bool ChangeHole(pcb_pin_t *Via); -void *ChangePinMaskSize(pcb_opctx_t *ctx, ElementTypePtr Element, pcb_pin_t *Pin); +void *ChangePinMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin); void *ChangeViaMaskSize(pcb_opctx_t *ctx, pcb_pin_t *Via); void *CopyVia(pcb_opctx_t *ctx, pcb_pin_t *Via); void *MoveVia(pcb_opctx_t *ctx, pcb_pin_t *Via); Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 4773) +++ trunk/src/object_act.c (revision 4774) @@ -45,9 +45,9 @@ /* --------------------------------------------------------------------------- */ -static ElementType *element_cache = NULL; +static pcb_element_t *element_cache = NULL; -static ElementType *find_element_by_refdes(const char *refdes) +static pcb_element_t *find_element_by_refdes(const char *refdes) { if (element_cache && NAMEONPCB_NAME(element_cache) && strcmp(NAMEONPCB_NAME(element_cache), refdes) == 0) @@ -146,7 +146,7 @@ case F_Element: { int n_found = 0; - ElementType *e = NULL; + pcb_element_t *e = NULL; ELEMENT_LOOP(PCB->Data); { if (TEST_FLAG(PCB_FLAG_SELECTED, element)) { @@ -163,7 +163,7 @@ void *ptrtmp; gui->get_coords(_("Click on an element"), &x, &y); if ((SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) - e = (ElementTypePtr) ptrtmp; + e = (pcb_element_t *) ptrtmp; else { Message(PCB_MSG_DEFAULT, _("No element found there\n")); return 1; @@ -321,7 +321,7 @@ static int ActionFlip(int argc, const char **argv, Coord x, Coord y) { const char *function = ACTION_ARG(0); - ElementTypePtr element; + pcb_element_t *element; void *ptrtmp; int err = 0; @@ -329,7 +329,7 @@ switch (funchash_get(function, NULL)) { case F_Object: if ((SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) { - element = (ElementTypePtr) ptrtmp; + element = (pcb_element_t *) ptrtmp; ChangeElementSide(element, 2 * Crosshair.Y - PCB->MaxHeight); IncrementUndoSerialNumber(); Draw(); @@ -480,7 +480,7 @@ static int ActionElementList(int argc, const char **argv, Coord x, Coord y) { - ElementType *e = NULL; + pcb_element_t *e = NULL; const char *refdes, *value, *footprint; const char *args[3]; const char *function = argv[0]; @@ -588,7 +588,7 @@ #endif int er, pr, i; Coord mx, my; - ElementType *pe; + pcb_element_t *pe; /* Different footprint, we need to swap them out. */ if (LoadFootprint(argc, args, x, y)) { @@ -656,7 +656,7 @@ static int ActionElementSetAttr(int argc, const char **argv, Coord x, Coord y) { - ElementType *e = NULL; + pcb_element_t *e = NULL; const char *refdes, *name, *value; AttributeType *attr; Index: trunk/src/operation.h =================================================================== --- trunk/src/operation.h (revision 4773) +++ trunk/src/operation.h (revision 4774) @@ -114,10 +114,10 @@ void *(*Text)(pcb_opctx_t *ctx, pcb_layer_t *, TextTypePtr); void *(*Polygon)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_polygon_t *); void *(*Via)(pcb_opctx_t *ctx, pcb_pin_t *); - void *(*Element)(pcb_opctx_t *ctx, ElementTypePtr); - void *(*ElementName)(pcb_opctx_t *ctx, ElementTypePtr); - void *(*Pin)(pcb_opctx_t *ctx, ElementTypePtr, pcb_pin_t *); - void *(*Pad)(pcb_opctx_t *ctx, ElementTypePtr, pcb_pad_t *); + void *(*Element)(pcb_opctx_t *ctx, pcb_element_t *); + void *(*ElementName)(pcb_opctx_t *ctx, pcb_element_t *); + void *(*Pin)(pcb_opctx_t *ctx, pcb_element_t *, pcb_pin_t *); + void *(*Pad)(pcb_opctx_t *ctx, pcb_element_t *, pcb_pad_t *); 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_polygon_t *, pcb_point_t *); void *(*Arc)(pcb_opctx_t *ctx, pcb_layer_t *, pcb_arc_t *); Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 4773) +++ trunk/src/polygon.c (revision 4774) @@ -1524,12 +1524,12 @@ case PCB_TYPE_ELEMENT: { - PIN_LOOP((ElementType *) ptr1); + PIN_LOOP((pcb_element_t *) ptr1); { PlowsPolygon(Data, PCB_TYPE_PIN, ptr1, pin, call_back); } END_LOOP; - PAD_LOOP((ElementType *) ptr1); + PAD_LOOP((pcb_element_t *) ptr1); { PlowsPolygon(Data, PCB_TYPE_PAD, ptr1, pad, call_back); } Index: trunk/src/rats.c =================================================================== --- trunk/src/rats.c (revision 4773) +++ trunk/src/rats.c (revision 4774) @@ -107,7 +107,7 @@ */ static pcb_bool FindPad(const char *ElementName, const char *PinNum, pcb_connection_t * conn, pcb_bool Same) { - ElementTypePtr element; + pcb_element_t *element; gdl_iterator_t it; pcb_pad_t *pad; pcb_pin_t *pin; @@ -235,7 +235,7 @@ if (TEST_FLAG(PCB_FLAG_DRC, (pcb_pin_t *) LastPoint.ptr2)) Message(PCB_MSG_DEFAULT, _ ("Error! Element %s pin %s appears multiple times in the netlist file.\n"), - NAMEONPCB_NAME((ElementTypePtr) LastPoint.ptr1), + NAMEONPCB_NAME((pcb_element_t *) LastPoint.ptr1), (LastPoint.type == PCB_TYPE_PIN) ? ((pcb_pin_t *) LastPoint.ptr2)->Number : ((pcb_pad_t *) LastPoint.ptr2)->Number); else { @@ -321,8 +321,8 @@ *menu = theNet; ALLPIN_LOOP(PCB->Data); { - ElementType *e = pin->Element; -/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (ElementType *)pin->Element)*/ + pcb_element_t *e = pin->Element; +/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (pcb_element_t *)pin->Element)*/ if ((TEST_FLAG(PCB_FLAG_DRC, pin)) && (!(e->Flags.f & PCB_FLAG_NONETLIST))) { warn = pcb_true; if (!pin->Spare) { @@ -352,8 +352,8 @@ ENDALL_LOOP; ALLPAD_LOOP(PCB->Data); { - ElementType *e = pad->Element; -/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (ElementType *)pad->Element)*/ + pcb_element_t *e = pad->Element; +/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (pcb_element_t *)pad->Element)*/ if ((TEST_FLAG(PCB_FLAG_DRC, pad)) && (!(e->Flags.f & PCB_FLAG_NONETLIST)) && (!(e->Name->Flags.f & PCB_FLAG_NONETLIST))) { warn = pcb_true; if (!pad->Spare) { @@ -828,7 +828,7 @@ Message(PCB_MSG_DEFAULT, _("No pad/pin under rat line\n")); return (NULL); } - if (NAMEONPCB_NAME((ElementTypePtr) ptr1) == NULL || *NAMEONPCB_NAME((ElementTypePtr) ptr1) == 0) { + if (NAMEONPCB_NAME((pcb_element_t *) ptr1) == NULL || *NAMEONPCB_NAME((pcb_element_t *) ptr1) == 0) { Message(PCB_MSG_DEFAULT, _("You must name the starting element first\n")); return (NULL); } @@ -843,7 +843,7 @@ Message(PCB_MSG_DEFAULT, _("No pad/pin under rat line\n")); return (NULL); } - if (NAMEONPCB_NAME((ElementTypePtr) ptr1) == NULL || *NAMEONPCB_NAME((ElementTypePtr) ptr1) == 0) { + if (NAMEONPCB_NAME((pcb_element_t *) ptr1) == NULL || *NAMEONPCB_NAME((pcb_element_t *) ptr1) == 0) { Message(PCB_MSG_DEFAULT, _("You must name the ending element first\n")); return (NULL); } @@ -919,7 +919,7 @@ default: return (NULL); } - strcpy(name, UNKNOWN(NAMEONPCB_NAME((ElementTypePtr) ptr1))); + strcpy(name, UNKNOWN(NAMEONPCB_NAME((pcb_element_t *) ptr1))); strcat(name, "-"); strcat(name, UNKNOWN(num)); return (name); Index: trunk/src/rubberband.c =================================================================== --- trunk/src/rubberband.c (revision 4773) +++ trunk/src/rubberband.c (revision 4774) @@ -402,7 +402,7 @@ switch (Type) { case PCB_TYPE_ELEMENT: { - ElementTypePtr element = (ElementTypePtr) Ptr1; + pcb_element_t *element = (pcb_element_t *) Ptr1; /* square pins are handled as if they are round. Speed * and readability is more important then the few % @@ -453,7 +453,7 @@ switch (Type) { case PCB_TYPE_ELEMENT: { - ElementTypePtr element = (ElementTypePtr) Ptr1; + pcb_element_t *element = (pcb_element_t *) Ptr1; PIN_LOOP(element); { Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 4773) +++ trunk/src/search.c (revision 4774) @@ -58,13 +58,13 @@ static pcb_bool SearchRatLineByLocation(int, pcb_rat_t **, pcb_rat_t **, pcb_rat_t **); static pcb_bool SearchTextByLocation(int, pcb_layer_t **, TextTypePtr *, TextTypePtr *); static pcb_bool SearchPolygonByLocation(int, pcb_layer_t **, pcb_polygon_t **, pcb_polygon_t **); -static pcb_bool SearchPinByLocation(int, ElementTypePtr *, pcb_pin_t **, pcb_pin_t **); -static pcb_bool SearchPadByLocation(int, ElementTypePtr *, pcb_pad_t **, pcb_pad_t **, pcb_bool); +static pcb_bool SearchPinByLocation(int, pcb_element_t **, pcb_pin_t **, pcb_pin_t **); +static pcb_bool SearchPadByLocation(int, pcb_element_t **, pcb_pad_t **, pcb_pad_t **, pcb_bool); static pcb_bool SearchViaByLocation(int, pcb_pin_t **, pcb_pin_t **, pcb_pin_t **); -static pcb_bool SearchElementNameByLocation(int, ElementTypePtr *, TextTypePtr *, TextTypePtr *, pcb_bool); +static pcb_bool SearchElementNameByLocation(int, pcb_element_t **, TextTypePtr *, TextTypePtr *, pcb_bool); static pcb_bool SearchLinePointByLocation(int, pcb_layer_t **, pcb_line_t **, pcb_point_t **); static pcb_bool SearchPointByLocation(int, pcb_layer_t **, pcb_polygon_t **, pcb_point_t **); -static pcb_bool SearchElementByLocation(int, ElementTypePtr *, ElementTypePtr *, ElementTypePtr *, pcb_bool); +static pcb_bool SearchElementByLocation(int, pcb_element_t **, pcb_element_t **, pcb_element_t **, pcb_bool); /* --------------------------------------------------------------------------- * searches a via @@ -114,7 +114,7 @@ * searches a pin * starts with the newest element */ -static pcb_bool SearchPinByLocation(int locked, ElementTypePtr * Element, pcb_pin_t ** Pin, pcb_pin_t ** Dummy) +static pcb_bool SearchPinByLocation(int locked, pcb_element_t ** Element, pcb_pin_t ** Pin, pcb_pin_t ** Dummy) { struct ans_info info; @@ -154,7 +154,7 @@ * searches a pad * starts with the newest element */ -static pcb_bool SearchPadByLocation(int locked, ElementTypePtr * Element, pcb_pad_t ** Pad, pcb_pad_t ** Dummy, pcb_bool BackToo) +static pcb_bool SearchPadByLocation(int locked, pcb_element_t ** Element, pcb_pad_t ** Pad, pcb_pad_t ** Dummy, pcb_bool BackToo) { struct ans_info info; @@ -432,7 +432,7 @@ { TextTypePtr text = (TextTypePtr) box; struct ans_info *i = (struct ans_info *) cl; - ElementTypePtr element = (ElementTypePtr) text->Element; + pcb_element_t *element = (pcb_element_t *) text->Element; double newarea; if (TEST_FLAG(i->locked, text)) @@ -456,7 +456,7 @@ * the search starts with the last element and goes back to the beginning */ static pcb_bool -SearchElementNameByLocation(int locked, ElementTypePtr * Element, TextTypePtr * Text, TextTypePtr * Dummy, pcb_bool BackToo) +SearchElementNameByLocation(int locked, pcb_element_t ** Element, TextTypePtr * Text, TextTypePtr * Dummy, pcb_bool BackToo) { struct ans_info info; @@ -476,7 +476,7 @@ static r_dir_t element_callback(const pcb_box_t * box, void *cl) { - ElementTypePtr element = (ElementTypePtr) box; + pcb_element_t *element = (pcb_element_t *) box; struct ans_info *i = (struct ans_info *) cl; double newarea; @@ -501,7 +501,7 @@ * if more than one element matches, the smallest one is taken */ static pcb_bool -SearchElementByLocation(int locked, ElementTypePtr * Element, ElementTypePtr * Dummy1, ElementTypePtr * Dummy2, pcb_bool BackToo) +SearchElementByLocation(int locked, pcb_element_t ** Element, pcb_element_t ** Dummy1, pcb_element_t ** Dummy2, pcb_bool BackToo) { struct ans_info info; @@ -1003,15 +1003,15 @@ if (Type & PCB_TYPE_VIA && SearchViaByLocation(locked, (pcb_pin_t **) Result1, (pcb_pin_t **) Result2, (pcb_pin_t **) Result3)) return (PCB_TYPE_VIA); - if (Type & PCB_TYPE_PIN && SearchPinByLocation(locked, (ElementTypePtr *) pr1, (pcb_pin_t **) pr2, (pcb_pin_t **) pr3)) + if (Type & PCB_TYPE_PIN && SearchPinByLocation(locked, (pcb_element_t **) pr1, (pcb_pin_t **) pr2, (pcb_pin_t **) pr3)) HigherAvail = PCB_TYPE_PIN; if (!HigherAvail && Type & PCB_TYPE_PAD && - SearchPadByLocation(locked, (ElementTypePtr *) pr1, (pcb_pad_t **) pr2, (pcb_pad_t **) pr3, pcb_false)) + SearchPadByLocation(locked, (pcb_element_t **) pr1, (pcb_pad_t **) pr2, (pcb_pad_t **) pr3, pcb_false)) HigherAvail = PCB_TYPE_PAD; if (!HigherAvail && Type & PCB_TYPE_ELEMENT_NAME && - SearchElementNameByLocation(locked, (ElementTypePtr *) pr1, (TextTypePtr *) pr2, (TextTypePtr *) pr3, pcb_false)) { + SearchElementNameByLocation(locked, (pcb_element_t **) pr1, (TextTypePtr *) pr2, (TextTypePtr *) pr3, pcb_false)) { pcb_box_t *box = &((TextTypePtr) r2)->BoundingBox; HigherBound = (double) (box->X2 - box->X1) * (double) (box->Y2 - box->Y1); HigherAvail = PCB_TYPE_ELEMENT_NAME; @@ -1018,8 +1018,8 @@ } if (!HigherAvail && Type & PCB_TYPE_ELEMENT && - SearchElementByLocation(locked, (ElementTypePtr *) pr1, (ElementTypePtr *) pr2, (ElementTypePtr *) pr3, pcb_false)) { - pcb_box_t *box = &((ElementTypePtr) r1)->BoundingBox; + SearchElementByLocation(locked, (pcb_element_t **) pr1, (pcb_element_t **) pr2, (pcb_element_t **) pr3, pcb_false)) { + pcb_box_t *box = &((pcb_element_t *) r1)->BoundingBox; HigherBound = (double) (box->X2 - box->X1) * (double) (box->Y2 - box->Y1); HigherAvail = PCB_TYPE_ELEMENT; } @@ -1106,15 +1106,15 @@ return (PCB_TYPE_NONE); if (Type & PCB_TYPE_PAD && - SearchPadByLocation(locked, (ElementTypePtr *) Result1, (pcb_pad_t **) Result2, (pcb_pad_t **) Result3, pcb_true)) + SearchPadByLocation(locked, (pcb_element_t **) Result1, (pcb_pad_t **) Result2, (pcb_pad_t **) Result3, pcb_true)) return (PCB_TYPE_PAD); if (Type & PCB_TYPE_ELEMENT_NAME && - SearchElementNameByLocation(locked, (ElementTypePtr *) Result1, (TextTypePtr *) Result2, (TextTypePtr *) Result3, pcb_true)) + SearchElementNameByLocation(locked, (pcb_element_t **) Result1, (TextTypePtr *) Result2, (TextTypePtr *) Result3, pcb_true)) return (PCB_TYPE_ELEMENT_NAME); if (Type & PCB_TYPE_ELEMENT && - SearchElementByLocation(locked, (ElementTypePtr *) Result1, (ElementTypePtr *) Result2, (ElementTypePtr *) Result3, pcb_true)) + SearchElementByLocation(locked, (pcb_element_t **) Result1, (pcb_element_t **) Result2, (pcb_element_t **) Result3, pcb_true)) return (PCB_TYPE_ELEMENT); return (PCB_TYPE_NONE); @@ -1303,9 +1303,9 @@ * searches for an element by its board name. * The function returns a pointer to the element, NULL if not found */ -ElementTypePtr SearchElementByName(pcb_data_t *Base, const char *Name) +pcb_element_t *SearchElementByName(pcb_data_t *Base, const char *Name) { - ElementTypePtr result = NULL; + pcb_element_t *result = NULL; ELEMENT_LOOP(Base); { Index: trunk/src/search.h =================================================================== --- trunk/src/search.h (revision 4773) +++ trunk/src/search.h (revision 4774) @@ -158,6 +158,6 @@ int SearchScreen(Coord, Coord, int, void **, void **, void **); int SearchScreenGridSlop(Coord, Coord, int, void **, void **, void **); int SearchObjectByID(pcb_data_t *, void **, void **, void **, int, int); -ElementTypePtr SearchElementByName(pcb_data_t *, const char *); +pcb_element_t *SearchElementByName(pcb_data_t *, const char *); #endif Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 4773) +++ trunk/src/select.c (revision 4774) @@ -53,7 +53,7 @@ #include -void pcb_select_element(ElementType *element, pcb_change_flag_t how, int redraw) +void pcb_select_element(pcb_element_t *element, pcb_change_flag_t how, int redraw) { /* select all pins and names of the element */ PIN_LOOP(element); @@ -88,7 +88,7 @@ } } -void pcb_select_element_name(ElementType *element, pcb_change_flag_t how, int redraw) +void pcb_select_element_name(pcb_element_t *element, pcb_change_flag_t how, int redraw) { /* select all names of the element */ ELEMENTTEXT_LOOP(element); @@ -193,11 +193,11 @@ break; case PCB_TYPE_ELEMENT_NAME: - pcb_select_element_name((ElementType *) ptr1, PCB_CHGFLG_TOGGLE, 1); + pcb_select_element_name((pcb_element_t *) ptr1, PCB_CHGFLG_TOGGLE, 1); break; case PCB_TYPE_ELEMENT: - pcb_select_element((ElementType *) ptr1, PCB_CHGFLG_TOGGLE, 1); + pcb_select_element((pcb_element_t *) ptr1, PCB_CHGFLG_TOGGLE, 1); break; } Draw(); @@ -524,22 +524,22 @@ case PCB_TYPE_ELEMENT: if (F->Element) - return (F->Element(ctx, (ElementTypePtr) Ptr1)); + return (F->Element(ctx, (pcb_element_t *) Ptr1)); break; case PCB_TYPE_PIN: if (F->Pin) - return (F->Pin(ctx, (ElementTypePtr) Ptr1, (pcb_pin_t *) Ptr2)); + return (F->Pin(ctx, (pcb_element_t *) Ptr1, (pcb_pin_t *) Ptr2)); break; case PCB_TYPE_PAD: if (F->Pad) - return (F->Pad(ctx, (ElementTypePtr) Ptr1, (pcb_pad_t *) Ptr2)); + return (F->Pad(ctx, (pcb_element_t *) Ptr1, (pcb_pad_t *) Ptr2)); break; case PCB_TYPE_ELEMENT_NAME: if (F->ElementName) - return (F->ElementName(ctx, (ElementTypePtr) Ptr1)); + return (F->ElementName(ctx, (pcb_element_t *) Ptr1)); break; case PCB_TYPE_RATLINE: Index: trunk/src/select.h =================================================================== --- trunk/src/select.h (revision 4773) +++ trunk/src/select.h (revision 4774) @@ -56,7 +56,7 @@ /* New API */ /* Change the selection of an element or element name (these have side effects) */ -void pcb_select_element(ElementType *element, pcb_change_flag_t how, int redraw); -void pcb_select_element_name(ElementType *element, pcb_change_flag_t how, int redraw); +void pcb_select_element(pcb_element_t *element, pcb_change_flag_t how, int redraw); +void pcb_select_element_name(pcb_element_t *element, pcb_change_flag_t how, int redraw); #endif Index: trunk/src/stub_vendor.c =================================================================== --- trunk/src/stub_vendor.c (revision 4773) +++ trunk/src/stub_vendor.c (revision 4774) @@ -28,12 +28,12 @@ return dia; } -static pcb_bool stub_vendorIsElementMappable_dummy(ElementTypePtr e) +static pcb_bool stub_vendorIsElementMappable_dummy(pcb_element_t *e) { return pcb_false; } int (*stub_vendorDrillMap)(int) = stub_vendorDrillMap_dummy; -pcb_bool (*stub_vendorIsElementMappable)(ElementTypePtr) = stub_vendorIsElementMappable_dummy; +pcb_bool (*stub_vendorIsElementMappable)(pcb_element_t *) = stub_vendorIsElementMappable_dummy; Index: trunk/src/stub_vendor.h =================================================================== --- trunk/src/stub_vendor.h (revision 4773) +++ trunk/src/stub_vendor.h (revision 4774) @@ -27,6 +27,6 @@ #include "global_typedefs.h" extern int (*stub_vendorDrillMap)(int); -extern pcb_bool (*stub_vendorIsElementMappable)(ElementTypePtr); +extern pcb_bool (*stub_vendorIsElementMappable)(pcb_element_t *); #endif /* __VENDOR_H__ */ Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 4773) +++ trunk/src/undo.c (revision 4774) @@ -562,7 +562,7 @@ /* lookup entry by ID */ type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind); if (type == PCB_TYPE_ELEMENT) { - ElementTypePtr element = (ElementTypePtr) ptr3; + pcb_element_t *element = (pcb_element_t *) ptr3; if (andDraw) EraseElement(element); MirrorElementCoordinates(PCB->Data, element, Entry->Data.Move.DY); Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 4773) +++ trunk/src_plugins/autoplace/autoplace.c (revision 4774) @@ -118,7 +118,7 @@ }; typedef struct { - ElementTypePtr *element; + pcb_element_t **element; pcb_cardinal_t elementN; } ElementPtrListType; @@ -125,11 +125,11 @@ enum ewhich { SHIFT, ROTATE, EXCHANGE }; typedef struct { - ElementTypePtr element; + pcb_element_t *element; enum ewhich which; Coord DX, DY; /* for shift */ unsigned rotate; /* for rotate/flip */ - ElementTypePtr other; /* for exchange */ + pcb_element_t *other; /* for exchange */ } PerturbationType; /* --------------------------------------------------------------------------- @@ -153,7 +153,7 @@ pcb_connection_t *c = &(Nets->Net[i].Connection[j]); switch (c->type) { case PCB_TYPE_PAD: - c->group = TEST_FLAG(PCB_FLAG_ONSOLDER, (ElementTypePtr) c->ptr1) + c->group = TEST_FLAG(PCB_FLAG_ONSOLDER, (pcb_element_t *) c->ptr1) ? SLayer : CLayer; c->X = ((pcb_pad_t *) c->ptr2)->Point1.X; c->Y = ((pcb_pad_t *) c->ptr2)->Point1.Y; @@ -180,7 +180,7 @@ ELEMENT_LOOP(PCB->Data); { if (TEST_FLAG(PCB_FLAG_SELECTED, element)) { - ElementTypePtr *epp = (ElementTypePtr *) GetPointerMemory(&list); + pcb_element_t **epp = (pcb_element_t **) GetPointerMemory(&list); *epp = element; } } @@ -460,7 +460,7 @@ 0, 0, NULL}; struct ebox { pcb_box_t box; - ElementTypePtr element; + pcb_element_t *element; }; direction_t dir[4] = { NORTH, EAST, SOUTH, WEST }; struct ebox **boxpp, *boxp; @@ -552,7 +552,7 @@ { PerturbationType pt = { 0 }; /* pick element to perturb */ - pt.element = (ElementTypePtr) selected->Ptr[pcb_rand() % selected->PtrN]; + pt.element = (pcb_element_t *) selected->Ptr[pcb_rand() % selected->PtrN]; /* exchange, flip/rotate or shift? */ switch (pcb_rand() % ((selected->PtrN > 1) ? 3 : 2)) { case 0: @@ -588,10 +588,10 @@ case 2: { /* exchange! */ pt.which = EXCHANGE; - pt.other = (ElementTypePtr) + pt.other = (pcb_element_t *) selected->Ptr[pcb_rand() % (selected->PtrN - 1)]; if (pt.other == pt.element) - pt.other = (ElementTypePtr) selected->Ptr[selected->PtrN - 1]; + pt.other = (pcb_element_t *) selected->Ptr[selected->PtrN - 1]; /* don't allow exchanging a solderside-side SMD component * with a non-SMD component. */ if ((pinlist_length(&(pt.element->Pin)) != 0 /* non-SMD */ && Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 4773) +++ trunk/src_plugins/autoroute/autoroute.c (revision 4774) @@ -626,7 +626,7 @@ return lastrb; } -static routebox_t *AddPad(PointerListType layergroupboxes[], ElementTypePtr element, pcb_pad_t *pad, RouteStyleType * style) +static routebox_t *AddPad(PointerListType layergroupboxes[], pcb_element_t *element, pcb_pad_t *pad, RouteStyleType * style) { Coord halfthick; routebox_t **rbpp; @@ -995,7 +995,7 @@ else switch (connection->type) { case PCB_TYPE_PAD: - rb = AddPad(layergroupboxes, (ElementType *) connection->ptr1, (pcb_pad_t *) connection->ptr2, rd->styles[j]); + rb = AddPad(layergroupboxes, (pcb_element_t *) connection->ptr1, (pcb_pad_t *) connection->ptr2, rd->styles[j]); break; case PCB_TYPE_PIN: rb = AddPin(layergroupboxes, (pcb_pin_t *) connection->ptr2, pcb_false, rd->styles[j]); Index: trunk/src_plugins/distalign/distalign.c =================================================================== --- trunk/src_plugins/distalign/distalign.c (revision 4773) +++ trunk/src_plugins/distalign/distalign.c (revision 4774) @@ -178,7 +178,7 @@ /* this macro produces a function in X or Y that switches on 'point' */ #define COORD(DIR) \ static inline Coord \ -coord ## DIR(ElementType *element, int point) \ +coord ## DIR(pcb_element_t *element, int point) \ { \ switch (point) { \ case K_Marks: \ @@ -201,7 +201,7 @@ COORD(Y) /* return the element coordinate associated with the given internal point */ - static Coord coord(ElementType * element, int dir, int point) + static Coord coord(pcb_element_t * element, int dir, int point) { if (dir == K_X) return coordX(element, point); @@ -210,7 +210,7 @@ } static struct element_by_pos { - ElementType *element; + pcb_element_t *element; Coord pos; Coord width; } *elements_by_pos; @@ -563,7 +563,7 @@ /* subtract all the "widths" from the slack */ for (i = 0; i < nelements_by_pos; ++i) { - ElementType *element = elements_by_pos[i].element; + pcb_element_t *element = elements_by_pos[i].element; /* coord doesn't care if I mix Lefts/Tops */ w = elements_by_pos[i].width = coord(element, dir, K_Rights) - coord(element, dir, K_Lefts); /* Gaps distribution is on centers, so half of @@ -577,7 +577,7 @@ } /* move all selected elements to the new coordinate */ for (i = 0; i < nelements_by_pos; ++i) { - ElementType *element = elements_by_pos[i].element; + pcb_element_t *element = elements_by_pos[i].element; Coord p, q, dp, dx, dy; /* find reference point for this element */ Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 4773) +++ trunk/src_plugins/export_bboard/bboard.c (revision 4774) @@ -385,7 +385,7 @@ } -static void bboard_export_element_cairo(ElementType * element, pcb_bool onsolder) +static void bboard_export_element_cairo(pcb_element_t * element, pcb_bool onsolder) { cairo_surface_t *sfc; Coord ex, ey; Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 4773) +++ trunk/src_plugins/export_dsn/dsn.c (revision 4774) @@ -112,7 +112,7 @@ /* this function is mostly ripped from bom.c */ -static pcb_point_t get_centroid(ElementType * element) +static pcb_point_t get_centroid(pcb_element_t * element) { pcb_point_t centroid; double sumx = 0.0, sumy = 0.0; Index: trunk/src_plugins/export_openscad/scadcomp.c =================================================================== --- trunk/src_plugins/export_openscad/scadcomp.c (revision 4773) +++ trunk/src_plugins/export_openscad/scadcomp.c (revision 4774) @@ -285,7 +285,7 @@ * - adjusts the model position, rotation, scale * - processes the model line-by-line and perfoprms variable expansion ************************************************************/ -static void scad_export_model(int model_type, ElementType * element, pcb_bool imported, FILE * f, char *line, int size) +static void scad_export_model(int model_type, pcb_element_t * element, pcb_bool imported, FILE * f, char *line, int size) { char *model_rotation, *model_translate, *model_scale, *model_angle; Angle tmp_angle = (Angle) 0; @@ -349,7 +349,7 @@ extern void FreeRotateBuffer(pcb_buffer_t * Buffer, Angle angle); -static int scad_calculate_bbox(ElementType * element, Angle angle, float *w, float *h, float *ox, float *oy) +static int scad_calculate_bbox(pcb_element_t * element, Angle angle, float *w, float *h, float *ox, float *oy) { return 0; @@ -361,7 +361,7 @@ element_buffer.Data = CreateNewBuffer (); -- Copy - AddElementToBuffer (ElementType *Element) + AddElementToBuffer (pcb_element_t *Element) if (ON_SIDE(Element,(Settings.ShowBottomSide)?BOTTOM_SIDE:TOP_SIDE)) MirrorElementCoordinates (element_buffer.Data, element, 0); @@ -374,7 +374,7 @@ * - identifies the model for the component - primary and overlay * - exports both models ************************************************************/ -static void scad_export_bbox(ElementType * element) +static void scad_export_bbox(pcb_element_t * element) { char *model_angle, *bbox; Angle tmp_angle = (Angle) 0; @@ -450,7 +450,7 @@ } -static void scad_writeout_element(ElementType * element, char *name, int model_type, pcb_bool imported, pcb_bool simple) +static void scad_writeout_element(pcb_element_t * element, char *name, int model_type, pcb_bool imported, pcb_bool simple) { FILE *f = NULL; char line[2048]; @@ -475,7 +475,7 @@ * - identifies the model for the component - primary and overlay * - exports both models ************************************************************/ -static void scad_export_element(ElementType * element, pcb_bool simple) +static void scad_export_element(pcb_element_t * element, pcb_bool simple) { char *model_name, *s; pcb_bool imported_model; Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4773) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4774) @@ -616,7 +616,7 @@ void ghid_show_item(void *item) { - ghid_pinout_window_show(&ghid_port, (ElementTypePtr) item); + ghid_pinout_window_show(&ghid_port, (pcb_element_t *) item); } void ghid_beep() Index: trunk/src_plugins/hid_gtk/gui-output-events.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-output-events.c (revision 4773) +++ trunk/src_plugins/hid_gtk/gui-output-events.c (revision 4774) @@ -312,7 +312,7 @@ return NULL; if (type == PCB_TYPE_PIN || type == PCB_TYPE_PAD) - elename = (char *) UNKNOWN(NAMEONPCB_NAME((ElementTypePtr) ptr1)); + elename = (char *) UNKNOWN(NAMEONPCB_NAME((pcb_element_t *) ptr1)); pinname = ConnectionName(type, ptr1, ptr2); Index: trunk/src_plugins/hid_gtk/gui-pinout-preview.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-pinout-preview.c (revision 4773) +++ trunk/src_plugins/hid_gtk/gui-pinout-preview.c (revision 4774) @@ -53,7 +53,7 @@ } -static void pinout_set_data(GhidPinoutPreview * pinout, ElementType * element) +static void pinout_set_data(GhidPinoutPreview * pinout, pcb_element_t * element) { if (element == NULL) { FreeElementMemory(&pinout->element); @@ -172,7 +172,7 @@ switch (property_id) { case PROP_ELEMENT_DATA: - pinout_set_data(pinout, (ElementType *) g_value_get_pointer(value)); + pinout_set_data(pinout, (pcb_element_t *) g_value_get_pointer(value)); if (window != NULL) gdk_window_invalidate_rect(window, NULL, FALSE); break; @@ -273,7 +273,7 @@ * * \return The GhidPinoutPreview created. */ -GtkWidget *ghid_pinout_preview_new(ElementType * element) +GtkWidget *ghid_pinout_preview_new(pcb_element_t * element) { GhidPinoutPreview *pinout_preview; Index: trunk/src_plugins/hid_gtk/gui-pinout-preview.h =================================================================== --- trunk/src_plugins/hid_gtk/gui-pinout-preview.h (revision 4773) +++ trunk/src_plugins/hid_gtk/gui-pinout-preview.h (revision 4774) @@ -47,7 +47,7 @@ struct _GhidPinoutPreview { GtkDrawingArea parent_instance; - ElementType element; /* element data to display */ + pcb_element_t element; /* element data to display */ gint x_max, y_max; gint w_pixels, h_pixels; /* natural size of element preview */ }; @@ -55,7 +55,7 @@ GType ghid_pinout_preview_get_type(void); -GtkWidget *ghid_pinout_preview_new(ElementType * element); +GtkWidget *ghid_pinout_preview_new(pcb_element_t * element); void ghid_pinout_preview_get_natural_size(GhidPinoutPreview * pinout, int *width, int *height); #endif /* PCB_HID_GTK_GUI_PINOUT_PREVIEW_H */ Index: trunk/src_plugins/hid_gtk/gui-pinout-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-pinout-window.c (revision 4773) +++ trunk/src_plugins/hid_gtk/gui-pinout-window.c (revision 4774) @@ -46,7 +46,7 @@ } -void ghid_pinout_window_show(GHidPort * out, ElementType * element) +void ghid_pinout_window_show(GHidPort * out, pcb_element_t * element) { GtkWidget *button, *vbox, *hbox, *preview, *top_window; gchar *title; Index: trunk/src_plugins/hid_gtk/gui.h =================================================================== --- trunk/src_plugins/hid_gtk/gui.h (revision 4773) +++ trunk/src_plugins/hid_gtk/gui.h (revision 4774) @@ -404,7 +404,7 @@ void ghid_logv(enum pcb_message_level level, const char *fmt, va_list args); /* gui-pinout-window.c */ -void ghid_pinout_window_show(GHidPort * out, ElementTypePtr Element); +void ghid_pinout_window_show(GHidPort * out, pcb_element_t *Element); /* gtkhid-gdk.c AND gtkhid-gl.c */ int ghid_set_layer(const char *name, int group, int empty); Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 4773) +++ trunk/src_plugins/io_kicad/read.c (revision 4774) @@ -999,7 +999,7 @@ unsigned direction = 0; /* default is horizontal */ char * end, * textLabel, * text; char * moduleName, * moduleRefdes, * moduleValue, * pinName; - ElementTypePtr newModule; + pcb_element_t *newModule; FlagType Flags = MakeFlags(0); /* start with something bland here */ FlagType TextFlags = MakeFlags(0); /* start with something bland here */ Index: trunk/src_plugins/io_kicad/write.c =================================================================== --- trunk/src_plugins/io_kicad/write.c (revision 4773) +++ trunk/src_plugins/io_kicad/write.c (revision 4774) @@ -463,7 +463,7 @@ static int io_kicad_write_element_index(FILE * FP, pcb_data_t *Data) { gdl_iterator_t eit; - ElementType *element; + pcb_element_t *element; unm_t group1; /* group used to deal with missing names and provide unique ones if needed */ elementlist_dedup_initializer(ededup); @@ -803,7 +803,7 @@ gdl_iterator_t eit; pcb_line_t *line; pcb_arc_t *arc; - ElementType *element; + pcb_element_t *element; pcb_box_t *boxResult; Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */ @@ -1042,7 +1042,7 @@ Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */ Coord xPos, yPos; - ElementType *element; + pcb_element_t *element; unm_t group1; /* group used to deal with missing names and provide unique ones if needed */ const char * currentElementName; const char * currentElementRef; Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (revision 4773) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 4774) @@ -466,7 +466,7 @@ static int io_kicad_legacy_write_element_index(FILE * FP, pcb_data_t *Data) { gdl_iterator_t eit; - ElementType *element; + pcb_element_t *element; unm_t group1; /* group used to deal with missing names and provide unique ones if needed */ elementlist_dedup_initializer(ededup); @@ -763,7 +763,7 @@ gdl_iterator_t eit; pcb_line_t *line; pcb_arc_t *arc; - ElementType *element; + pcb_element_t *element; pcb_box_t *boxResult; Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */ @@ -997,7 +997,7 @@ Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */ Coord xPos, yPos; - ElementType *element; + pcb_element_t *element; unm_t group1; /* group used to deal with missing names and provide unique ones if needed */ const char * currentElementName; LibraryMenuTypePtr current_pin_menu; Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 4773) +++ trunk/src_plugins/io_lihata/read.c (revision 4774) @@ -336,7 +336,7 @@ } -static int parse_line(pcb_layer_t *ly, ElementType *el, lht_node_t *obj, int no_id, Coord dx, Coord dy) +static int parse_line(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, int no_id, Coord dx, Coord dy) { pcb_line_t *line; @@ -404,7 +404,7 @@ return 0; } -static int parse_arc(pcb_layer_t *ly, ElementType *el, lht_node_t *obj, Coord dx, Coord dy) +static int parse_arc(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, Coord dx, Coord dy) { pcb_arc_t *arc; @@ -438,7 +438,7 @@ } -static int parse_polygon(pcb_layer_t *ly, ElementType *el, lht_node_t *obj) +static int parse_polygon(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj) { pcb_polygon_t *poly = GetPolygonMemory(ly); lht_node_t *geo; @@ -488,7 +488,7 @@ return 0; } -static int parse_pcb_text(pcb_layer_t *ly, ElementType *el, lht_node_t *obj) +static int parse_pcb_text(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj) { TextType *text; lht_node_t *role; @@ -580,7 +580,7 @@ } /* If el == NULL and dt != NULL it is a via (for now). */ -static int parse_pin(pcb_data_t *dt, ElementType *el, lht_node_t *obj, Coord dx, Coord dy) +static int parse_pin(pcb_data_t *dt, pcb_element_t *el, lht_node_t *obj, Coord dx, Coord dy) { pcb_pin_t *via; @@ -615,7 +615,7 @@ return 0; } -static int parse_pad(ElementType *el, lht_node_t *obj, Coord dx, Coord dy) +static int parse_pad(pcb_element_t *el, lht_node_t *obj, Coord dx, Coord dy) { pcb_pad_t *pad; @@ -650,7 +650,7 @@ static int parse_element(pcb_board_t *pcb, pcb_data_t *dt, lht_node_t *obj) { - ElementType *elem = GetElementMemory(dt); + pcb_element_t *elem = GetElementMemory(dt); lht_node_t *lst, *n; lht_dom_iterator_t it; int onsld; Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 4773) +++ trunk/src_plugins/io_lihata/write.c (revision 4774) @@ -375,7 +375,7 @@ return obj; } -static lht_node_t *build_element(ElementType *elem) +static lht_node_t *build_element(pcb_element_t *elem) { char buff[128]; pcb_line_t *li; @@ -485,7 +485,7 @@ { lht_node_t *grp, *ndt; pcb_pin_t *pi; - ElementType *el; + pcb_element_t *el; gdl_iterator_t it; pcb_rat_t *line; Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 4773) +++ trunk/src_plugins/io_pcb/file.c (revision 4774) @@ -371,7 +371,7 @@ gdl_iterator_t eit; pcb_line_t *line; pcb_arc_t *arc; - ElementType *element; + pcb_element_t *element; pcb_printf_slot[0] = ((io_pcb_ctx_t *)(ctx->plugin_data))->write_coord_fmt; elementlist_foreach(&Data->Element, &eit, element) { @@ -559,7 +559,7 @@ void PostLoadElementPCB() { pcb_board_t *pcb_save = PCB; - ElementTypePtr e; + pcb_element_t *e; if (!yyPCB) return; Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 4773) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 4774) @@ -709,7 +709,7 @@ const char *yyfilename; /* in this file */ pcb_board_t * yyPCB; /* used by parser */ pcb_data_t * yyData; -ElementTypePtr yyElement; +pcb_element_t * yyElement; pcb_font_t * yyFont; conf_role_t yy_settings_dest; FlagType yy_pcb_flags; Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 4773) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 4774) @@ -75,7 +75,7 @@ const char *yyfilename; /* in this file */ pcb_board_t * yyPCB; /* used by parser */ pcb_data_t * yyData; -ElementTypePtr yyElement; +pcb_element_t * yyElement; pcb_font_t * yyFont; conf_role_t yy_settings_dest; FlagType yy_pcb_flags; Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 4773) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 4774) @@ -130,7 +130,7 @@ extern char *yytext; /* defined by LEX */ extern pcb_board_t * yyPCB; extern pcb_data_t * yyData; -extern ElementTypePtr yyElement; +extern pcb_element_t *yyElement; extern pcb_font_t * yyFont; extern int pcb_lineno; /* linenumber */ extern char *yyfilename; /* in this file */ Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 4773) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 4774) @@ -67,7 +67,7 @@ extern char *yytext; /* defined by LEX */ extern pcb_board_t * yyPCB; extern pcb_data_t * yyData; -extern ElementTypePtr yyElement; +extern pcb_element_t *yyElement; extern pcb_font_t * yyFont; extern int pcb_lineno; /* linenumber */ extern char *yyfilename; /* in this file */ Index: trunk/src_plugins/mincut/rats_mincut.c =================================================================== --- trunk/src_plugins/mincut/rats_mincut.c (revision 4773) +++ trunk/src_plugins/mincut/rats_mincut.c (revision 4774) @@ -161,7 +161,7 @@ for (n = short_conns, gids = 2; n != NULL; n = n->next, gids++) { char *s; const char *typ; - ElementType *parent; + pcb_element_t *parent; n->gid = gids; debprintf(" {%d} found %d %d/%p type %d from %d\n", n->gid, n->to_type, n->to->ID, (void *)n->to, n->type, n->from_id); lut_by_oid[n->to->ID] = n; Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 4773) +++ trunk/src_plugins/propedit/propsel.c (revision 4774) @@ -124,7 +124,7 @@ map_attr(ctx, &poly->Attributes); } -static void map_eline_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_line_t *line) +static void map_eline_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line) { map_chk_skip(ctx, line); map_line_cb(ctx, pcb, NULL, line); @@ -131,7 +131,7 @@ map_attr(ctx, &line->Attributes); } -static void map_earc_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_arc_t *arc) +static void map_earc_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc) { map_chk_skip(ctx, arc); map_arc_cb(ctx, pcb, NULL, arc); @@ -138,7 +138,7 @@ map_attr(ctx, &arc->Attributes); } -static void map_etext_cb(void *ctx, pcb_board_t *pcb, ElementType *element, TextType *text) +static void map_etext_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, TextType *text) { map_chk_skip(ctx, text); map_text_cb(ctx, pcb, NULL, text); @@ -145,7 +145,7 @@ map_attr(ctx, &text->Attributes); } -static void map_epin_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pin_t *pin) +static void map_epin_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin) { map_chk_skip(ctx, pin); map_add_prop(ctx, "p/pin/thickness", Coord, pin->Thickness); @@ -155,7 +155,7 @@ map_attr(ctx, &pin->Attributes); } -static void map_epad_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pad_t *pad) +static void map_epad_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad) { map_chk_skip(ctx, pad); map_add_prop(ctx, "p/pad/mask", Coord, pad->Mask); @@ -323,7 +323,7 @@ } } -static void set_eline_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_line_t *line) +static void set_eline_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line) { set_ctx_t *st = (set_ctx_t *)ctx; @@ -335,7 +335,7 @@ } } -static void set_earc_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_arc_t *arc) +static void set_earc_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc) { set_ctx_t *st = (set_ctx_t *)ctx; @@ -347,12 +347,12 @@ } } -static void set_etext_cb(void *ctx, pcb_board_t *pcb, ElementType *element, TextType *text) +static void set_etext_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, TextType *text) { set_text_cb_any(ctx, pcb, PCB_TYPE_ELEMENT_NAME, element, text); } -static void set_epin_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pin_t *pin) +static void set_epin_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin) { set_ctx_t *st = (set_ctx_t *)ctx; const char *pn = st->name + 6; @@ -377,7 +377,7 @@ ChangeObject2ndSize(PCB_TYPE_PIN, pin->Element, pin, NULL, st->c, st->c_absolute, pcb_false)) DONE; } -static void set_epad_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pad_t *pad) +static void set_epad_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad) { set_ctx_t *st = (set_ctx_t *)ctx; const char *pn = st->name + 6; @@ -510,31 +510,31 @@ del_attr(ctx, &poly->Attributes); } -static void del_eline_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_line_t *line) +static void del_eline_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line) { map_chk_skip(ctx, line); del_attr(ctx, &line->Attributes); } -static void del_earc_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_arc_t *arc) +static void del_earc_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc) { map_chk_skip(ctx, arc); del_attr(ctx, &arc->Attributes); } -static void del_etext_cb(void *ctx, pcb_board_t *pcb, ElementType *element, TextType *text) +static void del_etext_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, TextType *text) { map_chk_skip(ctx, text); del_attr(ctx, &text->Attributes); } -static void del_epin_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pin_t *pin) +static void del_epin_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin) { map_chk_skip(ctx, pin); del_attr(ctx, &pin->Attributes); } -static void del_epad_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pad_t *pad) +static void del_epad_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad) { map_chk_skip(ctx, pad); del_attr(ctx, &pad->Attributes); Index: trunk/src_plugins/query/query_access.c =================================================================== --- trunk/src_plugins/query/query_access.c (revision 4773) +++ trunk/src_plugins/query/query_access.c (revision 4774) @@ -69,7 +69,7 @@ APPEND(ctx, PCB_OBJ_POLYGON, poly, PCB_PARENT_LAYER, layer); } -static int list_element_cb(void *ctx, pcb_board_t *pcb, ElementType *element, int enter) +static int list_element_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, int enter) { if (enter) APPEND(ctx, PCB_OBJ_ELEMENT, element, PCB_PARENT_DATA, pcb->Data); @@ -76,27 +76,27 @@ return 0; } -static void list_eline_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_line_t *line) +static void list_eline_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_line_t *line) { APPEND(ctx, PCB_OBJ_ELINE, line, PCB_PARENT_ELEMENT, element); } -static void list_earc_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_arc_t *arc) +static void list_earc_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_arc_t *arc) { APPEND(ctx, PCB_OBJ_EARC, arc, PCB_PARENT_ELEMENT, element); } -static void list_etext_cb(void *ctx, pcb_board_t *pcb, ElementType *element, TextType *text) +static void list_etext_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, TextType *text) { APPEND(ctx, PCB_OBJ_ETEXT, text, PCB_PARENT_ELEMENT, element); } -static void list_epin_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pin_t *pin) +static void list_epin_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin) { APPEND(ctx, PCB_OBJ_PIN, pin, PCB_PARENT_ELEMENT, element); } -static void list_epad_cb(void *ctx, pcb_board_t *pcb, ElementType *element, pcb_pad_t *pad) +static void list_epad_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad) { APPEND(ctx, PCB_OBJ_PAD, pad, PCB_PARENT_ELEMENT, element); } @@ -488,7 +488,7 @@ static int field_element(pcb_obj_t *obj, pcb_qry_node_t *fld, pcb_qry_val_t *res) { - ElementType *p = obj->data.element; + pcb_element_t *p = obj->data.element; query_fields_keys_t fh1; fld2hash_req(fh1, fld, 0); @@ -517,7 +517,7 @@ PCB_QRY_RET_INV(res); } -static int field_element_from_ptr(ElementType *e, pcb_qry_node_t *fld, pcb_qry_val_t *res) +static int field_element_from_ptr(pcb_element_t *e, pcb_qry_node_t *fld, pcb_qry_val_t *res) { pcb_obj_t tmp; tmp.type = PCB_OBJ_ELEMENT; Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 4773) +++ trunk/src_plugins/renumber/renumber.c (revision 4774) @@ -57,8 +57,8 @@ static int ActionRenumber(int argc, const char **argv, Coord x, Coord y) { pcb_bool changed = pcb_false; - ElementTypePtr *element_list; - ElementTypePtr *locked_element_list; + pcb_element_t **element_list; + pcb_element_t **locked_element_list; unsigned int i, j, k, cnt, lock_cnt; unsigned int tmpi; size_t sz; @@ -130,8 +130,8 @@ * We'll actually renumber things in the 2nd pass. */ numele = elementlist_length(&PCB->Data->Element); - element_list = (ElementType **) calloc(numele, sizeof(ElementTypePtr)); - locked_element_list = (ElementType **) calloc(numele, sizeof(ElementTypePtr)); + element_list = (pcb_element_t **) calloc(numele, sizeof(pcb_element_t *)); + locked_element_list = (pcb_element_t **) calloc(numele, sizeof(pcb_element_t *)); was = (char **) calloc(numele, sizeof(char *)); is = (char **) calloc(numele, sizeof(char *)); if (element_list == NULL || locked_element_list == NULL || was == NULL || is == NULL) { Index: trunk/src_plugins/report/drill.c =================================================================== --- trunk/src_plugins/report/drill.c (revision 4773) +++ trunk/src_plugins/report/drill.c (revision 4774) @@ -39,14 +39,14 @@ /* * some local prototypes */ -static void FillDrill(DrillTypePtr, ElementTypePtr, pcb_pin_t *); -static void InitializeDrill(DrillTypePtr, pcb_pin_t *, ElementTypePtr); +static void FillDrill(DrillTypePtr, pcb_element_t *, pcb_pin_t *); +static void InitializeDrill(DrillTypePtr, pcb_pin_t *, pcb_element_t *); -static void FillDrill(DrillTypePtr Drill, ElementTypePtr Element, pcb_pin_t *Pin) +static void FillDrill(DrillTypePtr Drill, pcb_element_t *Element, pcb_pin_t *Pin) { pcb_cardinal_t n; - ElementTypeHandle ptr; + pcb_element_t **ptr; pcb_pin_t ** pin; pin = GetDrillPinMemory(Drill); @@ -67,7 +67,7 @@ Drill->UnplatedCount++; } -static void InitializeDrill(DrillTypePtr drill, pcb_pin_t *pin, ElementTypePtr element) +static void InitializeDrill(DrillTypePtr drill, pcb_pin_t *pin, pcb_element_t *element) { void *ptr; @@ -85,7 +85,7 @@ *((pcb_pin_t **) ptr) = pin; if (element) { ptr = (void *) GetDrillElementMemory(drill); - *((ElementTypeHandle) ptr) = element; + *((pcb_element_t **) ptr) = element; drill->PinCount = 1; } else @@ -200,7 +200,7 @@ d->Drill[i].ElementMax = d->Drill[i].ElementN + d->Drill[i + 1].ElementN; if (d->Drill[i].ElementMax) { - d->Drill[i].Element = (ElementTypePtr *) realloc(d->Drill[i].Element, d->Drill[i].ElementMax * sizeof(ElementTypePtr)); + d->Drill[i].Element = (pcb_element_t **) realloc(d->Drill[i].Element, d->Drill[i].ElementMax * sizeof(pcb_element_t *)); for (ei = 0; ei < d->Drill[i + 1].ElementN; ei++) { for (ej = 0; ej < d->Drill[i].ElementN; ej++) @@ -288,9 +288,9 @@ /* --------------------------------------------------------------------------- * get next slot for a DrillElement, allocates memory if necessary */ -ElementTypeHandle GetDrillElementMemory(DrillTypePtr Drill) +pcb_element_t **GetDrillElementMemory(DrillTypePtr Drill) { - ElementTypePtr *element; + pcb_element_t **element; element = Drill->Element; @@ -297,9 +297,9 @@ /* realloc new memory if necessary and clear it */ if (Drill->ElementN >= Drill->ElementMax) { Drill->ElementMax += STEP_ELEMENT; - element = (ElementTypePtr *) realloc(element, Drill->ElementMax * sizeof(ElementTypeHandle)); + element = (pcb_element_t **) realloc(element, Drill->ElementMax * sizeof(pcb_element_t **)); Drill->Element = element; - memset(element + Drill->ElementN, 0, STEP_ELEMENT * sizeof(ElementTypeHandle)); + memset(element + Drill->ElementN, 0, STEP_ELEMENT * sizeof(pcb_element_t **)); } return (element + Drill->ElementN++); } Index: trunk/src_plugins/report/drill.h =================================================================== --- trunk/src_plugins/report/drill.h (revision 4773) +++ trunk/src_plugins/report/drill.h (revision 4774) @@ -38,7 +38,7 @@ PinN, /* number of drill coordinates in the list */ PinMax; /* max number of coordinates from malloc() */ pcb_pin_t **Pin; /* coordinates to drill */ - ElementTypePtr *Element; /* a pointer to an array of element pointers */ + pcb_element_t **Element; /* a pointer to an array of element pointers */ } DrillType, *DrillTypePtr; typedef struct { /* holds a range of Drill Infos */ @@ -52,7 +52,7 @@ void RoundDrillInfo(DrillInfoTypePtr, int); DrillTypePtr GetDrillInfoDrillMemory(DrillInfoTypePtr); pcb_pin_t **GetDrillPinMemory(DrillTypePtr); -ElementTypeHandle GetDrillElementMemory(DrillTypePtr); +pcb_element_t **GetDrillElementMemory(DrillTypePtr); #define DRILL_LOOP(top) do { \ pcb_cardinal_t n; \ Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 4773) +++ trunk/src_plugins/report/report.c (revision 4774) @@ -171,7 +171,7 @@ case PCB_TYPE_PIN: { pcb_pin_t *Pin; - ElementTypePtr element; + pcb_element_t *element; #ifndef NDEBUG if (gui->shift_is_pressed()) { __r_dump_tree(PCB->Data->pin_tree->root, 0); @@ -179,7 +179,7 @@ } #endif Pin = (pcb_pin_t *) ptr2; - element = (ElementTypePtr) ptr1; + element = (pcb_element_t *) ptr1; PIN_LOOP(element); { @@ -325,7 +325,7 @@ { Coord len; pcb_pad_t *Pad; - ElementTypePtr element; + pcb_element_t *element; #ifndef NDEBUG if (gui->shift_is_pressed()) { __r_dump_tree(PCB->Data->pad_tree->root, 0); @@ -333,7 +333,7 @@ } #endif Pad = (pcb_pad_t *) ptr2; - element = (ElementTypePtr) ptr1; + element = (pcb_element_t *) ptr1; PAD_LOOP(element); { @@ -371,7 +371,7 @@ } case PCB_TYPE_ELEMENT: { - ElementTypePtr element; + pcb_element_t *element; #ifndef NDEBUG if (gui->shift_is_pressed()) { __r_dump_tree(PCB->Data->element_tree->root, 0); @@ -378,7 +378,7 @@ return 0; } #endif - element = (ElementTypePtr) ptr2; + element = (pcb_element_t *) ptr2; report = pcb_strdup_printf("%m+ELEMENT ID# %ld; Flags:%s\n" "BoundingBox %$mD %$mD.\n" "Descriptive Name \"%s\".\n" Index: trunk/src_plugins/smartdisperse/smartdisperse.c =================================================================== --- trunk/src_plugins/smartdisperse/smartdisperse.c (revision 4773) +++ trunk/src_plugins/smartdisperse/smartdisperse.c (revision 4774) @@ -54,7 +54,7 @@ * * This is taken almost entirely from ActionDisperseElements, with cleanup */ -static void place(ElementType * element) +static void place(pcb_element_t * element) { Coord dx, dy; @@ -101,7 +101,7 @@ */ static Coord padDX(pcb_connection_t * conn) { - ElementType *element = (ElementType *) conn->ptr1; + pcb_element_t *element = (pcb_element_t *) conn->ptr1; AnyLineObjectType *line = (AnyLineObjectType *) conn->ptr2; return line->BoundingBox.X1 - (element->BoundingBox.X1 + element->BoundingBox.X2) / 2; @@ -191,8 +191,8 @@ NET_LOOP(Nets); { pcb_connection_t *conna, *connb; - ElementType *ea, *eb; -/* ElementType *epp;*/ + pcb_element_t *ea, *eb; +/* pcb_element_t *epp;*/ if (net->ConnectionN != 2) continue; @@ -202,8 +202,8 @@ if (!IS_ELEMENT(conna) || !IS_ELEMENT(conna)) continue; - ea = (ElementType *) conna->ptr1; - eb = (ElementType *) connb->ptr1; + ea = (pcb_element_t *) conna->ptr1; + eb = (pcb_element_t *) connb->ptr1; /* place this pair if possible */ if (is_visited(ea) || is_visited(eb)) @@ -228,12 +228,12 @@ { CONNECTION_LOOP(net); { - ElementType *element; + pcb_element_t *element; if (!IS_ELEMENT(connection)) continue; - element = (ElementType *) connection->ptr1; + element = (pcb_element_t *) connection->ptr1; /* place this one if needed */ if (is_visited(element)) Index: trunk/src_plugins/teardrops/teardrops.c =================================================================== --- trunk/src_plugins/teardrops/teardrops.c (revision 4773) +++ trunk/src_plugins/teardrops/teardrops.c (revision 4774) @@ -41,7 +41,7 @@ static int layer; static int px, py; static Coord thickness; -static ElementType *element; +static pcb_element_t *element; static int new_arcs = 0; @@ -207,7 +207,7 @@ spot.X2 = px + 10; spot.Y2 = py + 10; - element = (ElementType *) pin->Element; + element = (pcb_element_t *) pin->Element; fprintf(stderr, "Pin %s (%s) at %.6f, %.6f (element %s, %s, %s)\n", EMPTY(pin->Number), EMPTY(pin->Name), /* 0.01 * pin->X, 0.01 * pin->Y, */ @@ -252,7 +252,7 @@ px = (pad->BoundingBox.X1 + pad->BoundingBox.X2) / 2; py = (pad->BoundingBox.Y1 + pad->BoundingBox.Y2) / 2; thickness = pad->Thickness; - element = (ElementType *) pad->Element; + element = (pcb_element_t *) pad->Element; fprintf(stderr, "Pad %s (%s) at %.6f, %.6f (element %s, %s, %s) \n", Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 4773) +++ trunk/src_plugins/vendordrill/vendor.c (revision 4774) @@ -568,7 +568,7 @@ } } -pcb_bool vendorIsElementMappable(ElementTypePtr element) +pcb_bool vendorIsElementMappable(pcb_element_t *element) { int i; int noskip; Index: trunk/src_plugins/vendordrill/vendor.h =================================================================== --- trunk/src_plugins/vendordrill/vendor.h (revision 4773) +++ trunk/src_plugins/vendordrill/vendor.h (revision 4774) @@ -24,6 +24,6 @@ #define PCB_VENDOR_H int vendorDrillMap(int); -pcb_bool vendorIsElementMappable(ElementTypePtr); +pcb_bool vendorIsElementMappable(pcb_element_t *); #endif /* __VENDOR_H__ */