On 25.02.2010, at 10:47, Duncan Gibson wrote:
> I just saw your commit: [Library] r7144 - branches/branch-1.3/fluid
> http://www.fltk.org/newsgroups.php?gfltk.commit+v:7518
>
> I don't have time now to download and explore, so I'll just ask:
>
> I'm just curious to know how easy it will be to add new files and
> options, so do you maintain or generate a master list of files and
> dependencies from which you then generate the code that then gives
> the tool specific formatted output?
In the current implementation, Fluid generates the code from a database. The
database itself is also created by Fluid. To add files to the database, one
wold have to add a line to the Fluid source code. As an example, this is the
configuration section for Fluid:
Fl_Target_Prefs fluid_app(apps_db.add_with_key("name", "Fluid")); {
fluid_app.add_source(files_db, "fluid/CodeEditor.cxx");
fluid_app.add_source(files_db, "fluid/Fl_Function_Type.cxx");
...
fluid_app.add_source(files_db, "fluid/undo.cxx");
fluid_app.add_source(files_db, "fluid/widget_panel.cxx");
fluid_app.add_lib(fltk_lib);
fluid_app.add_lib(fltk_forms_lib);
fluid_app.add_lib(fltk_images_lib);
fluid_app.add_lib(fltk_jpeg_lib);
fluid_app.add_lib(fltk_png_lib);
visualc_only(fluid_app.add_lib(fltk_z_lib));
osx_only(fluid_app.add_external_lib(files_db, "icons/fluid.icns"));
demo_db.depends_on(fluid_app);
}
or for "test/Keyboard". All .fl dependencies ore done automatically.
{ Fl_Target_Prefs db(tests_db.add_with_key("name", "keyboard"));
db.add_source(files_db, "test/keyboard.cxx");
db.add_fl(files_db, "test/keyboard_ui.fl");
db.add_lib(fltk_lib);
db.depends_on(fluid_app);
demo_db.depends_on(db);
}
"Blocks" is a bit more complicated because it needs an external library. I am
working on solving that better. Maybe a known set of libraries, or even an
fltk_sound wrapper.
{ Fl_Target_Prefs db(tests_db.add_with_key("name", "blocks"));
db.add_source(files_db, "test/blocks.cxx");
db.add_lib(fltk_lib);
osx_only(db.add_external_lib(files_db,
"/System/Library/Frameworks/CoreAudio.framework"));
ux_only(db.add_external_lib(files_db, "..."));
visualc_only(db.add_external_lib(files_db, "..."));
demo_db.depends_on(db);
}
Fluid does all the rest.
The goal is to make it really easy for us developers to add new libraries,
applications, or test programs, and then update all IDE's, CMake and Makefiles
with a single call to Fluid.
The database makes additions really easy. Contributions to the FLTK bazaar
could be wrapped in a package which would automatically modify the database and
IDE's to integrate the package - kind of an iTunes Store for FLTK widgets
(without a payment system, obviously).
I will keep things command-line only for now, but maybe one day, Fluid can also
generate brand new projects for our users that can be compiled on platforms
that the author doesn't need to know about.
- Matthias
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev