home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / GETSCRN.EXE / SOURCE / CAPTURE.H < prev    next >
Text File  |  1990-06-24  |  5KB  |  160 lines

  1. /*
  2.  
  3.  
  4.  
  5.                                 CAPTURE.h
  6.  
  7.  
  8.         Copyright (c) 1990 by:  Arthur Kevin McGrath
  9.                                 Contract Engineers
  10.                                 P. O. Box 128
  11.                                 Barboursville, VA  22923
  12.  
  13.                                 703/832-7025
  14.  
  15.  
  16.   ALL RIGHTS ARE RESERVED.  You may not copy this program in any way
  17.   except to make back-up copies FOR YOUR OWN USE.  If you copy this
  18.   program for any reason without WRITTEN PERMISSION from the above
  19.   named copyright owner (except to make back-up copies FOR YOUR OWN USE),
  20.   you are breaking the Copyright Laws of the United States.  You will go
  21.   to jail for one year and pay a $50,000 fine.
  22.  
  23.  
  24.  
  25.  
  26. */
  27.  
  28. #define STACK_KILLER_QUEUE      ( "\\queues\\killstk$.$$$" )
  29. #define NO_QUEUE_SEMAPHORE          0L
  30. #define NEXT_QUEUE_MESSAGE      (  ( USHORT )0  )
  31.  
  32. #define THIS_THREAD_ONLY            0
  33.  
  34.  
  35. /*  The following are used by various STACK ALLOCATION functions.   */
  36. #define STACK_SIZE              20000
  37. #define STACK_KILLER_STACK       2000
  38. #define NOSHARE_NODISCARD           0
  39.  
  40. #define LONGEST_FILE_NAME      13
  41. #define LONGEST_PATH_NAME     256
  42.  
  43.  
  44. /*  For the DosOpen call.   */
  45. #define ARCHIVE             ( 1 << 5 )
  46.  
  47. /*  For our CAPTURE_FLAG in main()  */
  48. #define ALL_ASCII_CHARACTERS    FALSE
  49. #define PRINTABLE_ASCII_ONLY    ( !(FALSE)  )
  50.  
  51. /*  For the VioPopUp session.   */
  52. #define TRANSPARENT         2
  53. #define NON_TRANSPARENT     0
  54. #define WAIT_FOR_POP_UP     1
  55. #define NO_WAIT_FOR_POP_UP  0
  56.  
  57. #define GET_FILE_NAME   0xF000
  58. #define FAREWELL        0xF001
  59. #define MALLOC_ERROR    0xF002
  60. #define RESULTS         0xF003
  61.  
  62. #define DEFAULT_SCREEN_HANDLE   0
  63. #define RESERVED                0
  64.  
  65. /*  VioPopUp session colors.    */
  66. #define BLACK   0
  67. #define BLUE    1
  68. #define GREEN   2
  69. #define CYAN    3
  70. #define RED     4
  71. #define MAGENTA 5
  72. #define BROWN   6
  73. #define GREY    7
  74.  
  75. #define BRIGHT  8
  76. #define BACKGROUND(x)     (     ( x << 4 )      )
  77.  
  78. #define POPUP_BACKGROUND_COLOR      ( BACKGROUND( GREEN ) | BRIGHT | GREY  )
  79. #define NORMAL_TEXT_COLOR           ( BACKGROUND( GREEN ) | BRIGHT | GREY  )
  80. #define HILITE_TEXT_COLOR           ( BACKGROUND( GREEN ) | BRIGHT | BROWN )
  81. #define ERROR_TEXT_COLOR            ( BACKGROUND(  RED  ) | BRIGHT | BROWN )
  82.  
  83. /*  Text for various pop up sessions.   */
  84. #define FAREWELL_STRING    (  " has ended." )
  85. #define RESULTS_1          (  "The screen capture attempt was " )
  86. #define RESULTS_SUCCESS    (  "SUCCESSFUL!!!"  )
  87. #define RESULTS_FAILURE    (  "UNSUCCESSFUL."  )
  88. #define ERROR_INTRO         (  "The error was"  )
  89. #define DEFAULT_FILE_NAME   ( default_file_name )
  90.  
  91. #define MIN(x,y)    (   ( x<y ) ?  x : y )
  92.  
  93.  
  94. struct screen_text
  95. {
  96.     char            letter;
  97.     unsigned char   attribute;
  98.  
  99. };
  100.  
  101.  
  102. /*      The following structure will be passed through a queue
  103.         to tell one thread when it is safe to blow away another
  104.         thread's stack.         */
  105. struct stack_selector
  106. {
  107.         TID     id;
  108.         SEL     stack;
  109.  
  110. };
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118. /*       Function prototypes.    */
  119. USHORT  center_the_line( USHORT left, USHORT right, USHORT string_length );
  120.  
  121. void    get_string( char *default_data, char *string,
  122.                     USHORT size,
  123.                     USHORT row,
  124.                     USHORT column,
  125.                     USHORT width,
  126.                     HKBD keyboard       );
  127.  
  128. void    get_file_name(  USHORT  left,
  129.                     USHORT right,
  130.                     USHORT top,
  131.                     char   *file_name  );
  132.  
  133. void    results(    USHORT   left,
  134.                     USHORT   right,
  135.                     USHORT   top,
  136.                     unsigned failure );
  137.  
  138. void    farewell(   USHORT   left,
  139.                     USHORT   right,
  140.                     USHORT   top     );
  141.  
  142. int     pop_up( enum popup_type type, char *file_name, unsigned failure );
  143.  
  144. int monitor_the_keyboard( void );
  145.  
  146. SEL       stack_segment( void );
  147.  
  148.  
  149. /*  The following are functions that are called in place ot
  150.     the standard C runtime functions from threads other than
  151.     thread one.     */
  152. void    thread_copy( char *destination, char *source );
  153. void    thread_cat( char *destination, char *source );
  154. int     thread_strlen( char *string );
  155. void    mark_stack(  char *stack, unsigned length   );
  156.  
  157. /*      Thread prototypes.      */
  158. PFNTHREAD       capture_the_screen( void );
  159. PFNTHREAD       free_the_stack( void );
  160.