camv-rnd user manual

# camv-rnd User Manual: Appendix

## Action Reference

, Action | Description | Syntax | Plugin About | Present the about box | About() | camv_dialogs
ActionString | Execute a pcb-rnd action parsing a string; syntac: "action(arg,arg,arg)" | ActionString(action) | script plugin
AddTimer (RND) | Add a new timer | AddTimer(action, period, [repeat], [userdata]) | script plugin
AnyLoad (RND) | Load "anything" from path (or offer a file selectio dialog if no path specified) | AnyLoad([path]) |
awk | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
bas | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
Benchmark (RND) | Benchmark the GUI speed. | Benchmark() |
BrowseScripts | Present a dialog box for browsing scripts | BrowseScripts() | script plugin
Center (RND) | Moves the pointer to the center of the window. | Center() | lib_hid_common plugin
ChkGridSize | Return 1 if the currently selected grid matches the expected_size. If argument is "none" return 1 if there is no grid. | ChkGridSize(expected_size) ChkGridSize(none) |
ChkGridUnits | Return 1 if currently selected grid unit matches the expected (normally mm or mil) | ChkGridUnits(expected) |
ChkMode | Return 1 if the currently selected mode is the expected_mode | ChkMode(expected_mode) |
cli_MessageBox | Intenal: CLI frontend action. Do not use directly. |  |
cli_PromptFor | Intenal: CLI frontend action. Do not use directly. |  |
ColorLayer | Change the color of a layer addressed (@ for current). Not affected by ResetLayer(). Colorstr shall be #rrggbb with hex components. | ColorLayer(@|last|idx, colorstr) |
Command | Displays the command line input in the status area. | Command() | lib_hid_common plugin
conf | Perform various operations on the configuration tree. | conf(set, path, value, [role], [policy]) - change a config setting to an absolute value conf(delta, path, value, [role], [policy]) - change a config setting by a delta value (numerics-only) conf(toggle, path, [role]) - invert boolean value of a flag; if no role given, overwrite the highest prio config conf(reset, role) - reset the in-memory lihata of a role conf(iseq, path, value) - returns whether the value of a conf item matches value (for menu checked's) |
confget | Return conf node value or property from the merged in-memory/native storage. Returns nil if node is unset (for value query) or not found. Intended for scripting. | ConfGet(path, [value]) - return the value of a conf node; units, colors and lists are returned as string. ConfGet(path, desc) - return the human readable description ConfGet(path, ArraySize) - number of elements ConfGet(path, ReadOnly) - returns 1 if node is read-only, 0 otherwise ConfGet(path, ConfRev) - conf (merge) rev number the value last changed |
CreateMenu | Creates a new menu, popup (only path specified) or submenu (at least path and action are specified) | CreateMenu(path) CreateMenu(path, action, tooltip, cookie, [accel]) |
Cursor (RND) | Move the cursor. | Cursor(Type,DeltaUp,DeltaRight,Units) |
dad | Manipulate Dynamic Attribute Dialogs | dad(dlgname, new) - create new dialog dad(dlgname, label, text) - append a label widget dad(dlgname, button, text) - append a button widget dad(dlgname, button_closes, label, retval, ...) - standard close buttons dad(dlgname, enum, choices) - append an enum (combo box) widget; choices is a tab separated list dad(dlgname, bool) - append an checkbox widget (default off) dad(dlgname, integer|real|coord, min, max) - append an input field dad(dlgname, string) - append a single line text input field dad(dlgname, default, val) - set the default value of a widet while creating the dialog dad(dlgname, help, tooltip) - set the help (tooltip) text for the current widget dad(dlgname, progress) - append a progress bar (set to 0) dad(dlgname, preview, cb_act_prefix, minsize_x, minsize_y, [ctx]) - append a preview with a viewbox of 10*10mm, minsize in pixels dad(dlgname, tree, cols, istree, [header]) - append tree-table widget; header is like enum values dad(dlgname, tree_append, row, cells) - append after row (0 means last item of the root); cells is like enum values; returns a row pointer dad(dlgname, tree_append_under, row, cells) - append at the end of the list under row (0 means last item of the root); cells is like enum values; returns a row pointer dad(dlgname, tree_insert, row, cells) - insert before row (0 means first item of the root); cells is like enum values; returns a row pointer dad(dlgname, begin_hbox) - begin horizontal box dad(dlgname, begin_vbox) - begin vertical box dad(dlgname, begin_hpane) - begin horizontal paned box dad(dlgname, begin_vpane) - begin vertical paned box dad(dlgname, begin_table, cols) - begin table layout box dad(dlgname, begin_tabbed, tabnames) - begin a view with tabs; tabnames are like choices in an enum; must have as many children widgets as many names it has dad(dlgname, end) - end the last begin dad(dlgname, flags, flg1, flg2, ...) - change the flags of the last created widget dad(dlgname, onchange, action) - set the action to be called on widget change dad(dlgname, run, title) - present dlgname as a non-modal dialog dad(dlgname, run_modal, title) - present dlgname as a modal dialog dad(dlgname, exists) - returns wheter the named dialog exists (0 or 1) dad(dlgname, set, widgetID, val) - changes the value of a widget in a running dialog dad(dlgname, get, widgetID, [unit]) - return the current value of a widget dad(dlgname, iterate) - runs a global GUI iteration (event dispatch, redraw) dad(dlgname, raise) - pops up window in front dad(dlgname, close) - close the dialog (and return 0 from modal run) | lib_hid_common plugin
dlg_confval_edit | Present a dialog box for editing the value of a conf node at path. | dlg_confval_edit(path, idx, role, [modal]) | lib_hid_common plugin
duktape | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
DumpActions | Dump all actions available. | DumpActions() |
dumpconf | Perform various operations on the configuration tree. | dumpconf(native, [verbose], [prefix]) - dump the native (binary) config tree to stdout dumpconf(lihata, role, [prefix]) - dump in-memory lihata representation of a config tree | diag_rnd
DumpPluginDirs | Print plugins directories in a format digestable by scripts. | DumpPluginDirs() |
DumpPlugins | Print plugins loaded in a format digestable by scripts. | DumpPlugins() |
DumpVersion | Dump version in script readable format. | DumpVersion() |
estutter | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
EvalConf | Perform various operations on the configuration tree. | EvalConf(path) - evaluate a config path in different config sources to figure how it ended up in the native database | diag_rnd
ExecActionFile | Run actions from the given file. | ExecuteFile(filename) |
ExecuteFile | Run actions from the given file. | ExecuteFile(filename) |
ExportDialog | Open the export dialog. | ExportDialog() | lib_hid_common plugin
fawk | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
fbas | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
fpas | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
FsdSimple | File selection dialog, simplified API; for meaning of the arguments, see the HID API doc. | FsdSimple(title, descr, default_file, default_ext, history_tag, [read]) | lib_hid_common plugin
FsdTest | Central, DAD based File Selection Dialog demo | FsdTest() | lib_hid_common plugin
FullScreen | Hide widgets to get edit area full screen | FullScreen(on|off|toggle) |
GetXY (RND) | Get a coordinate. If x or y specified, the return value of the action is the x or y coordinate. | GetXY([message, [x|y]]) |
Grid | Set the grid. | grid(set, [name:]size[@offs][!unit]) grid(+|up) grid(-|down) grid(#N) grid(idx, N) grid(get) grid(ask) |
GroupLoad | Starts or ends a group load of files. | GroupLoad(begin|end) | plug_io_act
gui_FallbackColorPick | Intenal: GUI frontend action. Do not use directly. |  | lib_hid_common plugin
gui_MayOverwriteFile | Intenal: GUI frontend action. Do not use directly. |  | lib_hid_common plugin
gui_MessageBox | Intenal: GUI frontend action. Do not use directly. |  | lib_hid_common plugin
gui_PromptFor | Intenal: GUI frontend action. Do not use directly. |  | lib_hid_common plugin
Help | On-line action help | Help() |
InvertLayer | Inverts the layer addressed (@ for current). Not affected by ResetLayer(). | InvertLayer(@|last|idx) |
irc | non-modal, single-instance, single-server, single-channel irc window for online support | irc() | irc plugin
javascript | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
js | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
LayerDialog | Present the LayerDialog box on the currently selected layer | LayerDialog() | camv_dialogs
ListScripts (RND) | List fungw scripts, optionally filtered wiht regex pat. | ListScripts([pat]) | script plugin
LiveScript (RND) | Manage a live script | LiveScript([new], [name]) LiveScript(load|save, name, [filame]) LiveScript(run|stop|rerun|undo, name) | script plugin
LoadFrom | Load project or layer data from a file. | LoadFrom(Layer|Project,filename[,format]) | plug_io_act
LoadScript (RND) | Load a fungw script | LoadScript(id, filename, [language]) | script plugin
Log | Manages the central, in-memory log. | Log(clear, [fromID, [toID]) Log(export, [filename, [text|lihata]) |
LogDialog | Open the log dialog. | LogDialog() | lib_hid_common plugin
LogGui | Log() action GUI section | LogGui(export, [filename, [text|lihata]) |
lua | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
ManagePlugins | Manage plugins dialog. | ManagePlugins() | lib_hid_common plugin
mawk | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
MenuDebug | Menu debug helpers: save the merged menu in a file | MenuDebug(save, path) |
MenuPatch | Manage menu patches | MenuPatch(load, cookie, path, desc) MenuPatch(unload, cookie) MenuPatch(list) MenuPatch(InhibitInc|InhibitDec) |
Message (RND) | Writes a message to the log window. | message([ERROR|WARNING|INFO|DEBUG,] message) |
MessageBox | Open a modal message dialog box with title and label. If icon string is not empty, display the named icon on the left. Present one or more window close buttons with different text and return value. | MessageBox(icon, title, label, button_txt, button_retval, ...) |
Mode | Change or use the tool mode. | Tool(Arc|Arrow|Copy|InsertPoint|Line|Lock|Move|None|PasteBuffer) Tool(Poly|Rectangle|Remove|Rotate|Text|Thermal|Via) Tool(Press|Release|Cancel|Stroke) Tool(Save|Restore) |
MoveCursorTo | Move the cursor to absolute coords, pan the view as needed. | MoveCursorTo(x,y) |
mruby | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
Oneliner | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
Pan (RND) | Start or stop panning (Mode = 1 to start, 0 to stop) | Pan(Mode) | lib_hid_common plugin
pas | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
pcb_acos |  |  | script plugin
pcb_asin |  |  | script plugin
pcb_atan2 |  |  | script plugin
pcb_atan |  |  | script plugin
pcb_cos |  |  | script plugin
pcb_rand |  |  | script plugin
pcb_sin |  |  | script plugin
pcb_sqrt |  |  | script plugin
pcb_srand |  |  | script plugin
pcb_tan |  |  | script plugin
perl | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
Preferences | Present the preferences dialog, optionally opening the tab requested. | Preferences([tabname]) | lib_hid_common plugin
Print (RND) | Present the print export dialog for printing the layout from the GUI. | Print() |
PrintActions | Print all actions available. | PrintActions() |
PrintCopyright | Print copyright notice. | PrintCopyright() |
PrintDialog | Open the print dialog. | PrintDialog() | lib_hid_common plugin
PrintFiles | Print files currently loaded. | PrintFiles() |
PrintPaths | Print full paths and search paths. | PrintPaths() |
PrintUsage | Print command line arguments of camv-rnd or a plugin loaded. | PrintUsage() PrintUsage(plugin) |
PrintVersion | Print version. | PrintVersion() |
PromptFor (RND) | Prompt for a string. Returns the string (or NULL on cancel) | PromptFor([message[,default[,title]]]) |
py | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
python | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
Quit | Quits the application. | Quit() |
Redraw | Redraw the entire screen | Redraw() |
ReloadScript (RND) | Reload a fungw script | ReloadScript(id) | script plugin
RemoveMenu | Recursively removes a new menu, popup (only path specified) or submenu. | RemoveMenu(path, cookie) |
ResetLayer | Reset the transformation matrix of the layer. | ResetLayer(@|last|idx, sx[, sy]) |
rnd_acos |  |  | script plugin
rnd_asin |  |  | script plugin
rnd_atan2 |  |  | script plugin
rnd_atan |  |  | script plugin
rnd_cos |  |  | script plugin
rnd_dlg_xpm_by_name | Intenal: GUI frontend action. Do not use directly. |  | lib_hid_common plugin
rnd_rand |  |  | script plugin
rnd_sin |  |  | script plugin
rnd_sqrt |  |  | script plugin
rnd_srand |  |  | script plugin
rnd_tan |  |  | script plugin
rnd_toolbar_init | For ringdove apps: initialize the toolbar. |  | lib_hid_common plugin
rnd_toolbar_uninit | For ringdove apps: uninitialize the toolbar. |  | lib_hid_common plugin
rnd_zoom | Change zoom level (relative, absolute, window, ...) | Zoom() Zoom([+|-|=]factor) Zoom(x1, y1, x2, y2) Zoom(?) Zoom(get) | lib_hid_common plugin
RotateLayer | Rotates the layer addressed (@ for current) by deg degrees CCW. (The transformation is added to the current transformation matrix of the layer.) | RotateLayer(@|last|idx, [deg]) |
ruby | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
SafeFsclearerr | Same as clearerr(3) | SafeFsclearerr(f) |
SafeFsFclose | Closes a file previously open using SafeFsFopen() | SafeFsFclose(f) |
SafeFsFeof | Returns 1 if file has reached EOF, 0 otherwise | SafeFsFeof(f) |
SafeFsFerror | Returns 1 if file had errors, 0 otherwise | SafeFsFerror(f) |
SafeFsFgets | Reads and returns a line from f (open with SafeFsFopen()). Stops reading after maxlen (subsequent call will continue reading the same line). Returns nil on error or eof or empty line. Maxlen is 64k by default. Note: string heap allocation is made for maxlen. | SafeFsFgets(f, [maxlen]) |
SafeFsFileMtime | Return the last modification time of a file, from Epoch, or -1 on error. | SafeFsFileMtime(path) |
SafeFsFileSize | Return the size of a file in bytes, or -1 on error. | SafeFsFileSize(path) |
SafeFsFopen | Opens a file using fopen, returns FILE *. If mode is not specified, r is assumed. Returns nil on error. | SafeFsFopen(path, [mode]) |
SafeFsFputs | Writes str to file f (previously opne with SafeFsFopen)) | SafeFsFputs(f, str) |
SafeFsFread | Reads and returns at most len bytes from a file (open with SafeFsFopen()). Returns nil on error or eof or empty line. | SafeFsFread(f, len) |
SafeFsFreadSep | Reads characters that are either all non-seps or all seps. Reads at most maxlen bytes. Returns the string read or nil on eof or error. Seps is a string that contains every separator character. Maxlen is 64k by default. | SafeFsFreadSep(f, seps, [maxlen]) |
SafeFsFseek | Same as fseek(3); whence is a string, one of set, cur or end not specified (set is used when not specified) | SafeFsFseek(f, offs, [whence]) |
SafeFsFtell | Same as ftell(3). | SafeFsFtell(f) |
SafeFsIsDir | Return 1 if path exists and is a directory, else return 0. | SafeFsIsDir(path) |
SafeFsMkdir | Mkdir a file from the file system. If mode is a string, it is converted from octal. Return value is the same as mkdir(2)'s | SafeFsMkdir(path, mode) |
SafeFsPathSep | Return the system dependet path separator character (normally slash). | SafeFsPathSep(path) |
SafeFsReadFile | Reads a text file into one long string, returned, but at most maxlen bytes. If maxlen is not specified, 64k is used. Returns nil on error or empty file. | SafeFsReadFile(path, [maxlen]) |
SafeFsRealPath | Returns the realpath(3) of path, or NULL on error. | SafeFsRealPath(path) |
SafeFsRemove | Remove an object from the file system. Return value is the same as remove(3)'s | SafeFsRemove(path) |
SafeFsRename | Rename an object on the file system. Return value is the same as rename(2)'s | SafeFsRename(old_path, new_path) |
SafeFsRewind | Same as rewind(3) | SafeFsRewind(f) |
SafeFsSystem | Runs cmdline with a shell using librnd safe_fs. Return value is the same integer as system()'s | SafeFsSystem(cmdline) |
SafeFsUnlink | Unlink a file from the file system. Return value is the same as unlink(2)'s | SafeFsUnlink(path) |
SaveTo | Save design to a file. | SaveTo(design, filename[,format]) | plug_io_act
ScaleLayer | Scales the layer addressed (@ for current) by the factor of sx and sy. If only sx is specified, it is used as sy as well. (The transformation is added to the current transformation matrix of the layer.) | ScaleLayer(@|last|idx, [sx, [sy]]) |
ScriptCookie (RND) | Return a cookie specific to the current script instance during script initialization | ScriptCookie() | script plugin
ScriptPersistency (RND) | Read or remove script persistency data savd on preunload | ScriptPersistency(read|remove) | script plugin
Scroll (RND) | Scroll the viewport. | Scroll(up|down|left|right, [pixels]) | lib_hid_common plugin
SetGrid | Change grid size. | SetGrid(delta|*mult|/div, [unit]) |
SetGridOffs (RND) | Change grid offset (alignment) to x_offs and y_offs. Offsets should be specified with units. | SetGridOffs(x_offs, y_offs) |
SetUnits (RND) | Set the default measurement units. | SetUnits(mm|mil) |
stroke | Various gesture recognition related functions | stroke(gesture, seq) | stroke plugin
stt | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
System | Run shell command | System(shell_cmd) |
tcl | Execute a script one-liner using a specific language | Oneliner(lang, script) | script plugin
Tool (RND) | Change or use the tool mode. | Tool(Arc|Arrow|Copy|InsertPoint|Line|Lock|Move|None|PasteBuffer) Tool(Poly|Rectangle|Remove|Rotate|Text|Thermal|Via) Tool(Press|Release|Cancel|Stroke) Tool(Save|Restore) |
TranslateLayer | Translates (moves) the layer addressed (@ for current) by dx and dy. (The transformation is added to the current transformation matrix of the layer.) | TranslateLayer(@|last|idx, dx, dy) |
UnloadScript (RND) | Unload a fungw script | UnloadScript(id) | script plugin
ViewPortDialog | Bring up a viewport dialog copying the current design/zoom/pan of the main window. Optionally sets window title. | ViewPortDialog([title]) | camv_dialogs
VisLayer | Change the visibility of a layer addressed (@ for current). Not affected by ResetLayer(). | VisLayer(@|last|idx, [0|1|toggle]) |
Zoom | GUI zoom | Zoom() Zoom([+|-|=]factor) Zoom(x1, y1, x2, y2) Zoom(?) Zoom(get) Zoom(auto_first) |

RND: this action comes from librnd and is common to all ringdove applications.