home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-12-04 | 8.7 KB | 231 lines | [TEXT/KAHL] |
- /*
- -----------------------------------------------------------------------------
-
- HeaderKey v1.0a7 12/03/90
-
- Copyright 1990 Brian Fitzgerald
- All rights reserved.
-
- -----------------------------------------------------------------------------
-
- About HeaderKey
- ---------------
-
- I got tired of making function header comments by hand, so I tried to
- write one using the MPW shell commands. After everything was said and
- done, the script took over 20 seconds to execute! Ridiculous. So I
- started to make a real MPW tool that did this, then said "Waitaminut!
- Why not make it an FKEY?
-
- Why not? So, after a long Sunday afternoon, and a week of fixes,
- we have HeaderKey 1.0a7.
-
- This is an FKEY (id=9) that will bring up a dialog allowing you to
- enter information about the function, and choose a language to spit out
- that information in a comment header. You have to PASTE after you run
- the FKEY to get the information into your text editor.
-
-
- Very preliminary
- -----------------
-
- However, this is a very preliminary version. It only supports C and
- assembly (I made it for assembly-language programming, but in the process
- of debugging it added the C support (it's written in Think C) ). It has a
- few quirks. It's somewhat rigid (inflexible). But it's still darn useful.
-
- New as of version 1.0a7 - cmd-U to update the display of the header so
- you can see what it will look like. Also, cut/copy/paste work (they did
- in 1.0a2 but probably no one tried it!). And finally, added some hacks so
- that the desk scrap will copy back and forth correctly.
-
-
- What do I do?
- -------------
-
- OK, the Header FKEY file has 4 DLOG resources, 4 DITL resources, and
- an FKEY resource. If you have Suitcase or some such, then great - just
- open the file up, and you're going. If not, then you need to paste
- these resources into your System file. Since this FKEY is really
- intended for programmers, I hope you know how to do that. No? Well,
- quick instructions (you of COURSE have a backup and you KNOW that I
- can't be held liable etc). From Finder (not MultiFinder), double-click
- on the "Header FKEY" file to open ResEdit. Also open the System file
- from the system folder. Copy DLOG from "Header FKEY". Paste into
- "System". Repeat with DITL and FKEY. Close System (save changes). Quit.
- Ok, you got it.
-
- To use it, just run your favorite programming editor (Think C, MPW,
- or whatever). Hit command-shift-9. You should see a dialog box
- (since this is a TEXT file, sorry no pictures). Fill in the three
- boxes, click on the appropriate language button (C or Asm only for now,
- sorry!), then click the "Make Header" button. Now, do a PASTE (this
- is always command-V). You should see your header appear in all it's
- glory. (If not, and you are using Think C, see below).
-
-
- Known bugs and quirks.
- ----------------------
-
- 1. none
-
- There is one thing- the handling of the desk scrap. Since an FKEY
- invocation doesn't trigger window activate/deactivate events, most
- applications don't write their private scrap to the desk scrap. MPW
- knows that the desk scrap changed when the FKEY exited, Think C sometimes
- doesn't (if you COPY'd, then ran the FKEY, you would not get your
- crafted header pasted in).
-
- To fix this, I added some code hinted at by Mike Livewright. If the
- TE scrap has something in it, copy it to the desk scrap on entry, and
- copy the desk scrap to the TE scrap on exit. This kinda bothers me, but
- it seems to work for Think C. Unfortunately, it doesn't work for the
- MPW editor. A little poking about with The Debugger (triggering on
- Scrap Manager traps) reveals that Think C uses the TE scrap (even though
- they have their "PE" replacement for TextEdit, it evidently shares some
- of the globals et al. But MPW is a more robust editor, and has entirely
- private data structures, ones I didn't feel like busting into. So if
- I get the MPW part working, I'll have to give up the TE scrap copy idea,
- or recognize which editor was active on FKEY invocation (ugg!).
-
- So, Think C should work just fine, but in order to IMPORT a scrap into
- the FKEY (which isn't supported yet anyway), you need to COPY, then
- change windows to force the private MPW scrap into the desk scrap.
- The copying via the desk scrap on exit from the FKEY seems to work just
- fine the way it is, however, and that's the important part (for now).
-
-
- Where am I going?
- -----------------
-
- Near-term future plans
-
- o Finish up Pascal support.
- o Add flourishes to C and Asm support.
- o Allow defaults to be "sticky" from invocation to invocation.
- o Allow defaults to be saved to disk.
- o Fix known bugs.
- o Add better help.
-
- Long-term plans
-
- o Add template parsing to add flexibility to comment generation.
- o Read scrap on FKEY start to generate defaults for fields.
- o Make "sets" for ease of generating multiple comment formats.
-
- Let me know how useful (or useless) this FKEY is. I am willing to
- entertain most reasonable requests for formats, languages and so forth.
- I wrote this for myself and a few others, and would like to widen the
- circle. Programming tools are so primitive! Let's get some better ones
- out there. (Not that this in itself should be construed as a "better one").
-
-
- Reporting bugs
- --------------
-
- I am releasing a preliminary version because
- 1) I think this is so neat that people need this know.
- 2) I'd like to find out about bugs.
-
- To reward bug reporting, I will give free registrations as follows
-
- 1. You are the first to report the bug. (I may have already fixed it!)
- 2. It has to be reproducible (ie I have to see it myself).
- 3. Not insignificant (cosmetic problems are not bugs, but I
- would like to hear about them).
-
- I will be fairly liberal with registrations. This policy will be in
- effect until further notice or until I go broke from free registrations.
-
-
- Shareware
- ---------
-
- Ah yes, that plea. You've heard it all before. Here are the terms - you
- can evaluate for 10 days (if you know if you need this after 10 days of
- evaluation, then trust me you probably do but just don't realize it).
- After that, please stop using, or register it.
-
- $5.00 You want to register it, and get on mailing list
- $10.00 You want to register, and also get the next 2 upgrades free.
- $20.00 Register, 2 upgrades, and source code.
-
- You can pay check or cash. If you are foreign, and have problems with
- check transfers (ie large bank charges), send me an e-mail or US mail and
- I might be able to work out a credit card transfer through a local computer
- store.
-
- If you got this package, there should be two files
-
- Header FKEY v1.0a7
- HeaderKey v1.0a7 readme
-
- If you are passing this on, you must distribute both files together.
- Please. As long as both files are passed together, put it anywhere you
- can.
-
-
- Where to write
- --------------
-
- Brian Fitzgerald
- 18942 Dallas Ave
- Riverside, CA 92508
- USA
-
- CompuServe: 72250,3226
- GEnie: HAL.LABS
- BIX: bfitz
- AppleLink: D0366
- Ma Bell: (714) 780-3328 only between 6PM and 12PM
-
- December 3rd, 1990
-
- ps - if you get this more than 1 year after the above date, don't assume that
- the address and phone number are still good. However, my electronic IDs will
- probably be good for longer than the life of the Macintosh.
-
-
-
- Change History
- --------------
-
- 12/03/90 1.0a7 Now show the scrap as it is being built. The user
- can hit cmd-U to update the display (rebuilding
- is slow right now, so this is not done automatically
- yet..). Fixed all known bugs. Second release.
- Added hooks for using tabs or spaces (could be an
- option later, but it was added for the clipboard
- display). Added kludge for Think C editor.
-
- 12/01/90 1.0a6 Reworked header forming code to take parameters.
- The "open/close" buttons are respected to slightly
- modify the formed header, and the margins are
- respected.
-
- 11/29/90 1.0a5 Added new dialog to customize spacing parameters.
- Set up for read/write of parameters to disk, but
- left for future implementation.
-
- 11/28/90 1.0a4 Changed it to use global variables (from A4) to
- make modularization easier (some routines need
- global variables). Moved constants and prototypes
- into header file. More fix to update problem.
-
- 11/26/90 1.0a3 Fixed updating problems. Also fix spaces in front
- of lines, and blank lines to form separators. Add
- tweaks so that we have a start/end char. Need to
- rework all this so it's cleaner. Added cut/copy/
- paste support to main dialog.
-
- 11/26/90 1.0a2 Added assembly language headers, changed to 72
- column lines. Fixed at 0/12/68/72, but need to
- add dialog so that users can edit this to their
- preferences. Lots of choices unfortunately.
-
- 11/25/90 1.0a1 First version. Choose between C, Asm, and Pascal
- Headers. Put header in system scrap for pasting into
- any editor. Only supports C, with fixes needed as
- indicated below.
-
- */