Index: trunk/doc/developer/indent_cmt.patch =================================================================== --- trunk/doc/developer/indent_cmt.patch (revision 34886) +++ trunk/doc/developer/indent_cmt.patch (nonexistent) @@ -1,18 +0,0 @@ -diff -uri indent-2.2.11.orig/src/comments.c indent-2.2.11/src/comments.c ---- indent-2.2.11.orig/src/comments.c 2018-01-26 13:45:48.474640060 +0100 -+++ indent-2.2.11/src/comments.c 2018-01-26 14:47:06.867653819 +0100 -@@ -339,7 +339,13 @@ - start_column = count_columns (compute_label_target (), s_lab, NULL_CHAR); - } - -- if (start_column < target) -+ if (target == 0) -+ { -+ /* 0 means start right after the end of the line, adding a space, no alignment */ -+ *e_com++ = ' '; -+ column++; -+ } -+ else if (start_column < target) - { - start_column = target; - } Index: trunk/doc/developer/indent_fdecl.patch =================================================================== --- trunk/doc/developer/indent_fdecl.patch (revision 34886) +++ trunk/doc/developer/indent_fdecl.patch (nonexistent) @@ -1,17 +0,0 @@ -diff -uri indent-2.2.11.orig/src/handletoken.c indent-2.2.11/src/handletoken.c ---- indent-2.2.11.orig/src/handletoken.c 2018-01-26 13:45:48.477640023 +0100 -+++ indent-2.2.11/src/handletoken.c 2018-01-26 14:23:38.923255546 +0100 -@@ -677,8 +677,11 @@ - - } - #endif -- -- parser_state_tos->want_blank = true; -+ if (parser_state_tos->in_decl) -+ parser_state_tos->want_blank = false; -+ else -+ parser_state_tos->want_blank = true; -+ - } - - /** Index: trunk/doc/developer/action_doc.txt =================================================================== --- trunk/doc/developer/action_doc.txt (revision 34886) +++ trunk/doc/developer/action_doc.txt (revision 34887) @@ -1,38 +1,3 @@ -How to document actions -~~~~~~~~~~~~~~~~~~~~~~~ +Moved to librnd, see -Detailed action doc lives in trunk/doc/user/09_appendix/action_src in -almost-html files. There is no html header and the standard tags in use -are restricted to: b, i, p, pre, ul, li, table, tr, td. - -There are a few extra, non-standard tags: - -- argname names an argument of the current action -- actname links to another action; actname is all lowercase - -The name of the file should be actname.html. - -Documentation policy: - - - do not document the trivial - do not write alibi docs. We do not want - action doc to just repeat the syntax description. Please explore - what the action does, all aspects, all use cases; see if the syntax - help string already covers everything and the action is trivial to use; - if so, the action does not need any more documentation - - - after creating the html doc, please add a - /* DOC: actname.html */ - comment above the action function in the source code - - - the doc is high level in the sense that it should tell the basic ideas - behind the action, how to use it, what it is for - - - it should not tell much about what bigger scheme it fits in (that's - even higher level, plugin doc; but should cross link relevant sibling - actions) - - - it should not repeat low level info (e.g. enumerate possible arguments - from the syntax string) if no extra info is added - - - do not do custom styling, the doc format is unified - +http://www.repo.hu/projects/librnd/developer/action_doc.txt Index: trunk/doc/developer/c89.html =================================================================== --- trunk/doc/developer/c89.html (revision 34886) +++ trunk/doc/developer/c89.html (revision 34887) @@ -1,12 +1,5 @@ -

pcb-rnd - C89

- -Most of the code base is written in C89, with a few exceptions -written in C99 (gtk, because it's not C89-compatible). When adding -new code, keep it C89. Especially watch out for these: - +Moved to librnd + + Index: trunk/doc/developer/dad/wtabbed.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wtabbed.png =================================================================== --- trunk/doc/developer/dad/wtabbed.png (revision 34886) +++ trunk/doc/developer/dad/wtabbed.png (nonexistent) Property changes on: trunk/doc/developer/dad/wtabbed.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wbutton.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wbutton.png =================================================================== --- trunk/doc/developer/dad/wbutton.png (revision 34886) +++ trunk/doc/developer/dad/wbutton.png (nonexistent) Property changes on: trunk/doc/developer/dad/wbutton.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/TEMPLATE.c =================================================================== --- trunk/doc/developer/dad/TEMPLATE.c (revision 34886) +++ trunk/doc/developer/dad/TEMPLATE.c (nonexistent) @@ -1,94 +0,0 @@ -/* - HOW TO USE THE TEMPLATE: - 1. decide about the name of your dialog box, e.g. foo in this example - 2. svn copy this file to dlg_foo.c - do not use plain fs copy, use svn copy! - 3. rename functions in this file to - 4. add '#include "dlg_foo.c"' in dialogs.c at the end of the list where - all the other dlg_*.c files are included - 5. add an action to pcb_act*_Foo in dialogs.c - 6. edit the parts marked with '<<<- edit this' or 'EDIT THIS' - do not - yet add the implementation - 7. run 'make dep' in src/ - 8. remove this comment block so copyright is on top - 9. edit the copyright message: year and author - 10. test compile - 11. in trunk/: 'svn commit src_plugins/dialogs src/Makefile.dep' - 12. start implementing the dialog box - - This simplistic example is a single-instance non-modal dialog; - there should be only one global variable, created out of the - context struct. This ensures it is easy to convert the dialog - to multi-instance in the future, if needed. - - If you need a multi-instance dialog, there should be no global variable - at all and the context struct should be allocated. A good example - on this is the shape dialog in ../shape/shape_dialog.c -*/ - -/* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2018 Tibor 'Igor2' Palinkas - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Contact: - * Project page: http://repo.hu/projects/pcb-rnd - * lead developer: http://repo.hu/projects/pcb-rnd/contact.html - * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") - */ - -#include "core headers this file depends on (even if other dialogs include them)" - -typedef struct{ - RND_DAD_DECL_NOINIT(dlg) - int active; /* already open - allow only one instance */ - int whatever; -} foo_ctx_t; <<<- rename this - -foo_ctx_t foo_ctx; - -static void foo_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) <<<- rename this -{ - foo_ctx_t *ctx = caller_data; - RND_DAD_FREE(ctx->dlg); - memset(ctx, 0, sizeof(foo_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ -} - -static void pcb_dlg_foo(whatever args) <<<- edit this -{ - rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; - if (foo_ctx.active) - return; /* do not open another */ - - RND_DAD_BEGIN_VBOX(foo_ctx.dlg); - RND_DAD_COMPFLAG(foo_ctx.dlg, RND_HATF_EXPFILL); - RND_DAD_LABEL(foo_ctx.dlg, "foo"); - RND_DAD_BUTTON_CLOSES(foo_ctx.dlg, clbtn); - RND_DAD_END(foo_ctx.dlg); - - /* set up the context */ - foo_ctx.active = 1; - - RND_DAD_NEW("EDIT_THIS_ID", foo_ctx.dlg, "EDIT THIS: title", &foo_ctx, rnd_false, foo_close_cb); -} - -static const char pcb_acts_Foo[] = "Foo(object)\n"; <<<- edit this -static const char pcb_acth_Foo[] = ""; <<<- edit this -static fgw_error_t pcb_act_Foo(fgw_arg_t *res, int argc, fgw_arg_t *argv) <<<- edit this -{ - return 0; -} Index: trunk/doc/developer/dad/text.html =================================================================== --- trunk/doc/developer/dad/text.html (revision 34886) +++ trunk/doc/developer/dad/text.html (nonexistent) @@ -1,21 +0,0 @@ - - - -

DAD: Dynamic Attribute Dialogs

-

-The text widget is a text viewer/editor that operates on a string -that may contain multiple lines. - -

Helper macro for widget creation

-

-PCB_DAD_TEXT(table, user_ctx) -creates a new text widget and installs user context. - -

User callbacks

-

-The only callback the user may provide is user_free_cb which is called -when the text widget is destroyed. Other than this, DAD caller code can not -react on events happening in the text. - - - Index: trunk/doc/developer/dad/widgets.html =================================================================== --- trunk/doc/developer/dad/widgets.html (revision 34886) +++ trunk/doc/developer/dad/widgets.html (nonexistent) @@ -1,275 +0,0 @@ - - - -

DAD: Dynamic Attribute Dialogs

- -

Input widgets

-

-Input widgets are leaf widgets in the widget tree that typically -implement a field where user input takes place. Available -input widgets are: - -
creation call screenshot (gtk2) description -
PCB_DAD_LABEL single line or multi line of plain text, from a string -
PCB_DAD_LABELF single line or multi line of plain text, using printf formatting -
PCB_DAD_ENUM select one value from a fixed set (typical implementation is a combo box) -
PCB_DAD_BOOL checkbox -
PCB_DAD_INTEGER set an integer value -
PCB_DAD_REAL set a real (floating point) value -
PCB_DAD_COORD set a coordinate value -
PCB_DAD_STRING input single line string value (plain text) -
PCB_DAD_BUTTON clickable push button -
PCB_DAD_PROGRESS progress bar -
PCB_DAD_TREE a list, table or tree of text data -
PCB_DAD_PREVIEW drawing area -
PCB_DAD_PICTURE static bitmap image -
PCB_DAD_PICBUTTON static bitmap button -
PCB_DAD_COLOR color button and selector -
PCB_DAD_TEXT text box (text editor) -
- - - -

PCB_DAD_LABEL(table, text)

-

-Draw a label, which is not an input field (unmodifiable by the user). -text is copied by the call into a new allocation. The only -control text accepts is '\n', which is line break. - -

PCB_DAD_LABELF(table, (printf_args))

-

-Same as PCB_DAD_LABEL() but the text is rendered using printf. Note: -printf args, including the format string, shall be in parenthesis, e.g. -

-PCB_DAD_LABELF(dlg, ("Cats: %d", num_cats))
-
- -

PCB_DAD_ENUM(table, choices)

-

-The user can choose one value out of an ordered list of strings. The list -is passed as a NULL terminalte char * array. The value -of the enum is an integer index into that array, 0 being the first string. -

-Typical GUI implementation is a combo box, without text editing. - -

PCB_DAD_BOOL(table, label)

-

-Ask the user about a boolean value, typically using a checkbox. The value -of the bool is an integer which is either 0 or 1. - -

PCB_DAD_INTEGER(table, label)

-

-Ask for an integer value, between a minval and a maxval. -The value is an int, which is not guaranteed to be wider than a -16 bit signed value. -

-Typical GUI implementation is a text entry, often upgraded with small buttons -to increase or decrease the value ("spinbox"). - -

PCB_DAD_REAL(table, label)

-

-Ask for a REAL (double precision floating point value), between a minval -and a maxval. -

-Typical GUI implementation is a text entry, often upgraded with small buttons -to increase or decrease the value ("spinbox"). - - -

PCB_DAD_COORD(table, label)

-

-Ask for a coordinate value, between a minval and a maxval. -The value is pcb_coord_t. -

-Typical GUI implementation is a text entry that understands unit suffix, -often upgraded with small buttons to increase or decrease the value ("spinbox"). - - -

PCB_DAD_STRING(table)

-

-Ask for a single line of plain text input. -

-The value is a dynamically allocated string. - -

PCB_DAD_BUTTON(table, text)

-

-A push button the user can click on. text is not allocated or copied -(shall be a static const string or allocated/free'd by the user). -

-There is no value, the only interface is the change callback. - - -

PCB_DAD_PROGRESS(table)

-

-Present a progress bar which is not an user input. value is a -REAL value between 0.0 and 1.0. When the code changes the value, the -GUI makes sure the dialog box is drawn and flushed, because typical use -is in a busy loop calculation. - -

PCB_DAD_TREE(table, cols, first_col_is_tree, opt_header)

-

-Present a tree-table with cols columns of text objects. When -first_col_is_tree is 1, the first column works as a tree, with -indentation and/or tree graphics and logics for collapsing/expanding subtrees. -If opt_header is not NULL, it is a NULL terminated static const -array of header strings describing the table header to be displayed, in as -many strings as cols specified. -

-A special cases: -

- -
case parameters -
plain flat list cols=1, first_col_is_tree=0 -
tree-only cols=1, first_col_is_tree=1 -
table-only cols>1, first_col_is_tree=0 -
-

-Manipulating the data and the view are both done using - special tree-table macros. - -

PCB_DAD_PREVIEW(table, expose_cb, mouse_cb, free_cb, initial_view_box, user_ctx)

-

-Present a drawing area with callbacks to the host code to handle drawing: - -
argument meaning -
expose_cb called when (parts of) the preview needs to be redrawn -
mouse_cb called on mouse events -
free_cb called before the widget is destroyed -
initial_view_box set the initial zoom/pan to match the view box specified in drawing units -
min_sizex_px widget minimum size in x direction (width), in pixels -
min_sizey_px widget minimum size in y direction (height), in pixels -
user_ctx opaque pointer that is passed to every callback -
- -

PCB_DAD_PICTURE(table, xpm)

-

-The pointer to a static xpm image is stored in the enumerations field. The image -is displayed in a widget without any other decoration. - -

PCB_DAD_PICBUTTON(table, xpm)

-

-The pointer to a static xpm image is stored in the enumerations field. The image -is displayed in a button tat behaves exaclty as a normal BUTTON in all other -regards. - -

PCB_DAD_COLOR(table)

-

-A button that has a solid region of the color specified in value. Unless -read-only (PCB_HATF_CLR_STATIC), when the user clicks the button a -HID-specific color selector dialog is popped up where the user can -specify a new color. - -

PCB_DAD_TEXT(table, cols, first_col_is_tree, opt_header)

-

-Free form multiline text string, edited using a HID-builtin text editor. Line -terminator is \n. -

-TODO: accessor macros - -

Layout widgets

- - -
creation call screenshot (gtk2) description -
PCB_DAD_BEGIN_HBOX arrange children widgets in a horizontal list -
PCB_DAD_BEGIN_VBOX arrange children widgets in a vertical list -
PCB_DAD_BEGIN_HPANE split the parent box horizontally into two sections; the split ratio is adjustable
Note: "left" and "right" are the first and second children (left and right sibling) of the widget tree -
PCB_DAD_BEGIN_VPANE split the parent box vertically into two sections; the split ratio is adjustable
Note: on the screenshot "left" and "right" are the first and second children (left and right sibling) of the widget tree -
PCB_DAD_BEGIN_TABLE arrange children widgets into a n*m matrix, allocate each cell the same size
Note: on the screenshot the table is set up to have 3 columns -
PCB_DAD_BEGIN_TABBED create a "tabbed notebook" view, each children is a new tab -
- -

Box common flags

-

-hbox, vbox and table share a few common compflags, that are defined in -hid_attrib.h, pcb_hatt_compflags_t. The explanation of what each flag does -can be found there. The most commonly used ones are PCB_HATF_FRAME, -PCB_HATF_SCROLL, PCB_HATF_EXPFILL. -

-If PCB_HATF_EXPFILL is set, the given box tries to expannd and fill, using -up all available space in its parent widget. If multiple sibling boxes -have this flag set the behaviour is unspecified; some HIDs may prefer -to grow only one box, others may evenly distribute the avaialble space -among boxes. If this flag is not set, the box uses only as much space -as its children widgets require. - - -

PCB_DAD_BEGIN_HBOX(table) and PCB_DAD_BEGIN_VBOX(table)

-

-Arrange children widgets in a horizontal or vertical row. - -

PCB_DAD_BEGIN_HPANE(table)

-

-Expect exactly two child widgets. Arrange them horizontally, with -a widget in between them that allows the user to change the space allocation -between the sides. - -

PCB_DAD_BEGIN_VPANE(table)

-

-Expect exactly two child widgets. Arrange them vertically, with -a widget in between them that allows the user to change the space allocation -between the sides. - -

PCB_DAD_BEGIN_TABLE(table, cols)

-

-Place children widgets in a table with cols columns. Widgets are -placed by filling up rows first. If there are not enough widget to finish -the last row, rightmost columns are left empty. -

-The table is homogenous, which means the cell size is the same for all cells -and is either determined by the size of the smallest cell content or if -the table fills in a larger widget space than its minimal size, then cell -space is evenly distributed. - -

PCB_DAD_BEGIN_TABBED(table, tabs)

-

-Creates a "tabbed notebook": each child widget ends up on a new -page, there is only one page shown at a time and there is a GUI way -to switch page (the tab). The list of tab names is passed as tabs, -as a NULL terminalte char * array. The number of tab names must match -the number of children widgets. The value -of is an integer index into that array, 0 being the first tab. -

-If compflag includes PCB_HATF_HIDE_TABLAB, the tab graphics are hidden - -no tab labels printed and the user can not click to switch tab. This is -useful for dialog boxes where the code needs to present different tabs -using the same screen estate. -

-If compflag PCB_HATF_LEFT_TAB is set, tab labels are presented in a vertical -row on the left side of the widget. This is useful if there are a lot of -tabs with short names. - -

PCB_DAD_DUP_ATTR(table, attr)

-

-Create a new widget by duplicating an existing one. attr is the -widget ID of the existing widget. If the widget being duplicated is a -BEGIN*, it will need a corresponding PCB_DAD_END. - - -

Property sets

-

-The raw macro call is PCB_DAD_SET_VALUE, which can change (overwrite) a named -field of the current (last created) widget. The following table lists high -level macros that usually call PCB_DAD_SET_VALUE on a specific field. -

- -
name description -
PCB_DAD_COMPFLAG(table, val) set all compflags -
PCB_DAD_MINVAL(table, val) change the minimal value for numeric input -
PCB_DAD_MAXVAL(table, val) change the maximal value for numeric input -
PCB_DAD_DEFAULT_NUM(table, val) set the default (initial) value for numeric fields (integers, coords, bools, floats) -
PCB_DAD_DEFAULT_PTR(table, val) set the default (initial) value for pointer fields (e.g. strings) -
PCB_DAD_MINMAX(table, min, max) hange both the minimal and the maximal value for numeric input -
PCB_DAD_CHANGE_CB(table, cb) cb is a function that shall be called upon any change to the widget value -
PCB_DAD_HELP(table, val) set the help text (typically presented as a tooltip) -
- -

Actions and scripting

-

-There is a dad() action in the dialogd plugin that exposes all the above macros. -The dialog table ID is am arbitrary unique string and commands are the macro -names without PCB_DAD, written in lowercase. -

-Please refer to scripting rosetta -project for examples. An example of a typical small dialog box is the -unit conveter -script. - Index: trunk/doc/developer/dad/run.html =================================================================== --- trunk/doc/developer/dad/run.html (revision 34886) +++ trunk/doc/developer/dad/run.html (nonexistent) @@ -1,75 +0,0 @@ - - - -

DAD: running the dialog box

- -

From C

-

-Dialog box data is created in memory using either PCB_DAD_DECL(table) or -PCB_DAD_DECL_NOINIT(table). The first call declares and initializes all -variables and is suitable for when the dialog box is hosted directly in -(static) global variables or as local variables of a function. The _NOINIT -version omits the initialization and is suitable for declaring the dialog box -as part of a struct. In the latter case the caller needs to make sure all -dialog box fields are initialized to zero. -

-How user attached data and memory allocation is managed is described in -the DAD closing sequence document. - -

Running non-modal dialogs

-

-The typical sequence of running a non-modal dialog is: -

-(declaration)
-(filling in with widgets)
-PCB_DAD_NEW();
-
-

-The modal argument of PCB_DAD_NEW() is pcb_false. The dialog box -is created in the PCB_DAD_NEW() call, which returns immediately, leaving -the dialog box running in the background. -

-example code template - -

Running modal dialogs

-

-The typical sequence of running a modal dialog is: -

-(declaration)
-(filling in with widgets)
-PCB_DAD_NEW();
-PCB_DAD_RUN();
-(process the return value of PCB_DAD_RUN())
-PCB_DAD_FREE();
-
-

-The modal argument of PCB_DAD_NEW() is pcb_true. PCB_DAD_RUN() -will not return until the user gets the modal dialog box closed (either -by the VM or by the code). -

-example code template - -

Running modal dialogs - shorthand

-

-There is an alternative sequence using PCB_DAD_AUTORUN() but it saves -only one line compared to the above code and makes handling the return -value somewhat more complicated. Thus the above sequence should be -preferred. - - -

From user scripts

-

-After creating the dialog box widgets in memory, the actual GUI can be -started up by a call to action dad(dialog_name, run, title) or -dad(dlgname, run_modal, title). -

-The difference between run and run_modal is when the -call returns: -

Index: trunk/doc/developer/dad/whpane.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/whpane.png =================================================================== --- trunk/doc/developer/dad/whpane.png (revision 34886) +++ trunk/doc/developer/dad/whpane.png (nonexistent) Property changes on: trunk/doc/developer/dad/whpane.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wpicbtn.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wpicbtn.png =================================================================== --- trunk/doc/developer/dad/wpicbtn.png (revision 34886) +++ trunk/doc/developer/dad/wpicbtn.png (nonexistent) Property changes on: trunk/doc/developer/dad/wpicbtn.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wvpane.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wvpane.png =================================================================== --- trunk/doc/developer/dad/wvpane.png (revision 34886) +++ trunk/doc/developer/dad/wvpane.png (nonexistent) Property changes on: trunk/doc/developer/dad/wvpane.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/winteger.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/winteger.png =================================================================== --- trunk/doc/developer/dad/winteger.png (revision 34886) +++ trunk/doc/developer/dad/winteger.png (nonexistent) Property changes on: trunk/doc/developer/dad/winteger.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wcoord.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wcoord.png =================================================================== --- trunk/doc/developer/dad/wcoord.png (revision 34886) +++ trunk/doc/developer/dad/wcoord.png (nonexistent) Property changes on: trunk/doc/developer/dad/wcoord.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/TEMPLATE_MODAL.c =================================================================== --- trunk/doc/developer/dad/TEMPLATE_MODAL.c (revision 34886) +++ trunk/doc/developer/dad/TEMPLATE_MODAL.c (nonexistent) @@ -1,77 +0,0 @@ -/* - HOW TO USE THE TEMPLATE: - 0. reconsider: does this dialog have to be modal? - 1. decide about the name of your dialog box, e.g. foo in this example - 2. svn copy this file to dlg_foo.c - do not use plain fs copy, use svn copy! - 3. rename functions in this file to - 4. add '#include "dlg_foo.c"' in dialogs.c at the end of the list where - all the other dlg_*.c files are included - 5. add an action to pcb_act*_Foo in dialogs.c - 6. edit the parts marked with '<<<- edit this' or 'EDIT THIS' - do not - yet add the implementation - 7. run 'make dep' in src/ - 8. remove this comment block so copyright is on top - 9. edit the copyright message: year and author - 10. test compile - 11. in trunk/: 'svn commit src_plugins/dialogs src/Makefile.dep' - 12. start implementing the dialog box -*/ - -/* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2018 Tibor 'Igor2' Palinkas - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Contact: - * Project page: http://repo.hu/projects/pcb-rnd - * lead developer: http://repo.hu/projects/pcb-rnd/contact.html - * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") - */ - -#include "core headers this file depends on (even if other dialogs include them)" - -typedef struct{ - rnd_hid_attribute_t *attrs; -} foo_ctx_t; <<<- rename this - -static void pcb_dlg_foo(whatever args) <<<- edit this -{ - foo_ctx_t ctx; - rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; - RND_DAD_DECL(dlg); - - RND_DAD_BEGIN_VBOX(dlg); - RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - RND_DAD_LABEL(dlg, "foo"); - RND_DAD_BUTTON_CLOSES(dlg, clbtn); - RND_DAD_END(dlg); - - /* set up the context */ - ctx.attrs = dlg; - - RND_DAD_NEW("EDIT_THIS_ID", dlg, "EDIT THIS: title", &ctx, rnd_true, NULL); - RND_DAD_RUN(dlg); - RND_DAD_FREE(dlg); -} - -static const char pcb_acts_Foo[] = "Foo(object)\n"; <<<- edit this -static const char pcb_acth_Foo[] = ""; <<<- edit this -static fgw_error_t pcb_act_Foo(fgw_arg_t *res, int argc, fgw_arg_t *argv) <<<- edit this -{ - return 0; -} Index: trunk/doc/developer/dad/wstring.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wstring.png =================================================================== --- trunk/doc/developer/dad/wstring.png (revision 34886) +++ trunk/doc/developer/dad/wstring.png (nonexistent) Property changes on: trunk/doc/developer/dad/wstring.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/closing.html =================================================================== --- trunk/doc/developer/dad/closing.html (revision 34886) +++ trunk/doc/developer/dad/closing.html (nonexistent) @@ -1,73 +0,0 @@ - - - -

DAD: Dynamic Attribute Dialogs: closing sequence

-

-There are two ways a DAD can be closed: -

-

-There are four sets of structures/allocations associated with a DAD: -

-

- -There is only one allocation sequence: -

    -
  1. [caller] allocates the user data -
  2. [caller] calls [dad] to allocate the dad ctx: PCB_DAD_NEW() -
  3. [dad] calls [HID] to allocate the hid ctx -
  4. [HID] calls the [toolkit] to allocate widgets -
  5. the [caller] calls PCB_DAD_RUN() or PCB_DAD_AUTORUN() -
- -There are many different free sequences possible, the three most -typical ones are: - - -

-In other words, one PCB_DAD_NEW() needs to have exactly one PCB_DAD_FREE() -pair. If PCB_DAD_FREE() is called while the dialog is on (code close), -the dialog is closed and the callback function is called (unless it is -already running). The [caller] can access DAD widget states and values -only between PCB_DAD_NEW() and PCB_DAD_FREE(). - Index: trunk/doc/developer/dad/wreal.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wreal.png =================================================================== --- trunk/doc/developer/dad/wreal.png (revision 34886) +++ trunk/doc/developer/dad/wreal.png (nonexistent) Property changes on: trunk/doc/developer/dad/wreal.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wtree.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wtree.png =================================================================== --- trunk/doc/developer/dad/wtree.png (revision 34886) +++ trunk/doc/developer/dad/wtree.png (nonexistent) Property changes on: trunk/doc/developer/dad/wtree.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wlabel.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wlabel.png =================================================================== --- trunk/doc/developer/dad/wlabel.png (revision 34886) +++ trunk/doc/developer/dad/wlabel.png (nonexistent) Property changes on: trunk/doc/developer/dad/wlabel.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wbool.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wbool.png =================================================================== --- trunk/doc/developer/dad/wbool.png (revision 34886) +++ trunk/doc/developer/dad/wbool.png (nonexistent) Property changes on: trunk/doc/developer/dad/wbool.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wenum.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wenum.png =================================================================== --- trunk/doc/developer/dad/wenum.png (revision 34886) +++ trunk/doc/developer/dad/wenum.png (nonexistent) Property changes on: trunk/doc/developer/dad/wenum.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/tree.html =================================================================== --- trunk/doc/developer/dad/tree.html (revision 34886) +++ trunk/doc/developer/dad/tree.html (nonexistent) @@ -1,32 +0,0 @@ - - - -

DAD: Dynamic Attribute Dialogs

-

-The table tree widget is a table containint cells arranged in a -fixed number of columns. Each cell is a dynamically allocated -char * string. - -

Helper macros for widget creation

-

-These macros, defined in hid_dad.h, are used to fill up the last -created (tree) widget with initial data. They return a row pointer. If the -row pointer is NULL, root is used - in this case insert means inserting at -the beginning of the row list, append means append at the end of the row list. -

- -

Inline functions for manipulating the tree runtime

-

-When the tree widget is already created, typically when the dialog box -is already running, the code can use hid_dad_tree.h for reading or -changing cells or rows of the tree. Any change is immediately reflected -on the GUI. Please refer to the comments in hid_dad_tree.h for details -on the functions and arguments. - - - Index: trunk/doc/developer/dad/wprogress.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wprogress.png =================================================================== --- trunk/doc/developer/dad/wprogress.png (revision 34886) +++ trunk/doc/developer/dad/wprogress.png (nonexistent) Property changes on: trunk/doc/developer/dad/wprogress.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wpicture.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wpicture.png =================================================================== --- trunk/doc/developer/dad/wpicture.png (revision 34886) +++ trunk/doc/developer/dad/wpicture.png (nonexistent) Property changes on: trunk/doc/developer/dad/wpicture.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/whbox.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/whbox.png =================================================================== --- trunk/doc/developer/dad/whbox.png (revision 34886) +++ trunk/doc/developer/dad/whbox.png (nonexistent) Property changes on: trunk/doc/developer/dad/whbox.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/intro.html =================================================================== --- trunk/doc/developer/dad/intro.html (revision 34886) +++ trunk/doc/developer/dad/intro.html (nonexistent) @@ -1,56 +0,0 @@ - - - -

DAD: Dynamic Attribute Dialogs

- -

History

-

-Attribute Dialogs were originally invented around the early/mid 2000s for export -HIDs to store a static, flat list of options that are then presented both -as command line options and as the GUI dialog box for export parameters. - -

Intro

-

-DAD is the dyamically allocated version, extended with new widget types for -providing tools for building more complex dialog boxes. It is not connected -with command line options in any way at the moment. -

-The list of widgets is still a flat, growing C array, often called the -table. But inside the table, widgets build as a logical tree -structure. Widgets with name that includes "BEGIN" will open a new -logical layout level that has to be closed with a PCB_DAD_END(). - -

Calling conventions

-

-A table is always built incrementally and sequentially. In this sense -the dialog box is static: once build and created, the number and -type of widgets can not be modified. The dynamic aspect is that the code -may create (and destroy) arbitrary DAD boxes, even with loops and -runtime conditions on what widgets end up in the box. -

-There are two kind of widget calls: widget creation and property set. -Property set calls always change the last created widget. This, by -convention, is often indicated by code indentation as well. For example: -

-	PCB_DAD_INTEGER(dlg, "foo");
-		PCB_DAD_MINVAL(dlg, 1);
-		PCB_DAD_MAXVAL(dlg, 10);
-		PCB_DAD_DEFAULT_NUM(dlg, 3);
-		widget_id_foo = PCB_DAD_CURRENT(dlg);
-	PCB_DAD_BUTTON(dlg, "update!");
-		PCB_DAD_CHANGE_CB(dlg, pcb_act_attr_chg);
-
-

-PCB_DAD_INTEGER() and PCB_DAD_BUTTON() are (macro) calls to create -new widgets (an integer entry and a button), the rest of the calls -change the last created widget's properties. -

-The main widget of the box, the root widget of the widget tree is -any widget. It is practical to make it a container widget (e.g. a HBOX, VBOX, -TABLE, PANE, or TABBED) so that it can host children widgets. -

-After each creation, the caller can query and store the integer widget -identifier using the PCB_DAD_CURRENT() macro. The widget identifier can -be used, together with the table, to query or change widget properties -and current value any time the dialog box is active. - Index: trunk/doc/developer/dad/wtable.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wtable.png =================================================================== --- trunk/doc/developer/dad/wtable.png (revision 34886) +++ trunk/doc/developer/dad/wtable.png (nonexistent) Property changes on: trunk/doc/developer/dad/wtable.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/wvbox.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/developer/dad/wvbox.png =================================================================== --- trunk/doc/developer/dad/wvbox.png (revision 34886) +++ trunk/doc/developer/dad/wvbox.png (nonexistent) Property changes on: trunk/doc/developer/dad/wvbox.png ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/doc/developer/dad/index.html =================================================================== --- trunk/doc/developer/dad/index.html (revision 34886) +++ trunk/doc/developer/dad/index.html (revision 34887) @@ -1,14 +1,5 @@ - -

DAD: Dynamic Attribute Dialogs

- -

Table of Contents

- - +Moved to librnd + + Index: trunk/doc/developer/fungw_actions.txt =================================================================== --- trunk/doc/developer/fungw_actions.txt (revision 34886) +++ trunk/doc/developer/fungw_actions.txt (revision 34887) @@ -1,129 +1,5 @@ -Actions implemented as fungw functions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Moved to librnd, see -1. Intro +http://www.repo.hu/projects/librnd/developer/fungw_actions.txt -All pcb-rnd actions are fungw functions by now. This helps the code to do -all the data type conversions easier, save a few conversions where we -don't need conversions. More importantly, this makes a more seamless -integration between user scripts and C code, whether scripts are calling -C actions or the user is executing script defined actions. -To stay compatible with the old action mechanism, the current version -applies the following restrictions: - -- we have only one large fungw object (pcb_fgw_obj) that hosts all - functions; this emulates the old central hash of functions - -- before a function enters the object or a function is looked up in the - object, the function name is converted to lowercase; this emulates the - case intensity of the old action system, which is still essential for - the user interface (GUI or CLI command entry and menu). - -- temporarily, for the transition, there are two helper macros - PCB_OLD_ACT_BEGIN and PCB_OLD_ACT_END that can wrap old function - code, converting all arguments to a char **argv. Such old actions - should return non-zero on error, while the value of ores will always be - FGW_INT/0. New action code shall NOT use the compatibility API. - -- a single action call will result in a single fungw function call; that - is, the fungw function that serves the action is free to convert any - of the arguments. - -2. converting arguments - -Arguments are normally converted using PCB_ACT_CONVARG(); the last -argument is a statement that can make the value assignment to a local -variable if the conversion was succesful. For example fetching the 2nd -argument into a local coord: - -{ - pcb_coord_t c; - PCB_ACT_CONVARG(2, FGW_COORD, ActioName, c = fgw_coord(&argv[2])); -} - -If conversion fails or the argument is not available, the macro returns -from the function with error. Anoter variant of the macro called -PCB_ACT_MAY_CONVARG() omits the error-return part, allowing the code -to have optional arguments. - -When the coordinate conversion needs to keep extra info, e.g. whether -the coordinate was specified in absolute or relative, the special type -fgw_coords_t shall be used: - -{ - fgw_coords_t *crd; - PCB_ACT_CONVARG(1, FGW_COORDS, d1, crd = fgw_coords(&argv[1])); -} - - -3. returning - -An action function has two return values: the C function return value -and the "res" argument. If the action could not start executing code -because of a calling error, e.g. there are not enough arguments or -arguments can not be converted or the function is invoked out-of-context, -it should retrun a fungw error using the C return value. This indicates -that performing the call itself failed. - -Else, if actual action code runs, the C return value should be 0 and the -res argument should be loaded with the return value of the action. This -indicates that the call took place, the action was executed and the conclusion -is stored in res. The semantic of the result is action-specifiec. The common -convention is returning int, 0 meaning success. The shortnad for this: - -{ - PCB_ACT_IRES(0); - return 0; -} - -PCB_ACT_IRES() loads res with type and value. There are other similar, -type-specific macros available. - -4. multi-call - -Currently pcb-rnd does not depend on fungw's multi-call, thus actions are -free to convert their arguments - the same arguments will not be reused in -other actions. - -5. calling an action from another action - -There are two common cases: wrapping/dispatching and invoking. - -In the wrap/dispatch setup an outer action is called that does not alter -the arguments (not even converting them!), but has to call another action -with exactly the same arguments. This can be done by using the macro -PCB_ACT_CALL_C(). - -When an action code needs to invoke another action, there are three ways -doing it. - -5.1. string call - -The slow, string parsing way using pcb_actionl() or the more -efficient direct call. - - -5.2. direct C call - -Direct C function call is possible only if both the caller and callee -actions are in core, or are in the same plugin. Before the direct call -the caller needs to set up a fungw argv array and after the call the -array members need to be free'd using fgw_argv_free() to avoid -leaking argument memory. This needs to be done even if the caller did -not allocate any memory for argv members - the callee can allocate memory -by converting arguments. - -5.3. indirect C call - -Call pcb_find_action() to get an fgw_func_t * to the action - this holds -the C function pointer. Set up argv, make sure argv[0] is set up to be -the target function: - - fgw_func_t *fn = pcb_find_action(...); - argv[0].type = FGW_FUNC; - argv[0].val.func = fn; - -Call pcb_actionv_() with fn and the arguments. Always call fgw_argv_free() -afterward. Also call fgw_arg_free() on the res. - Index: trunk/doc/developer/hid_render_comp.html =================================================================== --- trunk/doc/developer/hid_render_comp.html (revision 34886) +++ trunk/doc/developer/hid_render_comp.html (revision 34887) @@ -1,128 +1,5 @@ -

HID: rendering vs. composite layers

-

-All rendering is driven by the core. The core understands the PCB stackup, -layers, layer groups, compositions within the layer groups, extra labels, -layer visibility, etc. The HID is a slave device that takes drawing -instructions and blindly executes them. -

-However, the HID has a chance to alter which layer groups are drawn, using -the set_layer_group hooks return value. - -

Bursts and layer groups

-

-The rendering is done in bursts. A burst may redraw only a small window -of the screen. Each bursts draws multiple layer groups, in Z-order, from -bottom (furthest from the eye of the user) to up (closest to the eye of -the user). Each layer group is drawn on a transparent sketch canvas. In positive mode, -objects are drawn with multiple colors on each sketch canvas. In negative mode -pixels are erased from the sketch canvas, making the affected pixels transparent again. Drawing -on a layer group (either positively or negatively) should -overwrite pixels on the same layer group. In other words, there's -no translucency between two overlapping objects drawn on the same layer -group. - -

-There is a so called output canvas, which shall be cleared to -the background color upon render_burst / start. The background -color shall be fetched from the config tree (appearance/color/background). -

-The following steps are taken by the core in a burst: -

-

-When set_drawing_mode / reset is called, the HID needs to -create a new sketch canvas, all pixels initialized to transparent. The -core may switch between positive and negative draw any time. When -set_drawing_mode / flush is called, the current sketch -canvas needs to be blitted onto the output (in a HID-specific way) and -the sketch canvas can be destroyed. The output canvas shall be flushed to -the screen upon render_burst / end. -

-Optional optimization: the most common case is when only positively drawn -layers are used to draw the final output. Drawing on separate sketch canvases and -blitting them onto an output buffer is a waste in this setup. To give HIDs a -chance to avoid the extra copies, set_drawing_mode calls have an -argument called direct. When the direct is set, it is safe -to directly draw on the output canvas, without allocating a sketch canvas. The -core guarantees the followings: -

-

-It is possible that the core would draw the whole board in direct -mode. It is safe to ignore the direct argument and always use the -more expensive, sketch-canvas+blitting method. - -

GCs

-

-The API contains Graphic Context, or GC for short. A GC is a pen with -properties like color and tip shape. The core will initialize multiple -GCs for the drawing and will pass a GC pointer with each drawing command. -

-Note: this concept is orthogonal to the above canvas based drawing. -Regardless of which GC is used, the object being drawn always ends up -making modifications to the currently active (sketch) canvas. -

-A GC can be initialized only after render_burst / start -and all GCs will be uninitialized before render_burst / end. - -

colors

-

-In negative drawing mode, drawing an object always clear on the current canvas, -regardless of the GC color. -

-In positive drawing mode, objects are drawn with whatever color the -current GC has. The special color "drill" is used to draw holes that go thru -all layers of the board. It is possible that a drill is drawn over existing -objects and new objects are drawn on top of a drilled hole. To get the -proper order, the HID shall set the .holes_after to 1. -

-(Note: there's no "erase" color anymore.) - - -

transition

-

-When switching over an existing HID from the old use_mask() API to the new -composite API: -

- -

XOR drawing

-

-XOR draw is used as a mean to make an object always visible, no matter -over what background it is drawns. It is not used as a cheap draw/erase -mechanism, so HIDs are free to implement it with a different algorithm - as -long as it is guaranteed that objects drawn on the same colored background -will stick out. -

-There are two places XOR draw takes place: -

-

-In both cases the drawing mode is set to PCB_HID_COMP_POSITIVE_XOR, which does -not clear the direct flag. The GC that is used for drawing the actual -objects also has its xor mode set. - +Moved to librnd Index: trunk/doc/developer/hidlib/TODO =================================================================== --- trunk/doc/developer/hidlib/TODO (revision 34886) +++ trunk/doc/developer/hidlib/TODO (nonexistent) @@ -1,22 +0,0 @@ -What the user code needs to implement - -1. actions (optional) - StatusSetText() - DescribeLocation() - -2. docked DAD subwindows (optional) - bottom status line - top right coord readout - top left toolbar - -3. conventions - all calls have access to the current (pcb_hidlib_t *) - there's a design (pcb_board_t) - recommendation: the design struct's first field should be pcb_hildib_t so they can be casted forth and back - -4. icon colors: - - None - transparent - #000000 - black - #7A8584 - light grey - #6EA5D7 - cyan/blue Index: trunk/doc/developer/hidlib/init_seq.txt =================================================================== --- trunk/doc/developer/hidlib/init_seq.txt (revision 34886) +++ trunk/doc/developer/hidlib/init_seq.txt (nonexistent) @@ -1,117 +0,0 @@ -1. simplified (custom) init sequence - -This method is useful for the simplest, gui-only applications that -potentially do not have plugins. - -int main(int argc, char *argv[]) -{ - pcb_fix_locale_and_env(); - - /* set up non-hidlib related app states */ - ... - - pcb_hidlib_init1(conf_core_init); - - /* process command line args */ - ... - - pcb_hidlib_init2(pup_buildins); - - /* set up hidlib related app states - all main infrastructure is up by now */ - ... - - /* initialize the gui and run the main loop */ - pcb_gui = pcb_hid_find_gui(gui_name); - if (pcb_gui == NULL) { - pcb_message(PCB_MSG_ERROR, "can't find HID '%s'\n", gui_name); - pcbhl_log_print_uninit_errs(""); - exit(1); - } - if (pcb_gui->parse_arguments(&argc, &argv) != 0) { - pcb_message(PCB_MSG_ERROR, "can't init HID '%s'\n", gui_name); - pcbhl_log_print_uninit_errs(""); - exit(1); - } - pcb_gui->do_export(&camv.hidlib, 0); - - /* application state uninit */ - ... -} - - -2. standard init sequence - -Hidlib calls help to initialize the plugin system, parse the command line -argument, choose command line action, exporter or GUI in a standard way. -Full featured hidlib applications with feature and export plugins should -use this sequence. - -static const char *camv_action_args[] = { -/*short, -long, action, help, hint-on-error */ - "V", "-version", "PrintVersion()", "Print version info and exit", NULL, - "V", "-dump-version", "DumpVersion()", "Print version info in script readable format and exit", NULL, - NULL, "-copyright", "PrintCopyright()", "Print copyright and exit", NULL, - NULL, NULL, NULL, NULL, NULL /* terminator */ -}; - -int main(int argc, char *argv[]) -{ - pcbhl_main_args_t ga; - - pcb_fix_locale_and_env(); - - pcbhl_main_args_init(&ga, argc, camv_action_args); - - pcb_hidlib_init1(conf_core_init); - for(n = 1; n < argc; n++) { - /* process application-specific arguments here and skip the next line for those */ - n += pcbhl_main_args_add(&ga, argv[n], argv[n+1]); - } - pcb_hidlib_init2(pup_buildins); - - /* direct exporting via -x */ - if (pcbhl_main_args_setup1(&ga) != 0) { - camv_main_uninit(); - pcbhl_main_args_uninit(&ga); - exit(1); - } - -/* Initialize actions only when the gui is already known so only the right - one is registered (there can be only one GUI). */ -#include "generated_lists.h" - - if (pcbhl_main_args_setup2(&ga, &n) != 0) { - camv_main_uninit(); - pcbhl_main_args_uninit(&ga); - exit(n); - } - - if (ga.hid_argc > 0) { - /* command line leftover: typically file name(s) to load, in - ga.hid_argv[0 .. ga.hid_argc-1]; */ - } - - /* do the export if -x was specified */ - if (pcbhl_main_exported(&ga, ...)) { - camv_main_uninit(); - pcbhl_main_args_uninit(&ga); - exit(0); - } - - /* main loop */ - do { - /* optional: if a plugin is required for basic GUI operation, load it here */ - if (PCB_HAVE_GUI_ATTR_DLG) - gui_support_plugins(1); - pcbhl_mainloop_interactive(&ga, ...); - } while(pcb_gui != NULL); - - /* application specific uninit */ - ... - - pcbhl_main_args_uninit(&ga); - return 0; -} - - - Index: trunk/doc/developer/hidlib/index.html =================================================================== --- trunk/doc/developer/hidlib/index.html (nonexistent) +++ trunk/doc/developer/hidlib/index.html (revision 34887) @@ -0,0 +1,5 @@ + + +Moved to librnd + + Index: trunk/doc/developer/indent.html =================================================================== --- trunk/doc/developer/indent.html (revision 34886) +++ trunk/doc/developer/indent.html (revision 34887) @@ -1,36 +1,5 @@ -

pcb-rnd - indentation

- -As of r1022 all old code is converted using indent(1). Our preferred -coding style is close to what the following command line produces, using -our patched version of indent(1): -
-indent --line-length256 -brs -br -nce --tab-size2 -ut -npsl  -npcs -hnl -cli2 -nsaf -sai -nsaw -ncs -c0 -cd0 -cp0
-
-

-Contributors are kindly asked to follow this style or run the above -commandline on their new code before sending a patch or committing -to svn. The style of existing code lines should not be changed, -not even the "surrounding" lines to a largish patch, especially not in the -same patch/commit with actual code changes. -

-We do not put space between the pointer-asterisk and name; indent(1) -unfortunately does this in function declaration: - - -
right wrong -
int foo(char *bar); - int foo(char * bar); -
-

-We have a patch against indent 2.2.11 to -fix this. -

-We do not use tabs for aligning code in columns; we use tabs exclusively -to indicate levels logical alignment. indent(1) attempts to align the -right-side comments using tabs. We have a patch -against indent 2.2.11 to change this when column is set to 0. - +Moved to librnd