Index: trunk/doc/developer/packaging.txt =================================================================== --- trunk/doc/developer/packaging.txt (revision 21065) +++ trunk/doc/developer/packaging.txt (revision 21066) @@ -10,8 +10,9 @@ processing. There are different graphical frontends - pcb-rnd does not depend on gtk or motif, the specific frontend modules may depend on them. -Pcb-rnd is scriptable if libgpmi is available. Since libgpmi is not -a mainstream library for the scripting feature it should also be packaged. +Pcb-rnd is scriptable if system installed libfungw is available. Since +libfungw is not a mainstream library, it is most probably not already +present in your distro and it should also be packaged too. Pcb-rnd is intended for UNIX-fans. It is heavily keyboard-oriented and it doesn't assume its users don't want to understand or learn how it works. Index: trunk/doc/plan.txt =================================================================== --- trunk/doc/plan.txt (revision 21065) +++ trunk/doc/plan.txt (revision 21066) @@ -62,7 +62,6 @@ fab layer in some exports yes, buildin [draw_fab] font selection GUI yes, buildin [draw_fontsel] font editor yes, buildin [fontmode] - GPMI scripting yes, buildin [gpmi] y push lines out of the way yes, buildin [jostle] diagnostics: log HID calls no [loghid] calculate toolpath for milling no [millpath] Index: trunk/doc/user/06_feature/gpmi/scripting_intro.html =================================================================== --- trunk/doc/user/06_feature/gpmi/scripting_intro.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/scripting_intro.html (nonexistent) @@ -1,235 +0,0 @@ - - - - pcb-rnd user manual - - - - -

This plugin is deprecated and will be soon removed. Please use -fungw scripting instead. - -

Scripting intro

-This document is an introduction to GPMI for pcb-rnd users. It focuses on -scripting pcb-rnd and doesn't discuss GPMI deeper than the minimum necessary. -GPMI is more generic than shown here. -

-The scope of the document is to describe the relations between pcb-rnd, -hids, GPMI, glue packages and scripts. Details on how specific glue -packages access pcb-rnd internals (or how those internals work) are -described in other documents. - -

1. pcb-rnd internals

- -Since scripts are glued to pcb-rnd internals, scripters need to know -the basic concepts of how pcb-rnd is structured. - -

1.1 pcb-rnd, HIDs, plugins and GPMI

-pcb-rnd consists of: - -

-Note 1: at the moment GUI hids can not be plugins or buildins. -
-Note 2: plugins/buildins are always exporter HIDs technically, but in practice -they do not have to offer exporting. This means such a HID plugin is loaded -and registered as an exporter on paper, but it doesn't really create a -new export facility, just sits there, interacting with pcb-rnd (creating -menus, actions, etc). Most script plugins do this. -

-When the pcb-rnd executable is compiled, the core, the default GUI and exporter HIDs -and buildins are compiled into the executable. Later on -

-The GPMI hid is an optional plugin that, by compile-time choice -of the user, can be: -

- -

1.2. Actions, menus, exporters

-The core implements actions. An action is a command with custom arguments, -e.g. Delete(Selected). These actions are the commands on the default command -line in pcb-rnd. In batch mode the command language uses these actions as well. -Remote controlling pcb-rnd using the --listen switch will read these actions -on the standard input. -

-GUI menus are configured to execute actions too. This also means it is impossible -to realize an user-accessible functionality that can be triggered from -the GUI command line, menu or batch input without making it an action. -

-The only exception, where new functionality is not behind a new action is -exporters. An exporter is a structured dialog box of options and a set of -callback functions implementing a drawing API. Exporting works by the following -steps: -

    -
  1. An exporter HID may register one or more exporters. -
  2. When the user tries to export the design, pcb-rnd lists all - registered exporters. -
  3. The user chooses one, and the preconfigured dialog box - with the selected exporter's options are popped up. -
  4. pcb-rnd core runs the dialog and saves the results if the user - clicked on the ok button. -
  5. pcb-rnd starts the exporting process: it calls the callbacks - to draw the design layer by layer, object by object. -
- -

1.3. How a script can interact with the user

- - - -

2. GPMI intro

- -

2.1. GPMI's place in the pcb-rnd world

-
-GPMI is a plugin/buildin HID. Instead of doing actual work, it loads scripts -and provides a glue layer between pcb-rnd and the scripts. The actual work -is performed by the scripts. -The glue layer comes in two kinds: -
    -
  • gpmi module: dynamic lib written in C, knows how to load and interpret a script and how to deliver events to the script -
  • gpmi package: dynamic lib, provides C functions the script can directly call; package functions then know how to deal with PCB internals -
-Arrows drawn with dashed line represents a slow, string based communication. -
[gpmi HID interacting with pcb-rnd and other components]
- -

2.2. Module, script, script context, packages

-
-Each time a script needs to be loaded, first a module is loaded and the name -of the script is passed to the module. During module initialization, the module -sets up a script interpreter and script context and loads the script into the -context. -

-If there are 3 separate lua scripts running in pcb-rnd, there are 3 separate -lua modules loaded, each dealing with one of the scripts. The process of -loading a script is illustrated by highlighting the relevant paths with red -for step 1 and green for step 2. -

-Step 0: the GPMI HID finds a script has to be loaded. The idea comes -from the config file (pcb-rnd-gpmi.conf) or from the GUI (manage scripts) -or as a request from a script already loaded. -

-Step 1: the GPMI HID loads the corresponding module which in turns -loads the script. The script has a "main" part that is run on load. For -most languages this is the global code sections; in some languages it is -a specific function, usually called main. A few basic glue packages -are already loaded before the script. -

-Step 2: the script can load glue packages. This usually happens -from the on-load main part from the script. The actual mechanism is to -call PkgLoad() from a glue package that was automatically loaded in -Step 1. The green arrows represent this path: the script executes PkgLoad() -which in turns loads other package(s) into the GPMI hid. -

-Packages are loaded only once and are globally accessible for multiple modules. -

[same diagram as before, with package load flow highlighted]
- -

2.3. Binding events, registering actions, creating menus

-
-Binding an event in a script is done by calling the Bind() function -(this is implemented in a package automatically loaded). The first -argument is the name of the event, the second argument is the name of -the script function that should be called when the event is triggered. Both -arguments are strings. The event binding mechanism is shown in red in the -map to the right. -

-The script can create new actions using the action_register() function -(the actions package needs to be loaded first). A script may register multiple -actions. This call is marked with green in the above map. -If any of the actions registered by the script is called, the event "ACTE_action" -is generated. This has two implications: -

    -
  • a script that registers actions needs to bind the ACTE_action event to serve the action requests -
  • if a script registers multiple actions, in the event handler it needs to check which action triggered the event (e.g. with a switch()-like construction on the event name) -
-
[same diagram as before, with action registration flow highlighted]
- -
-Menus are created using the create_menu() call. Menus can be -created only when the GUI is already set up - this may happen only -after some of the scripts are already loaded. Thus scripts shall -create menus from an event handler bound to the ACTE_gui_init event. -This event is triggered right after the GUI has been set up. -On the map to the right the red arrows represent the path of ACTE_gui_init; -the green arrows represent the reaction of the script, creating the new -menu. -

-

[same diagram as before, with menu setup flow highlighted]
- -

2.4. Exporting

-
-Exporter scripts first have to set up an exporter hid. This typically -happens from their on-load main part. Related calls are in the hid -package. The following map shows this process with red arrows: -

-When the user chooses to use the exporter, among the green arrows, -a series of events are triggered and the script can generate output -directly to a file from event handlers bound to these exporting events. -

[same diagram as before, with exporter flow highlighted]
- -

2.5. Making modifications on the design

-The purpose of a script might be to manipulate the objects in the current design. -Such a script registers actions, and implements the handler of the actions -using the layout package. The layout package provides calls to query, -change and create design objects. - - -

3. How it works in practice

- -

3.1. Loading the GPMI plugin

-Check the output of ./configure, it will tell if gpmi is compiled as buildin -or plugin (or not at all). -If the gpmi plugin is compiled as a buildin, it is already loaded, no -further steps are required. -

-If gpmi is a plugin, gpmi_plugin.so (or gpmi_plugin.dll) needs to be -copied in one of the plugin directories pcb-rnd is looking into on startup: - -
path purpose -
-
$prefix/lib/pcb-rnd/plugins/$arch/ system plugins, multihost -
$prefix/lib/pcb-rnd/plugins/ system plugins -
~/.pcb/plugins/$arch/ user plugins, multihost -
~/.pcb/plugins/ user plugins -
./plugins/$arch/ project plugins, multihost -
./plugins/ project plugins -
-In the above table: -

- -

3.2. Loading scripts

-The gpmi plugin looks for a file called "pcb-rnd-gpmi.conf" in each of the -plugin directories. Wherever the file is found, it is loaded and parsed. -The file is plain text, each line describes a script to be loaded. Empty -lines and lines starting with # are comments and are ignored. -

-Script load lines contain two words separated by a space: a module name -and a script name. Relative paths in the the script name are relative to -the directory the config file is found in. -

-Example config: -

-# load the carc script (written in lua) from next to the config file:
-lua carc.lua
-
-# load foo.awk, which is a mawk script, from its installation path
-mawk /usr/lib/foo/foo.awk
-
Index: trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ex.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ex.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ex.html (nonexistent) @@ -1,49 +0,0 @@ -Animated clock on an UI layer. -

-


- -

Theory of operation

- - -

Implementation

-Load packages the script depends on: - -

-Set up an exporter hid, storing the handle of each object created in -a global variable: -

-

-Set up global state variables: -

-

-Define a make_gc callback. It is called when a new graphic -context is created (e.g. for layers). An exporter is sort of a drawing -backend: pcb-rnd sets up gc's and draws on them. The first gc set up -should open the output file, the last gc closed should flush/close the file. -Define a destroy_gc callback for the latter. GCs are -destroyed at the end of the export process. Use global variable channel -to make sure the file is open/close only once (see TODO script context). -

-Define a set_layer callback that sets green_light to true if -layer name is "topasssembly", false otherwise. -

-Callback fill_circle is the workhorse: check if we have the green -light to emit lines, then convert coordinates and diameter to mm and -decide what format to use for printing a line for each filled circle. -

-Finally, bind all four callbacks to exporter events. - - Index: trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ID.desc =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ID.desc (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ID.desc (nonexistent) @@ -1 +0,0 @@ -Create and animate an analog clock on a dedicated UI layer. Index: trunk/doc/user/06_feature/gpmi/rosetta/90_clock/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/90_clock/index.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/90_clock/index.html (nonexistent) @@ -1,69 +0,0 @@ - - - - pcb-rnd rosetta animated clock on a UI layer - - - - -<-- back to the index of Rosetta examples -

animated clock on a UI layer

-Create and animate an analog clock on a dedicated UI layer. -

Example implementations

-awk -

Explanation, step by step

-Animated clock on an UI layer. -

-


-

Theory of operation

- -

Implementation

- Load packages the script depends on: - - -

Set up an exporter hid, storing the handle of each object created in a global variable: -

- -

Set up global state variables: -

- -

Define a -make_gc - callback. It is called when a new graphic context is created (e.g. for layers). An exporter is sort of a drawing backend: pcb-rnd sets up gc's and draws on them. The first gc set up should open the output file, the last gc closed should flush/close the file. Define a -destroy_gc - callback for the latter. GCs are destroyed at the end of the export process. Use global variable -channel - to make sure the file is open/close only once (see TODO -script context -). -

Define a -set_layer - callback that sets green_light to true if layer name is "topasssembly", false otherwise. -

Callback -fill_circle - is the workhorse: check if we have the green light to emit lines, then convert coordinates and diameter to mm and decide what format to use for printing a line for each filled circle. -

Finally, bind all four callbacks to exporter events. - - Index: trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ID.name =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ID.name (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ID.name (nonexistent) @@ -1 +0,0 @@ -animated clock on a UI layer Index: trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ex.awk =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ex.awk (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/90_clock/ex.awk (nonexistent) @@ -1,126 +0,0 @@ -BEGIN { - PkgLoad("pcb-rnd-gpmi/actions", 0); - PkgLoad("pcb-rnd-gpmi/dialogs", 0); - PkgLoad("pcb-rnd-gpmi/layout", 0); - pi=3.141592654 -} - -# the clock coordinate system -function clock_cos(a) -{ - return cos((a-15)*6/180*pi) -} -function clock_sin(a) -{ - return sin((a-15)*6/180*pi) -} - -# draw the labels -function draw_dial(ui, cx, cy, r ,flg,w,cl,a,l,x1,y1,x2,y2) -{ - flg = "FL_NONE" - w = int(0.5 * mm) - cl = int(1 * mm) - - for(a = 0; a < 60; a++) { - tw = w - if (a == 0) - l = 4*mm - else if (a % 5 == 0) - l = 2*mm - else { - l = 1*mm - tw = w / 2 - } - - x1 = int(cx + clock_cos(a) * r) - y1 = int(cy + clock_sin(a) * r) - x2 = int(cx + clock_cos(a) * (r-l)) - y2 = int(cy + clock_sin(a) * (r-l)) - layout_create_line("", ui, x1, y1, x2, y2, tw, cl, flg) - - - if ((a % 5) == 0) { - x2 = int(cx + clock_cos(a) * (r-6*mm)) - 0.25*mm - y2 = int(cy + clock_sin(a) * (r-6*mm)) - layout_create_text("", ui, x2, y2, 0, 100, ((a == 0) ? "12" : a/5), flg) - } - } - - hlen[0] = 0.95 - hlen[1] = 0.9 - hlen[2] = 0.6 - - x2 = int(cx + clock_cos(a) * (r * hlen[0])) - y2 = int(cy + clock_sin(a) * (r * hlen[0])) - hand_sec = layout_create_line("hands", ui, cx, cy, x2, y2, 0.2*mm, cl, flg) - - x2 = int(cx + clock_cos(a) * (r * hlen[1])) - y2 = int(cy + clock_sin(a) * (r * hlen[1])) - hand_min = layout_create_line("hands", ui, cx, cy, x2, y2, 0.5*mm, cl, flg) - - x2 = int(cx + clock_cos(a) * (r * hlen[2])) - y2 = int(cy + clock_sin(a) * (r * hlen[2])) - hand_hour = layout_create_line("hands", ui, cx, cy, x2, y2, 2*mm, cl, flg) - - clock_cx = cx - clock_cy = cy - clock_r = r -} - - -function ev_action(id, name, argc, x, y) -{ - ui = int(uilayer_alloc("clock", "#DD33DD")) - mm = mm2pcb_multiplier(); - AddTimer(0, 10, "ev_second", ""); - draw_dial(ui, 50*mm, 50*mm, 30*mm) - - clock_sec = 12 - clock_min = 33 - clock_hour = 9 - set_hands() -} - -function set_hand(obj, idx, at ,ox2,oy2,x2,y2) -{ - ox2 = layout_obj_coord(obj, "OC_P2X") - oy2 = layout_obj_coord(obj, "OC_P2Y") - - x2 = int(clock_cx + clock_cos(at) * (clock_r * hlen[idx])) - y2 = int(clock_cy + clock_sin(at) * (clock_r * hlen[idx])) - - layout_obj_move(obj, "OC_P2", x2-ox2, y2-oy2); -} - -function set_hands() -{ - set_hand(hand_hour, 2, (clock_hour + clock_min/60 + clock_sec/3600)*5) - set_hand(hand_min, 1, clock_min + clock_sec/60) - set_hand(hand_sec, 0, clock_sec) -} - - -function ev_second(timer_data) -{ - if (hand_sec != "") { - clock_sec++; - if (clock_sec >= 60) { - clock_sec = 0 - clock_min++ - if (clock_min >= 60) { - clock_min = 0 - clock_hour++ - if (clock_hour >= 12) - clock_hour = 0; - } - } - set_hands() - } -} - -BEGIN { - layout_search_empty("hands") - Bind("ACTE_action", "ev_action"); - action_register("clock", "", "animate an analog clock on a debug layer", "clock()"); -} Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.html (nonexistent) @@ -1,25 +0,0 @@ -Load packages the script depends on: -

-

-Create a function ev_action that will be called when any of -the actions registered by the script is executed. The script registers -only one action, so it does not need to check which action caused -the function to be called. -

-When the action event is called, use dialog_log to append -a log message. -

-In the "main" section of the script, bind event ACTE_action to -our local function ev_action - this gets ev_action to -be called when any of the actions registered by this script is executed. -

-Finally use action_register to register the action: -

Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.py =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.py (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.py (nonexistent) @@ -1,8 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -def ev_action(id, name, argc, x, y): - dialog_log("Hello world!\n"); - -Bind("ACTE_action", "ev_action"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.stt =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.stt (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.stt (nonexistent) @@ -1,10 +0,0 @@ -(PkgLoad "pcb-rnd-gpmi/actions" 0) -(PkgLoad "pcb-rnd-gpmi/dialogs" 0) - -(defun ev_action (id name argc x y) - (dialog_log "Hello world!\n")) - -(Bind "ACTE_action" "ev_action") -(action_register "hello" "" "log hello world" "hello()") - - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.pl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.pl (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.pl (nonexistent) @@ -1,10 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -sub ev_action { - my($id, $name, $argc, $x, $y) = @_; - dialog_log("Hello world!\n"); -} - -Bind("ACTE_action", "ev_action"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.bash =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.bash (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.bash (nonexistent) @@ -1,18 +0,0 @@ -#!/bin/bash - -function load_packages() -{ - GPMI PkgLoad "pcb-rnd-gpmi/actions" 0 - GPMI PkgLoad "pcb-rnd-gpmi/dialogs" 0 -} - -function ev_action() { - GPMI dialog_log "Hello world!\n" -} - -function main() -{ - load_packages - GPMI Bind "ACTE_action" "ev_action" - GPMI action_register "hello" "" "log hello world" "hello()" -} Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ID.desc =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ID.desc (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ID.desc (nonexistent) @@ -1,2 +0,0 @@ -Create a new action hello() that prints "Hello world!" in the message log. - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/index.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/index.html (nonexistent) @@ -1,63 +0,0 @@ - - - - pcb-rnd rosetta hello world (text, log) - - - - -<-- back to the index of Rosetta examples -

hello world (text, log)

-Create a new action hello() that prints "Hello world!" in the message log. -

Example implementations

-awk - | -bash - | -lua - | -pl - | -py - | -rb - | -scm - | -stt - | -tcl -

Explanation, step by step

-Load packages the script depends on: - - -

Create a function -ev_action - that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called. -

When the action event is called, use -dialog_log - to append a log message. -

In the "main" section of the script, bind event -ACTE_action - to our local function -ev_action - - this gets -ev_action - to be called when any of the actions registered by this script is executed. -

Finally use -action_register - to register the action: -

- - - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ID.name =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ID.name (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ID.name (nonexistent) @@ -1 +0,0 @@ -hello world (text, log) Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.lua =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.lua (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.lua (nonexistent) @@ -1,9 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -function ev_action(id, name, argc, x, y) - dialog_log("Hello world!\n"); -end - -Bind("ACTE_action", "ev_action"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.tcl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.tcl (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.tcl (nonexistent) @@ -1,10 +0,0 @@ -PkgLoad pcb-rnd-gpmi/actions 0 -PkgLoad pcb-rnd-gpmi/dialogs 0 - -proc ev_action {id, name, argc, x, y} { - dialog_log "Hello world!\n" -} - -Bind ACTE_action ev_action -action_register "hello" "" "log hello world" "hello()" - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.scm =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.scm (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.scm (nonexistent) @@ -1,9 +0,0 @@ -(PkgLoad "pcb-rnd-gpmi/actions" 0) -(PkgLoad "pcb-rnd-gpmi/dialogs" 0) - -(define ev_action (lambda (id name argc x y) - (dialog_log "Hello world!\n"))) - -(Bind "ACTE_action" "ev_action") -(action_register "hello" "" "log hello world" "hello()") - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.awk =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.awk (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.awk (nonexistent) @@ -1,14 +0,0 @@ -BEGIN { - PkgLoad("pcb-rnd-gpmi/actions", 0); - PkgLoad("pcb-rnd-gpmi/dialogs", 0); -} - -function ev_action(id, name, argc, x, y) -{ - dialog_log("Hello world!\n"); -} - -BEGIN { - Bind("ACTE_action", "ev_action"); - action_register("hello", "", "log hello world", "hello()"); -} Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.rb =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.rb (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello/ex.rb (nonexistent) @@ -1,9 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -def ev_action(id, name, argc, x, y) - dialog_log("Hello world!\n"); -end - -Bind("ACTE_action", "ev_action"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.html (nonexistent) @@ -1,26 +0,0 @@ -Load packages the script depends on: - -

-Create a function ev_action that will be called when any of -the actions registered by the script is executed. The script registers -only one action, so it does not need to check which action caused -the function to be called. -

-When the action event is called, use dialog_report to pop -up a report dialog. First argument donates the name (title) of the window, -the second is the text printed in the window. -

-In the "main" section of the script, bind event ACTE_action to -our local function ev_action - this gets ev_action to -be called when any of the actions registered by this script is executed. -

-Finally use action_register to register the action: -

Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.py =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.py (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.py (nonexistent) @@ -1,8 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -def ev_action(id, name, argc, x, y): - dialog_report("Greeting window", "Hello world!"); - -Bind("ACTE_action", "ev_action"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.stt =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.stt (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.stt (nonexistent) @@ -1,10 +0,0 @@ -(PkgLoad "pcb-rnd-gpmi/actions" 0) -(PkgLoad "pcb-rnd-gpmi/dialogs" 0) - -(defun ev_action (id name argc x y) - (dialog_report "Greeting window" "Hello world!")) - -(Bind "ACTE_action" "ev_action") -(action_register "hello" "" "log hello world" "hello()") - - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.pl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.pl (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.pl (nonexistent) @@ -1,10 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -sub ev_action { - my($id, $name, $argc, $x, $y) = @_; - dialog_report("Greeting window", "Hello world!"); -} - -Bind("ACTE_action", "ev_action"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.bash =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.bash (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.bash (nonexistent) @@ -1,18 +0,0 @@ -#!/bin/bash - -function load_packages() -{ - GPMI PkgLoad "pcb-rnd-gpmi/actions" 0 - GPMI PkgLoad "pcb-rnd-gpmi/dialogs" 0 -} - -function ev_action() { - GPMI dialog_report "Greeting window" "Hello world!" -} - -function main() -{ - load_packages - GPMI Bind "ACTE_action" "ev_action" - GPMI action_register "hello" "" "log hello world" "hello()" -} Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.desc =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.desc (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.desc (nonexistent) @@ -1,3 +0,0 @@ -Create a new action hello() that prints "Hello world!" in a popup window. - - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/index.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/index.html (nonexistent) @@ -1,63 +0,0 @@ - - - - pcb-rnd rosetta hello world (popup window) - - - - -<-- back to the index of Rosetta examples -

hello world (popup window)

-Create a new action hello() that prints "Hello world!" in a popup window. -

Example implementations

-awk - | -bash - | -lua - | -pl - | -py - | -rb - | -scm - | -stt - | -tcl -

Explanation, step by step

-Load packages the script depends on: - - -

Create a function -ev_action - that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called. -

When the action event is called, use -dialog_report - to pop up a report dialog. First argument donates the name (title) of the window, the second is the text printed in the window. -

In the "main" section of the script, bind event -ACTE_action - to our local function -ev_action - - this gets -ev_action - to be called when any of the actions registered by this script is executed. -

Finally use -action_register - to register the action: -

- - - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.name =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.name (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ID.name (nonexistent) @@ -1 +0,0 @@ -hello world (popup window) Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.lua =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.lua (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.lua (nonexistent) @@ -1,9 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -function ev_action(id, name, argc, x, y) - dialog_report("Greeting window", "Hello world!"); -end - -Bind("ACTE_action", "ev_action"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.tcl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.tcl (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.tcl (nonexistent) @@ -1,10 +0,0 @@ -PkgLoad pcb-rnd-gpmi/actions 0 -PkgLoad pcb-rnd-gpmi/dialogs 0 - -proc ev_action {id, name, argc, x, y} { - dialog_report "Greeting window" "Hello world!" -} - -Bind ACTE_action ev_action -action_register "hello" "" "log hello world" "hello()" - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.scm =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.scm (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.scm (nonexistent) @@ -1,9 +0,0 @@ -(PkgLoad "pcb-rnd-gpmi/actions" 0) -(PkgLoad "pcb-rnd-gpmi/dialogs" 0) - -(define ev_action (lambda (id name argc x y) - (dialog_report "Greeting window" "Hello world!"))) - -(Bind "ACTE_action" "ev_action") -(action_register "hello" "" "log hello world" "hello()") - Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.awk =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.awk (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.awk (nonexistent) @@ -1,14 +0,0 @@ -BEGIN { - PkgLoad("pcb-rnd-gpmi/actions", 0); - PkgLoad("pcb-rnd-gpmi/dialogs", 0); -} - -function ev_action(id, name, argc, x, y) -{ - dialog_report("Greeting window", "Hello world!"); -} - -BEGIN { - Bind("ACTE_action", "ev_action"); - action_register("hello", "", "log hello world", "hello()"); -} Index: trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.rb =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.rb (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/10_hello_gui/ex.rb (nonexistent) @@ -1,9 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -def ev_action(id, name, argc, x, y) - dialog_report("Greeting window", "Hello world!"); -end - -Bind("ACTE_action", "ev_action"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.html (nonexistent) @@ -1,36 +0,0 @@ -Load packages the script depends on: - -

-Create a function ev_action that will be called when any of -the actions registered by the script is executed. The script registers -only one action, so it does not need to check which action caused -the function to be called. -

-When the action event is called, first set up: -

-A loop then iterates over the objects on the list: - -Finally the search list shall be destroyed to reclaim memory, using layout_search_free. -

- -In the "main" section of the script, bind event ACTE_action to -our local function ev_action - this gets ev_action to -be called when any of the actions registered by this script is executed. -

-Finally use action_register to register the action: -

Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.py =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.py (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.py (nonexistent) @@ -1,15 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/layout", 0); - -def ev_action(id, name, argc, x, y): - dx = int(action_arg(0)) * float(mm2pcb_multiplier()) - dy = int(action_arg(1)) * float(mm2pcb_multiplier()) - num_objs = int(layout_search_selected("mv_search", "OM_ANY")) - for n in xrange(0, num_objs): - obj_ptr = layout_search_get("mv_search", n) - layout_obj_move(obj_ptr, "OC_OBJ", dx, dy) - layout_search_free("mv_search") - -Bind("ACTE_action", "ev_action"); -action_register("hello", "", "log hello world", "hello()"); -action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.stt =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.stt (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.stt (nonexistent) @@ -1,24 +0,0 @@ -(PkgLoad "pcb-rnd-gpmi/actions" 0) -(PkgLoad "pcb-rnd-gpmi/layout" 0) - -(defun ev_action (id name argc x y) -(let - ( - (dx (* (->num (action_arg 0)) (->num (mm2pcb_multiplier)))) - (dy (* (->num (action_arg 1)) (->num (mm2pcb_multiplier)))) - (num_objs (->num (layout_search_selected "mv_search" "OM_ANY"))) - (obj_ptr 0) - ) - (do ((n 0 (1+ n))) - ((> n num_objs)) - (set! obj_ptr (layout_search_get "mv_search" n)) - (layout_obj_move obj_ptr "OC_OBJ" (->int dx) (->int dy)) - ) -) -) - -(Bind "ACTE_action" "ev_action") -(action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)") - - - Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.pl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.pl (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.pl (nonexistent) @@ -1,20 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/layout", 0); - -sub ev_action { - my($id, $name, $argc, $x, $y) = @_; - - my $dx = action_arg(0) * mm2pcb_multiplier(); - my $dy = action_arg(1) * mm2pcb_multiplier(); - - my $num_objs = layout_search_selected("mv_search", "OM_ANY"); - for(my $n = 0; $n < $num_objs; $n++) { - $obj_ptr = layout_search_get("mv_search", $n); - layout_obj_move($obj_ptr, "OC_OBJ", $dx, $dy); - } - layout_search_free("mv_search"); - -} - -Bind("ACTE_action", "ev_action"); -action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.bash =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.bash (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.bash (nonexistent) @@ -1,41 +0,0 @@ -#!/bin/bash - -function load_packages() -{ - GPMI PkgLoad "pcb-rnd-gpmi/actions" 0 - GPMI PkgLoad "pcb-rnd-gpmi/layout" 0 -} - -function ev_action() { - local dx dy n num_objs - - GPMI action_arg 0 - a0=`bash_int "$result"` - - GPMI action_arg 1 - a1=`bash_int "$result"` - - GPMI mm2pcb_multiplier - conv=`bash_int "$result"` - - dx=$(($a0 * $conv)) - dy=$(($a1 * $conv)) - - GPMI layout_search_selected "mv_search" "OM_ANY" - num_objs=`bash_int "$result"` - - for n in `seq 0 $(($num_objs-1))` - do - GPMI layout_search_get "mv_search" $n - obj_ptr="$result" - GPMI layout_obj_move $obj_ptr "OC_OBJ" $dx $dy - done - GPMI layout_search_free "mv_search" -} - -function main() -{ - load_packages - GPMI Bind "ACTE_action" "ev_action" - GPMI action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)" -} Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ID.desc =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ID.desc (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ID.desc (nonexistent) @@ -1,3 +0,0 @@ -Create a new action mv(dx,dy) that moves selected objects relative by dx and dy mm. - - Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/index.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/index.html (nonexistent) @@ -1,82 +0,0 @@ - - - - pcb-rnd rosetta action: move selected objects - - - - -<-- back to the index of Rosetta examples -

action: move selected objects

-Create a new action mv(dx,dy) that moves selected objects relative by dx and dy mm. -

Example implementations

-awk - | -bash - | -lua - | -pl - | -py - | -rb - | -scm - | -stt - | -tcl -

Explanation, step by step

-Load packages the script depends on: - - -

Create a function -ev_action - that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called. -

When the action event is called, first set up: -

- A loop then iterates over the objects on the list: - - Finally the search list shall be destroyed to reclaim memory, using -layout_search_free -. -

In the "main" section of the script, bind event -ACTE_action - to our local function -ev_action - - this gets -ev_action - to be called when any of the actions registered by this script is executed. -

Finally use -action_register - to register the action: -

- - - Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ID.name =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ID.name (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ID.name (nonexistent) @@ -1 +0,0 @@ -action: move selected objects Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.lua =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.lua (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.lua (nonexistent) @@ -1,18 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/layout", 0); - -function ev_action(id, name, argc, x, y) - local dx = action_arg(0) * mm2pcb_multiplier() - local dy = action_arg(1) * mm2pcb_multiplier() - - local num_objs = layout_search_selected("mv_search", "OM_ANY") - for n=0,num_objs+1 - do - obj_ptr = layout_search_get("mv_search", n) - layout_obj_move(obj_ptr, "OC_OBJ", dx, dy) - end - layout_search_free("mv_search") -end - -Bind("ACTE_action", "ev_action"); -action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); \ No newline at end of file Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.tcl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.tcl (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.tcl (nonexistent) @@ -1,17 +0,0 @@ -PkgLoad pcb-rnd-gpmi/actions 0 -PkgLoad pcb-rnd-gpmi/layout 0 - -proc ev_action {id, name, argc, x, y} { - set dx [expr round([action_arg 0] * [mm2pcb_multiplier])] - set dy [expr round([action_arg 1] * [mm2pcb_multiplier])] - - set num_objs [layout_search_selected mv_search OM_ANY] - for {set n 0} {$n < $num_objs} {incr n} { - set obj_ptr [layout_search_get mv_search $n] - layout_obj_move $obj_ptr OC_OBJ $dx $dy - } - layout_search_free mv_search -} - -Bind ACTE_action ev_action -action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)" Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.scm =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.scm (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.scm (nonexistent) @@ -1,20 +0,0 @@ -(PkgLoad "pcb-rnd-gpmi/actions" 0) -(PkgLoad "pcb-rnd-gpmi/layout" 0) - -(define ev_action (lambda (id name argc x y) -(let - ( - (dx (* (string->number (action_arg 0)) (string->number (mm2pcb_multiplier)))) - (dy (* (string->number (action_arg 1)) (string->number (mm2pcb_multiplier)))) - (num_objs (string->number (layout_search_selected "mv_search" "OM_ANY"))) - (obj_ptr 0) - ) - (do ((n 0 (1+ n))) - ((> n num_objs)) - (set! obj_ptr (layout_search_get "mv_search" n)) - (layout_obj_move obj_ptr "OC_OBJ" (inexact->exact dx) (inexact->exact dy)) - ) -))) - -(Bind "ACTE_action" "ev_action") -(action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)") Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.awk =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.awk (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.awk (nonexistent) @@ -1,22 +0,0 @@ -BEGIN { - PkgLoad("pcb-rnd-gpmi/actions", 0); - PkgLoad("pcb-rnd-gpmi/layout", 0); -} - -function ev_action(id, name, argc, x, y ,dx,dy,n,num_objs,obj_ptr) -{ - dx = action_arg(0) * mm2pcb_multiplier() - dy = action_arg(1) * mm2pcb_multiplier() - - num_objs = layout_search_selected("mv_search", "OM_ANY") - for(n = 0; n < num_objs; n++) { - obj_ptr = layout_search_get("mv_search", n) - layout_obj_move(obj_ptr, "OC_OBJ", dx, dy) - } - layout_search_free("mv_search") -} - -BEGIN { - Bind("ACTE_action", "ev_action"); - action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); -} Index: trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.rb =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.rb (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/30_move/ex.rb (nonexistent) @@ -1,25 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/layout", 0); - -def ev_action(id, name, argc, x, y) -# TODO: how to convert 1e+06 in ruby? -# conv = mm2pcb_multiplier().to_i - conv = 1000000 - - - dx = action_arg(0).to_i * conv.to_i; - dy = action_arg(1).to_i * conv.to_i; - - num_objs = layout_search_selected("mv_search", "OM_ANY").to_i; - - for n in 0..(num_objs-1) - obj_ptr = layout_search_get("mv_search", n); - layout_obj_move(obj_ptr, "OC_OBJ", dx, dy); - n += 1; - end - layout_search_free("mv_search"); - -end - -Bind("ACTE_action", "ev_action"); -action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)"); Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.html (nonexistent) @@ -1,33 +0,0 @@ -Load packages the script depends on: - -

-Create a function ev_action that will be called when any of -the actions registered by the script is executed. The script registers -only one action, so it does not need to check which action caused -the function to be called. -

-When the action event is called, use dialog_report to pop -up a report dialog. First argument donates the name (title) of the window, -the second is the text printed in the window. -

-Create a function ev_gui_init that will be called when the -gui has been initialized - this is the right moment to register -new menus in the GUI. Put the new menu item in the -"Plugins/GPMI scripting/" menu by convention, and set hot key to ctrl+w. -The menu should execute action hello(). -

-In the "main" section of the script, bind event ACTE_action to -our local function ev_action - this gets ev_action to -be called when any of the actions registered by this script is executed. -Also bind ev_gui_init so that the new menu can be safely created. -

-Finally use action_register to register the action: -

Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.py =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.py (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.py (nonexistent) @@ -1,12 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -def ev_action(id, name, argc, x, y): - dialog_report("Greeting window", "Hello world!"); - -def ev_gui_init(id, argc, argv): - create_menu("/main_menu/Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); - -Bind("ACTE_action", "ev_action"); -Bind("ACTE_gui_init", "ev_gui_init"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.stt =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.stt (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.stt (nonexistent) @@ -1,12 +0,0 @@ -(PkgLoad "pcb-rnd-gpmi/actions" 0) -(PkgLoad "pcb-rnd-gpmi/dialogs" 0) - -(defun ev_action (id name argc x y) - (dialog_report "Greeting window" "Hello world!")) - -(defun ev_gui_init (id argc argv) - (create_menu "/main_menu/Plugins/GPMI scripting/hello" "hello()" "h" "Ctrlw" "tooltip for hello")) - -(Bind "ACTE_action" "ev_action") -(Bind "ACTE_gui_init" "ev_gui_init") -(action_register "hello" "" "log hello world" "hello()") Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.pl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.pl (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.pl (nonexistent) @@ -1,17 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -sub ev_action { - my($id, $name, $argc, $x, $y) = @_; - dialog_report("Greeting window", "Hello world!"); -} - -sub ev_gui_init -{ - my($id, $name, $argc, $argv) = @_; - create_menu("/main_menu/Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); -} - -Bind("ACTE_action", "ev_action"); -Bind("ACTE_gui_init", "ev_gui_init"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.bash =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.bash (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.bash (nonexistent) @@ -1,24 +0,0 @@ -#!/bin/bash - -function load_packages() -{ - GPMI PkgLoad "pcb-rnd-gpmi/actions" 0 - GPMI PkgLoad "pcb-rnd-gpmi/dialogs" 0 -} - -function ev_action() { - GPMI dialog_report "Greeting window" "Hello world!" -} - -function ev_gui_init() -{ - GPMI create_menu "/main_menu/Plugins/GPMI scripting/hello" "hello()" "h" "Ctrlw" "tooltip for hello" -} - -function main() -{ - load_packages - GPMI Bind "ACTE_action" "ev_action" - GPMI Bind "ACTE_gui_init" "ev_gui_init" - GPMI action_register "hello" "" "log hello world" "hello()" -} Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.desc =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.desc (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.desc (nonexistent) @@ -1,3 +0,0 @@ -Create a new action hello() that prints "Hello world!" in a popup window, create a menu (under "Plugins/GPMI scripting/") that executes the action. - - Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/index.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/index.html (nonexistent) @@ -1,66 +0,0 @@ - - - - pcb-rnd rosetta hello world (popup window + submenu) - - - - -<-- back to the index of Rosetta examples -

hello world (popup window + submenu)

-Create a new action hello() that prints "Hello world!" in a popup window, create a menu (under "Plugins/GPMI scripting/") that executes the action. -

Example implementations

-awk - | -bash - | -lua - | -pl - | -py - | -rb - | -scm - | -stt - | -tcl -

Explanation, step by step

-Load packages the script depends on: -
    -
  • -actions - for registering the new action; -
  • -dialogs - for creating a dialog box.
- -

Create a function -ev_action - that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called. -

When the action event is called, use -dialog_report - to pop up a report dialog. First argument donates the name (title) of the window, the second is the text printed in the window. -

Create a function -ev_gui_init - that will be called when the gui has been initialized - this is the right moment to register new menus in the GUI. Put the new menu item in the "Plugins/GPMI scripting/" menu by convention, and set hot key to ctrl+w. The menu should execute action hello(). -

In the "main" section of the script, bind event -ACTE_action - to our local function -ev_action - - this gets -ev_action - to be called when any of the actions registered by this script is executed. Also bind ev_gui_init so that the new menu can be safely created. -

Finally use -action_register - to register the action: -

    -
  • first argument is the name of the action -
  • second is the xy query string; it is empty since this action won't need coordinates to operate on -
  • third is the description that shows up in dumps and helps -
  • fourth is the syntax description (also for helps)
- - - Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.name =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.name (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ID.name (nonexistent) @@ -1 +0,0 @@ -hello world (popup window + submenu) Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.lua =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.lua (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.lua (nonexistent) @@ -1,14 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -function ev_action(id, name, argc, x, y) - dialog_report("Greeting window", "Hello world!"); -end - -function ev_gui_init(id, argc, argv) - create_menu("/main_menu/Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); -end - -Bind("ACTE_action", "ev_action"); -Bind("ACTE_gui_init", "ev_gui_init"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.tcl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.tcl (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.tcl (nonexistent) @@ -1,15 +0,0 @@ -PkgLoad pcb-rnd-gpmi/actions 0 -PkgLoad pcb-rnd-gpmi/dialogs 0 - -proc ev_action {id, name, argc, x, y} { - dialog_report "Greeting window" "Hello world!" -} - -proc ev_gui_init {id, argc, argv} { - create_menu "/main_menu/Plugins/GPMI scripting/hello" "hello()" "h" "Ctrlw" "tooltip for hello" -} - -Bind ACTE_action ev_action -Bind ACTE_gui_init ev_gui_init -action_register "hello" "" "log hello world" "hello()" - Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.scm =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.scm (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.scm (nonexistent) @@ -1,12 +0,0 @@ -(PkgLoad "pcb-rnd-gpmi/actions" 0) -(PkgLoad "pcb-rnd-gpmi/dialogs" 0) - -(define ev_action (lambda (id name argc x y) - (dialog_report "Greeting window" "Hello world!"))) - -(define ev_gui_init (lambda (id argc argv) - (create_menu "/main_menu/Plugins/GPMI scripting/hello" "hello()" "h" "Ctrlw" "tooltip for hello"))) - -(Bind "ACTE_action" "ev_action") -(Bind "ACTE_gui_init" "ev_gui_init") -(action_register "hello" "" "log hello world" "hello()") Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.awk =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.awk (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.awk (nonexistent) @@ -1,20 +0,0 @@ -BEGIN { - PkgLoad("pcb-rnd-gpmi/actions", 0); - PkgLoad("pcb-rnd-gpmi/dialogs", 0); -} - -function ev_action(id, name, argc, x, y) -{ - dialog_report("Greeting window", "Hello world!"); -} - -function ev_gui_init(id, argc, argv) -{ - create_menu("/main_menu/Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); -} - -BEGIN { - Bind("ACTE_action", "ev_action"); - Bind("ACTE_gui_init", "ev_gui_init"); - action_register("hello", "", "log hello world", "hello()"); -} Index: trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.rb =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.rb (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/12_hello_menu/ex.rb (nonexistent) @@ -1,14 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/actions", 0); -PkgLoad("pcb-rnd-gpmi/dialogs", 0); - -def ev_action(id, name, argc, x, y) - dialog_report("Greeting window", "Hello world!"); -end - -def ev_gui_init(id, argc, argv) - create_menu("/main_menu/Plugins/GPMI scripting/hello", "hello()", "h", "Ctrlw", "tooltip for hello"); -end - -Bind("ACTE_action", "ev_action"); -Bind("ACTE_gui_init", "ev_gui_init"); -action_register("hello", "", "log hello world", "hello()"); Index: trunk/doc/user/06_feature/gpmi/rosetta/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/index.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/index.html (nonexistent) @@ -1,68 +0,0 @@ - - - - pcb-rnd rosetta - - - - -

pcb-rnd scripting - Rosetta

-The Rosetta Stone -of pcb-rnd scripting is a collection of example scripts implemented in -various scripting languages. Rosetta has multiple purposes: -
    -
  • to provide examples of using the pcb-rnd API; -
  • to not scare away newcomers by showing the first examples in an unfamiliar language; -
  • to help the user to decide which language to use for a specific task; -
  • to provide examples on how to convert idioms of pcb-rnd scripts from one language to another. -
-

-Each example comes with an explanation, written in plain English about what the -scripts do, step by step. Instead of trying to exploit powerful features -of the language, example implementations try to be simple. -

-The list below is ordered from the least complex to the most complex examples. -Column lvl is the complexity score. The less the score is, the simpler -the example is. - - -

Index of examples

- - - - - - - - - -
lvlexample languages description -
10 - hello world (text, log) - awk bash lua perl python ruby scheme stutter tcl - Create a new action hello() that prints "Hello world!" in the message log. -
10 - hello world (popup window) - awk bash lua perl python ruby scheme stutter tcl - Create a new action hello() that prints "Hello world!" in a popup window. -
12 - hello world (popup window + submenu) - awk bash lua perl python ruby scheme stutter tcl - Create a new action hello() that prints "Hello world!" in a popup window, create a menu (under "Plugins/GPMI scripting/") that executes the action. -
30 - action: move selected objects - awk bash lua perl python ruby scheme stutter tcl - Create a new action mv(dx,dy) that moves selected objects relative by dx and dy mm. -
35 - drill list exporter - awk lua tcl - Create a new exporter that prints a list of drills in x,y,dia table in CSV, TSV or text format -
90 - animated clock on a UI layer - awk - Create and animate an analog clock on a dedicated UI layer. -
- - - - Index: trunk/doc/user/06_feature/gpmi/rosetta/index.templ.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/index.templ.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/index.templ.html (nonexistent) @@ -1,34 +0,0 @@ - - - - pcb-rnd rosetta - - - - -

pcb-rnd scripting - Rosetta

-The Rosetta Stone -of pcb-rnd scripting is a collection of example scripts implemented in -various scripting languages. Rosetta has multiple purposes: -
    -
  • to provide examples of using the pcb-rnd API; -
  • to not scare away newcomers by showing the first examples in an unfamiliar language; -
  • to help the user to decide which language to use for a specific task; -
  • to provide examples on how to convert idioms of pcb-rnd scripts from one language to another. -
-

-Each example comes with an explanation, written in plain English about what the -scripts do, step by step. Instead of trying to exploit powerful features -of the language, example implementations try to be simple. -

-The list below is ordered from the least complex to the most complex examples. -Column lvl is the complexity score. The less the score is, the simpler -the example is. - - -

Index of examples

- - - - - Index: trunk/doc/user/06_feature/gpmi/rosetta/Makefile =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/Makefile (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/Makefile (nonexistent) @@ -1,4 +0,0 @@ -all: FORCE - cd ../util && ./rosetta_genpages.sh - -FORCE: Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.html (nonexistent) @@ -1,60 +0,0 @@ - -An exporter is a hid registered. During the export -process, pcb-rnd calls the exporter to draw objects on layers. The GPMI -layer converts these calls to bindable events. An exporter script catches -the drawing events relevant to the output format and draws everything from -event handlers. -

-An exporter is sort of a drawing backend: pcb-rnd sets up graphic contexts -(gc for short) and draws on them. The first gc set up should open the -output file, the last gc closed should flush/close the file. -

-


- -

Theory of operation

-Assume only filled circles on the -top assembly layer are holes. Emit a line for each of these -and ignore everything else. - -

Implementation

-Load packages the script depends on: -
    -
  • hid for registering the new exporter; -
  • layout for unit conversion; -
  • dialogs for error reporting. -
-

-Set up an exporter hid, storing the handle of each object created in -a global variable: -

    -
  • create a hid using hid_create -
  • add two attributes (fields) to the dialog using hid_add_attribute -
  • register the new hid using hid_register - this makes it an exporter -
-

-Set up global state variables: -

    -
  • fmt will be a cache for the format selected by the user -
  • conv is the conversion scale between mm and PCB internal coordinate unit -
  • channel specifies a file handle or indicates that the output file is open -
  • green_light indicates that the exporter is drawing the relevant layer -
-

-Define a make_gc callback. It is called when a new graphic -context is created (e.g. for layers). An exporter is sort of a drawing -backend: pcb-rnd sets up gc's and draws on them. The first gc set up -should open the output file, the last gc closed should flush/close the file. -Define a destroy_gc callback for the latter. GCs are -destroyed at the end of the export process. Use global variable channel -to make sure the file is open/close only once (see TODO script context). -

-Define a set_layer callback that sets green_light to true if -layer name is "topasssembly", false otherwise. -

-Callback fill_circle is the workhorse: check if we have the green -light to emit lines, then convert coordinates and diameter to mm and -decide what format to use for printing a line for each filled circle. -

-Finally, bind all four callbacks to exporter events. - - Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.desc =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.desc (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.desc (nonexistent) @@ -1 +0,0 @@ -Create a new exporter that prints a list of drills in x,y,dia table in CSV, TSV or text format Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/index.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/index.html (nonexistent) @@ -1,79 +0,0 @@ - - - - pcb-rnd rosetta drill list exporter - - - - -<-- back to the index of Rosetta examples -

drill list exporter

-Create a new exporter that prints a list of drills in x,y,dia table in CSV, TSV or text format -

Example implementations

-awk - | -lua - | -tcl -

Explanation, step by step

- - An exporter is a hid registered. During the export process, pcb-rnd calls the exporter to draw objects on layers. The GPMI layer converts these calls to bindable events. An exporter script catches the drawing events relevant to the output format and draws everything from event handlers. -

An exporter is sort of a drawing backend: pcb-rnd sets up graphic contexts (gc for short) and draws on them. The first gc set up should open the output file, the last gc closed should flush/close the file. -

-


-

Theory of operation

- Assume only -filled circles - on the -top assembly layer - are holes. Emit a line for each of these and ignore everything else. -

Implementation

- Load packages the script depends on: -
    -
  • -hid - for registering the new exporter; -
  • -layout - for unit conversion; -
  • -dialogs - for error reporting.
- -

Set up an exporter hid, storing the handle of each object created in a global variable: -

- -

Set up global state variables: -

    -
  • fmt will be a cache for the format selected by the user -
  • conv is the conversion scale between mm and PCB internal coordinate unit -
  • channel specifies a file handle or indicates that the output file is open -
  • green_light indicates that the exporter is drawing the relevant layer
- -

Define a -make_gc - callback. It is called when a new graphic context is created (e.g. for layers). An exporter is sort of a drawing backend: pcb-rnd sets up gc's and draws on them. The first gc set up should open the output file, the last gc closed should flush/close the file. Define a -destroy_gc - callback for the latter. GCs are destroyed at the end of the export process. Use global variable -channel - to make sure the file is open/close only once (see TODO -script context -). -

Define a -set_layer - callback that sets green_light to true if layer name is "topasssembly", false otherwise. -

Callback -fill_circle - is the workhorse: check if we have the green light to emit lines, then convert coordinates and diameter to mm and decide what format to use for printing a line for each filled circle. -

Finally, bind all four callbacks to exporter events. - - Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.name =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.name (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ID.name (nonexistent) @@ -1 +0,0 @@ -drill list exporter Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.lua =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.lua (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.lua (nonexistent) @@ -1,65 +0,0 @@ -PkgLoad("pcb-rnd-gpmi/hid", 0) -PkgLoad("pcb-rnd-gpmi/layout", 0) -PkgLoad("pcb-rnd-gpmi/dialogs", 0) - -hid = hid_create("drill", "drill list export") -attr_path = hid_add_attribute(hid, "filename", "name of the output file", "HIDA_Path", 0, 0, "drill.txt") -attr_format = hid_add_attribute(hid, "format", "file format", "HIDA_Enum", 0, 0, "CSV|TSV|text") -hid_register(hid) - -fmt = 0 -conv = mm2pcb_multiplier() -channel = nil -green_light = 0 - -function make_gc(event_id, hid, gc) - if channel == nil - then - channel = io.open(hid_get_attribute(hid, attr_path), "w") - if channel == nil - then - dialog_report("Error exporting drill", "Could not open file [hid_get_attribute $hid $attr_path] for\nwriting, exporting drill failed.") - return - end - fmt = hid_get_attribute(hid, attr_format) - end -end - -function destroy_gc(event_id, hid, gc) - if channel ~= nil - then - channel:close() - channel = nil - end -end - -function set_layer_group(event_id, hid, group, layer, flags, empty) - if (layer_flag_is_set(flags, "LYT_ASSY") == "1") and (layer_flag_is_set(flags, "LYT_TOP") == "1") - then - green_light = 1 - else - green_light = 0 - end -end - -function fill_circle(event_id, hid, gc, cx, cy, r) - if green_light == 1 - then - cx = cx / conv - cy = cy / conv - local dia = r / conv * 2 - - if fmt == "CSV" then - channel:write(cx .. "," .. cy .. "," .. dia .. "\n") - elseif (fmt == "TSV") then - channel:write(cx .. "\t" .. cy .. "\t" .. dia .. "\n") - elseif (fmt == "text") then - channel:write(cx .. " " .. cy .. " " .. dia .. "\n") - end - end -end - -Bind("HIDE_make_gc", "make_gc") -Bind("HIDE_destroy_gc", "destroy_gc") -Bind("HIDE_set_layer_group", "set_layer_group") -Bind("HIDE_fill_circle", "fill_circle") Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.tcl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.tcl (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.tcl (nonexistent) @@ -1,65 +0,0 @@ -PkgLoad pcb-rnd-gpmi/hid 0 -PkgLoad pcb-rnd-gpmi/layout 0 -PkgLoad pcb-rnd-gpmi/dialogs 0 - -set hid [hid_create "drill" "drill list export"] -set attr_path [hid_add_attribute $hid "filename" "name of the output file" "HIDA_Path" 0 0 "drill.txt"] -set attr_format [hid_add_attribute $hid "format" "file format" "HIDA_Enum" 0 0 "CSV|TSV|text"] -hid_register $hid - -set fmt 0 -set conv [mm2pcb_multiplier] -set channel -1 -set green_light 0 - -proc make_gc {event_id hid gc} { - global channel attr_path attr_format fmt - - if {$channel == -1} { - if {[catch {open [hid_get_attribute $hid $attr_path] "w"} channel]} { - dialog_report "Error exporting drill" "Could not open file [hid_get_attribute $hid $attr_path] for\nwriting, exporting drill failed." - return - } - set fmt [hid_get_attribute $hid $attr_format] - } -} - -proc destroy_gc {event_id hid gc} { - global channel - - if {$channel > -1} { - close $channel - set channel -1 - } -} - -proc set_layer_group {event_id hid group layer flags empty} { - global green_light - - if { [layer_flag_is_set $flags "LYT_ASSY"] && [layer_flag_is_set $flags "LYT_TOP"] } { set green_light 1; puts "!!!!!!!!!!!!!!!"} { set green_light 0 } -} - -proc fill_circle {event_id hid gc cx cy r} { - global channel conv fmt green_light - - if {$green_light} { - set cx [expr $cx / $conv] - set cy [expr $cy / $conv] - set dia [expr $r / $conv * 2] - - if {$fmt eq "CSV"} { - puts $channel "$cx,$cy,$dia" - } elseif {$fmt eq "TSV"} { - puts $channel "$cx $cy $dia" - } elseif {$fmt eq "text"} { - puts $channel "$cx $cy $dia" - } - } -} - -Bind HIDE_make_gc make_gc -Bind HIDE_destroy_gc destroy_gc -Bind HIDE_set_layer_group set_layer_group -Bind HIDE_fill_circle fill_circle - -puts "NA?" Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.awk =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.awk (revision 21065) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.awk (nonexistent) @@ -1,60 +0,0 @@ -BEGIN { - PkgLoad("pcb-rnd-gpmi/hid", 0) - PkgLoad("pcb-rnd-gpmi/layout", 0) - PkgLoad("pcb-rnd-gpmi/dialogs", 0) - - hid = hid_create("drill", "drill list export") - attr_path = hid_add_attribute(hid, "filename", "name of the output file", "HIDA_Path", 0, 0, "drill.txt") - attr_format = hid_add_attribute(hid, "format", "file format", "HIDA_Enum", 0, 0, "CSV|TSV|text") - hid_register(hid) - - fmt = 0 - conv = mm2pcb_multiplier() - channel = "" - green_light = 0 -} - -function make_gc(event_id, hid, gc) { - if (channel == "") { - channel = hid_get_attribute(hid, attr_path) -# awk: can't check whether the file can be open here - fmt = hid_get_attribute(hid, attr_format) - } -} - -function destroy_gc(event_id, hid, gc) { - if (channel != "") { - close(channel) - channel = "" - } -} - -function set_layer(event_id, hid, group, layer, flags, empty) { - if ((layer_flag_is_set(flags, "LYT_ASSY") == "1") && (layer_flag_is_set(flags, "LYT_TOP") == "1")) - green_light = 1 - else - green_light = 0 -} - -function fill_circle(event_id, hid, gc, cx, cy, r ,dia) { - if (green_light) { - cx = cx / conv - cy = cy / conv - dia = r / conv * 2 - - if (fmt == "CSV") { - print cx "," cy "," dia > channel - } else if (fmt == "TSV") { - print cx "\t" cy "\t" dia > channel - } else if (fmt == "text") { - print cx " " cy " " dia > channel - } - } -} - -BEGIN { - Bind("HIDE_make_gc", "make_gc") - Bind("HIDE_destroy_gc", "destroy_gc") - Bind("HIDE_set_layer_group", "set_layer_group") - Bind("HIDE_fill_circle", "fill_circle") -} Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_exp.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_exp.png =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow_exp.png (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow_exp.png (nonexistent) Property changes on: trunk/doc/user/06_feature/gpmi/gpmi_flow_exp.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/user/06_feature/gpmi/Porting =================================================================== --- trunk/doc/user/06_feature/gpmi/Porting (revision 21065) +++ trunk/doc/user/06_feature/gpmi/Porting (nonexistent) @@ -1,5 +0,0 @@ -Currently the project works on Linux only. GPMI is portable, so we need -only Makefile tweakings on pcb-gpmi to be able to compile it anywhere -where GPMI compiles. However, first I want to see some test results -from Linux users. - Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_exp.dot =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow_exp.dot (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow_exp.dot (nonexistent) @@ -1,65 +0,0 @@ -digraph g { - rankdir=LR - splines="polyline" -# nodesep=1 -# ranksep=1.5 - - subgraph cluster_0 { - label="pcb-rnd" -# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] - core [label="core" shape=box] - hids [label="HID system" shape=box height=2] - plugins [label="plugin system" shape=box height=2] - } - - subgraph cluster_1 { - label="GPMI" - gpmi_hid [label="gpmi HID"] - gpmi_pkg [label="gpmi package\n(host glue layer)"] - gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] - gpmi_scr1 [label="lua script"] - gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] - gpmi_scr2 [label="awk script"] - outfile [label="export\noutput file" color=green] - } - - - - gui [label="the active\nGUI HID\n(e.g. gtk)"] - exp1 [label="PS exporer"] - exp2 [label="PNG exporer"] - - - exp1 -> hids [label="register"] - exp2 -> hids [label="register"] - - hids -> exp1 [label="drawing"] - hids -> exp2 [label="drawing"] - hids -> gui [label="drawing"] - - plugins -> gpmi_hid [label="load plugin"] - gpmi_hid -> hids [label="register"] - hids -> gpmi_hid [label="drawing" color=green] - core -> gpmi_hid [label="event"] - - gpmi_pkg -> core [label="calls & variables"] - gpmi_pkg -> hids [label="calls & variables" color=red] - gpmi_pkg -> gpmi_hid [label="calls & variables"] - gpmi_pkg -> plugins [label="calls & variables"] - - - gpmi_hid -> gpmi_mod1 [label="load script"] - gpmi_hid -> gpmi_mod1 [label="event" color=green] - gpmi_hid -> gpmi_mod2 [label="load script"] - gpmi_hid -> gpmi_mod2 [label="event"] - - gpmi_mod1 -> gpmi_scr1 [label="load and exec"] - gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed color=green] - gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=red] - gpmi_scr1 -> outfile [label="write" color=green] - - gpmi_mod2 -> gpmi_scr2 [label="load and exec"] - gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] - gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] - -} \ No newline at end of file Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_menu.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_menu.png =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow_menu.png (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow_menu.png (nonexistent) Property changes on: trunk/doc/user/06_feature/gpmi/gpmi_flow_menu.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/user/06_feature/gpmi/gpmi_temp_inst.txt =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_temp_inst.txt (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_temp_inst.txt (nonexistent) @@ -1,65 +0,0 @@ -GPMI system-wide installation -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The installation process is somewhat manual at this early stage. Please -follow the steps below. - -First, you'll need libgpmi - it's a general purpose script glue interface. - -A/1. svn checkout svn://repo.hu/gpmi/trunk gpmi/trunk -A/2. look at doc/languages.txt there; if you have preferred languages, -please install the -dev packages of those. My favorite is mawk, but I -think most of the example pcb scripts would be in lua. Versions should -match; it may be that gpmi works with a newer minor version out of the -box, tho. -A/3. run ./configure -A/4. check if it found the language(s) you wanted; if not, or anything -else breaks, please send me your scconfig/config.log -A/5. make -A/6. make install (as root, but see below) - -There are options to step 6: - -- if you want to check what it'd do, you could run this: - - install_root=/tmp/foo make install - - it's like DESTDIR for autotools: it will do everything but will use - /tmp/foo instead of / so you see what it'd do without using root or - messing with /usr - -- you can use make linstall instead of make install; this creates symlinks -(pointing to the binaries in your user checkout) instead of copying the -files. If gpmi changes and you need to update and recompile, you won't -need to reinstall (until the number of files change). - -- there's a make uninstall, but it's more or less untested (failed once -and worked once for me) - -Second, you'll need pcb-rnd: - -B/1. svn checkout svn://repo.hu/pcb-rnd/trunk pcb-rnd/trunk -B/2. ./configure -B/3. check the output; if anything went wrong, please send me -scconfig/config.log -B/4. make -B/5. you don't need to install it for testing: cd src; ./pcb-rnd - - -There are options in step 2: by default, if gpmi is found, it's compiled -in "buildin" mode, which means script support is compiled into the pcb-rnd -executable. An alternative is to have it as a plugin (dynamic linkable -object). This can be done using the --plugin-gpmi argument for ./configure. - - -GPMI local installation -~~~~~~~~~~~~~~~~~~~~~~~ -GPMI can be installed without root, into a local user directory (typically -under home). To achieve this, follow the above steps with the following -modifications (assuming you want to install gpmi in ~/usr): - -A/3. ./configure --prefix=~/usr -B/2. ./configure --gpmi-prefix=~/usr - -NOTE: you don't need to use install_root; gpmi will install under ~/usr as -if it was /usr. Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_menu.dot =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow_menu.dot (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow_menu.dot (nonexistent) @@ -1,63 +0,0 @@ -digraph g { - rankdir=LR - splines="polyline" -# nodesep=1 -# ranksep=1.5 - - subgraph cluster_0 { - label="pcb-rnd" -# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] - core [label="core" shape=box] - hids [label="HID system" shape=box height=2] - plugins [label="plugin system" shape=box height=2] - } - - subgraph cluster_1 { - label="GPMI" - gpmi_hid [label="gpmi HID"] - gpmi_pkg [label="gpmi package\n(host glue layer)"] - gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] - gpmi_scr1 [label="lua script"] - gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] - gpmi_scr2 [label="awk script"] - } - - - - gui [label="the active\nGUI HID\n(e.g. gtk)"] - exp1 [label="PS exporer"] - exp2 [label="PNG exporer"] - - - exp1 -> hids [label="register"] - exp2 -> hids [label="register"] - - hids -> exp1 [label="drawing"] - hids -> exp2 [label="drawing"] - hids -> gui [label="drawing" color=green] - - plugins -> gpmi_hid [label="load plugin"] - gpmi_hid -> hids [label="register"] - hids -> gpmi_hid [label="drawing"] - core -> gpmi_hid [label="event" color=red] - - gpmi_pkg -> core [label="calls & variables"] - gpmi_pkg -> hids [label="calls & variables" color=green] - gpmi_pkg -> gpmi_hid [label="calls & variables"] - gpmi_pkg -> plugins [label="calls & variables"] - - - gpmi_hid -> gpmi_mod1 [label="load script"] - gpmi_hid -> gpmi_mod1 [label="event" color=red] - gpmi_hid -> gpmi_mod2 [label="load script"] - gpmi_hid -> gpmi_mod2 [label="event"] - - gpmi_mod1 -> gpmi_scr1 [label="load and exec"] - gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed color=red] - gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=green] - - gpmi_mod2 -> gpmi_scr2 [label="load and exec"] - gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] - gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] - -} \ No newline at end of file Index: trunk/doc/user/06_feature/gpmi/Credits =================================================================== --- trunk/doc/user/06_feature/gpmi/Credits (revision 21065) +++ trunk/doc/user/06_feature/gpmi/Credits (nonexistent) @@ -1,11 +0,0 @@ -2006...2009 -~~~~~~~~~~~ -Big thanks to DJ Delorie who added external HID support in PCB and commited -many small patches needed to get this project working in the period -when the whole project was a plugin to vanilla pcb. - -The following people helped the project with their valuable feedbacks -in the early stage: - John Griessen - Carlos Nieves Onega - Index: trunk/doc/user/06_feature/gpmi/History =================================================================== --- trunk/doc/user/06_feature/gpmi/History (revision 21065) +++ trunk/doc/user/06_feature/gpmi/History (nonexistent) @@ -1,32 +0,0 @@ -History -~~~~~~~ -As of October 2006, PCB has native support for external (or dynamic -loadable) HIDs. This project is a plugin that provides scripting features. - -For a long time I have believed that good applications should be scriptable, -and really good ones should not restrict scripting to one or two languages. -For this reason I have been working on GPMI with various other developers -for years. GPMI provides a general way to split up big applications in -smaller, usually dynamic loadable parts, and encourages that some of these -parts should be written in a script language. For me, the ideal model -of an application is a small core that knows how to manipulate the -internal representation of the task and a lot of dynamic functionality -plugins and support plugins that do all the high-level job for the user. - -PCB is an old and big software, with a stable user base. Restructuring the -whole source to "GPMIize" it is not an option. Instead, a nice compromise is -implementing this functionality in a plugin that pcb can load for the users -who are interested in such extras. - -From 2006 to spring 2009 the project was on hold, because I was nagging -PCB developers to add support for customizable dialog boxes. In late March -2009, PCB developers pointed out that the interface I was waiting for had been -there for who-knows-how-long. With the help of DJ Delorie I extended the -action handling of PCB to remember action contexts, which was another showstopper. -After all obstacles were removed, I allocated a 24 hour coding session where I -finished the exporter functionality, added action binding, dialog box handling, -and layout manipulation functions. - -During the summer of 2015 I merged pcb-gpmi into pcb-rnd and made it -the default scripting engine for pcb-rnd. - Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_reg.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_reg.png =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow_reg.png (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow_reg.png (nonexistent) Property changes on: trunk/doc/user/06_feature/gpmi/gpmi_flow_reg.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_reg.dot =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow_reg.dot (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow_reg.dot (nonexistent) @@ -1,64 +0,0 @@ -digraph g { - rankdir=LR - splines="polyline" -# nodesep=1 -# ranksep=1.5 - - subgraph cluster_0 { - label="pcb-rnd" -# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] - core [label="core" shape=box] - hids [label="HID system" shape=box height=2] - plugins [label="plugin system" shape=box height=2] - } - - subgraph cluster_1 { - label="GPMI" - gpmi_hid [label="gpmi HID"] - gpmi_pkg [label="gpmi package\n(host glue layer)"] - gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] - gpmi_scr1 [label="lua script"] - gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] - gpmi_scr2 [label="awk script"] - } - - - - gui [label="the active\nGUI HID\n(e.g. gtk)"] - exp1 [label="PS exporer"] - exp2 [label="PNG exporer"] - - - exp1 -> hids [label="register"] - exp2 -> hids [label="register"] - - hids -> exp1 [label="drawing"] - hids -> exp2 [label="drawing"] - hids -> gui [label="drawing"] - - plugins -> gpmi_hid [label="load plugin"] - gpmi_hid -> hids [label="register"] - hids -> gpmi_hid [label="drawing"] - core -> gpmi_hid [label="event"] - - gpmi_pkg -> core [label="calls & variables" color=green] - gpmi_pkg -> hids [label="calls & variables"] - gpmi_pkg -> gpmi_hid [label="calls & variables" color=red] - gpmi_pkg -> plugins [label="calls & variables"] - - - gpmi_hid -> gpmi_mod1 [label="load script"] - gpmi_hid -> gpmi_mod1 [label="event"] - gpmi_hid -> gpmi_mod2 [label="load script"] - gpmi_hid -> gpmi_mod2 [label="event"] - - gpmi_mod1 -> gpmi_scr1 [label="load and exec"] - gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed] - gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=red] - gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=green] - - gpmi_mod2 -> gpmi_scr2 [label="load and exec"] - gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] - gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] - -} \ No newline at end of file Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_load.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_load.png =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow_load.png (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow_load.png (nonexistent) Property changes on: trunk/doc/user/06_feature/gpmi/gpmi_flow_load.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/user/06_feature/gpmi/gpmi_flow.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/user/06_feature/gpmi/gpmi_flow.png =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow.png (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow.png (nonexistent) Property changes on: trunk/doc/user/06_feature/gpmi/gpmi_flow.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/user/06_feature/gpmi/gpmi_flow_load.dot =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow_load.dot (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow_load.dot (nonexistent) @@ -1,63 +0,0 @@ -digraph g { - rankdir=LR - splines="polyline" -# nodesep=1 -# ranksep=1.5 - - subgraph cluster_0 { - label="pcb-rnd" -# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] - core [label="core" shape=box] - hids [label="HID system" shape=box height=2] - plugins [label="plugin system" shape=box height=2] - } - - subgraph cluster_1 { - label="GPMI" - gpmi_hid [label="gpmi HID"] - gpmi_pkg [label="gpmi package\n(host glue layer)"] - gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] - gpmi_scr1 [label="lua script"] - gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] - gpmi_scr2 [label="awk script"] - } - - - - gui [label="the active\nGUI HID\n(e.g. gtk)"] - exp1 [label="PS exporer"] - exp2 [label="PNG exporer"] - - - exp1 -> hids [label="register"] - exp2 -> hids [label="register"] - - hids -> exp1 [label="drawing"] - hids -> exp2 [label="drawing"] - hids -> gui [label="drawing"] - - plugins -> gpmi_hid [label="load plugin" color=red] - gpmi_hid -> hids [label="register"] - hids -> gpmi_hid [label="drawing"] - core -> gpmi_hid [label="event"] - - gpmi_pkg -> core [label="calls & variables"] - gpmi_pkg -> hids [label="calls & variables"] - gpmi_pkg -> gpmi_hid [label="calls & variables" color=green] - gpmi_pkg -> plugins [label="calls & variables"] - - - gpmi_hid -> gpmi_mod1 [label="load script" color=red] - gpmi_hid -> gpmi_mod1 [label="event"] - gpmi_hid -> gpmi_mod2 [label="load script"] - gpmi_hid -> gpmi_mod2 [label="event"] - - gpmi_mod1 -> gpmi_scr1 [label="load and exec" color=red] - gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed] - gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=green] - - gpmi_mod2 -> gpmi_scr2 [label="load and exec"] - gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] - gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] - -} \ No newline at end of file Index: trunk/doc/user/06_feature/gpmi/gpmi_flow.dot =================================================================== --- trunk/doc/user/06_feature/gpmi/gpmi_flow.dot (revision 21065) +++ trunk/doc/user/06_feature/gpmi/gpmi_flow.dot (nonexistent) @@ -1,63 +0,0 @@ -digraph g { - rankdir=LR - splines="polyline" -# nodesep=1 -# ranksep=1.5 - - subgraph cluster_0 { - label="pcb-rnd" -# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record] - core [label="core" shape=box] - hids [label="HID system" shape=box height=2] - plugins [label="plugin system" shape=box height=2] - } - - subgraph cluster_1 { - label="GPMI" - gpmi_hid [label="gpmi HID"] - gpmi_pkg [label="gpmi package\n(host glue layer)"] - gpmi_mod1 [label="gpmi lua module\n(script glue layer)"] - gpmi_scr1 [label="lua script"] - gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"] - gpmi_scr2 [label="awk script"] - } - - - - gui [label="the active\nGUI HID\n(e.g. gtk)"] - exp1 [label="PS exporer"] - exp2 [label="PNG exporer"] - - - exp1 -> hids [label="register"] - exp2 -> hids [label="register"] - - hids -> exp1 [label="drawing"] - hids -> exp2 [label="drawing"] - hids -> gui [label="drawing"] - - plugins -> gpmi_hid [label="load plugin"] - gpmi_hid -> hids [label="register"] - hids -> gpmi_hid [label="drawing"] - core -> gpmi_hid [label="event"] - - gpmi_pkg -> core [label="calls & variables"] - gpmi_pkg -> hids [label="calls & variables"] - gpmi_pkg -> gpmi_hid [label="calls & variables"] - gpmi_pkg -> plugins [label="calls & variables"] - - - gpmi_hid -> gpmi_mod1 [label="load script"] - gpmi_hid -> gpmi_mod1 [label="event"] - gpmi_hid -> gpmi_mod2 [label="load script"] - gpmi_hid -> gpmi_mod2 [label="event"] - - gpmi_mod1 -> gpmi_scr1 [label="load and exec"] - gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed] - gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed] - - gpmi_mod2 -> gpmi_scr2 [label="load and exec"] - gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed] - gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed] - -} \ No newline at end of file Index: trunk/doc/user/06_feature/gpmi/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/index.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/index.html (nonexistent) @@ -1,41 +0,0 @@ - - - - pcb-rnd user manual - - - -

pcb-rnd GPMI scripting - TOC

- -

This plugin is deprecated and will be soon removed. Please use -fungw scripting instead. - - -

Installation, configuration

- - - -

High level docs

- - -

Glue layer documentation

- - -

Authors, credits, misc

- - - - Index: trunk/doc/user/06_feature/gpmi/util/rosetta_genpages.sh =================================================================== --- trunk/doc/user/06_feature/gpmi/util/rosetta_genpages.sh (revision 21065) +++ trunk/doc/user/06_feature/gpmi/util/rosetta_genpages.sh (nonexistent) @@ -1,182 +0,0 @@ -#!/bin/sh - -clean_id() -{ - tr "\r\n" "~" | sed ' -s/~*$//; -s/|/\&pipe;/g; -s/&/\&/g; -s//\>/g; -s/"/\"/g; -s/'\''/\'/g; -s/~\+/
/g; -' - echo "" -} - -genpage() -{ - local dir scripts name desc - - dir="$1" - scripts="$2" - - name=`cat $dir/ID.name` - desc=`cat $dir/ID.desc` - ./tags < "$dir/ex.html" | awk -v "fn_ref=../packages/XREF" -v "scripts=$scripts" -v "name=$name" -v "desc=$desc" ' - BEGIN { - while((getline < fn_ref) > 0) { - REF[$2] = $3 - } - print "" - print "" - print "" - print " pcb-rnd rosetta", name, "" - print " " - print "" - print "" - print "" - print "<-- back to the index of Rosetta examples" - print "

" name "

" - print desc - - print "

Example implementations

" - v = split(scripts, S, "[\r\n]+") - for(n = 1; n <= v; n++) { - lang=S[n] - sub("^ex[.]", "", lang) - if (n != 1) - print " | " - print "" lang "" - } - - print "

Explanation, step by step

" - } - /^/ { - gsub("", "", $0) - name=$0 - gsub("[ \t]*", "", name) - if (name in REF) { - link_begin="" - link_end = "" - } - else { - link_begin="" - link_end="" - } - print "" link_begin $0 link_end "" - next - } - - { print $0 } - - END { - print "" - print "" - } - - ' > "$dir/index.html" -} - -gen_index() -{ - - awk -v "template=$1" ' - BEGIN { - FS="[|]" - q = "\"" - LANGS["rb"] = "ruby" - LANGS["pl"] = "perl" - LANGS["py"] = "python" - LANGS["stt"] = "stutter" - LANGS["scm"] = "scheme" - } - - ($1 == "scripts") { - s = $3 - gsub("ex[.]", "", s) - v = split(s, S, " ") - s = "" - for(n = 1; n <= v; n++) { - if (S[n] in LANGS) - s = s " " LANGS[S[n]] - else - s = s " " S[n] - } - DATA[$2, $1] = s - next - } - - ($1 == "name") { - if (names == "") - names = $2 - else - names = names "|" $2 - } - - - { - # DATA[script, name] = "hello world" - DATA[$2, $1] = $3 - } - - function generate(cmd ,N,n,v,name,level) { - if (cmd == "index") { - print "" - print "" - print "
lvlexample languages description" - v = split(names, N, "[|]") - for(n = 1; n <= v; n++) { - name = N[n] - level = name - sub("_.*", "", level) - if (level ~ "[^0-9]") - level = "n/a" - print "
" level - print " " DATA[name, "name"] "" - print " " DATA[name, "scripts"] - print " " DATA[name, "desc"] - } - print "
" - } - else - print "Do not know how to generate " cmd > "/dev/stderr" - } - - END { - FS="" - while((getline < template) > 0) { - if (match($0, "]*>")) { - print substr($0, 1, RSTART-1) - cmd=substr($0, RSTART+8, RLENGTH-9) - sub("^[ \t]*", "", cmd) - generate(cmd) - print substr($0, RSTART+RLENGTH) - } - else - print $0 - } - } - ' - -} - - -for n in ../rosetta/* -do - if test -d "$n" - then - bn=`basename $n` - scripts=`cd $n && ls ex.* | grep -v ".pyc$\|.html$" ` - genpage "$n" "$scripts" - echo -n "desc|$bn|" - clean_id < $n/ID.desc - echo -n "name|$bn|" - clean_id < $n/ID.name - echo -n "scripts|$bn|" - echo $scripts - fi -done | gen_index ../rosetta/index.templ.html > ../rosetta/index.html - - Property changes on: trunk/doc/user/06_feature/gpmi/util/rosetta_genpages.sh ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: trunk/doc/user/06_feature/gpmi/util/Makefile =================================================================== --- trunk/doc/user/06_feature/gpmi/util/Makefile (revision 21065) +++ trunk/doc/user/06_feature/gpmi/util/Makefile (nonexistent) @@ -1 +0,0 @@ -all: Index: trunk/doc/user/06_feature/gpmi/util/tags =================================================================== --- trunk/doc/user/06_feature/gpmi/util/tags (revision 21065) +++ trunk/doc/user/06_feature/gpmi/util/tags (nonexistent) @@ -1,4 +0,0 @@ -#!/bin/sh - -tr "\n" " " | sed "s@\(<[^/]\)@\n\1@g;s@\(]*>\)@\1\n@g" - Property changes on: trunk/doc/user/06_feature/gpmi/util/tags ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: trunk/doc/user/06_feature/gpmi/Makefile =================================================================== --- trunk/doc/user/06_feature/gpmi/Makefile (revision 21065) +++ trunk/doc/user/06_feature/gpmi/Makefile (nonexistent) @@ -1,20 +0,0 @@ -DPI_BIG=-Gsize=8,8 -Gdpi=166 -DPI=-Gsize=8,8 -Gdpi=100 - -all: gpmi_flow.png gpmi_flow_load.png gpmi_flow_reg.png gpmi_flow_menu.png gpmi_flow_exp.png - cd rosetta && $(MAKE) - -gpmi_flow.png: gpmi_flow.dot Makefile - dot $(DPI_BIG) -Tpng gpmi_flow.dot >$@ - -gpmi_flow_load.png: gpmi_flow_load.dot Makefile - dot $(DPI) -Tpng gpmi_flow_load.dot >$@ - -gpmi_flow_reg.png: gpmi_flow_reg.dot Makefile - dot $(DPI) -Tpng gpmi_flow_reg.dot >$@ - -gpmi_flow_menu.png: gpmi_flow_menu.dot Makefile - dot $(DPI) -Tpng gpmi_flow_menu.dot >$@ - -gpmi_flow_exp.png: gpmi_flow_exp.dot Makefile - dot $(DPI) -Tpng gpmi_flow_exp.dot >$@ Index: trunk/doc/user/06_feature/gpmi/packages/actions_ref.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/actions_ref.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/actions_ref.html (nonexistent) @@ -1,82 +0,0 @@ - - -

PCB GPMI

-

Reference manual for package actions

-Automatically generated from actions.h - -

Events

-
-

Events do not have return value. The first argument is always the even id. Event handlers defined in scripts get all event arguments converted to string (types below are informational). - -

ACTE_action(int event_id, const char* name, int argc, int x, int y)

-
- Generated when an action registered by the script is executed.
-   Arguments:
-    name: name of the action (as registered using function action_register())
-    argc: number of arguments. Arguments can be accessed using function action_arg
-    x, y: optional coords, if need_xy was not empty at action_register 
-
-
-

ACTE_gui_init(int event_id, int argc, char** argv)

-
- Generated right after gui initialization, before the gui main loop.
-   Arguments:
-    argc: number of arguments the gui was initialized with.
-    argv[]: arguments the gui was initialized with - unaccessible for the scripts. 
-
-
-

ACTE_unload(int event_id, const char* conffile)

-
- Generated right before unloading a script to give the script a chance
-   to clean up.
-   Arguments:
-    conffile: the name of the config file that originally triggered loading the script, or empty if the script was loaded from the gui. 
-
-
-

Functions

-
-

The following functions are registered in script context. - -

int action_register(const char* name, const char* need_xy, const char* description, const char* syntax)

-
- Register an action in PCB - when the action is executed, event
-   ACTE_action is generated with the action name.
-   Multiple actions can be registered. Any action registered by the script
-   will trigger an ACTE_event sent to the script.
-   Arguments:
-    name: name of the action
-    need_xy: the question the user is asked when he needs to choose a coordinate; if empty, no coordinate is asked
-    description: description of the action (for the help)
-    syntax: syntax of the action (for the help)
-   Returns 0 on success.
- 
-
-
-

const char* action_arg(int argn)

-
- extract the (argn)th event argument for the current action (makes sense only in an ACTE_action event handler 
-
-
-

int action(const char* cmdline)

-
- call an existing action using PCB syntax (e.g. foo(1, 2, 3))
-   Returns non-zero on error; generally returns value of the action
-   (which is also non-zero on error). 
-
-
-

void create_menu(const char* path, const char* action, const char* mnemonic, const char* hotkey, const char* tooltip)

-
- Create a new menu or submenu at path. Missing parents are created
-   automatically with empty action, mnemonic, hotkey and tooltip.
-   Arguments:
-    path: the full path of the new menu
-    action: this action is executed when the user clicks on the menu
-    mnemonic: which letter to underline in the menu text (will be the fast-jump-there key once the menu is open)
-    hotkey: when this key is pressed in the main gui, the action is also triggered; the format is modifiers<Key>letter, where modifiers is Alt, Shift or Ctrl. This is the same syntax that is used in the .res files.
-    tooltip: short help text 
-
-
- - - - Index: trunk/doc/user/06_feature/gpmi/packages/layout.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/layout.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/layout.html (nonexistent) @@ -1,58 +0,0 @@ - - -

layout package

- -Layout package searches and manipulates the current layout. Dimension units -are in nanometer unless otherwise mentioned. - -

Page: board dimensions

- Functions used to query or set width and height of the drawing: -
    -
  • int layout_get_page_width(); -
  • int layout_get_page_height(); -
  • void layout_set_page_size(int width, int height); -
- -

Layer manipulation

-Most functions perform operations similar to user commands affecting -the current layer. -The following few calls can change the current layer. Warning: this is the -same current layer as the user's; the script most probably wants to save -the current layer before changing it and then restore it after the operation. -
    -
  • int layout_resolve_layer(const char *name): resolve layer number by name (case sensitive); returns negative number if not found -
  • int layout_get_current_layer(): returns the number of the current layer -
  • void layout_switch_to_layer(int layer): switch to layer (further actions will take place there) -
-

- -

Object searches

- Search results are collected on lists identified by their name (search_ID). - If a new search is done with the same name, old search results for that - name are discarded. - Search functions return the number of objects found (size of the list) that can - be then used while querying the results using layout_search_get(). - Results should be freed using layout_search_free() when they are no - longer needed. -

- TODO: validity of a list in time -

-Once the search list is ready, the script can iterate over it and resolve -the object handle of each object found, using layout_search_get(). Having -an object handle, The layout_obj_*() functions may be used by the script -to access fields of an object structure. - -

Create new objects

- The layout_create_*() calls are used to create new objects on the current - layer (set by layout_switch_to_layer()). - - -

API reference - page, units and coordinates

-(angles are in radian) -TODO - -

API reference - debug draw

-TODO - - - Index: trunk/doc/user/06_feature/gpmi/packages/event_id.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/event_id.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/event_id.html (nonexistent) @@ -1,20 +0,0 @@ - - -

event_id

- -The first argument passed to an event handler is always the event ID. -It is useful if there are several GPMI events with the same arguments and -the script wants to bind them all to the same event handler. In that case -using event_id the event handler can determine which event triggered the -call. This design is similar to the signal handler documented in -signal(2). - -

- -The case described above (dispatcher in the event handler) is rare. -Most users will bind one event to one function and can safely ignore this -argument. Nevertheless it must present as the first argument -on the event handler's argument list. - - - Index: trunk/doc/user/06_feature/gpmi/packages/dialogs_ref.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/dialogs_ref.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/dialogs_ref.html (nonexistent) @@ -1,105 +0,0 @@ - - -

PCB GPMI

-

Reference manual for package dialogs

-Automatically generated from dialogs.h - -

Enums

-
-

Enum values should be passed on as strings. - -

dialog_fileselect_e

-
- Filter on what files a file select dialog should list 
-
- -
value meaning -
FS_NONE none of the below -
FS_READ when the selected file will be read, not written (HID_FILESELECT_READ) -
FS_NOT_EXIST the function calling hid->fileselect will deal with the case when the selected file already exists. If not given, then the gui will prompt with an "overwrite?" prompt. Only used when writing. (HID_FILESELECT_MAY_NOT_EXIST) -
FS_TEMPLATE the call is supposed to return a file template (for gerber output for example) instead of an actual file. Only used when writing. (HID_FILESELECT_IS_TEMPLATE) -
-
-

Functions

-
-

The following functions are registered in script context. - -

void dialog_log(const char* msg)

-
- Append a msg to the log (log window and/or stderr). 
-
-
-

int dialog_confirm(const char* msg, const char* ok, const char* cancel)

-
- Ask the user for confirmation (usually using a popup). Returns 0 for
-   cancel and 1 for ok.
-   Arguments:
-     msg: message to the user
-     ok: label of the OK button
-     cancel: label of the cancel button
-  Arguments "ok" and "cancel" may be empty (or NULL) in which
-  case the GUI will use the default (perhaps localized) labels for
-  those buttons. 
-
-
-

void dialog_report(const char* title, const char* msg)

-
- Pop up a report dialog.
-   Arguments:
-     title: title of the window
-     msg: message 
-
-
-

char* dialog_prompt(const char* msg, const char* default_)

-
- Ask the user to input a string (usually in a popup).
-   Arguments:
-     msg: message or question text
-     default_: default answer (this may be filled in on start)
-   Returns the answer. 
-
-
-

char* dialog_fileselect(const char* title, const char* descr, char* default_file_, char* default_ext, const char* history_tag, dialog_fileselect_t flags)

-
- Pops up a file selection dialog.
-   Arguments:
-     title: window title
-     descr: description
-     default_file_
-     default_ext: default file name extension
-     history_tag
-     flags: one or more flags (see below)
-   Returns the selected file or NULL (empty). 
-
-
-

void dialog_beep(void)

-
- Audible beep 
-
-
-

int dialog_progress(int so_far, int total, const char* message)

-
- Request the GUI hid to draw a progress bar.
-   Arguments:
-     int so_far: achieved state
-     int total: maximum state
-     const char *message: informs the users what they are waiting for
-   If so_far is bigger than total, the progress bar is closed.
-   Returns nonzero if the user wishes to cancel the operation.
-
-
-
-

int dialog_attribute(hid_t* hid, const char* title, const char* descr)

-
- Pop up an attribute dialog; content (widgets) of the dialog box are coming
-   from hid (see the hid package).
-   Arguments:
-     hid: widgets
-     title: title of the window
-     descr: description printed in the dialog 
-
-
- - - - Index: trunk/doc/user/06_feature/gpmi/packages/actions.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/actions.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/actions.html (nonexistent) @@ -1,123 +0,0 @@ - - -

The actions package

- -The action package is used to register actions and menus in PCB and -to execute existing actions. In PCB actions -are generated when the user selects a menu, presses a key or issues a -command on the PCB command line. - -

Registration of new actions

-The script may register new actions -using arbitrary action names. If any of the registered actions is -detected, an ACTE_action event is sent to the script. If multiple -actions are used in a script, argument name of the event handler -can be used to identify the triggering action. (This may be time consuming -in scripting languages (a series of string comparison) - those scripts -binding to frequent actions should not bind to too many different actions.) -pcb-gpmi guarantees that the event handler of a script is triggered only -when an action is caught that previously was registered by the same script. -

-The process of binding an action: -

    -
  1. create an event handler for event ACTE_action -
  2. register one or more actions using function action_register -
  3. optional: when the event handler is triggered, check argument name (for scripts with multiple actions registered) -
  4. optional: use argument argc and function action_arg to fetch action arguments -
  5. optional: use arguments x, y to learn the cursor position on the layout. -
- -Example (written in lua): -
--- load the package
-PkgLoad("pcb-gpmi/actions", 0);
-
--- action callback
-function ev_action(id, name, argc, x, y)
-	if name == "cake" then
-		size = action_arg(1);
-		-- put cake drawing code here
-	else
-		-- must be candy
-		amount = action_arg(1);
-		-- put candy drawing code here
-	end
-end
-
--- register and bind action
-action_register("cake",  "cake center xy?", "cake service", "cake(size)", "");
-action_register("candy", "candy cloud center xy?", "cake service", "candy(amount)", "");
-Bind("ACTE_action", "ev_action");
-
-

-When the script is unloaded all actions the script registered -are removed from pcb-rnd automatically. - -

Executing actions

-An existing action can be executed using the action() call. The only one -argument is a command line string. The syntax is the same as in pcb -command line. - -Example (written in lua): -
-PkgLoad("pcb-rnd-gpmi/actions", 0);
-
-function ev_action1(id, name, argc, x, y)
-	action("undo()")
-	action("undo()")
-end
-
--- register and bind action
-action_register("untwo", "", "undo twice", "untwo()", "CONTEXT!");
-
-

-The above script registers a new action called untwo(). When untwo() is executed, -it executes action undo() twice. - - -

Creating menus

-It is possible to insert menus and submenus runtime, using the call -create_menu(). The script should do this only after the gui has been initialized. -The most common way is to create all menus from the ACTE_gui_init event, -which is called after the gui finished setting up. -

-The first argument of create_menu() is the menu path. The path is a list -of visible menu names separated by slashes (e.g. "/main_menu/File/Save as..." means -"File" menu, "Save as..." submenu). -

-Paths are interpreted as menu paths, which are a slightly simplified version -of lihata paths found in menu.lht. Basically there's a main directory directly -under root that determines the type of the menu: -

-

    -
  • /main_menu/ is the menubar -
  • /popups/something/ is a popup menu called something; the lesstif HID does - not support popups; popups are popped up by actions. -
-

-The simplification compared to lihata paths is that only menu and submenu -names are on the path, so lihata nodes like "li:submenu" should be ignored. -In other words, the path represents how the menus can be reached from the user -interface, plus a "main menu type prefix" as discussed above. -

-By convention, scripts should -create new menu items under the "/main_menu/Plugins/" menu. -

-The following example lua script registers a new menu item -

-PkgLoad("pcb-rnd-gpmi/actions", 0);
-
-function ev_gui_init(argc, argv)
-	create_menu("/main_menu/Plugins/foo", "undo()", "o", "Ctrl<Key>o", "tooltip for foo");
-end
-
--- register and bind action
-Bind("ACTE_gui_init", "ev_gui_init");
-
-

-When the user clicks on the menu, the action script specified in the second argument -of create_menu() is executed. Thus the script usually registers a new action -first then registers one or more menu items executing those actions. - - - Index: trunk/doc/user/06_feature/gpmi/packages/hid_ref.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/hid_ref.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/hid_ref.html (nonexistent) @@ -1,205 +0,0 @@ - - -

PCB GPMI

-

Reference manual for package hid

-Automatically generated from hid.h - -

Enums

-
-

Enum values should be passed on as strings. - -

hid_attr_type_e

-
- Type of an HID attribute (usually a widget on an attribute dialog box) 
-
- -
value meaning -
HIDA_Label non-editable label displayed on the GUI -
HIDA_Integer a signed integer value -
HIDA_Real a floating point value -
HIDA_String one line textual input -
HIDA_Boolean true/false boolean value -
HIDA_Enum select an item of a predefined list -
HIDA_Mixed TODO -
HIDA_Path path to a file or directory -
HIDA_Unit select a dimension unit -
HIDA_Coord enter a coordinate -
-
-

EndCapStyle_e

-
- Line or arc ending style 
-
- -
value meaning -
Trace_Cap filled circle (trace drawing) -
Square_Cap rectangular lines (square pad) -
Round_Cap round pins or round-ended pads, thermals -
Beveled_Cap octagon pins or bevel-cornered pads -
-
-

Events

-
-

Events do not have return value. The first argument is always the even id. Event handlers defined in scripts get all event arguments converted to string (types below are informational). - -

HIDE_get_export_options(int event_id, void* hid)

-
- Called before get_exporter_options returns the option list to the GUI hid 
-
-
-

HIDE_do_export_start(int event_id, void* hid)

-
- Called before export redraw starts 
-
-
-

HIDE_do_export_finish(int event_id, void* hid)

-
- Called after export redraw finished 
-
-
-

HIDE_set_layer(int event_id, void* hid, const char* name, int group, int empty)

-
- PCB callback events for drawing: change layer 
-
-
-

HIDE_set_color(int event_id, void* hid, void* gc, const char* name)

-
- PCB callback events for drawing: change drawing color 
-
-
-

HIDE_set_line_cap(int event_id, void* hid, void* gc, EndCapStyle style)

-
- PCB callback events for drawing: change drawing line cap style
-
-
-

HIDE_set_line_width(int event_id, void* hid, void* gc, int width)

-
- PCB callback events for drawing: change drawing line width 
-
-
-

HIDE_set_draw_xor(int event_id, void* hid, void* gc, int xor)

-
- PCB callback events for drawing: toggle xor drawing method 
-
-
-

HIDE_set_draw_faded(int event_id, void* hid, void* gc, int faded)

-
- PCB callback events for drawing: toggle faded drawing method 
-
-
-

HIDE_draw_line(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2)

-
- PCB callback events for drawing: draw a line 
-
-
-

HIDE_draw_arc(int event_id, void* hid, void* gc, int cx, int cy, int xradius, int yradius, double start_angle, double delta_angle)

-
- PCB callback events for drawing: draw an arc from center cx;cy 
-
-
-

HIDE_draw_rect(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2)

-
- PCB callback events for drawing: draw a rectangle 
-
-
-

HIDE_fill_circle(int event_id, void* hid, void* gc, int cx, int cy, int radius)

-
- PCB callback events for drawing: draw a filled circle 
-
-
-

HIDE_fill_polygon(int event_id, void* hid, void* gc, int n_coords, int* x, int* y)

-
- PCB callback events for drawing: draw a filled polygon 
-
-
-

HIDE_fill_rect(int event_id, void* hid, void* gc, int x1, int y1, int x2, int y2)

-
- PCB callback events for drawing: draw a filled rectangle 
-
-
-

HIDE_use_mask(int event_id, void* hid, int use_it)

-
- PCB callback events for drawing: TODO 
-
-
-

HIDE_make_gc(int event_id, void* hid, void* gc)

-
- PCB callback events for drawing: create a new graphical context 
-
-
-

HIDE_destroy_gc(int event_id, void* hid, void* gc)

-
- PCB callback events for drawing: destroy a graphical context 
-
-
-

HIDE_fill_pcb_pv(int event_id, void* hid, void* fg_gc, void* bg_gc, void* pad, int drawHole, int mask)

-
- PCB callback events for drawing: TODO 
-
-
-

HIDE_fill_pcb_pad(int event_id, void* hid, void* pad, int clear, int mask)

-
- PCB callback events for drawing: TODO 
-
-
-

Functions

-
-

The following functions are registered in script context. - -

hid_t* hid_create(char* hid_name, char* description)

-
- Creates a new hid context. Name and description matters only if the hid is
-registered as an exporter later. 
-
-
-

int hid_add_attribute(hid_t* hid, char* attr_name, char* help, hid_attr_type_t type, int min, int max, char* default_val)

-
- Append an attribute in a hid previously created using hid_create().
-   Arguments:
-     hid: hid_t previously created using hid_create()
-     attr_name: name of the attribute
-     help: help text for the attribute
-     type: type of the attribute (input widget type)
-     min: minimum value of the attribute, if type is integer or real)
-     max: maximum value of the attribute, if type is integer or real)
-     default_val: default value of the attribute
-  Returns an unique ID of the attribute the caller should store for
-  later reference. For example this ID is used when retrieving the
-  value of the attribute after the user finished entering data in
-  the dialog. 
-
-
-

char* hid_get_attribute(hid_t* hid, int attr_id)

-
- Query an attribute from the hid after dialog_attributes() returned.
-   Arguments:
-     hid: hid_t previously created using hid_create()
-     attr_id: the unique ID of the attribute (returned by hid_add_attribute())
-   Returns the value (converted to string) set by the user. 
-
-
-

int hid_register(hid_t* hid)

-
- Register the hid; call it after a hid is created and its attributes
-   are all set up 
-
-
-

void hid_gpmi_data_set(hid_t* h, void* data)

-
- For internal use 
-
-
-

hid_t* hid_gpmi_data_get(HID* h)

-
- For internal use 
-
-
-

HID_Attr_Val hid_string2val(const hid_attr_type_t type, const char* str)

-
- For internal use 
-
-
- - - - Index: trunk/doc/user/06_feature/gpmi/packages/XREF =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/XREF (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/XREF (nonexistent) @@ -1,85 +0,0 @@ -event ACTE_action ../packages/actions_ref.html#ACTE_action -event ACTE_gui_init ../packages/actions_ref.html#ACTE_gui_init -event ACTE_unload ../packages/actions_ref.html#ACTE_unload -function action_register ../packages/actions_ref.html#action_register -function action_arg ../packages/actions_ref.html#action_arg -function action ../packages/actions_ref.html#action -function create_menu ../packages/actions_ref.html#create_menu -enum dialog_fileselect_e ../packages/dialogs_ref.html#dialog_fileselect_e -function dialog_log ../packages/dialogs_ref.html#dialog_log -function dialog_confirm ../packages/dialogs_ref.html#dialog_confirm -function dialog_report ../packages/dialogs_ref.html#dialog_report -function dialog_prompt ../packages/dialogs_ref.html#dialog_prompt -function dialog_fileselect ../packages/dialogs_ref.html#dialog_fileselect -function dialog_beep ../packages/dialogs_ref.html#dialog_beep -function dialog_progress ../packages/dialogs_ref.html#dialog_progress -function dialog_attribute ../packages/dialogs_ref.html#dialog_attribute -enum hid_attr_type_e ../packages/hid_ref.html#hid_attr_type_e -enum EndCapStyle_e ../packages/hid_ref.html#EndCapStyle_e -event HIDE_get_export_options ../packages/hid_ref.html#HIDE_get_export_options -event HIDE_do_export_start ../packages/hid_ref.html#HIDE_do_export_start -event HIDE_do_export_finish ../packages/hid_ref.html#HIDE_do_export_finish -event HIDE_set_layer ../packages/hid_ref.html#HIDE_set_layer -event HIDE_set_color ../packages/hid_ref.html#HIDE_set_color -event HIDE_set_line_cap ../packages/hid_ref.html#HIDE_set_line_cap -event HIDE_set_line_width ../packages/hid_ref.html#HIDE_set_line_width -event HIDE_set_draw_xor ../packages/hid_ref.html#HIDE_set_draw_xor -event HIDE_set_draw_faded ../packages/hid_ref.html#HIDE_set_draw_faded -event HIDE_draw_line ../packages/hid_ref.html#HIDE_draw_line -event HIDE_draw_arc ../packages/hid_ref.html#HIDE_draw_arc -event HIDE_draw_rect ../packages/hid_ref.html#HIDE_draw_rect -event HIDE_fill_circle ../packages/hid_ref.html#HIDE_fill_circle -event HIDE_fill_polygon ../packages/hid_ref.html#HIDE_fill_polygon -event HIDE_fill_rect ../packages/hid_ref.html#HIDE_fill_rect -event HIDE_use_mask ../packages/hid_ref.html#HIDE_use_mask -event HIDE_make_gc ../packages/hid_ref.html#HIDE_make_gc -event HIDE_destroy_gc ../packages/hid_ref.html#HIDE_destroy_gc -event HIDE_fill_pcb_pv ../packages/hid_ref.html#HIDE_fill_pcb_pv -event HIDE_fill_pcb_pad ../packages/hid_ref.html#HIDE_fill_pcb_pad -function hid_create ../packages/hid_ref.html#hid_create -function hid_add_attribute ../packages/hid_ref.html#hid_add_attribute -function hid_get_attribute ../packages/hid_ref.html#hid_get_attribute -function hid_register ../packages/hid_ref.html#hid_register -function hid_gpmi_data_set ../packages/hid_ref.html#hid_gpmi_data_set -function hid_gpmi_data_get ../packages/hid_ref.html#hid_gpmi_data_get -function hid_string2val ../packages/hid_ref.html#hid_string2val -enum layout_object_mask_e ../packages/layout_ref.html#layout_object_mask_e -enum layout_object_coord_e ../packages/layout_ref.html#layout_object_coord_e -enum layout_flag_e ../packages/layout_ref.html#layout_flag_e -enum layer_field_e ../packages/layout_ref.html#layer_field_e -function layout_search_box ../packages/layout_ref.html#layout_search_box -function layout_search_selected ../packages/layout_ref.html#layout_search_selected -function layout_search_found ../packages/layout_ref.html#layout_search_found -function layout_search_get ../packages/layout_ref.html#layout_search_get -function layout_search_free ../packages/layout_ref.html#layout_search_free -function layout_obj_coord ../packages/layout_ref.html#layout_obj_coord -function layout_obj_type ../packages/layout_ref.html#layout_obj_type -function layout_obj_move ../packages/layout_ref.html#layout_obj_move -function layout_arc_angles ../packages/layout_ref.html#layout_arc_angles -function layout_create_line ../packages/layout_ref.html#layout_create_line -function layout_create_via ../packages/layout_ref.html#layout_create_via -function layout_create_arc ../packages/layout_ref.html#layout_create_arc -function layout_switch_to_layer ../packages/layout_ref.html#layout_switch_to_layer -function layout_get_current_layer ../packages/layout_ref.html#layout_get_current_layer -function layout_resolve_layer ../packages/layout_ref.html#layout_resolve_layer -function layout_get_max_possible_layer ../packages/layout_ref.html#layout_get_max_possible_layer -function layout_get_max_copper_layer ../packages/layout_ref.html#layout_get_max_copper_layer -function layout_get_max_layer ../packages/layout_ref.html#layout_get_max_layer -function layout_layer_name ../packages/layout_ref.html#layout_layer_name -function layout_layer_color ../packages/layout_ref.html#layout_layer_color -function layout_layer_field ../packages/layout_ref.html#layout_layer_field -function layout_get_page_width ../packages/layout_ref.html#layout_get_page_width -function layout_get_page_height ../packages/layout_ref.html#layout_get_page_height -function layout_set_page_size ../packages/layout_ref.html#layout_set_page_size -function mil2pcb_multiplier ../packages/layout_ref.html#mil2pcb_multiplier -function mm2pcb_multiplier ../packages/layout_ref.html#mm2pcb_multiplier -function current_grid_unit ../packages/layout_ref.html#current_grid_unit -function debug_draw_request ../packages/layout_ref.html#debug_draw_request -function debug_draw_flush ../packages/layout_ref.html#debug_draw_flush -function debug_draw_finish ../packages/layout_ref.html#debug_draw_finish -function debug_draw_dctx ../packages/layout_ref.html#debug_draw_dctx -function draw_set_color ../packages/layout_ref.html#draw_set_color -function draw_set_line_width ../packages/layout_ref.html#draw_set_line_width -function draw_set_draw_xor ../packages/layout_ref.html#draw_set_draw_xor -function draw_set_draw_faded ../packages/layout_ref.html#draw_set_draw_faded -function draw_line ../packages/layout_ref.html#draw_line Index: trunk/doc/user/06_feature/gpmi/packages/dialogs.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/dialogs.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/dialogs.html (nonexistent) @@ -1,47 +0,0 @@ - - -

dialogs package

- The purpose of this package is to expose the dialog box handling interface - of the active GUI hid. Using this package scripts can pop up dialog boxes - to inform or ask the user. If there is no active GUI, call logs are dumped - on stderr. Note: message arguments usually may contain newline (\n) characters - to split the message. - -

Common conventions

- Dialog boxes are blocking calls to the GUI HID: when the script - calls a dialog box, the script is suspended until the dialog box - is closed by the user. In other words, dialog boxes behave - as regular function calls from the scripts: when they return, - the dialog is over and the result is known. -

- The only exception is dialog_progress(), which opens or - updates or closes the already open progress dialog box, and - returns immediately (even when the box is left open). - -

Simple dialogs vs. custom dialogs

- Most of the calls will pop up a static dialog box. Static means - that widgets are predefined by the GUI HID. The script - is free to fill in data, but can not change the basic structure of - the dialog box. For example dialog_confirm(), dialog_prompt(), - dialog_fileselect() are static. -

- When the script needs a custom, dynamic dialog box, it needs to - create an attribute dialog. The script sets up a HID - structure using the hid package, builds up all the input fields - then calls dialog_attribute() with the hid. - -

Progress dialogs

- - The script should call dialog_progress() periodically from a process that - runs time consuming calculations and check the return value and break - the loop on cancel. The process should have an idea of how long it - will take. This is passed on in argument total. As long as - argument so_far is less than total, the dialog is - open. -

- After the process has finished, a call with so_far=total+1 should be - made to make sure the window is closed. If the call returns non-zero, - the process should be cancelled. - - - Index: trunk/doc/user/06_feature/gpmi/packages/hid.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/hid.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/hid.html (nonexistent) @@ -1,76 +0,0 @@ - - -

hid package

- -The hid package has two purposes: -
    -
  • it is glue layer for exporter dialog boxes and attribute dialog boxes; -
  • it can register exporter HIDs in PCB -
- -

Building a custom dialog box

-First hid_create() needs to be called. It returns a new hid_t, which is -an opaque structure for the package that is used to describe attributes of -an attribute dialog or an exporter hid. Attributes are added using -hid_add_attribute(), which returns an unique ID of the attribute. The -attribute ID can be used later for querying attribute value set by the -user using hid_get_attribute(). -

-The process of building a dialog box is closed by a call to -

    -
  • hid_register(), which registers a new exporter hid using the - attributes of the dialog box; or -
  • dialog_attribute() (of the dialog package) which pops up a custom - dialog box immediately. -
- -

Registering an exporter

- Function hid_register() registers the hid as an exporter. Should be - called after all attributes have been added using hid_add_attribute(). - The export is coordinated by pcb core; when the user request an export - using the exporter, a series of events are delivered to the script: -
    -
  1. envelope events to set up exporting -
  2. many draw events to actually export the objects -
  3. an envelope event to finish exporting -
- -

Envelope: events generated before or after exporting

-
    -
  • HIDE_get_export_options(void *hid): Generated before get_exporter_options returns the option list to the GUI hid -
  • HIDE_do_export_start(void *hid): Generated before export redraw starts -
  • HIDE_do_export_finish(void *hid): Generated after export redraw finished -
- -

Drawing: events generated during exporting

- Note: there may be multiple gcs (graphic contexts), each having its own color, line - properties, xor drawing and faded state. Graphic contexts are created - and destroyed by the following events: -
    -
  • HIDE_make_gc(void *hid, void *gc); -
  • HIDE_destroy_gc(void *hid, void *gc); -
- - Gc properties are changed by the following events: -
    -
  • HIDE_set_layer(void *hid, const char *name, int group); -
  • HIDE_set_color(void *hid, void *gc, const char *name); -
  • HIDE_set_line_cap(void *hid, void *gc, EndCapStyle style); -
  • HIDE_set_line_width(void *hid, void *gc, int width); -
  • HIDE_set_draw_xor(void *hid, void *gc, int xor); -
  • HIDE_set_draw_faded(void *hid, void *gc, int faded); -
- - Finally, the actual drawing operations: -
    -
  • HIDE_draw_line(void *hid, void *gc, int x1, int y1, int x2, int y2); -
  • HIDE_draw_arc(void *hid, void *gc, int cx, int cy, int xradius, int yradius, int start_angle, int delta_angle); -
  • HIDE_draw_rect(void *hid, void *gc, int x1, int y1, int x2, int y2); -
  • HIDE_fill_circle(void *hid, void *gc, int cx, int cy, int radius); -
  • HIDE_fill_polygon(void *hid, void *gc, int n_coords, int *x, int *y); -
  • HIDE_fill_rect(void *hid, void *gc, int x1, int y1, int x2, int y2); -
  • HIDE_use_mask(void *hid, int use_it); [TODO] -
- - - Index: trunk/doc/user/06_feature/gpmi/packages/layout_ref.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/layout_ref.html (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/layout_ref.html (nonexistent) @@ -1,300 +0,0 @@ - - -

PCB GPMI

-

Reference manual for package layout

-Automatically generated from layout.h - -

Enums

-
-

Enum values should be passed on as strings. - -

layout_object_mask_e

-
- Object type search mask bits 
-
- -
value meaning -
OM_LINE lines (traces, silk lines, not font) -
OM_TEXT text written using the font -
OM_POLYGON polygons, including rectangles -
OM_ARC arcs, circles -
OM_VIA vias and holes which are not part of a footprint -
OM_PIN pins/pads of a footprint -
OM_ANY shorthand for "find anything" -
-
-

layout_object_coord_e

-
- Which coordinate of the object is referenced 
-
- -
value meaning -
OC_BX1 bounding box X1 -
OC_BX2 bounding box X2 -
OC_BY1 bounding box Y1 -
OC_BY2 bounding box Y2 -
OC_P1X point 1 X -
OC_P2X point 2 X -
OC_P1Y point 1 Y -
OC_P2Y point 2 Y -
OC_OBJ the whole object -
OC_P1 point 1 is P1X -
OC_P2 point 2 is P2X -
-
-

layout_flag_e

-
- of layout_object_coord_t 
-
- -
value meaning -
FL_NONE <comment missing in the header> -
FL_SHOWNUMBER <comment missing in the header> -
FL_LOCALREF <comment missing in the header> -
FL_CHECKPLANS <comment missing in the header> -
FL_SHOWDRC <comment missing in the header> -
FL_RUBBERBAND <comment missing in the header> -
FL_DESCRIPTION <comment missing in the header> -
FL_NAMEONPCB <comment missing in the header> -
FL_AUTODRC <comment missing in the header> -
FL_ALLDIRECTION <comment missing in the header> -
FL_SWAPSTARTDIR <comment missing in the header> -
FL_UNIQUENAME <comment missing in the header> -
FL_CLEARNEW <comment missing in the header> -
FL_SNAPPIN <comment missing in the header> -
FL_SHOWMASK <comment missing in the header> -
FL_THINDRAW <comment missing in the header> -
FL_ORTHOMOVE <comment missing in the header> -
FL_LIVEROUTE <comment missing in the header> -
FL_THINDRAWPOLY <comment missing in the header> -
FL_LOCKNAMES <comment missing in the header> -
FL_ONLYNAMES <comment missing in the header> -
FL_NEWFULLPOLY <comment missing in the header> -
FL_HIDENAMES <comment missing in the header> -
FL_THERMALSTYLE1 <comment missing in the header> -
FL_THERMALSTYLE2 <comment missing in the header> -
FL_THERMALSTYLE3 <comment missing in the header> -
FL_THERMALSTYLE4 <comment missing in the header> -
FL_THERMALSTYLE5 <comment missing in the header> -
-
-

layer_field_e

-
- Field name of the layer structure 
-
- -
value meaning -
LFLD_NUM_LINES number of lines on the layer -
LFLD_NUM_TEXTS number of texts on the layer -
LFLD_NUM_POLYS number of polygons on the layer -
LFLD_NUM_ARCS number of arcs on the layer -
LFLD_VISIBLE non-zero if the layer is visible -
LFLD_NODRC non-zero if the layer doesn't use DRC -
-
-

Functions

-
-

The following functions are registered in script context. - -

int layout_search_box(const char* search_ID, layout_object_mask_t obj_types, int x1, int y1, int x2, int y2)

-
- creates a new search and adds all objects that matches obj_types mask within the given rectangle on the current layer
-   Arguments:
-     search_ID: unique name of the search (overwrites existing search on the same name)
-     obj_types: on or more object types
-     x1, y1, x2, y2: box the search is done within (PCB coords)
-   Returns the number of object on the search list. 
-
-
-

int layout_search_selected(const char* search_ID, layout_object_mask_t obj_types)

-
- creates a new search and adds all selected objects
-   Arguments:
-     search_ID: unique name of the search (overwrites existing search on the same name)
-     obj_types: on or more object types
-   Returns the number of object on the search list. 
-
-
-

int layout_search_found(const char* search_ID, layout_object_mask_t obj_types)

-
- creates a new search and adds all found objects (the green highlight)
-   Arguments:
-     search_ID: unique name of the search (overwrites existing search on the same name)
-     obj_types: on or more object types
-   Returns the number of object on the search list. 
-
-
-

layout_object_t* layout_search_get(const char* search_ID, int n)

-
- Returns the nth object from a search list (or NULL pointer if n is beyond the list) 
-
-
-

int layout_search_free(const char* search_ID)

-
- Frees all memory related to a search. Returns 0 on success.
-   Argument:
-     search_ID: unique name of the search (requires an existing search) 
-
-
-

int layout_obj_coord(layout_object_t* obj, layout_object_coord_t coord)

-
- Return the requested coord of an object; except for the bounding box
-    coordinates, the meaning of coordinates are object-specific.
-    Point 1 and point 2 are usually endpoints of the object (line, arc),
-    "the whole object" coordinate is a central point. 
-
-
-

layout_object_mask_t layout_obj_type(layout_object_t* obj)

-
- Return the type of an object (always a single bit) 
-
-
-

int layout_obj_move(layout_object_t* obj, layout_object_coord_t coord, int dx, int dy)

-
- Change location of an object or parts of the object (like move endpoint of a line);
-   Arguments:
-     obj: the object
-     coord: which coordinate to drag (e.g. move only the endpoint)
-     dx, dy: relative x and y coordinates the selected coordinate is displaced by
-   Returns 0 on success 
-
-
-

int layout_arc_angles(layout_object_t* obj, int relative, int start, int delta)

-
- change angles of an arc; start and delta are relative if relative is non-zero; returns 0 on success 
-
-
-

int layout_create_line(int x1, int y1, int x2, int y2, int thickness, int clearance, layout_flag_t flags)

-
- create a line 
-
-
-

int layout_create_via(int x, int y, int thickness, int clearance, int mask, int hole, const char* name, layout_flag_t flags)

-
- create a named via 
-
-
-

int layout_create_arc(int x, int y, int width, int height, int sa, int dir, int thickness, int clearance, layout_flag_t flags)

-
- create a new arc; sa is start angle, dir is delta angle 
-
-
-

void layout_switch_to_layer(int layer)

-
- switch to layer (further layer-specific actions will take place there) 
-
-
-

int layout_get_current_layer()

-
- returns the number of the current layer 
-
-
-

int layout_resolve_layer(const char* name)

-
- resolve layer number by name (case sensitive); returns negative number if not found 
-
-
-

int layout_get_max_possible_layer()

-
- return the theoretical number of layers supported by PCB 
-
-
-

int layout_get_max_layer()

-
- return the actual number of layers on the current design 
-
-
-

const char* layout_layer_name(int layer)

-
- return the name of a layer 
-
-
-

const char* layout_layer_color(int layer)

-
- return the color of a layer 
-
-
-

int layout_layer_field(int layer, layer_field_t fld)

-
- return an integer field of a layer 
-
-
-

int layout_get_page_width()

-
- query or set width and height of the drawing 
-
-
-

int layout_get_page_height()

-
-<comment missing in the header>
-
-
-

void layout_set_page_size(int width, int height)

-
-<comment missing in the header>
-
-
-

double mil2pcb_multiplier()

-
- -- coordinate system -- (coord.c) 
-
-
-

double mm2pcb_multiplier()

-
-<comment missing in the header>
-
-
-

const char* current_grid_unit()

-
-<comment missing in the header>
-
-
-

int debug_draw_request(void)

-
- Initialize debug drawing; returns 1 if worked, 0 if denied 
-
-
-

void debug_draw_flush(void)

-
- Flush the drawing 
-
-
-

void debug_draw_finish(dctx_t* ctx)

-
- Finish (close) drawing 
-
-
-

dctx_t* debug_draw_dctx(void)

-
- Get the draw context of debug draw 
-
-
-

void draw_set_color(dctx_t* ctx, const char* name)

-
- Debug draw style: set drawing color 
-
-
-

void draw_set_line_width(dctx_t* ctx, int width)

-
- Debug draw style: set line width 
-
-
-

void draw_set_draw_xor(dctx_t* ctx, int xor)

-
- Debug draw style: set whether drawing should happen in xor 
-
-
-

void draw_set_draw_faded(dctx_t* ctx, int faded)

-
- Debug draw style: set whether drawing should happen in faded mode  
-
-
-

void draw_line(dctx_t* ctx, int x1_, int y1_, int x2_, int y2_)

-
- Debug draw: draw a line using the current style settings 
-
-
- - - - Index: trunk/doc/user/06_feature/gpmi/packages/Makefile =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/Makefile (revision 21065) +++ trunk/doc/user/06_feature/gpmi/packages/Makefile (nonexistent) @@ -1,15 +0,0 @@ -ROOT=../../../../.. -GPMIDIR=$(ROOT)/src_plugins/gpmi/pcb-gpmi -ALL= actions dialogs hid layout - -all: XREF $(ALL:%=%_ref.html) - -include $(GPMIDIR)/Makefile.config - -%_ref.html REF.% : $(GPMIDIR)/gpmi_plugin/gpmi_pkg/%.h - $(ROOT)/util/genref.sh "$^" "$(ROOT)" "../packages/$*_ref.html" $(PCB_CFLAGS) >$*_ref.html - -XREF: $(ALL:%=REF.%) - cat $^ > $@ - - Index: trunk/doc/user/06_feature/index.html =================================================================== --- trunk/doc/user/06_feature/index.html (revision 21065) +++ trunk/doc/user/06_feature/index.html (revision 21066) @@ -21,7 +21,6 @@
  • distalign
  • distaligntext
  • djopt: DJ's options -
  • Scripting with GPMI (deprecated)
  • polystitch (pstoedit poly hole workaround)
  • query
  • Scripting pcb-rnd @@ -39,7 +38,6 @@ [todo] fp_board [todo] fp_fs [todo] fp_wget -[nodoc] gpmi - obsolete, will be removed [nodoc] jostle - doesn't really work, will be superseded by a push&shove later [todo] millpath [todo] mincut Index: trunk/doc/user/09_appendix/action_reference.html =================================================================== --- trunk/doc/user/09_appendix/action_reference.html (revision 21065) +++ trunk/doc/user/09_appendix/action_reference.html (revision 21066) @@ -12,7 +12,7 @@

    Action Reference

    @@ -242,7 +242,6 @@ - @@ -271,7 +270,6 @@ - Index: trunk/doc/user/Makefile.inst =================================================================== --- trunk/doc/user/Makefile.inst (revision 21065) +++ trunk/doc/user/Makefile.inst (revision 21066) @@ -89,114 +89,6 @@ $(SCCBOX) $(HOW) 06_feature/djopt/viatrim.pcb $(USERDIR)/06_feature/djopt/viatrim.pcb $(SCCBOX) $(HOW) 06_feature/djopt/viatrim.png $(USERDIR)/06_feature/djopt/viatrim.png $(SCCBOX) $(HOW) 06_feature/djopt/viatrim.txt $(USERDIR)/06_feature/djopt/viatrim.txt - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi - $(SCCBOX) $(HOW) 06_feature/gpmi/Credits $(USERDIR)/06_feature/gpmi/Credits - $(SCCBOX) $(HOW) 06_feature/gpmi/History $(USERDIR)/06_feature/gpmi/History - $(SCCBOX) $(HOW) 06_feature/gpmi/Makefile $(USERDIR)/06_feature/gpmi/Makefile - $(SCCBOX) $(HOW) 06_feature/gpmi/Porting $(USERDIR)/06_feature/gpmi/Porting - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow.dot $(USERDIR)/06_feature/gpmi/gpmi_flow.dot - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow.png $(USERDIR)/06_feature/gpmi/gpmi_flow.png - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow_exp.dot $(USERDIR)/06_feature/gpmi/gpmi_flow_exp.dot - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow_exp.png $(USERDIR)/06_feature/gpmi/gpmi_flow_exp.png - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow_load.dot $(USERDIR)/06_feature/gpmi/gpmi_flow_load.dot - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow_load.png $(USERDIR)/06_feature/gpmi/gpmi_flow_load.png - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow_menu.dot $(USERDIR)/06_feature/gpmi/gpmi_flow_menu.dot - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow_menu.png $(USERDIR)/06_feature/gpmi/gpmi_flow_menu.png - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow_reg.dot $(USERDIR)/06_feature/gpmi/gpmi_flow_reg.dot - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_flow_reg.png $(USERDIR)/06_feature/gpmi/gpmi_flow_reg.png - $(SCCBOX) $(HOW) 06_feature/gpmi/gpmi_temp_inst.txt $(USERDIR)/06_feature/gpmi/gpmi_temp_inst.txt - $(SCCBOX) $(HOW) 06_feature/gpmi/index.html $(USERDIR)/06_feature/gpmi/index.html - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi/packages - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/Makefile $(USERDIR)/06_feature/gpmi/packages/Makefile - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/XREF $(USERDIR)/06_feature/gpmi/packages/XREF - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/actions.html $(USERDIR)/06_feature/gpmi/packages/actions.html - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/actions_ref.html $(USERDIR)/06_feature/gpmi/packages/actions_ref.html - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/dialogs.html $(USERDIR)/06_feature/gpmi/packages/dialogs.html - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/dialogs_ref.html $(USERDIR)/06_feature/gpmi/packages/dialogs_ref.html - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/event_id.html $(USERDIR)/06_feature/gpmi/packages/event_id.html - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/hid.html $(USERDIR)/06_feature/gpmi/packages/hid.html - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/hid_ref.html $(USERDIR)/06_feature/gpmi/packages/hid_ref.html - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/layout.html $(USERDIR)/06_feature/gpmi/packages/layout.html - $(SCCBOX) $(HOW) 06_feature/gpmi/packages/layout_ref.html $(USERDIR)/06_feature/gpmi/packages/layout_ref.html - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi/rosetta/10_hello - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ID.desc $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ID.desc - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ID.name $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ID.name - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.awk $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.awk - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.bash $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.bash - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.html $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.html - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.lua $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.lua - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.pl $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.pl - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.py $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.py - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.rb $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.rb - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.scm $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.scm - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.stt $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.stt - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/ex.tcl $(USERDIR)/06_feature/gpmi/rosetta/10_hello/ex.tcl - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello/index.html $(USERDIR)/06_feature/gpmi/rosetta/10_hello/index.html - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ID.desc $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ID.desc - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ID.name $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ID.name - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.awk $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.awk - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.bash $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.bash - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.html $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.html - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.lua $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.lua - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.pl $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.pl - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.py $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.py - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.rb $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.rb - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.scm $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.scm - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.stt $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.stt - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/ex.tcl $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/ex.tcl - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/10_hello_gui/index.html $(USERDIR)/06_feature/gpmi/rosetta/10_hello_gui/index.html - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ID.desc $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ID.desc - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ID.name $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ID.name - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.awk $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.awk - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.bash $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.bash - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.html $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.html - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.lua $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.lua - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.pl $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.pl - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.py $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.py - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.rb $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.rb - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.scm $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.scm - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.stt $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.stt - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/ex.tcl $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/ex.tcl - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/12_hello_menu/index.html $(USERDIR)/06_feature/gpmi/rosetta/12_hello_menu/index.html - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi/rosetta/30_move - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ID.desc $(USERDIR)/06_feature/gpmi/rosetta/30_move/ID.desc - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ID.name $(USERDIR)/06_feature/gpmi/rosetta/30_move/ID.name - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.awk $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.awk - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.bash $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.bash - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.html $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.html - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.lua $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.lua - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.pl $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.pl - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.py $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.py - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.rb $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.rb - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.scm $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.scm - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.stt $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.stt - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/ex.tcl $(USERDIR)/06_feature/gpmi/rosetta/30_move/ex.tcl - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/30_move/index.html $(USERDIR)/06_feature/gpmi/rosetta/30_move/index.html - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi/rosetta/35_export_drill - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/35_export_drill/ID.desc $(USERDIR)/06_feature/gpmi/rosetta/35_export_drill/ID.desc - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/35_export_drill/ID.name $(USERDIR)/06_feature/gpmi/rosetta/35_export_drill/ID.name - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/35_export_drill/ex.awk $(USERDIR)/06_feature/gpmi/rosetta/35_export_drill/ex.awk - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/35_export_drill/ex.html $(USERDIR)/06_feature/gpmi/rosetta/35_export_drill/ex.html - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/35_export_drill/ex.lua $(USERDIR)/06_feature/gpmi/rosetta/35_export_drill/ex.lua - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/35_export_drill/ex.tcl $(USERDIR)/06_feature/gpmi/rosetta/35_export_drill/ex.tcl - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/35_export_drill/index.html $(USERDIR)/06_feature/gpmi/rosetta/35_export_drill/index.html - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi/rosetta/90_clock - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/90_clock/ID.desc $(USERDIR)/06_feature/gpmi/rosetta/90_clock/ID.desc - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/90_clock/ID.name $(USERDIR)/06_feature/gpmi/rosetta/90_clock/ID.name - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/90_clock/ex.awk $(USERDIR)/06_feature/gpmi/rosetta/90_clock/ex.awk - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/90_clock/ex.html $(USERDIR)/06_feature/gpmi/rosetta/90_clock/ex.html - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/90_clock/index.html $(USERDIR)/06_feature/gpmi/rosetta/90_clock/index.html - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi/rosetta - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/Makefile $(USERDIR)/06_feature/gpmi/rosetta/Makefile - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/index.html $(USERDIR)/06_feature/gpmi/rosetta/index.html - $(SCCBOX) $(HOW) 06_feature/gpmi/rosetta/index.templ.html $(USERDIR)/06_feature/gpmi/rosetta/index.templ.html - $(SCCBOX) $(HOW) 06_feature/gpmi/scripting_intro.html $(USERDIR)/06_feature/gpmi/scripting_intro.html - $(SCCBOX) mkdir -p $(USERDIR)/06_feature/gpmi/util - $(SCCBOX) $(HOW) 06_feature/gpmi/util/Makefile $(USERDIR)/06_feature/gpmi/util/Makefile - $(SCCBOX) $(HOW) 06_feature/gpmi/util/rosetta_genpages.sh $(USERDIR)/06_feature/gpmi/util/rosetta_genpages.sh - $(SCCBOX) $(HOW) 06_feature/gpmi/util/tags $(USERDIR)/06_feature/gpmi/util/tags $(SCCBOX) mkdir -p $(USERDIR)/06_feature $(SCCBOX) $(HOW) 06_feature/index.html $(USERDIR)/06_feature/index.html $(SCCBOX) mkdir -p $(USERDIR)/06_feature/query
    \n -This is pcb-rnd 2.0.1 (svn r20827) an interactive printed circuit board editor , Revision: 20880 +This is pcb-rnd 2.0.1 (svn r20827) an interactive printed circuit board editor , Revision: 21065
    Action Description Syntax Plugin
    AboutPresent the about boxAbout()dialogs plugin
    exteditextedit(object|selected, [interactive|method])Invoke an external program to edit a specific part of the current board.extedit plugin
    forcecolorchange selected objects' color to #RRGGBB, reset if does not start with '#'forcecolor(#RRGGBB)diag plugin
    fp_rehashFlush the library index; rescan all library search paths and rebuild the library index. Useful if there are changes in the library during a pcb-rnd session.fp_rehash()
    gpmi_scriptsManage gpmi scriptsTODOGPMI plugin cookie
    hPrint a help message for commands.hshand_cmd plugin
    integrityperform integrirty check on the current board and generate errors if neededintegrity()diag plugin
    javascriptExecute a script one-liner using a specific languageOneliner(lang, script)script plugin
    qQuits the application after confirming.qshand_cmd plugin
    queryPerform various queries on PCB data.query(dump, expr) - dry run: compile and dump an expression
    regpolyGenerate regular polygon. Where is x;y and radius is either r or rx;ry. Rotation is in degrees.regpoly([where,] corners, radius [,rotation])shape plugin
    rehashReload all gpmi scriptsTODOGPMI plugin cookie
    rnReads netlist.rn [name]shand_cmd plugin
    roundrectGenerate a rectangle with round cornersroundrect([where,] width[;height] [,rx[;ry] [,rotation]])shape plugin
    rubyExecute a script one-liner using a specific languageOneliner(lang, script)script plugin