On Sun, Jun 01, 2008 at 01:42:11PM -0400, Jorge Arellano Cid wrote:
I removed form.{hh,cc} from cvs. Although they may reappear once html.cc is split.
Well, since you mention it...! :-) I had another go at splitting html.cc and this time I got it to work. No code was modified except that DilloHtml::getCurrentForm is no longer inline and the DilloHtmlForm constructor and destructor are wrapped in Html_form_{create,delete}, which can be called without access to the DilloHtmlForm class definition. So let's talk filenames! I moved the form code into new files called html_form.{hh,cc} . I really like hierarchical file names like that (they make related things sort next to each other), but maybe you would prefer the old form.{hh,cc} ? Also, I had to move a lot of declarations that both html.cc and html_form.cc use into a new header called html_internal.hh . Again, please specify a different file name if you want. I hadn't planned on creating a second new header but there are several definitions that are used by most of the html.cc internals, eg. almost everything needs the DilloHtml class definition and various HT2* macros etc. The "internal header" factors out that common API. I'd like to avoid it but it seems inevitable to me. Note that adding html_internal.hh is a one-off change. Further splitting should not require extra internal headers, just one new header per new source file as is standard. Also note that splitting off the form code is particularly messy since it includes new objects that appear in the DilloHtml definition. I would expect further splitting (eg, the table code) to be much simpler. The final decision is what to do with function names that move from *.cc to *.hh files. Leave them the same or rename "Html_*" to "a_Html_*"? I would suggest leaving them the same because they are still Html internals. They only appear in *.hh files because the internal implementation is spread among several files. If people think this sounds good and confirm the right names for files and functions then I will start proposing patches. I will move the code around in stages without breaking the build, so you'll get several small patches instead of one big one. I think that will be easier to review (but you can have a mega-patch if you really want one). Here are the stats: before: $ wc html*.{hh,cc} 21 42 338 html.hh 0 0 0 html_form.hh 0 0 0 html_internal.hh 6016 20229 191216 html.cc 0 0 0 html_form.cc 6037 20271 191554 total after: $ wc html*.{hh,cc} 21 42 338 html.hh 40 121 1404 html_form.hh 240 841 7832 html_internal.hh 4114 14090 129091 html.cc 1764 5563 57036 html_form.cc 6179 20657 195701 total (The final version may differ as I clean things up, but it won't be much different.) Regards, Jeremy Henty