home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / ui_utils / inputvie.lzh / IHandler.doc < prev    next >
Text File  |  1992-02-01  |  3KB  |  70 lines

  1.  
  2.  
  3.                                 IHandler.c
  4.  
  5.                            (c) 1991 by Uwe Röhm
  6.  
  7.                               24. Mar 1991
  8.  
  9.  
  10. --- deutsch ---
  11. Bei der Durchforstung meiner Platte habe ich diese Routinen zur
  12. Programmierung eines Inputhandlers unter Kickstart 1.3 entdeckt:
  13.    IHandler.c  -  allgemeine Supportroutinen zum Verwalten eines
  14.                   Inputhandlers. Benötigt IHandler.h
  15.    IHandler.h  -  Prototypes und priv. Strukturen zu IHandler.c
  16.    IH-Test.c   -  Kurzes Testprogram für obrige Routinen.
  17.  
  18. Die Routinen aus IHandler.c übernehmen die vollständige Verwaltung
  19. (sprich: Starten und Beenden) eines Inputhandlers. Um möglichst frei
  20. von Seiteneffekten zu sein, benutze ich eine private Übergabestruktur,
  21. die von der Routine "InitIHandler()" initialisiert wird. Alle darin
  22. enthaltenen Felder bis auf does_control und WriteBuffer sind privat!
  23. Die beiden genannten Felder sollten je nach Aufgabenstellung und Inputhandler
  24. ausgetauscht/ergänzt werden, da sie dem eigentlichen Inputhandler als
  25. Parameter und Arbeitsvariablen dienen (vgl. Source).
  26.  
  27. Allgemeine Vorgehensweise:
  28.    Aufruf von InitIHandler()
  29.    Ausfüllen der Program-spezifischen Felder
  30.    Aufruf von LaunchIHandler()
  31.    Aufruf CatchIHandler()
  32.    Aufruf von CloseIHandler()
  33. Letzte Funktion gibt belegten Speicher wieder frei und schließt Resourcen.
  34. (siehe auch IH-Test.c).
  35.  
  36. Der im Source enthaltene Inputhandler ist nur ein sinnloses Beispiel,
  37. der frei verändert werden darf/muß/soll. Soweit getestet laufen die
  38. Routinen auch unter 2.0x, obwohl für und unter 1.3 programmiert.
  39.  
  40. --- english ---
  41. Searching on my harddisk I found the following support routines
  42. for easy use of an inputhandler:
  43.    IHandler.c  -  support functions for an own inputhandler. Needs IHandler.h
  44.    IHandler.h  -  prototypes and privat structure for IHandler.c
  45.    IH-Test.c   -  small test-program for the functions
  46.  
  47. With the included functions you can easy start und stop an own inputhandler
  48. without thinking off how to do so. Just program your handler, the rest
  49. will be done via the routines.
  50. To protect myself against double use of variables I use an own struct
  51. which is except of the fields does_control and WriteBuffer privat!
  52. The mentioned fields should be changed according to your special
  53. requirements because they are used as arguments for the inputhandler
  54. (see source-file).
  55.  
  56. How to use it:
  57.    Call InitIHandler()
  58.    <Fill your own fields>
  59.    Call LaunchIHandler()
  60.    Call CatchIHandler()
  61.    Call CloseIHandler()
  62. The last function CloseIHandler() frees private memory and resources
  63. (see also IH-Test.c).
  64.  
  65. The included inputhandler just is a silly example without any deeper
  66. meaning. You should program your own or just change this one. Be aware
  67. of the right function-name!
  68. I tested my code for kickstart 2.0x and it worked fine - which was
  69. a little bit surprising as I programed it for and under 1.3!
  70.