home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / ALERTDRV.ZIP / ENVIRON.H < prev    next >
C/C++ Source or Header  |  1994-01-25  |  10KB  |  223 lines

  1. #ifndef ENVIRON_H
  2. #define ENVIRON_H
  3.  
  4.  
  5.  
  6. /*------------------------------------------------------------------------------
  7.    Copyright           : (c)1994 by Logical Operators
  8.                          All Rights Reserved.
  9.    Filename            : Environ.H
  10.    Header File         : Environ.H
  11.    Purpose             : Header file which provides the environment-specific
  12.                          definitions needed to compile Logical Operators' class
  13.                          libraries. This file should be altered if the "root"
  14.                          base class of the programming environment's is renamed
  15.                          or if unique #defines are needed to compile the class
  16.                          library for a particular platform.
  17.    Compiler Directives : None
  18.  
  19.    Modifications       :
  20.    Version   Date    Programmer and Description of Changes
  21.    ------- --------  --------------------------------------------------------
  22.     1.00   01/25/94  Original version by Warren J. Hairston.
  23.    ---------------------------------------------------------------------------*/
  24.  
  25.  
  26.  
  27.    //Programmer-required defines
  28.    //---------------------------
  29.    /* Define the compilation environment and class library to be used. Defining
  30.       one of the valid entries may cause others to be automatically defined by
  31.       this header file. Valid entries:
  32.          BORLAND_CONTAIN = Borland Container Classes
  33.          BORLAND_OWL     = Borland ObjectWindows Library
  34.          BORLAND_TV      = Borland Turbo Vision
  35.          NOROOT          = No Root Class */
  36.    //-------------------------------------------------------------------------
  37.    #define NOROOT
  38.  
  39.    /* Define the target executable. Defining one of the valid entries may cause
  40.       others to be automatically defined by this header file. Not all valid
  41.       entries here are compatible with all entries for the compilation
  42.       environment (for example:  BORLAND_OWL is NOT compatible with TARGET_DOS).
  43.       Valid entries:
  44.          TARGET_DOS     = MS-DOS .EXE or .COM
  45.          TARGET_WINDOWS = MS-Windows .EXE or .DLL */
  46.    //--------------------------------------------------------------------------
  47.    #define TARGET_DOS
  48.  
  49.  
  50.  
  51.    //--------------------------------------------------------------------------
  52.    // PROGRAMMERS:  DON'T CHANGE ANYTHING BELOW THIS COMMENT!
  53.    //--------------------------------------------------------------------------
  54.  
  55.  
  56.  
  57.    //other required #defines
  58.    //-----------------------
  59.    #define ALERTDRIVER_VERSION 0x0100   //AlertDriver Class Library version
  60.  
  61.  
  62.  
  63.    /* Macros invoked for the compiler used to compile this library. Each
  64.       compiler (or compilation environment) should define the following:
  65.          1. #include any compiler-specific (non-ANSI) header files needed to
  66.             access the functions defined in the following steps.
  67.          2. #define macro GETCHE as the name of the function used to return a
  68.             single character from the keyboard. This function should preferably
  69.             return the character immediately after it is pressed and should
  70.             echo the character to the screen. This function is invoked when
  71.             processing certain user prompts. The function should accept no
  72.             parameters (void) and return an int. If your compiler does not
  73.             provide such a function, you may use the standard C function which
  74.         reads from stdin but buffers input (requires an ENTER keypress
  75.         before returning). */
  76.    //---------------------------------------------------------------------------
  77.    #ifndef TARGET_WINDOWS
  78.       #ifdef __BCPLUSPLUS__   //using a Borland C++ compiler
  79.          #include <conio.h>   //for getche() function prototype
  80.          #define GETCHE getche()   //gets single character w/echo from console
  81.       #elif (defined _MSC_VER)   //using a Microsoft C compiler
  82.          #if (_MSC_VER >= 700)   //using Microsoft C/C++ v7.00 or later
  83.         #include <conio.h>   //for getche() function prototype
  84.         #define GETCHE getche()   //gets single char w/echo from console
  85.          #endif   //_MSC_VER >= 700
  86.       #endif   //__BCPLUSPLUS__
  87.    #endif   //!TARGET_WINDOWS
  88.  
  89.    #ifndef GETCHE   //if GETCHE not previously defined
  90.       #include <stdio.h>   //for getchar() function prototype
  91.       #define GETCHE getchar()   //gets single character from stdin
  92.    #endif   //!GETCHE
  93.  
  94.  
  95.  
  96.    /* Macros invoked for compilation environment. Each compilation environment
  97.       should define the following:
  98.          1. Optionally #define any macros needed by compilation-environment
  99.             specific libraries and/or #include files.
  100.          2. Optionally #include all necessary header files for the compilation
  101.             environment, including the file which declares the base class for
  102.             the intended class hierarchy.
  103.          3. Optionally #define macro ROOTCLASS as the name of the class which
  104.             will be the root class for the intended class hierarchy. ROOTCLASS
  105.             should be able to be instantiated without parameters. If ROOTCLASS
  106.             is defined, then classes ReferenceCounter and AlertableObject will
  107.             be derived directly from ROOTCLASS; otherwise, those classes will
  108.             not have parent classes.
  109.          4. #define macro DEFAULT_ALERTDRIVER as the name of the specific
  110.             AlertDriver class to be instantiated as the default AlertDriver for
  111.             each object in the target environment. */
  112.    //---------------------------------------------------------------------------
  113.    #ifdef BORLAND_OWL   //compile for Borland's ObjectWindows Library
  114.       #ifndef TARGET_WINDOWS
  115.          #error "environ.h - Target Windows when compiling for OWL."
  116.       #endif   //TARGET_WINDOWS
  117.  
  118.       #define BORLAND_CONTAIN   //OWL uses Container Class's Object as root
  119.       #include <bwcc.h>   //Borland Windows Custom Controls header
  120.    #endif   //BORLAND_OWL
  121.  
  122.    #ifdef BORLAND_CONTAIN   //compile for Borland's Container Classes
  123.       #include <object.h>
  124.  
  125.       #define ROOTCLASS Object
  126.       #ifdef TARGET_WINDOWS
  127.          #define DEFAULT_ALERTDRIVER WindowsAlertDriver()
  128.       #else
  129.          #define DEFAULT_ALERTDRIVER StdAlertDriver()
  130.       #endif   //TARGET_WINDOWS
  131.    #endif   //BORLAND_CONTAIN
  132.  
  133.    #ifdef BORLAND_OWL
  134.       //change the default AlertDriver for OWL programs
  135.       #undef DEFAULT_ALERTDRIVER
  136.       #define DEFAULT_ALERTDRIVER BWCCAlertDriver()
  137.    #endif   //BORLAND_OWL
  138.  
  139.    #ifdef NOROOT   //compile w/o a common root class
  140.       #ifdef TARGET_WINDOWS
  141.          #define DEFAULT_ALERTDRIVER WindowsAlertDriver()
  142.       #else
  143.          #define DEFAULT_ALERTDRIVER StdAlertDriver()
  144.       #endif   //TARGET_WINDOWS
  145.    #endif   //NOROOT
  146.  
  147.    #ifdef BORLAND_TV   //compile for Borland's Turbo Vision
  148.       #ifndef TARGET_DOS
  149.          #error "environ.h - Target DOS when compiling for Turbo Vision."
  150.       #endif   //TARGET_DOS
  151.  
  152.       #define Uses_MsgBox
  153.       #define Uses_TButton
  154.       #define Uses_TDeskTop
  155.       #define Uses_TDialog
  156.       #define Uses_TProgram
  157.       #define Uses_TScreen
  158.       #define Uses_TStaticText
  159.       #include <tv.h>
  160.  
  161.       #define ROOTCLASS TObject
  162.       #define DEFAULT_ALERTDRIVER TurboVisionAlertDriver()
  163.    #endif   //BORLAND_TV
  164.  
  165.  
  166.  
  167.    //Ensure that all required compilation environment macros were defined
  168.    //--------------------------------------------------------------------
  169.    #ifndef DEFAULT_ALERTDRIVER
  170.       #error "environ.h - DEFAULT_ALERTDRIVER not defined."
  171.    #endif   //DEFAULT_ALERTDRIVER
  172.  
  173.  
  174.  
  175.    /* Macros invoked for target environment. Each target environment should
  176.       define the following:
  177.          1. Optionally #define any macros needed by target-environment specific
  178.             libraries and/or #include files.
  179.          2. Optionally #include all necessary header files for compilation of
  180.             the AlertDriver Class Library for the target environment.
  181.          3. #define macro ESC_CODE as the keycode representation of the ESC key
  182.             in the target environment. This keycode is examined to determine if
  183.             the user presses the ESC (or equivalent) key when responding to
  184.             certain prompts.
  185.          4. #define macro MAXTEXTSIZE as the length of the largest text string
  186.             to be output as an error, info, message, or warning alert. This size
  187.             should include the terminating zero-byte.
  188.          5. #define macro MAXTIMESTAMP as the length of the largest text string
  189.             to be used to hold the text representation of the current timestamp
  190.             returned by AlertDriver::GetTimeStamp(). This length should include
  191.             the terminating zero-byte. */
  192.    //---------------------------------------------------------------------------
  193.    #ifdef TARGET_WINDOWS   //target MS-Windows .EXE or .DLL files
  194.       #define TARGET_DOS   //Windows compilation has same requirements as DOS
  195.       #include <adwindll.h>   //AlertDriver for Windows DLL Header
  196.    #endif   //TARGET_WINDOWS
  197.  
  198.    #ifdef TARGET_DOS   //target MS-DOS .EXE or .COM files
  199.       #define ESC_CODE 27
  200.       #define MAXTEXTSIZE 256
  201.       #define MAXTIMESTAMP 50
  202.    #endif   //TARGET_DOS
  203.  
  204.  
  205.  
  206.    //Ensure that all required target environment macros were defined
  207.    //---------------------------------------------------------------
  208.    #ifndef ESC_CODE
  209.       #error "environ.h - ESC_CODE not defined."
  210.    #endif   //ESC_CODE
  211.  
  212.    #ifndef MAXTEXTSIZE
  213.       #error "environ.h - MAXTEXTSIZE not defined."
  214.    #endif   //MAXTEXTSIZE
  215.  
  216.    #ifndef MAXTIMESTAMP
  217.       #error "environ.h - MAXTIMESTAMP not defined."
  218.    #endif   //MAXTIMESTAMP
  219.  
  220.  
  221.  
  222. #endif //ENVIRON_H
  223.