======pcb Plugins====== pcb has a plug-in mechanism that allows developers to add or modify its functionality. Plugins can add pcb actions, hook into the GUI HIDs, create new exporters, and more. For a tutorial on the basics of writing and installing a pluging, see the hello world example on the [[geda:pcb_developer_introduction_2| pcb Developer Introduction]] page. This page will discuss how plugins interact with the pcb system. =====Plugin Mechanics===== pcb plugins are essentially shared libraries that pcb will load at run-time. Because of this, they can be written in just about any language that can be compiled into a shared library. I haven't verified anything other than C and C++, but it ought to be possible. If you've successfully written a plugin in another language, let me know! At runtime, pcb scans several directories for .so/.dll files (see src/common/hidinit.c:hid_load_dir). These include the exec prefix and the users personal preferences directory (~/.pcb). The exec_prefix is currently reserved for system plugins. Inside the personal pref directory should be a directory called "plugins". User plugins should be located in this directory. If pcb finds a .so/.dll file, it opens it and looks for a couple of symbols: "hid__init" and "pcb_plugin_init". If it finds one, it executes it as a function. These functions are responsible for registering the code they represent with pcb. ====Registration==== ====HID Structures==== =====Plugin Resources===== ====Handy Plugin Template==== {{ :geda:pcb_plugin_template.tar.gz |}} ====Plugin Repositories==== [[https://github.com/bert/pcb-plugins]] [[https://ljh4timm.home.xs4all.nl/gaf/dox_pcb-plugins/index.html]] ====List of Plugins==== * [[http://www.delorie.com/pcb/polystitch.c| Polygon Stitcher]], by DJ * [[http://www.delorie.com/pcb/ben-mode/ | Ben Mode]] photos for the PNG hid, by DJ * [[http://www.delorie.com/pcb/findrat.c | Find Rat]], by DJ * [[http://www.delorie.com/pcb/boardflip.c | Board Flip]], by DJ * [[http://www.delorie.com/pcb/renumberblock.c | Renumber Block]], by DJ * [[http://www.delorie.com/pcb/teardrops/ | Teardrops]], by DJ * [[https://github.com/bert/pcb-plugins]] git repo with many plugins * [[https://github.com/bgamari/pcb-sedrename| sed rename]], by bgamari * {{ :pcb:plugin_debug_window.tar.gz | Debug Window}}, by Chad Parker