User Tools

Site Tools


geda:pcb_developer_introduction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
geda:pcb_developer_introduction [2015/07/29 07:48]
myken insert image
geda:pcb_developer_introduction [2015/07/30 09:11] (current)
myken Added comment on the README_FILES directory
Line 24: Line 24:
 | |  example|Speaks for it self, examples how to use PCB| | |  example|Speaks for it self, examples how to use PCB|
 | |  gts|This directory/​library is only used by the toporouter (toporouter.h includes gts.h)| | |  gts|This directory/​library is only used by the toporouter (toporouter.h includes gts.h)|
-|*|  intl|Internationalization - it handles conversions to non-English languages. It is for i18n, l10n and related stuff.|+|*|  intl|Internationalization - it handles conversions to non-English languages. It is for i18n, l10n and related stuff. See the //​**ABOUT-NLS**//​ text file in the root directory for more information.|
 | |  lib|The M4 library stores the footprints as M4 macros| | |  lib|The M4 library stores the footprints as M4 macros|
 | |  m4|Some additional m4 scripts used by configure| | |  m4|Some additional m4 scripts used by configure|
 | |  newlib|File to make newlib library components| | |  newlib|File to make newlib library components|
 | |  po|Translation files| | |  po|Translation files|
-| |  README_FILES|Speaks for it self|+| |  README_FILES|Information in this directory is obsolete and/or very old. Just ignore ​it.  ​|
 | |  src|The source code| | |  src|The source code|
 | |  tests|File to test the build during make| | |  tests|File to test the build during make|
Line 64: Line 64:
  
 ^ _*_ ^File  ^Short description ​ ^Comment / Explanation ^ ^ _*_ ^File  ^Short description ​ ^Comment / Explanation ^
-|H|action.*|action routines for output window|This is one of the top files. A lot of the functionality will start here. This is a good place to start your digging work when learning the PCB code.\\ This file also contains a lot of documentation generating code.\\ This means two things:\\ - Look at the PCB manual for a description of all actions (manual is in doc directory after make)\\ - Take this as an example how to add documentation to the code.| +|H|action.*|action routines for output window ​ |This is one of the top files. A lot of the functionality will start here. This is a good place to start your digging work when learning the PCB code.\\ This file also contains a lot of documentation generating code.\\ This means two things:\\ - Look at the PCB manual for a description of all actions (manual is in doc directory after make)\\ - Take this as an example how to add documentation to the code.| 
-|H|autoplace.*|functions used to autoplace elements.|Don't know the status of this one. I think I read somewhere this function is broken. ?? TBD ??+|H|autoplace.*|functions used to autoplace elements. ​ | | 
-|H|autoroute.*|functions used to autoroute nets.| | +|H|autoroute.*|functions used to autoroute nets.  | | 
-|C|box.h|random box-related utilities.| | +|C|box.h|random box-related utilities. ​ | | 
-|C|buffer.*|functions used by paste- and move/copy buffer| | +|C|buffer.*|functions used by paste- and move/copy buffer ​ | | 
-|D|change.*|functions used to change object properties| |+|D|change.*|functions used to change object properties ​ | |
 | |check_icon.data| | | | |check_icon.data| | |
-| |clip.*|Clip the line to the clipBox| | +| |clip.*|Clip the line to the clipBox ​ | | 
-|C|command.*|executes commands from user|That is, some commands, only the short-hand vi compatible commands like l, le, m, q, w, s and rn.\\ See pcb manual for the explanation.\\ See action.c for the other commands.|+|C|command.*|executes commands from user  |That is, some commands, only the short-hand vi compatible commands like l, le, m, q, w, s and rn.\\ See pcb manual for the explanation.\\ See action.c for the other commands.|
 |C|compat.*| |This file is for compatibility across operating systems; we can define functions there that might be missing elsewhere (like linux-specific things) or broken elsewhere. ​ Mostly it's for unix-vs-windows.| |C|compat.*| |This file is for compatibility across operating systems; we can define functions there that might be missing elsewhere (like linux-specific things) or broken elsewhere. ​ Mostly it's for unix-vs-windows.|
-| |const.h|global source constants| | +| |const.h|global source constants ​ | | 
-|D|copy.*|functions used to copy pins, elements ...| | +|D|copy.*|functions used to copy pins, elements ...  | | 
-|D|create.*|functions used to create vias, pins ...| | +|D|create.*|functions used to create vias, pins ...  | | 
-|H|crosshair.*|crosshair stuff|is for the board'​s crosshair; this handles (for example) grid snapping. This is *not* the same as the GUI's mouse cursor. For the GKT GUI the crosshair will follow the mouse if its over the board-space/​canvas.| +|H|crosshair.*|crosshair stuff  |is for the board'​s crosshair; this handles (for example) grid snapping. This is *not* the same as the GUI's mouse cursor. For the GKT GUI the crosshair will follow the mouse if its over the board-space/​canvas.| 
-|C|data.*|just defines common identifiers| | +|C|data.*|just defines common identifiers ​ | | 
-|C|dbus.*|Interprocess communication (IPC)|D-Bus is a system for interprocess communication (IPC). D-Bus code originally derived from example-service.c in the dbus-glib bindings.\\ The dbus was added to provide some communications between gschem and pcb, and to provide some remote-control options for pcb.  Not sure if anything uses it at the moment.\\ If you're not interested in connecting to other programs just ignore the files.| +|C|dbus.*|Interprocess communication (IPC)  |D-Bus is a system for interprocess communication (IPC). D-Bus code originally derived from example-service.c in the dbus-glib bindings.\\ The dbus was added to provide some communications between gschem and pcb, and to provide some remote-control options for pcb.  Not sure if anything uses it at the moment.\\ If you're not interested in connecting to other programs just ignore the files.| 
-|C|dbus-pcbmain.*|PCB HID main loop integration.| |+|C|dbus-pcbmain.*|PCB HID main loop integration. ​ | |
 |C|default_font| |From the PCB documentation:​ A number of user defined Symbols are called a font. There is only one per layout. All symbols are made of lines. See the file '​default_font'​ as an example.\\ Fontmode.c is linked with this file.| |C|default_font| |From the PCB documentation:​ A number of user defined Symbols are called a font. There is only one per layout. All symbols are made of lines. See the file '​default_font'​ as an example.\\ Fontmode.c is linked with this file.|
 |D|djopt.*|optimize functions|is for the "​Connects->​Optimize Routed Tracks"​ functions.| |D|djopt.*|optimize functions|is for the "​Connects->​Optimize Routed Tracks"​ functions.|
 |C|dolists.h| |REGISTER_*(a) macro in dolists.h will be expanded by the preprocessor to the actual calling of these functions.| |C|dolists.h| |REGISTER_*(a) macro in dolists.h will be expanded by the preprocessor to the actual calling of these functions.|
-|H|draw.*|drawing routines| | +|H|draw.*|drawing routines ​ | | 
-|H|drill.*|functions to generate drill information|is for generating drill report information.| +|H|drill.*|functions to generate drill information ​ |is for generating drill report information.| 
-|H|edif.*|EDIF stands for Electronic Design Interchange Format.|These files are associated with only one action "​LoadFrom(Netlist)"​. This will call the function ImportNetlist() in file.c. If the first line of the netlist file contains "​edif"​ it will use these files to parse the EDIF 2.0.0 formatted file. A little googling learns that the EDIF 2.0.0 file format was approved in March 1988. File format EDIF 4.0.0 was released in August 1996. The PCB documentation doesn'​t say anything about EDIF. \\ The files are here to be backwards compatible, so we are able to read files generated many year ago. It doesn'​t hurt so just ignore it.| +|H|edif.*|EDIF stands for Electronic Design Interchange Format. ​ |These files are associated with only one action "​LoadFrom(Netlist)"​. This will call the function ImportNetlist() in file.c. If the first line of the netlist file contains "​edif"​ it will use these files to parse the EDIF 2.0.0 formatted file. A little googling learns that the EDIF 2.0.0 file format was approved in March 1988. File format EDIF 4.0.0 was released in August 1996. The PCB documentation doesn'​t say anything about EDIF. \\ The files are here to be backwards compatible, so we are able to read files generated many year ago. It doesn'​t hurt so just ignore it.| 
-|:::​|edif_parse.h|This file defines the interface to the outside world.|:::​| +|:::​|edif_parse.h|This file defines the interface to the outside world. ​ |:::| 
-|:::​|edif.y|file says: A Bison parser, used in with edif.c. EDIF stands for Electronic Design Interchange Format.|:::​| +|:::​|edif.y|file says: A Bison parser, used in with edif.c. EDIF stands for Electronic Design Interchange Format. ​ |:::| 
-|C|error.*|error and debug functions| | +|C|error.*|error and debug functions ​ | | 
-|C|file.*|file save, load, merge ... routines| | +|C|file.*|file save, load, merge ... routines ​ | | 
-|D|find.*|routines to find connections between pins, vias, lines...| | +|D|find.*|routines to find connections between pins, vias, lines... ​ | | 
-|C|flags.*|routines to initialize and use flags|flags.c functions are used by some of the HIDs to mark menu entries as "​checked"​ vs "​unchecked"​ when they refer to flags. ​ That's why they'​re registered, too, there'​s a list with ASCII names that hids can refer to.| +|C|flags.*|routines to initialize and use flags  |flags.c functions are used by some of the HIDs to mark menu entries as "​checked"​ vs "​unchecked"​ when they refer to flags. ​ That's why they'​re registered, too, there'​s a list with ASCII names that hids can refer to.| 
-|H|fontmode.c|routines to edit the font in PCB|There are two actions: \\ FontEdit() and FontSave() \\ Font editing draws one of each character on the screen as a PCB.  You edit the PCB.  Then it reads the traces from the PCB and turns it back into a font.  You can then cut/paste the font section out of that pcb to default_font.\\ default_font is linked with this file.| +|H|fontmode.c|routines to edit the font in PCB  |There are two actions: \\ FontEdit() and FontSave() \\ Font editing draws one of each character on the screen as a PCB.  You edit the PCB.  Then it reads the traces from the PCB and turns it back into a font.  You can then cut/paste the font section out of that pcb to default_font.\\ default_font is linked with this file.| 
-|C|free_atexit.*|some routines to free memory| | +|C|free_atexit.*|some routines to free memory ​ | | 
-| |gather-actions|shell script used during build.|Probably a leftover from an old build script, I can't find where it is called. Think the script isn't used. \\ Just ignore it.|+| |gather-actions|shell script used during build. ​ |Probably a leftover from an old build script, I can't find where it is called. Think the script isn't used. \\ Just ignore it.|
 | |gettext.h| |Used if --enable-nls option is configured. Takes care of internationalization.| | |gettext.h| |Used if --enable-nls option is configured. Takes care of internationalization.|
 |C|global.h| |The big include just about everything include file| |C|global.h| |The big include just about everything include file|
 |H|gpcb-menu.res| | | |H|gpcb-menu.res| | |
 |C|heap.*| |The heap functions seem to be associated mainly with the two autorouters. Additionally the file polygon1.c makes use of a heap in one of its functions| |C|heap.*| |The heap functions seem to be associated mainly with the two autorouters. Additionally the file polygon1.c makes use of a heap in one of its functions|
-|H|hid_draw.h|Low level drawing API.|| +|H|hid_draw.h|Low level drawing API.  | | 
-|H|hid.h|Human Interface Device layer.|This is one of the top files.\\ This is a good place to start looking if you want to know what'​s-what.|+|H|hid.h|Human Interface Device layer. ​ |This is one of the top files.\\ This is a good place to start looking if you want to know what'​s-what.|
 | |icon.data| | | | |icon.data| | |
-|D|insert.*|functions used to insert points into objects| | +|D|insert.*|functions used to insert points into objects ​ | | 
-|D|intersect.*|rectangle intersection/​union routines.| |+|D|intersect.*|rectangle intersection/​union routines. ​ | |
 |D|line.*|line routines| | |D|line.*|line routines| |
-| |lrealpath.*|Libiberty realpath. Like realpath, but more consistent behaviour| | +| |lrealpath.*|Libiberty realpath. Like realpath, but more consistent behaviour ​ | | 
-|C|macro.h|some commonly used macros not related to a special C-file the file is included by global.h after const.h| |+|C|macro.h|some commonly used macros not related to a special C-file the file is included by global.h after const.h ​ | |
 |C|main.c| |It all starts here| |C|main.c| |It all starts here|
 | |main-test.c| | | | |main-test.c| | |
-|D|mirror.*|functions used to change the mirror flag of an object| |+|D|mirror.*|functions used to change the mirror flag of an object ​ | |
 |C|misc.*| | | |C|misc.*| | |
 | |mode_icon.data| |Icons used in the GUI| | |mode_icon.data| |Icons used in the GUI|
-|D|move.*|functions used to move pins, elements ...| | +|D|move.*|functions used to move pins, elements ...  | | 
-|C|mtspace.*|implementation for "empty space" routines (needed for via-space tracking in the auto-router.| | +|C|mtspace.*|implementation for "empty space" routines (needed for via-space tracking in the auto-router. ​ | | 
-|C|mymem.*|memory management functions| |+|C|mymem.*|memory management functions ​ | |
 |H|netlist.c| | | |H|netlist.c| | |
-|C|parse_l.*|lexical definitions to parse ASCII input of PCB and Element description |Parse an element file or layout file. This is either a footprint file or our PCB layout file| +|C|parse_l.*|lexical definitions to parse ASCII input of PCB and Element description ​ |Parse an element file or layout file. This is either a footprint file or our PCB layout file| 
-|:::​|parse_y.*|grammar to parse ASCII input of PCB description| ::: |+|:::​|parse_y.*|grammar to parse ASCII input of PCB description ​ | ::: |
 |H|pcb-menu.res| | | |H|pcb-menu.res| | |
-|C|pcb-printf.*|Implementation of printf wrapper to output pcb coords and angles.| | +|C|pcb-printf.*|Implementation of printf wrapper to output pcb coords and angles. ​ | | 
-| |pcbtest.sh.in|Used during the build to test the program| | +| |pcbtest.sh.in|Used during the build to test the program ​ | | 
-|D|polyarea.h|file says: poly_Boolean:​ a polygon clip library.|Used in polygon.c, polygon1.c and thermal.c| +|D|polyarea.h|file says: poly_Boolean:​ a polygon clip library. ​ |Used in polygon.c, polygon1.c and thermal.c| 
-|:::​|polygon1.c|polygon clipping functions| | +|:::​|polygon1.c|polygon clipping functions ​ | | 
-|:::​|polygon.*|special polygon editing routines| | +|:::​|polygon.*|special polygon editing routines ​ | | 
-|H|print.*|printing routines|Looks like it is used to "​print"​ the fabrication layer. print.c generates a layer to be used as a fabrication drawing. Whether the HID uses that or not (and what it does with it) is a Separate question. ​ At least, both ps and gerber need that layer. Since the layer is created in "pcb unit space" it's in the core.  HID things tend to happen in "hid unit space" instead.| +|H|print.*|printing routines ​ |Looks like it is used to "​print"​ the fabrication layer. print.c generates a layer to be used as a fabrication drawing. Whether the HID uses that or not (and what it does with it) is a Separate question. ​ At least, both ps and gerber need that layer. Since the layer is created in "pcb unit space" it's in the core.  HID things tend to happen in "hid unit space" instead.| 
-|H|puller.c|PCB HID Project - Puller|See [[http://​www.delorie.com/​pcb/​puller]] for more information.| +|H|puller.c|PCB HID Project - Puller ​ |See [[http://​www.delorie.com/​pcb/​puller]] for more information.| 
-|H|rats.*|rats nest routines| | +|H|rats.*|rats nest routines ​ | | 
-|D|remove.*|functions used to remove vias, pins ...| | +|D|remove.*|functions used to remove vias, pins ...  | | 
-|H|report.*|Tell the user what he/she must know|See PCB manual for the options.|+|H|report.*|Tell the user what he/she must know  |See PCB manual for the options.|
 |H|res_lex.*| |These files are used to parse the pcb-menu.res and gpcb-menu.res files. This defines the menu structure of PCB. res_* is a generic resource parser. ​ Both gtk and lesstif hids use them.| |H|res_lex.*| |These files are used to parse the pcb-menu.res and gpcb-menu.res files. This defines the menu structure of PCB. res_* is a generic resource parser. ​ Both gtk and lesstif hids use them.|
-|:::​|res_parse.*|A parser, to read the resource (menu items etc) form PCB|:::|+|:::​|res_parse.*|A parser, to read the resource (menu items etc) form PCB  |:::|
 |H|resource.h| | | |H|resource.h| | |
-|D|rotate.*|functions used to rotate pins, elements ...| | +|D|rotate.*|functions used to rotate pins, elements ...  | | 
-|C|rtree.*|r-tree functions|a way to quickly find 2-D objects in a 2-D space| +|C|rtree.*|r-tree functions ​ |a way to quickly find 2-D objects in a 2-D space| 
-| |rubberband.*|functions used by '​rubberband moves'​| | +| |rubberband.*|functions used by '​rubberband moves' ​ | | 
-|C|search.*|search routines some of the functions use dummy parameters| | +|C|search.*|search routines some of the functions use dummy parameters ​ | | 
-|C|select.*|select routines| | +|C|select.*|select routines ​ | | 
-|C|set.*|routines to update widgets and global settings (except output window and dialogs)| | +|C|set.*|routines to update widgets and global settings (except output window and dialogs) ​ | | 
-|C|strflags.*|Some flags routines| | +|C|strflags.*|Some flags routines ​ | | 
-|C|thermal.*|negative thermal finger polygons| | +|C|thermal.*|negative thermal finger polygons ​ | | 
-| |toporouter.*|This file implements a topological autorouter.| | +| |toporouter.*|This file implements a topological autorouter. ​ |Please take a look inside the file for some literature references on the toporouter.
-|C|undo.*|functions used to undo operations| | +|C|undo.*|functions used to undo operations ​ | | 
-|C|vector.*|operations on vectors.| | +|C|vector.*|operations on vectors. ​ | | 
-|H|vendor.*|routines to generate vendor specific output|vendor.c is used to load vendor-specific DRC rules and apply them.|+|H|vendor.*|routines to generate vendor specific output ​ |vendor.c is used to load vendor-specific DRC rules and apply them.|
  
 D = These files have there focus on the Data Functionality. They manipulate the [[pcb_developer_introduction#​PCBType|PCBType]] or [[pcb_developer_introduction#​DataType|DataType]] structure. D = These files have there focus on the Data Functionality. They manipulate the [[pcb_developer_introduction#​PCBType|PCBType]] or [[pcb_developer_introduction#​DataType|DataType]] structure.
Line 222: Line 222:
  
 ActionMode is a generic function and therefore it will need to find what to do. ActionMode is a generic function and therefore it will need to find what to do.
-<code c>​ActionMode (int argc, char %%**%%argv, Coord x, Coord y)</​code>​+<code c>​ActionMode (int argc, char **argv, Coord x, Coord y)</​code>​
 It will do that by calling ''​GetFunctionID (AGV[0])''​ in this example AGV[0] = Line. The function ID will tell it to do the function ''​SetMode (LINE_MODE);''​ It will do that by calling ''​GetFunctionID (AGV[0])''​ in this example AGV[0] = Line. The function ID will tell it to do the function ''​SetMode (LINE_MODE);''​
  
 That function will set the variable **Settings.Mode** to LINE_MODE That function will set the variable **Settings.Mode** to LINE_MODE
  
-{{devel_intro:​set_mode.svg}}+{{:devel_intro:​set_mode.png}}
  
 ==== Mouse click ==== ==== Mouse click ====
 Next we trace down what will happen if we left click the mouse button to start drawing a track.\\ Please note this is a very simplified call graph. Next we trace down what will happen if we left click the mouse button to start drawing a track.\\ Please note this is a very simplified call graph.
  
-{{devel_intro:​draw_line.svg}}+{{:devel_intro:​draw_line.png}}
  
 In the file //​**gpcb-menu.res**//​ Left mouse click Mouse = Left => points to Mode(Notify) In the file //​**gpcb-menu.res**//​ Left mouse click Mouse = Left => points to Mode(Notify)
Line 465: Line 465:
 PCBType contain all the general information used in the program and it contains a pointer to the DataType PCBType contain all the general information used in the program and it contains a pointer to the DataType
  
-{{wiki:​structPCBType_graph.png}}+{{:​devel_intro:​structPCBType_graph.png}}
  
 ===== DataType ===== ===== DataType =====
Line 525: Line 525:
 A general r-tree will look like this: A general r-tree will look like this:
  
-{{wiki:rtree.svg}}+{{:​devel_intro:rtree.png}}
  
 The bottom row of records are called leafs. ​ The bottom row of records are called leafs. ​
Line 531: Line 531:
 The rtree data structure PCB uses is: The rtree data structure PCB uses is:
  
-{{wiki:​structrtree.png}}+{{:​devel_intro:​structrtree.png}}
  
 The r-tree data structure hold a copy of the where'​s what data. Meaning that it holds a list of every item on our canvas arranged in successively smaller boxes. The r-tree data structure hold a copy of the where'​s what data. Meaning that it holds a list of every item on our canvas arranged in successively smaller boxes.
-{{wiki:​rtreepicture.svg}}+{{:​devel_intro:​rtreepicture.png}}
  
 ===== More in-depth explanations:​ ===== ===== More in-depth explanations:​ =====
geda/pcb_developer_introduction.1438170488.txt.gz · Last modified: 2015/07/29 07:48 by myken