missing NULL terminator in set_config_x
[geda-gaf.git] / docs / wiki / pcb-plugins.html
blob9e79205bc52bca1f94bb81173a4ae999f5fe80c2
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4 <head>
5 <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />
6 <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />
7 <link rel="stylesheet" media="print" type="text/css" href="./print.css" />
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10 </head>
11 <body>
13 <h1 class="sectionedit1" id="pcb_plugins">pcb Plugins</h1>
14 <div class="level1">
16 <p>
17 pcb has a plug-in mechanism that allows developers to add or modify its functionality. Plugins can add pcb actions, hook into the <abbr title="Graphical User Interface">GUI</abbr> 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 <a href="geda-pcb_developer_introduction_2.html" class="wikilink1" title="geda-pcb_developer_introduction_2.html"> pcb Developer Introduction</a> page. This page will discuss how plugins interact with the pcb system.
18 </p>
20 </div>
21 <!-- EDIT1 SECTION "pcb Plugins" [1-435] -->
22 <h2 class="sectionedit2" id="plugin_mechanics">Plugin Mechanics</h2>
23 <div class="level2">
25 <p>
26 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&#039;t verified anything other than C and C++, but it ought to be possible. If you&#039;ve successfully written a plugin in another language, let me know!
27 </p>
29 <p>
30 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.
31 </p>
33 <p>
34 If pcb finds a .so/.dll file, it opens it and looks for a couple of symbols: “hid_&lt;file basename&gt;_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.
35 </p>
37 </div>
38 <!-- EDIT2 SECTION "Plugin Mechanics" [436-1429] -->
39 <h3 class="sectionedit3" id="registration">Registration</h3>
40 <div class="level3">
42 </div>
43 <!-- EDIT3 SECTION "Registration" [1430-1451] -->
44 <h3 class="sectionedit4" id="hid_structures">HID Structures</h3>
45 <div class="level3">
47 </div>
48 <!-- EDIT4 SECTION "HID Structures" [1452-1476] -->
49 <h2 class="sectionedit5" id="plugin_resources">Plugin Resources</h2>
50 <div class="level2">
52 </div>
53 <!-- EDIT5 SECTION "Plugin Resources" [1477-1503] -->
54 <h3 class="sectionedit6" id="handy_plugin_template">Handy Plugin Template</h3>
55 <div class="level3">
57 <p>
58 <a href="media/geda/pcb_plugin_template.tar.gz" class="media" target="_blank" title="geda:pcb_plugin_template.tar.gz"></a>
59 </p>
61 </div>
62 <!-- EDIT6 SECTION "Handy Plugin Template" [1504-1574] -->
63 <h3 class="sectionedit7" id="plugin_repositories">Plugin Repositories</h3>
64 <div class="level3">
66 <p>
67 <a href="https://github.com/bert/pcb-plugins" class="urlextern" title="https://github.com/bert/pcb-plugins" rel="nofollow">https://github.com/bert/pcb-plugins</a>
68 </p>
70 <p>
71 <a href="https://ljh4timm.home.xs4all.nl/gaf/dox_pcb-plugins/index.html" class="urlextern" title="https://ljh4timm.home.xs4all.nl/gaf/dox_pcb-plugins/index.html" rel="nofollow">https://ljh4timm.home.xs4all.nl/gaf/dox_pcb-plugins/index.html</a>
72 </p>
74 </div>
75 <!-- EDIT7 SECTION "Plugin Repositories" [1575-1712] -->
76 <h3 class="sectionedit8" id="list_of_plugins">List of Plugins</h3>
77 <div class="level3">
78 <ul>
79 <li class="level1"><div class="li"> <a href="http://www.delorie.com/pcb/polystitch.c" class="urlextern" title="http://www.delorie.com/pcb/polystitch.c" rel="nofollow"> Polygon Stitcher</a>, by DJ</div>
80 </li>
81 <li class="level1"><div class="li"> <a href="http://www.delorie.com/pcb/ben-mode/" class="urlextern" title="http://www.delorie.com/pcb/ben-mode/" rel="nofollow"> Ben Mode</a> photos for the PNG hid, by DJ</div>
82 </li>
83 <li class="level1"><div class="li"> <a href="http://www.delorie.com/pcb/findrat.c" class="urlextern" title="http://www.delorie.com/pcb/findrat.c" rel="nofollow"> Find Rat</a>, by DJ</div>
84 </li>
85 <li class="level1"><div class="li"> <a href="http://www.delorie.com/pcb/boardflip.c" class="urlextern" title="http://www.delorie.com/pcb/boardflip.c" rel="nofollow"> Board Flip</a>, by DJ</div>
86 </li>
87 <li class="level1"><div class="li"> <a href="http://www.delorie.com/pcb/renumberblock.c" class="urlextern" title="http://www.delorie.com/pcb/renumberblock.c" rel="nofollow"> Renumber Block</a>, by DJ</div>
88 </li>
89 <li class="level1"><div class="li"> <a href="http://www.delorie.com/pcb/teardrops/" class="urlextern" title="http://www.delorie.com/pcb/teardrops/" rel="nofollow"> Teardrops</a>, by DJ</div>
90 </li>
91 <li class="level1"><div class="li"> <a href="https://github.com/bert/pcb-plugins" class="urlextern" title="https://github.com/bert/pcb-plugins" rel="nofollow">https://github.com/bert/pcb-plugins</a> git repo with many plugins</div>
92 </li>
93 <li class="level1"><div class="li"> <a href="https://github.com/bgamari/pcb-sedrename" class="urlextern" title="https://github.com/bgamari/pcb-sedrename" rel="nofollow"> sed rename</a>, by bgamari</div>
94 </li>
95 <li class="level1"><div class="li"> <a href="media/pcb/plugin_debug_window.tar.gz" class="media" target="_blank" title="pcb:plugin_debug_window.tar.gz"> Debug Window</a>, by Chad Parker</div>
96 </li>
97 </ul>
99 </div>
100 <!-- EDIT8 SECTION "List of Plugins" [1713-] --></body>
101 </html>