home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / harbb30i.zip / DOC / gtapi.txt < prev    next >
Text File  |  1999-05-27  |  4KB  |  103 lines

  1. Message: 18   Date: Fri, 14 May 1999 20:14:57 -0600
  2.    From: "Bil Simser" <bsimser@xxxx.xxxx
  3. Subject: gt API for DOS, Windows and OS/2
  4.  
  5. I'm finally done and none the sooner. Attached you'll find my
  6. implementation of the gt API functions for Harbour.
  7.  
  8. gt API functions
  9. ----------------
  10. Using the gt API requires two steps.
  11. The gt API interface is kept in gtapi.c. This houses the gt API and
  12. does not have any platform or compiler specific information. This file
  13. should (read:will) never change except to add new _gt functions. This
  14. file will be used by Harbour or Harbour functions and must be linked
  15. into the RTL.
  16.  
  17. The second step requires you to link in your platform specific
  18. implementation of the _gt functions. These are functions named with
  19. gtxxxxxx convention and are called by the _gt functions in gtapi.c.
  20. I've provided the following files to implement the console functions:
  21.  
  22. gtdos.c - DOS implemenation
  23. gtwin.c - Windows 95/NT implementation
  24. gtos2.c - OS/2 implementation
  25. gtxxx.c - Generic template for implementation
  26.  
  27. If you wish to port the gt functions to another platform, just take the
  28. gtxxx.c and populate it with calls to your OSes functions. Call the file
  29. something appropriate (gtmac.c, gtnext.c or whatever) and add it to
  30. that platforms makefile.
  31.  
  32. The API supports a dozen or so compilers on three platforms. You only
  33. have to change the gtxxx.c files to implement your platform.
  34.  
  35. The API needs to be initialized for Windows to setup the Input and Output
  36. handles. These are done in _gtInit() and should always be called. Not sure
  37. how this will be implemented (if at all) into Harbour but it needs to happen
  38. or else you won't see any output under Windows.
  39.  
  40. There's a test section at the end of gtapi.c. I didn't want to keep
  41. rebuilding
  42.  
  43. Harbour to build a PRG test and PRGs shouldn't call the _gt functions
  44. directly anyway. Just compile gtapi.c alone with a #define of TEST to see
  45. the output (or build a PRG test if you want).
  46.  
  47. You must include gtapi.c and one of the platform implementation files
  48. to compile sucessfully!
  49.  
  50. There are exceptions for various compilers in the platform implementation
  51. files so if you're using a compiler that doesn't support certain routines
  52. or syntax just stick in your changes and surround it with an
  53. #if defined(__XXX__) call.
  54.  
  55. This is a complete set of gt functions as defined by Clipper. That is
  56. there are no new _gt functions added. But this is not a complete
  57. implementation. I do not know what _gtBegin or _gtEnd will do for
  58. instance. Yes, they buffer the display but what does that really mean
  59. under the covers? Perhaps someone needs to implement a screen buffer
  60. to write to in order to achive this but the issue that immediately comes
  61. to mind is how to initialize the size of this buffer?
  62.  
  63. The files are attached but I will NOT be checking them into cvs for the
  64. following reasons:
  65.  
  66. 1. There is already a gtapi.c file and under no circumstances will I ever
  67. overwrite someones code. If the author wants to remove his file and check
  68. this in then be my guest.
  69.  
  70. 2. This is my vision of how "I" think the gt API should be implemented.
  71. Perhaps it isn't Antonio's or anyone elses so review it and if you feel
  72. that it deserves being put into Harbour I'll leave that up to you.
  73.  
  74. TODO:
  75. The following functions are not implemented in gtapi.c:
  76. _gtPostExt
  77. _gtPreExt
  78. _gtScroll
  79. _gtSetBlink
  80. _gtSetMode
  81.  
  82. The following functions don't work in gtapi.c:
  83. _gtSave
  84. _gtRestore
  85.  
  86. You get garbage on the screen in DOS mode. Two Harbour functions are
  87. included in the gtapi.c file, ROW() and COL() to get started.
  88.  
  89. You also may notice that I didn't include any NanFor document headers or
  90. even any cvs macros. The jury is still out on that so I'll leave that to the
  91. reader.
  92.  
  93. I release this to anyone who wants it. If you feel you don't like the
  94. implementation and want to pursue a different approach, please do.
  95. By not checking this in I'm not forcing anyone to use it.
  96. If however you do feel it's a good start
  97. (or a better start than what we have)
  98. the please check it in and start writing those other terminal functions
  99. (DEVPOS, etc.)
  100.  
  101. By: Bil
  102.  
  103.