← Back to team overview

kicad-developers team mailing list archive

Re: Using class CMP_LIBRARY - resolving dependencies


Mateusz wrote:
> I am working on a standalone, fast library/component move/edit program.
> First, I thought that I will write my own code for handling libraries files, but then I decided to use eeschema classes to do it.
> I would like to create in my program two instances of eeschema CMP_LIBRARY class, to copy/edit components between two libraries.
> I've wasted the whole day trying to resolve dependencies between different classes (I think the biggest problem are CMP_LIB_ENTRY & LIB_ENTRY classes which includes almost every other file/class). The structure is too messy for me to understand (too many externs etc.). I would like to ask you for help! Which files I need to include/link to make it work?


It helps if you look at it as a tree structure. Component libraries
(CMP_LIBRARY) are nothing more than a list of components (LIB_COMPONENT)
and alias (LIB_ALIAS) objects. Aliases are another name for a component
so they don't do much. Components are primarily a list of drawable
objects that define the component such as arcs (LIB_ARC), pins
(LIB_PIN), fields (LIB_FIELD), etc. Each of the drawable objects are
fairly self contained in that they can load, save, draw, and plot
themselves. You are only interested the load and save part.
Unfortunately, you are probably getting bit by the current drawing code
dependencies which are lots global variables and external function calls
to the Kicad drawing code which is mostly located in common source
directory. Try building the source documention with Doxygen to get a
better overview of how these classes fit together. If you think the
dependencies are bad now, you should have seen them before I started to
clean up the component library code.


> ------------------------------------
> Yahoo! Groups Links