home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / TOOLKIT / MM / CLOCK / CLOCK.H < prev    next >
Text File  |  1994-11-17  |  8KB  |  201 lines

  1. /*************************************************************************
  2.  * File Name   : CLOCK.H
  3.  *
  4.  * Description : This file contains the definitions used by the clock
  5.  *               sample program.
  6.  *
  7.  * Concepts    : See this sample program's C source file.
  8.  *
  9.  * MMPM/2 API's: None.
  10.  *
  11.  * Required
  12.  *    Files    : See this sample program's C source file.
  13.  *
  14.  *
  15.  * Copyright (C) IBM 1991, 1992, 1993
  16.  *************************************************************************/
  17.  
  18. /*
  19.  * Resource specific definitions.
  20.  */
  21. #define ID_CLOCK_DIALOG_BOX                                     1000
  22. #define ID_ICON                                                 1000
  23. #define ID_PLAY_CHIME_PB                                        1100
  24. #define ID_CANCEL_PB                                            1200
  25. #define ID_HELP_PB                                              1300
  26. #define ID_CLOCK_HELPTABLE                                      1350
  27.  
  28. #define ID_CENTER_BELL                                          1050
  29. #define ID_LEFT_BELL                                            1051
  30. #define ID_RIGHT_BELL                                           1052
  31. #define ID_FAR_RIGHT_BELL                                       1053
  32. #define ID_FAR_LEFT_BELL                                        1054
  33.  
  34. /*
  35.  * Bell and Chime specific definitions.
  36.  */
  37. #define NUMBER_OF_BELLS_IN_A_SWING                              8
  38. #define NUMBER_OF_BELL_BITMAPS                                  5
  39. #define NUMBER_OF_CHIME_FILES                                   3
  40.  
  41. #define NUMBER_OF_AUDIO_CHIMES                                  3
  42. #define NUMBER_OF_COMMANDS                                      10
  43.  
  44. #define CHIME_PLAYING_HAS_STOPPED                               99
  45.  
  46. #define FILE_NAME_SIZE                                          81
  47.  
  48. /*
  49.  * Index into the array that has the handles to the bitmaps.
  50.  */
  51. #define IX_CENTER_BELL                                          0
  52. #define IX_LEFT_BELL                                            1
  53. #define IX_RIGHT_BELL                                           2
  54. #define IX_FAR_RIGHT_BELL                                       3
  55. #define IX_FAR_LEFT_BELL                                        4
  56.  
  57. #define BELL_BITMAP_X_SIZE                                      64
  58. #define BELL_BITMAP_Y_SIZE                                      64
  59.  
  60. #define PAUSE_BETWEEN_BITMAPS                                   500
  61.  
  62. /*
  63.  * Program specific definitions
  64.  */
  65. #define SIZE_OF_CIRCLE                                          350
  66. #define CLOCK_TIMER_ID                                          1
  67. #define CLOCK_TIMER_TIMEOUT                                     2000
  68.  
  69. #define NUMBER_OF_MINUTE_MARKERS                                60
  70. #define NUMBER_OF_DEGREES_IN_A_CIRCLE                           360
  71.  
  72. #define NUMBER_OF_HOUR_HAND_POINTS                              5
  73. #define NUMBER_OF_MINUTE_HAND_POINTS                            5
  74.  
  75. #define HOUR_HAND_INDEX                                         5
  76. #define HOUR_HAND_MULTIPLIER                                    (50/100)
  77. #define MINUTE_HAND_MULTIPLIER                                  (85/100)
  78.  
  79. #define CLOCK_HAND_COLOR                                        CLR_RED
  80. #define HAND_DOT                                                2
  81.  
  82. #define NO_ALLOC_ERROR                                          0
  83.  
  84. /*
  85.  * These defines are used in placeing the time markers for the clock
  86.  * face as well as drawing the clock hands.
  87.  */
  88. #define MARKER_POSITION_FROM_CENTER ( (LONG) (SIZE_OF_CIRCLE - 55) / 2)
  89. #define PIE                                                    3.141592654
  90. #define CONVERT_RADIAN_TO_DEGREES    ((double) (PIE / (double) 180))
  91.  
  92.  
  93. /*
  94.  * Pushbutton Sizes and Positions
  95.  */
  96. #define X_PLAY_CHIME_POSITION                                   5
  97. #define Y_PLAY_CHIME_POSITION                                   2
  98.  
  99. #define X_CANCEL_POSITION                                       70
  100. #define Y_CANCEL_POSITION                                       2
  101.  
  102. #define X_HELP_POSITION                                         135
  103. #define Y_HELP_POSITION                                         2
  104.  
  105. #define X_BITMAP_POSITION                                       325
  106. #define Y_BITMAP_POSITION                                       10
  107.  
  108. #define Y_SIZE_OF_THE_BUTTONS                                   12
  109. #define X_SIZE_OF_THE_BUTTONS                                   60
  110.  
  111. #define Y_ADJUSTMENT_SIZE_OF_BUTTONS    Y_SIZE_OF_THE_BUTTONS + 25
  112.  
  113. /* Positioning of the dialog window */
  114. #define X_CLOCK_DIALOG_POSTION                                  10
  115. #define Y_CLOCK_DIALOG_POSTION                                  10
  116. #define X_SIZE_FOR_THE_CLOCK_DIALOG                             270
  117. #define Y_SIZE_FOR_THE_CLOCK_DIALOG                             175
  118.  
  119. #define THREAD_STACK_SIZE                                       4096
  120.  
  121. #define MCI_ERROR_STRING_LENGTH                                 128
  122. #define STRING_SIZE                                             351
  123.  
  124. #define CHIME_HOUR_FILE                                         0
  125. #define CHIME_QUARTERS_FILE                                     1
  126. #define CHIME_HALF_HOUR_FILE                                    2
  127.  
  128. #define ID_MESSAGE_BOX                                          1
  129. #define SUBTABLE_MESSAGEBOX                                     2
  130.  
  131.  
  132. /*
  133.  * String defines for the string table.
  134.  */
  135. #define IDS_MAIN_WINDOW_TITLE                                   1
  136. #define IDS_HELP_CREATION_ERROR                                 2
  137. #define IDS_HELP_LIBRARY_FILE                                   3
  138. #define IDS_HELP_WINDOW_TITLE                                   4
  139. #define IDS_NORMAL_ERROR_MESSAGE_BOX_TEXT                       5
  140. #define IDS_SWING_THREAD_NOT_STARTED                            6
  141. #define IDS_CHIME_FILE_A                                        7
  142. #define IDS_CHIME_FILE_B                                        8
  143. #define IDS_CHIME_FILE_C                                        9
  144.  
  145. #define NUMBER_OF_PROGRAM_STRINGS                               9
  146.  
  147. #define IDS_CANNOT_GET_MEMORY                                   10
  148. #define IDS_CHIME_FILE_ERROR                                    11
  149. #define IDS_FAILED_MMIO_CLOSE                                   12
  150. #define IDS_CANNOT_PLAY_CHIME                                   13
  151.  
  152. /*
  153.  * MMPM/2 Playlist defines
  154.  */
  155. #define DATA_OPERATION                                          0
  156. #define BRANCH_OPERATION                                        1
  157. #define LOOP_OPERATION                                          2
  158. #define CALL_OPERATION                                          3
  159. #define RETURN_OPERATION                                        4
  160. #define EXIT_OPERATION                                          5
  161. #define NOP_OPERATION                                           6
  162. #define MESSAGE_OPERATION                                       7
  163. #define CUEPOINT_OPERATION                                      8
  164.  
  165. #define QUARTERS_PLAYLIST                                       0
  166. #define HALF_HOUR_PLAYLIST                                      1
  167. #define THREE_QUARTERS_PLAYLIST                                 2
  168. #define HOUR_PLAYLIST                                           3
  169.  
  170. #define LOOP_LINE                                               4
  171. #define NUMBER_OF_PLAYLISTS                                     4
  172.  
  173.  
  174. /*
  175.  * Program specific Typedefs
  176.  */
  177. typedef enum
  178. {
  179.    STOP,
  180.    GO,
  181.    READY
  182. } STOP_GO_READY_T;
  183.  
  184. typedef enum
  185. {
  186.    NONE,
  187.    HOUR,
  188.    HALF_HOUR,
  189.    QUARTER_HOUR,
  190.    THREE_QUARTER_HOUR
  191.  
  192. } CHIME_TIME_VALUE_T;
  193.  
  194. typedef struct pls
  195. {
  196.    ULONG ulCommand;
  197.    ULONG ulOperandOne;
  198.    ULONG ulOperandTwo;
  199.    ULONG ulOperandThree;
  200. } PLAY_LIST_STRUCTURE_T;
  201.