home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / IDEHOOK.PAK / IDEHOOKT.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  4KB  |  208 lines

  1. //----------------------------------------------------------------------------
  2. // IdeHook - (C) Copyright 1994 by Borland International
  3. //----------------------------------------------------------------------------
  4. #ifndef __IDEHOOKT_H
  5. #define __IDEHOOKT_H
  6.  
  7. #ifndef __STDDEF_H
  8. #  include <stddef.h>
  9. #endif
  10.  
  11.  
  12. //  Some generic defines and types
  13.  
  14. #ifndef _UNIQUE_COOKIE
  15. #  define _UNIQUE_COOKIE(name)    typedef const struct name##__ _near* name
  16. #  define _UNIQUE_COOKIE32(name)  typedef const struct name##__ _far* name
  17. #endif
  18.  
  19. #define _HOOKCLASS _huge
  20. #define _HOOKEP       _pascal _loadds
  21.  
  22.  
  23. //  Tool enums and helper structs
  24.  
  25. _UNIQUE_COOKIE32( ToolObj );         // ToolObj is not persistent
  26. _UNIQUE_COOKIE32( ToolLaunchId );
  27. _UNIQUE_COOKIE32( ProjectNode );     // ProjectNode is persistent
  28.  
  29. #define DEFAULT_LAUNCH_ID  ToolLaunchId(0)
  30. #define CALLBACK_LAUNCH_ID ToolLaunchId(-1)
  31.  
  32. enum ToolTypes
  33. {
  34.     Transfer = -4,
  35.     Viewer,
  36.     Translator,
  37. };
  38.  
  39. enum ToolFlags
  40. {
  41.     TargetTranslator = 0x0001,
  42.     OnLocalMenu      = 0x1000,
  43.     OnToolsMenu      = 0x2000,
  44. };
  45.  
  46. struct ToolInfo
  47. {
  48.     ToolTypes        toolType;
  49.     const char *     name;
  50.     const char *     path;
  51.     ToolFlags        flags;
  52.     const char *     menuName;
  53.     const char *     helpHint;
  54.     const char *     defCmdLine;
  55.     union {
  56.         const char *appliesTo;
  57.         const char *translateFrom;
  58.         };
  59.     const char *    defaultFor;
  60.     const char *    translateTo;
  61.     ToolLaunchId    launchId;
  62. };
  63.     
  64. enum ToolReturn 
  65. {
  66.      NotHandled = -1,
  67.      Success, 
  68.      Warnings, 
  69.      Errors, 
  70.      FatalError 
  71. };
  72.  
  73. class _HOOKCLASS ToolClient;
  74.  
  75. struct ToolInvokeArgs
  76. {
  77.     const char * cmdLine;
  78.     ProjectNode *nodeArray;
  79.     int          numNodes;
  80. };
  81.  
  82. typedef ToolReturn _HOOKEP 
  83.                 (ToolClient::*ToolMethod)( ToolInvokeArgs * );
  84.  
  85. struct ToolRegisterPack
  86. {
  87.     const char *      toolName;
  88.     ToolMethod          toolMethod;
  89.     unsigned long     resv1;
  90. };
  91.  
  92.  
  93. //  Project helper types
  94.  
  95. struct ProjectNodeInfo
  96. {
  97.     const char *    name;
  98.     const char *    nodeType;
  99.     const char *    description;
  100.     const char *    inputLocation;
  101.     const char *    outputLocation;
  102.     ProjectNode     parent;
  103.     ProjectNode     firstChild;
  104.     ProjectNode     nextSibling;
  105. };
  106.  
  107. //  Option set ids
  108.  
  109. enum OptionsStringIds
  110. {
  111.     OID_null,
  112.     OID_RemoveAll = OID_null,
  113.     OID_Include,
  114.     OID_Library,
  115.     OID_Source,
  116.     OID_Intermediate,
  117.     OID_Final,
  118.     OID_Defines,
  119.     OID_CmdlineOverride,
  120.  
  121.     OID_Invalid
  122. };
  123.  
  124.  
  125. //  Target expert types
  126.  
  127. enum TargetPlatforms
  128. {
  129.     Win16       =     0x0001,
  130.     Win32       =     0x0002,
  131.     Dos16       =     0x0008,
  132.     DosOverlay  =     0x0010,
  133. };
  134.  
  135. enum TargetStdLibs
  136. {
  137.     Framework = 0x0001,
  138.     RTL       = 0x0004,
  139.     BIDS      = 0x0002,
  140.     OWL       = Framework,
  141.     BWCC      = 0x0008,
  142.     BGI       = BWCC,
  143.  
  144.     FloatingMath    = 0x0010,
  145.     FloatingEmu     = 0x0020,
  146.     FloatingStartup = 0x0040,
  147.  
  148.     Static          = 0x0100,
  149.     Dynamic         = 0x0200,
  150.  
  151.     MultiThread     = 0x2000,
  152.  
  153.     Diagnostic      = 0x8000,
  154. };
  155.  
  156. enum TargetModel
  157. {
  158.     Tiny     = 0x01,
  159.     Small    = 0x02,
  160.     Medium   = 0x04,
  161.     Compact  = 0x08,
  162.     Large    = 0x10,
  163.     Huge     = 0x20,
  164.  
  165.     GUI      = 0x0100,
  166.     Console  = 0x0200
  167. };
  168.  
  169.  
  170. //  Make stuff
  171.  
  172. enum MakeMode
  173. {
  174.     Make,
  175.     Build,
  176.     Translate
  177. };
  178.  
  179. //  Editor stuff
  180.  
  181. _UNIQUE_COOKIE32( BufferId );
  182. _UNIQUE_COOKIE32( ViewId   );
  183.  
  184. struct KeyStroke;
  185.  
  186. typedef int (*KeyHitHandler)(KeyStroke *);
  187.  
  188. enum KeyModifier
  189. {
  190.    NoModifier,
  191.    Shift   = 0x0001,
  192.    Control = 0x0002,
  193.    Alt     = 0x0004
  194. };
  195.  
  196. struct KeyStroke
  197. {
  198.     unsigned short  msg;
  199.     unsigned short  key;
  200.     KeyModifier     modifier;
  201.     KeyHitHandler   handler;
  202. };
  203.  
  204. #endif  __IDEHOOKT_H
  205.  
  206. // End of file
  207.  
  208.