Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4971) +++ trunk/doc-rnd/hacking/renames (revision 4972) @@ -599,3 +599,11 @@ ALLTEXT_LOOP -> PCB_TEXT_ALL_LOOP VISIBLETEXT_LOOP -> PCB_TEXT_VISIBLE_LOOP TEXT_LOOP -> PCB_TEXT_LOOP +LoadElementToBuffer -> pcb_element_load_to_buffer +LoadFootprintByName -> pcb_element_load_footprint_by_name +SmashBufferElement -> pcb_element_smash_buffer +ConvertBufferToElement -> pcb_element_convert_from_buffer +CopyElementLowLevel -> pcb_element_copy +UniqueElementName -> pcb_element_uniq_name +AddTextToElement -> pcb_element_text_set +ChangeElementText -> pcb_element_text_change Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4971) +++ trunk/src/buffer.c (revision 4972) @@ -161,7 +161,7 @@ if (!name) PCB_AFAIL(loadfootprint); - if (LoadFootprintByName(PCB_PASTEBUFFER, name)) + if (pcb_element_load_footprint_by_name(PCB_PASTEBUFFER, name)) return 1; if (elementlist_length(&PCB_PASTEBUFFER->Data->Element) == 0) { @@ -786,12 +786,12 @@ /* converts buffer contents into an element */ case F_Convert: - ConvertBufferToElement(PCB_PASTEBUFFER); + pcb_element_convert_from_buffer(PCB_PASTEBUFFER); break; /* break up element for editing */ case F_Restore: - SmashBufferElement(PCB_PASTEBUFFER); + pcb_element_smash_buffer(PCB_PASTEBUFFER); break; /* Mirror buffer */ Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 4971) +++ trunk/src/file_act.c (revision 4972) @@ -119,7 +119,7 @@ if (strcasecmp(function, "ElementToBuffer") == 0) { pcb_notify_crosshair_change(pcb_false); - if (LoadElementToBuffer(PCB_PASTEBUFFER, name)) + if (pcb_element_load_to_buffer(PCB_PASTEBUFFER, name)) SetMode(PCB_MODE_PASTE_BUFFER); pcb_notify_crosshair_change(pcb_true); } Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4971) +++ trunk/src/obj_elem.c (revision 4972) @@ -122,7 +122,7 @@ * returns pcb_false on error * if successful, update some other stuff and reposition the pastebuffer */ -pcb_bool LoadElementToBuffer(pcb_buffer_t *Buffer, const char *Name) +pcb_bool pcb_element_load_to_buffer(pcb_buffer_t *Buffer, const char *Name) { pcb_element_t *element; @@ -151,14 +151,14 @@ /* Searches for the given element by "footprint" name, and loads it into the buffer. Returns zero on success, non-zero on error. */ -int LoadFootprintByName(pcb_buffer_t *Buffer, const char *Footprint) +int pcb_element_load_footprint_by_name(pcb_buffer_t *Buffer, const char *Footprint) { - return !LoadElementToBuffer(Buffer, Footprint); + return !pcb_element_load_to_buffer(Buffer, Footprint); } /* break buffer element into pieces */ -pcb_bool SmashBufferElement(pcb_buffer_t *Buffer) +pcb_bool pcb_element_smash_buffer(pcb_buffer_t *Buffer) { pcb_element_t *element; pcb_cardinal_t group; @@ -253,7 +253,7 @@ } /* convert buffer contents into an element */ -pcb_bool ConvertBufferToElement(pcb_buffer_t *Buffer) +pcb_bool pcb_element_convert_from_buffer(pcb_buffer_t *Buffer) { pcb_element_t *Element; pcb_cardinal_t group; @@ -481,7 +481,7 @@ } /* changes the layout-name of an element */ -char *ChangeElementText(pcb_board_t * pcb, pcb_data_t * data, pcb_element_t *Element, int which, char *new_name) +char *pcb_element_text_change(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 */ -pcb_element_t *CopyElementLowLevel(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, pcb_coord_t dx, pcb_coord_t dy) +pcb_element_t *pcb_element_copy(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, pcb_coord_t dx, pcb_coord_t dy) { int i; /* release old memory if necessary */ @@ -576,11 +576,11 @@ /* copy values and set additional information */ TextScale = MAX(MIN_TEXTSCALE, TextScale); - AddTextToElement(&DESCRIPTION_TEXT(Element), PCBFont, TextX, TextY, Direction, Description, TextScale, TextFlags); + pcb_element_text_set(&DESCRIPTION_TEXT(Element), PCBFont, TextX, TextY, Direction, Description, TextScale, TextFlags); if (uniqueName) - NameOnPCB = UniqueElementName(Data, NameOnPCB); - AddTextToElement(&NAMEONPCB_TEXT(Element), PCBFont, TextX, TextY, Direction, NameOnPCB, TextScale, TextFlags); - AddTextToElement(&VALUE_TEXT(Element), PCBFont, TextX, TextY, Direction, Value, TextScale, TextFlags); + NameOnPCB = pcb_element_uniq_name(Data, NameOnPCB); + pcb_element_text_set(&NAMEONPCB_TEXT(Element), PCBFont, TextX, TextY, Direction, NameOnPCB, TextScale, TextFlags); + pcb_element_text_set(&VALUE_TEXT(Element), PCBFont, TextX, TextY, Direction, Value, TextScale, TextFlags); DESCRIPTION_TEXT(Element).Element = Element; NAMEONPCB_TEXT(Element).Element = Element; VALUE_TEXT(Element).Element = Element; @@ -645,7 +645,7 @@ /* creates a new textobject as part of an element copies the values to the appropriate text object */ -void AddTextToElement(pcb_text_t *Text, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, +void pcb_element_text_set(pcb_text_t *Text, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, unsigned Direction, char *TextString, int Scale, pcb_flag_t Flags) { free(Text->TextString); @@ -879,7 +879,7 @@ /* make a unique name for the name on board * this can alter the contents of the input string */ -char *UniqueElementName(pcb_data_t *Data, char *Name) +char *pcb_element_uniq_name(pcb_data_t *Data, char *Name) { pcb_bool unique = pcb_true; /* null strings are ok */ @@ -1115,7 +1115,7 @@ pcb_element_t *element; element = pcb_element_alloc(ctx->buffer.dst); - CopyElementLowLevel(ctx->buffer.dst, element, Element, pcb_false, 0, 0); + pcb_element_copy(ctx->buffer.dst, element, Element, pcb_false, 0, 0); PCB_FLAG_CLEAR(ctx->buffer.extraflg, element); if (ctx->buffer.extraflg) { PCB_ELEMENT_PCB_TEXT_LOOP(element); @@ -1373,13 +1373,13 @@ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, &Element->Name[0])) return (NULL); if (NAME_INDEX() == NAMEONPCB_INDEX) { - if (conf_core.editor.unique_names && UniqueElementName(PCB->Data, ctx->chgname.new_name) != ctx->chgname.new_name) { + if (conf_core.editor.unique_names && pcb_element_uniq_name(PCB->Data, ctx->chgname.new_name) != ctx->chgname.new_name) { pcb_message(PCB_MSG_DEFAULT, _("Error: The name \"%s\" is not unique!\n"), ctx->chgname.new_name); return ((char *) -1); } } - return ChangeElementText(PCB, PCB->Data, Element, NAME_INDEX(), ctx->chgname.new_name); + return pcb_element_text_change(PCB, PCB->Data, Element, NAME_INDEX(), ctx->chgname.new_name); } void *ChangeElementNonetlist(pcb_opctx_t *ctx, pcb_element_t *Element) @@ -1507,7 +1507,7 @@ printf("Entered CopyElement, trying to copy element %s\n", Element->Name[1].TextString); #endif - pcb_element_t *element = CopyElementLowLevel(PCB->Data, + pcb_element_t *element = pcb_element_copy(PCB->Data, NULL, Element, conf_core.editor.unique_names, ctx->copy.DeltaX, ctx->copy.DeltaY); Index: trunk/src/obj_elem.h =================================================================== --- trunk/src/obj_elem.h (revision 4971) +++ trunk/src/obj_elem.h (revision 4972) @@ -73,12 +73,13 @@ int pcb_element_get_orientation(pcb_element_t * e); -pcb_bool LoadElementToBuffer(pcb_buffer_t *Buffer, const char *Name); -int LoadFootprintByName(pcb_buffer_t *Buffer, const char *Footprint); -pcb_bool SmashBufferElement(pcb_buffer_t *Buffer); -pcb_bool ConvertBufferToElement(pcb_buffer_t *Buffer); -pcb_element_t *CopyElementLowLevel(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, pcb_coord_t dx, pcb_coord_t dy); -char *UniqueElementName(pcb_data_t *Data, char *Name); +pcb_bool pcb_element_load_to_buffer(pcb_buffer_t *Buffer, const char *Name); +int pcb_element_load_footprint_by_name(pcb_buffer_t *Buffer, const char *Footprint); +pcb_bool pcb_element_smash_buffer(pcb_buffer_t *Buffer); +pcb_bool pcb_element_convert_from_buffer(pcb_buffer_t *Buffer); +pcb_element_t *pcb_element_copy(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, pcb_coord_t dx, pcb_coord_t dy); +char *pcb_element_uniq_name(pcb_data_t *Data, char *Name); + void r_delete_element(pcb_data_t * data, pcb_element_t * element); void pcb_element_move(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t DX, pcb_coord_t DY); @@ -90,7 +91,7 @@ pcb_line_t *pcb_element_line_new(pcb_element_t *Element, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness); -void AddTextToElement(pcb_text_t *Text, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, +void pcb_element_text_set(pcb_text_t *Text, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, unsigned Direction, char *TextString, int Scale, pcb_flag_t Flags); @@ -97,7 +98,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, pcb_element_t *Element, int which, char *new_name); +char *pcb_element_text_change(pcb_board_t * pcb, pcb_data_t * data, pcb_element_t *Element, int which, char *new_name); /* --------------------------------------------------------------------------- Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 4971) +++ trunk/src/object_act.c (revision 4972) @@ -625,10 +625,10 @@ element_cache = NULL; e = find_element_by_refdes(refdes); - old = ChangeElementText(PCB, PCB->Data, e, NAMEONPCB_INDEX, pcb_strdup(refdes)); + old = pcb_element_text_change(PCB, PCB->Data, e, NAMEONPCB_INDEX, pcb_strdup(refdes)); if (old) free(old); - old = ChangeElementText(PCB, PCB->Data, e, VALUE_INDEX, pcb_strdup(value)); + old = pcb_element_text_change(PCB, PCB->Data, e, VALUE_INDEX, pcb_strdup(value)); if (old) free(old); @@ -795,7 +795,7 @@ SetBufferNumber(MAX_BUFFER - 1); pcb_buffer_clear(PCB_PASTEBUFFER); pcb_copy_obj_to_buffer(PCB_PASTEBUFFER->Data, PCB->Data, PCB_TYPE_ELEMENT, ptr1, ptr2, ptr3); - SmashBufferElement(PCB_PASTEBUFFER); + pcb_element_smash_buffer(PCB_PASTEBUFFER); PCB_PASTEBUFFER->X = 0; PCB_PASTEBUFFER->Y = 0; SaveUndoSerialNumber(); Index: trunk/src/select_act.c =================================================================== --- trunk/src/select_act.c (revision 4971) +++ trunk/src/select_act.c (revision 4972) @@ -228,7 +228,7 @@ pcb_buffer_add_selected(PCB_PASTEBUFFER, x, y, pcb_true); SaveUndoSerialNumber(); RemoveSelected(); - ConvertBufferToElement(PCB_PASTEBUFFER); + pcb_element_convert_from_buffer(PCB_PASTEBUFFER); RestoreUndoSerialNumber(); pcb_buffer_copy_to_layout(x, y); SetBufferNumber(Note.Buffer); Index: trunk/src_plugins/hid_gtk/gui-library-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-library-window.c (revision 4971) +++ trunk/src_plugins/hid_gtk/gui-library-window.c (revision 4972) @@ -394,7 +394,7 @@ fullp = entry->data.fp.loc_info; } SetMode(PCB_MODE_ARROW); - if (LoadElementToBuffer(PCB_PASTEBUFFER, name == NULL ? fullp : name)) + if (pcb_element_load_to_buffer(PCB_PASTEBUFFER, name == NULL ? fullp : name)) SetMode(PCB_MODE_PASTE_BUFFER); /* update the preview with new symbol data */ Index: trunk/src_plugins/hid_gtk/gui-pinout-preview.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-pinout-preview.c (revision 4971) +++ trunk/src_plugins/hid_gtk/gui-pinout-preview.c (revision 4972) @@ -68,7 +68,7 @@ * move element to a 5% offset from zero position * set all package lines/arcs to zero width */ - CopyElementLowLevel(NULL, &pinout->element, element, FALSE, 0, 0); + pcb_element_copy(NULL, &pinout->element, element, FALSE, 0, 0); PCB_PIN_LOOP(&pinout->element); { PCB_FLAG_SET(PCB_FLAG_DISPLAYNAME, pin); Index: trunk/src_plugins/hid_lesstif/library.c =================================================================== --- trunk/src_plugins/hid_lesstif/library.c (revision 4971) +++ trunk/src_plugins/hid_lesstif/library.c (revision 4972) @@ -64,7 +64,7 @@ { pcb_fplibrary_t *e = picks.array[last_pick]; e = &e->data.dir.children.array[cbs->item_position - 1]; - if (LoadElementToBuffer(PCB_PASTEBUFFER, e->data.fp.loc_info)) + if (pcb_element_load_to_buffer(PCB_PASTEBUFFER, e->data.fp.loc_info)) SetMode(PCB_MODE_PASTE_BUFFER); } Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 4971) +++ trunk/src_plugins/shand_cmd/command.c (revision 4972) @@ -153,7 +153,7 @@ switch (argc) { case 1: /* filename is passed in commandline */ filename = argv[0]; - if (filename && LoadElementToBuffer(PCB_PASTEBUFFER, filename)) + if (filename && pcb_element_load_to_buffer(PCB_PASTEBUFFER, filename)) SetMode(PCB_MODE_PASTE_BUFFER); break;