home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 199.lha / GimmeLib / GIMMELIB.DOC < prev    next >
Text File  |  1988-12-27  |  8KB  |  161 lines

  1.  
  2. GIMMELIB.DOC        gimme.lib        Jan Sven Trabandt
  3.             V1.2   31-Oct-88        {utgpu,utzoo,lsuc}!oscvax!jan
  4.  
  5. gimme.lib V1.2 (C)CopyRight 1988, Jan Sven Trabandt. All Rights Reserved.
  6. This software may not be distributed for profit; in other words, it is
  7. freely redistributable except that it may not be incorporated as part of any
  8. commercial software package without my express written consent.
  9.  
  10. What is this thing??
  11. Gimme.lib is a general purpose library of handy-dandy flexible support routines
  12. that allow dynamic creation of intuition structures such as windows, gadgets
  13. and screens (including double-buffering and dual playfields), quick and easy
  14. use of the timer.device, spawning subtasks, simple IFF ILBM and 8SVX routines,
  15. memory chaining and more...
  16. There are currently over 100 functions.
  17. The source to the library may be instructional in demonstrating how some aspects
  18. of the Amiga are used (especially Intuition structures).
  19.  
  20. The include files should be located in the gimmelib subdirectory of your normal
  21. include directory.
  22. The functions are prototyped in gimmelib/gimmefuncs.h for quick reference and
  23. correct use of the functions.
  24. Documentation (similar to "man" pages) for each function is catenated together
  25. in the DOCS file, grouped by source file; to find a function in it, search for
  26. the function name catenated with an opening bracket, such as "gimmeBitMap(",
  27. to find either the function's synopsis line or the start of the actual function
  28. [this is useful since the function name "gimmeBitMap" can be referenced in many
  29. places in the DOCS file].
  30.  
  31. Some general notes regarding gimme.lib:
  32.  
  33. 0 - This library was made using Manx C V3.6a,
  34.     and should work with Lattice with little or no modification (hopefully).
  35.     Using a pre-compiled include file is highly recommended.
  36.  
  37. 1 - Gimme.lib is almost entirely reentrant, with the following known exceptions:
  38.     dbufvquick.c :    makeDBufVQuick(), unmakeDBufVQuick(), swapDBufVQuick()
  39.         These routines manipulate copper lists for maximum speed
  40.         using global copper list variables.
  41.     requester.c  :    gimmeAutoRequest()
  42.         This routine has default text for the yes/no gadgets which can be
  43.         altered via global variables; if these are not changed, then the
  44.         routine is re-entrant.
  45.     stdstuff.c   :    gimmeStdStuff(), getRidOfStdStuff()
  46.         These routines are primarily for a mainline and are not reentrant
  47.         for multiple subtasks.
  48.  
  49. 2 - Gimme.lib routines do not write to a CLI window or stdout, so they can be
  50.     safely used from subtasks that have no output file associated with them.
  51.     Known exception: gimmePicture() and gimmeSound(), which test Output()
  52.     before doing a Write() in the case of an error.
  53.  
  54. 3 - Gimme.lib routine names follow this naming convention:
  55.     start with a lower-case letter
  56.     each distinct "word" in the name starts with an upper-case letter,
  57.         except for the first "word"
  58.     underscores (_) are not used
  59.     examples:   gimmeStringGadget, getRidOfScreen
  60.     also, global variables start with "gim" and follow the same conventions
  61.         as routine names.
  62.     Exception: communic.c, where the routine names begin with c_
  63.     for example: c_getc(), c_open().
  64.  
  65. 4 - Gimme.lib routines which return a short generally return non-zero on error,
  66.     sometimes returning different non-zero values as different error codes.
  67.  
  68. 5 - Gimme.lib routines almost always take SHORTs instead of LONGs, with these
  69.     known notable exceptions:
  70.     flags, which are ULONGs
  71.     size parameters passed to gimmeMessage(), chainAllocMem() and
  72.         gimmeSubTask
  73.     unit parameter to the time functions, as well as the (micro) second
  74.         parameters to timeDelay() and timeDelayAsync()
  75.     "num" pararameter in positionText()
  76.     However, if you use 32-bit ints, you shouldn't have to typecast to a short
  77.     as the short would be promoted to an int anyways.
  78.  
  79. 6 - Specialized flags for gimme.lib routines are usually of the form
  80.     GIM_YYY or GXX_YYY where XX denotes a 2-letter shortform for a routine
  81.     name and YYY denotes the particular flag. For example:
  82.     GIM_MINTERM_COPY    - general purpose copy minterm
  83.     GPT_XCENTRE        - x-centre flag for gimmePositionText(), hence GPT
  84.  
  85. 7 - Most of the gimmeXXX() routines have a corresponding getRidOfXXX() routine
  86.     to undo the effect or deallocate memory resulting from the former routine.
  87.     If no such getRidOfXXX() routine exists, then most likely the effects of
  88.     the gimmeXXX() will be undone by another routine which you may have to call
  89.     yourself -- this is most evident in the case of memory chaining.
  90.     For example, gimmeImage() chains its memory to a given memory-chain, which
  91.     you must free with chainFreeMem() at some point, or if you linked the image
  92.     memory into a gadget, then getRidOfGadget() will free the image memory along
  93.     with the rest of the gadget's memory.
  94.  
  95. 8 - The gimme.lib routines do NOT, in general, check for NULL pointers in
  96.     parameters before using them, unless the docs specifically say that NULL
  97.     can be used as a default. However, gimme.lib can be recompiled using the
  98.     GIMME_WIMPY option which will check with brute-force that pointers are
  99.     non-NULL before using them.
  100.     Important exceptions: memchain.c routines always check because it is so
  101.     important, and menu.c routines check to make user coding easier.
  102.  
  103. 9 - Since several routines are grouped together in modules, your program may
  104.     link in more routines than it needs, so don't count on having the absolute
  105.     smallest code possible when using gimme.lib routines...
  106.     it's the price you pay for quick prototyping capabilities.
  107.  
  108. 10- There are different versions of gimme.lib for different options:
  109.     gimme.lib    - 16-bit int, small code/data
  110.     gimme32.lib    - 32-bit int, small code/data
  111.     NOTE: all the code was written for safe 16-bit use (and hence 32-bit too).
  112.     You should be able to recompile it using large code options as well.
  113.  
  114. 11- NO floating-point operations of any kind are used.
  115.     malloc() and free() are NOT used.
  116.     NO "int"s are used.
  117.  
  118. 12- Many of the routines use my memory-chaining routines [chainAllocMem(),
  119.     chainFreeMem(), etc.]. You may wish to look at them carefully.
  120.     In particular, some routines such as for gadgets and windows use the
  121.     existing structure's UserData field for its own use -- for gadgets,
  122.     it is a memory-chain pointer which includes the gadget's structure itself.
  123.  
  124.  
  125.  
  126. Major Changes (in reverse chronological order)
  127.  
  128. V1.2    31-Oct-88
  129. -----------------
  130.     1    gadget.c: addGadgets() and removeGadgets() removed due to duplication
  131.             of existing RKM1.2 functions AddGList() and RemoveGList().
  132.           clearGadgets(): order of parameters changed to more closely
  133.             resemble RefreshGadgets(), ie. gadget first, then window.
  134.     2    font.c: gimmeFontQuick() added.
  135.     3    graph.c: new routines for graphing added.
  136.     4    inputhand.c: new routines to add/remove an input handler added.
  137.     5    menu.c, menustuff.c: new routines for menus
  138.     6    copystuff.c: new routines plus some moved from intuistuff.c,
  139.               to copy intuition-type structure lists.
  140.     7    communic.c: new routines for serial port
  141.  
  142.  
  143. V1.1    30-Sep-88
  144. -----------------
  145.     1    font.c: gimmeFont now alters the TextAttr to reflect the actual
  146.             characteristics of the font found.
  147.     2    gadget.c: gadget routines enhanced and some split to gadgstuff.c
  148.           getRidOfGadget() renamed to getRidOfGadgets()
  149.           clearGadget() renamed to clearGadgets()
  150.           added removeGadgets().
  151.     3    postext.c: changed "num" parm in positionText() to a LONG,
  152.             vertical text option added.
  153.     4    stdstuff.c: new routines for opening/closing standard libraries
  154.             and devices added.
  155.  
  156.  
  157. V1.0    31-Aug-88
  158. -----------------
  159.     1    first reasonable release version
  160.  
  161.