Index: doc-rnd/TODO =================================================================== --- doc-rnd/TODO (revision 1098) +++ doc-rnd/TODO (revision 1099) @@ -1,8 +1,10 @@ CLEANUP + - write mods.html + - ActionBell() + - Makefile.dep vs. plugins - move to plugin: - - toporouter - - gpmi - - remove libstroke or move it in a plugin? + - libstroke + - import_sch.c - warnings in util/ BACK ANNOTATION Index: doc-rnd/index.html =================================================================== --- doc-rnd/index.html (revision 1098) +++ doc-rnd/index.html (revision 1099) @@ -37,6 +37,7 @@ [ba] back annotation [onpoint] on-point by Robert Drehmel [cycdrag] cycle drag; with additional feature: negative box select +[mods] modularize the code to reduce core size settings minor changes in default settings Index: scconfig/hooks.c =================================================================== --- scconfig/hooks.c (revision 1098) +++ scconfig/hooks.c (revision 1099) @@ -72,6 +72,10 @@ {"buildin-toporouter", "/local/pcb/toporouter/buildin", arg_true, "$static link the toporouter plugin into the executable"}, {"plugin-toporouter", "/local/pcb/toporouter/buildin", arg_false, "$the toporouter plugin is dynamic loadable"}, + {"disable-oldactions", "/local/pcb/oldactions/enable", arg_false, "$do not compile the oldactions"}, + {"buildin-oldactions", "/local/pcb/oldactions/buildin", arg_true, "$static link the oldactions plugin into the executable"}, + {"plugin-oldactions", "/local/pcb/oldactions/buildin", arg_false, "$the oldactions plugin is dynamic loadable"}, + {NULL, NULL, NULL, NULL} }; @@ -164,6 +168,10 @@ put("/local/pcb/toporouter/enable", strue); put("/local/pcb/toporouter/buildin", strue); + db_mkdir("/local/pcb/oldactions"); + put("/local/pcb/oldactions/enable", strue); + put("/local/pcb/oldactions/buildin", strue); + return 0; } @@ -385,6 +393,7 @@ plugin_stat("Edif: ", "/local/pcb/edif"); plugin_stat("djopt: ", "/local/pcb/djopt"); plugin_stat("Mincut: ", "/local/pcb/mincut"); + plugin_stat("old actions:", "/local/pcb/oldactions"); if (manual_config) printf("\n\n * NOTE: you may want to edit config.manual.h (user preferences) *\n"); Index: src/Makefile.in =================================================================== --- src/Makefile.in (revision 1098) +++ src/Makefile.in (revision 1099) @@ -142,6 +142,7 @@ include {../src_plugins/mincut/Plug.tmpasm} include {../src_plugins/gpmi/Plug.tmpasm} include {../src_plugins/toporouter/Plug.tmpasm} +include {../src_plugins/oldactions/Plug.tmpasm} append /local/pcb/CFLAGS /target/libs/sul/glib/cflags append /local/pcb/LIBS /target/libs/sul/glib/ldflags Index: src/action.c =================================================================== --- src/action.c (revision 1098) +++ src/action.c (revision 1099) @@ -1260,43 +1260,6 @@ } } -/* -------------------------------------------------------------------------- */ - -static const char dumplibrary_syntax[] = "DumpLibrary()"; - -static const char dumplibrary_help[] = "Display the entire contents of the libraries."; - -/* %start-doc actions DumpLibrary - - -%end-doc */ - -static int ActionDumpLibrary(int argc, char **argv, Coord x, Coord y) -{ - int i, j; - - printf("**** Do not count on this format. It will change ****\n\n"); - printf("MenuN = %d\n", Library.MenuN); - printf("MenuMax = %d\n", Library.MenuMax); - for (i = 0; i < Library.MenuN; i++) { - printf("Library #%d:\n", i); - printf(" EntryN = %d\n", Library.Menu[i].EntryN); - printf(" EntryMax = %d\n", Library.Menu[i].EntryMax); - printf(" Name = \"%s\"\n", UNKNOWN(Library.Menu[i].Name)); - printf(" directory = \"%s\"\n", UNKNOWN(Library.Menu[i].directory)); - printf(" Style = \"%s\"\n", UNKNOWN(Library.Menu[i].Style)); - printf(" flag = %d\n", Library.Menu[i].flag); - - for (j = 0; j < Library.Menu[i].EntryN; j++) { - printf(" #%4d: ", j); - printf("newlib: \"%s\"\n", UNKNOWN(Library.Menu[i].Entry[j].ListEntry)); - } - } - - return 0; -} - - /* --------------------------------------------------------------------------- * !!! no action routine !!! * @@ -1759,9 +1722,6 @@ /* --------------------------------------------------------------------------- */ HID_Action action_action_list[] = { - {"DumpLibrary", 0, ActionDumpLibrary, - dumplibrary_help, dumplibrary_syntax} - , {"ExecuteFile", 0, ActionExecuteFile, executefile_help, executefile_syntax} , Index: src_plugins/oldactions/Makefile =================================================================== --- src_plugins/oldactions/Makefile (nonexistent) +++ src_plugins/oldactions/Makefile (revision 1099) @@ -0,0 +1,5 @@ +all: + cd ../../src && make mod_oldactions + +clean: + rm *.o *.so 2>/dev/null ; true Index: src_plugins/oldactions/Plug.tmpasm =================================================================== --- src_plugins/oldactions/Plug.tmpasm (nonexistent) +++ src_plugins/oldactions/Plug.tmpasm (revision 1099) @@ -0,0 +1,16 @@ +append /local/pcb/oldactions/enable {} +append /local/pcb/oldactions/buildin {} + +put /local/pcb/mod {oldactions} +put /local/pcb/mod/OBJS [@ $(PLUGDIR)/oldactions/oldactions.o @] + +if /local/pcb/oldactions/enable then + if /local/pcb/oldactions/buildin then + include {Makefile.in.mod/Buildin} + else + include {Makefile.in.mod/Plugin} + end +end + + + Index: src_plugins/oldactions/oldactions.c =================================================================== --- src_plugins/oldactions/oldactions.c (nonexistent) +++ src_plugins/oldactions/oldactions.c (revision 1099) @@ -0,0 +1,82 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996 Thomas Nau + * Copyright (C) 1997, 1998, 1999, 2000, 2001 Harry Eaton + * + * 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 St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Contact addresses for paper mail and Email: + * Harry Eaton, 6697 Buttonhole Ct, Columbia, MD 21044, USA + * haceaton@aplcomm.jhuapl.edu + * + */ +#include "config.h" +#include "global.h" +#include "data.h" +#include "action.h" +#include "change.h" +#include "error.h" +#include "undo.h" +/* -------------------------------------------------------------------------- */ + +static const char dumplibrary_syntax[] = "DumpLibrary()"; + +static const char dumplibrary_help[] = "Display the entire contents of the libraries."; + +/* %start-doc actions DumpLibrary + + +%end-doc */ + +static int ActionDumpLibrary(int argc, char **argv, Coord x, Coord y) +{ + int i, j; + + printf("**** Do not count on this format. It will change ****\n\n"); + printf("MenuN = %d\n", Library.MenuN); + printf("MenuMax = %d\n", Library.MenuMax); + for (i = 0; i < Library.MenuN; i++) { + printf("Library #%d:\n", i); + printf(" EntryN = %d\n", Library.Menu[i].EntryN); + printf(" EntryMax = %d\n", Library.Menu[i].EntryMax); + printf(" Name = \"%s\"\n", UNKNOWN(Library.Menu[i].Name)); + printf(" directory = \"%s\"\n", UNKNOWN(Library.Menu[i].directory)); + printf(" Style = \"%s\"\n", UNKNOWN(Library.Menu[i].Style)); + printf(" flag = %d\n", Library.Menu[i].flag); + + for (j = 0; j < Library.Menu[i].EntryN; j++) { + printf(" #%4d: ", j); + printf("newlib: \"%s\"\n", UNKNOWN(Library.Menu[i].Entry[j].ListEntry)); + } + } + + return 0; +} + +HID_Action oldactions_action_list[] = { + {"DumpLibrary", 0, ActionDumpLibrary, + dumplibrary_help, dumplibrary_syntax} +}; + +REGISTER_ACTIONS(oldactions_action_list) + +#include "dolists.h" +void hid_oldactions_init(void) +{ + REGISTER_ACTIONS(oldactions_action_list) +} +