Re: Changes to ivtools-drawtool
Brought to you by:
johnston
|
From: Scott J. <sc...@ac...> - 2002-02-07 18:39:48
|
Glen Koundry wrote: > Scott, > I've been going through the documentation for the various API's and have > even done a small amount of work on the drawtool program (I changed the > toolbar to have two rows of buttons). I just had a few questions, namely: > a. How do you handle code changes? Is there some sort of CVS setup? and b. > Are there any sort of coding standards (ie. file names, source code > comments, etc.) that I should be aware of? I have attached the changes I > made and would appreciate it if you could look it over when you get a > chance. > > Thanks > > ------------------------------------------------------------------------ > Name: drawtool.zip > drawtool.zip Type: Zip Compressed Data (application/x-zip-compressed) > Encoding: base64 Glen, Once again I'm forwarding this to ivt...@li..., because I want to be able to point people's browsers to the following reference material in the future. Work to date: I tested your new stuff in my development source tree by replacing the body of OverlayKit::MakeToolbar with what you created in CustomOverlayKit::MakeToolbar. Works fine, looks great. But I will back out this change for now, and let you submit through normal channels (to be discussed below). Two comments about work so far: 1) feel free to do generic work like this in place, in the existing methods and classes (I do understand this was just an initial experiment); and 2) I like the double row of toolbar buttons, but it certainly begs for some mechanism to preserve a natural height to the entire toolbar panel (to preserve the natural shape of the drawing editor, whatever that would be). Submitting work: As for submitting work, you have two choices: via cvs with developer permissions (which I will give you shortly), or via informal patches e-mailed to ivt...@li.... If you choose to use patch I will keep the cvs repository in synch myself. If you use cvs it would be helpful if you sent an e-mail to ivt...@li... after committing a set of changes that will go into a formal patch. There is an automatic notification of commits but a redundant notice will help me keep things organized (and inform others of progress). In either case I will take it upon myself to incorporate your changes into the source tree I use for generating release tarfiles, and archive the change by authoring a formal patch which gets posted at ivt...@li.... Visit here to see formal patches to-date: http://sourceforge.net/mailarchive/forum.php?forum_id=5713 Standards and conventions: C++ filenames are all lower-case, with a .c instead of .cc or .cxx for historical reasons. Typically there is one class per file, and the filename is lower-case version of the classname, simplified if necessary to keep a reasonable length (8 to 12 characters?). For example, OverlayKit can be found in ovkit.c. Sometimes filenames contain a prefix that relates them to the class library they are part of. This is mostly used for derived classes that are central to the drawing editor framework (like oved.c which contains OverlayEditor). But new mechanisms break this rule (slctbyattr.c contains a SelectByAttributesCmd), and it was kind of redundant since you always refer to include files using the both the class library and the file name, i.e.: #include <OverlayUnidraw/ovkit.h> Each fragment of a classname is capitalized (unlike Smalltalk, etc.., which capitalize all but the first fragment). Macros are all CAPS (except where they're not trying to look like a macro). Variables are all lowercase. Member variables have a trailing or leading underbar. Older methods related to the IV-2_6 layer and Unidraw are capitalized. Younger methods related to the IV-3_1 glyphs and ComTerp are lower case. Of course there's more, but a lot of it you can learn in a monkey-see, monkey-do fashion, or I'll offer feedback as we go. The primary convention is the code works and does something useful an interesting. Everything else is secondary :-) Any questions? Scott Johnston http://www.ivtools.org |