home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pentlk11.zip / WRTSAMPL.H < prev    next >
Text File  |  1994-01-13  |  11KB  |  251 lines

  1. /******************************************************************************/
  2. /*                                                                            */
  3. /* File Name   : WRTSAMPLE.H                                                  */
  4. /*                                                                            */
  5. /* Description : Example Pen for OS/2 Aware Application                       */
  6. /*                                                                            */
  7. /*                                                                            */
  8. /* Copyright (C) 1993 IBM Corporation                                         */
  9. /*                                                                            */
  10. /*     DISCLAIMER OF WARRANTIES.  The following [enclosed] code is            */
  11. /*     sample code created by IBM Corporation. This sample code is not        */
  12. /*     part of any standard or IBM product and is provided to you solely      */
  13. /*     for  the purpose of assisting you in the development of your           */
  14. /*     applications.  The code is provided "AS IS", without                   */
  15. /*     warranty of any kind.  IBM shall not be liable for any damages         */
  16. /*     arising out of your use of the sample code, even if they have bee      */
  17. /*     advised of the possibility of such damages.                            */
  18. /*                                                                            */
  19. /******************************************************************************/
  20.  
  21.  
  22. #define IDD_BCDLG     2500
  23. #define IDD_LCDLG     2501
  24. #define IDD_SCDLG     2502
  25. #define IDD_DCDLG     2503
  26. #define IDD_SVDLG     2504
  27. #define IDD_SSDLG     2505
  28. #define IDD_WSDLG     2506
  29. #define IDD_RSDLG     2507
  30. #define IDD_EIDLG     2508
  31. #define IDD_QVDLG     2509
  32. #define IDD_DNDLG     2510
  33. #define IDD_SNDLG     2511
  34. #define ID_PTL_ARRAY  2512
  35. #define PTR_BLOB      2513                 /* ID of BLOB pointer     */
  36. #define wrtelc01      2514
  37. #define wrtelc02      2515
  38. #define wrtelc03      2516
  39. #define wrtelc04      2517
  40. #define wrtelc05      2518
  41. #define wrtelc06      2519
  42. #define wrtelc07      2520
  43. #define wrtelc08      2521
  44. #define wrtelc09      2522
  45. #define wrtelc10      2523
  46. #define wrtelc11      2524
  47. #define wrtelc12      2525
  48. #define wrtelc13      2526
  49. #define wrtelc14      2527
  50. #define wrtelc15      2528
  51. #define wrtelc16      2529
  52. #define wrtelc17      2530
  53. #define wrtelc18      2531
  54. #define wrtelc19      2532
  55. #define wrtelc20      2533
  56. #define wrtelc21      2534
  57. #define wrtelc22      2535
  58. #define wrtelc23      2536
  59. #define wrtelc24      2537
  60. #define wrtelc25      2606
  61. #define wrtlc01       2538
  62. #define wrtlc02       2539
  63. #define wrtlc03       2540
  64. #define wrtlc04       2541
  65. #define wrtlc05       2542
  66. #define wrtlc06       2543
  67. #define wrtlc07       2544
  68. #define wrtlc08       2545
  69. #define wrtlc09       2546
  70. #define wrtlc10       2547
  71. #define wrtlc11       2548
  72. #define wrtlc12       2549
  73. #define wrtlc13       2550
  74. #define wrtlc14       2551
  75. #define wrtlc15       2552
  76. #define wrtlc16       2553
  77. #define wrtlc17       2554
  78. #define wrtlc18       2555
  79. #define wrtlc19       2556
  80. #define wrtlc20       2557
  81. #define wrtlc21       2558
  82. #define wrtlc22       2559
  83. #define wrtlc23       2560
  84. #define wrtlc24       2561
  85. #define EXIT          2562
  86. #define SET           2563
  87. #define READ          2564
  88. #define IDMSG_UNKOWN  2565
  89. #define ID_MAIN       2566
  90. #define ID_CLEAR      2567
  91. #define ID_EXIT       2568
  92. #define ID_DLSTR      2569
  93. #define ID_DLEND      2570
  94. #define ID_FULL       2571
  95. #define ID_SCAPS      2572
  96. #define ID_LCAPS      2573
  97. #define ID_BCAPS      2574
  98. #define ID_DCAPS      2575
  99. #define ID_QSVAL      2576
  100. #define ID_SSVAL      2577
  101. #define ID_WSVAL      2578
  102. #define ID_RSVAL      2579
  103. #define ID_ENUDR      2580
  104. #define ID_QDNAM      2581
  105. #define ID_QDVAR      2582
  106. #define ID_SDVAR      2583
  107. #define ID_SEMUL      2584
  108. #define ID_BACKL      2585
  109. #define ID_AUX        2586
  110. #define ID_EVENT      2587
  111. #define IDD_PADLG     2588
  112. #define IDD_EVDLG     2589
  113. #define IDD_BLDLG     2590
  114. #define OBJECTID1     2591
  115. #define OBJECTID2     2592
  116.  
  117. #define ID_DISP       WM_USER
  118. #define ID_TAUX       WM_USER + 1
  119. #define ID_TEVENT     WM_USER + 2
  120. #define ID_TLIFTOFF   WM_USER + 3
  121.  
  122. #define MAXCBUFFER      80
  123. #define QSVALUESIZE     19
  124. #define PPMIDSIZE       11
  125.  
  126. typedef struct _PPMID
  127.   {
  128.  CHAR  name[30];
  129.  ULONG ValueID;
  130.  LONG  value;
  131.  BOOL  active;
  132.  LONG  maxval;
  133.  LONG  minval;
  134.  INT   disable;
  135.   } PPMID;
  136. typedef struct _QSVSTRUCT1             /* sturcture for the system values     */
  137.  {
  138.  CHAR  valname[40];
  139.  ULONG valueid;          
  140.  LONG  value;           
  141.  LONG  valuemin;
  142.  LONG  valuemax;
  143.  INT   disable;
  144.  } QSVSTRUCT1;
  145.  
  146.  
  147. #ifdef WRTSAMPL_MAIN
  148. HAB               habMain;
  149. ULONG             ulocindx;
  150. BOOL              blocarr[10];         /* array to identify good locator */
  151. WRTLOCATORDEVINFO ldiarr[10];          /* Array of Locator capabilities structure */
  152. ULONG             ulNumDrivers;
  153. CHAR              szDriverName[10][32];
  154. AUXPOINTDATA      apdExtra;
  155. WRTEVENTDATA     edInfo;
  156. PWRTEVENTDATA     pedInfo;
  157. ULONG            ulbacklight_displayID[10];
  158. PPMID ppmid[PPMIDSIZE] =
  159.   {"PPMID_MOTION_STOP",PPMID_MOTION_STOP, 0L, 0, PPMID_MOTION_STOP_MAX, PPMID_MOTION_STOP_MIN,0 ,
  160.    "PPMID_MOTION_START",PPMID_MOTION_START, 0L, 0, PPMID_MOTION_START_MAX, PPMID_MOTION_START_MIN,0 ,
  161.    "PPMID_MINGESTURELENGTH",PPMID_MINGESTURELENGTH, 0L, 0, PPMID_MINGESTURELENGTH_MAX, PPMID_MINGESTURELENGTH_MIN,0 ,
  162.    "PPMID_DISABLE_PROXIMITY",PPMID_DISABLE_PROXIMITY, 0L, 0, PPMID_DISABLE_PROXIMITY_MAX, PPMID_DISABLE_PROXIMITY_MIN,0 ,
  163.    "PPMID_TOUCHOFFSET_X",PPMID_TOUCHOFFSET_X, 0L, 0, PPMID_TOUCHOFFSET_X_MAX, PPMID_TOUCHOFFSET_X_MIN,0 ,
  164.    "PPMID_TOUCHOFFSET_Y",PPMID_TOUCHOFFSET_Y, 0L, 0, PPMID_TOUCHOFFSET_Y_MAX, PPMID_TOUCHOFFSET_Y_MIN,0 ,
  165.    "PPMID_BACKLIGHTBLANK",PPMID_BACKLIGHTBLANK, 0L, 0, PPMID_BACKLIGHTBLANK_MAX, PPMID_BACKLIGHTBLANK_MIN,0 ,
  166.    "PPMID_BACKLIGHTBLANK_INT",PPMID_BACKLIGHTBLANK_INT, 0L, 0, PPMID_BACKLIGHTBLANK_INT_MAX, PPMID_BACKLIGHTBLANK_INT_MIN,0 ,
  167.    "PPMID_POINT_RATE",PPMID_POINT_RATE, 0L, 0, PPMID_POINT_RATE_MAX, PPMID_POINT_RATE_MIN,1 ,
  168.    "PPMID_DIVIDE_RATE",PPMID_DIVIDE_RATE, 0L, 0, PPMID_DIVIDE_RATE_MAX, PPMID_DIVIDE_RATE_MIN,0 ,
  169.    "PPMID_DEVICE_PARMS",PPMID_DEVICE_PARMS, 0L, 0, PPMID_DEVICE_PARMS_MAX, PPMID_DEVICE_PARMS_MIN,0};
  170. QSVSTRUCT1 qsvalue[QSVALUESIZE] =
  171. {"Version",PPMSV_VERSION,0,0,0,0 ,
  172.  "Suspend",PPMSV_SUSPEND,0,0,1,0 ,
  173.  "Pen Pause",PPMSV_PEN_PAUSE,0,PPMSV_PEN_PAUSE_MIN,PPMSV_PEN_PAUSE_MAX,0 ,
  174.  "Pen Pause Enable",PPMSV_PEN_PAUSE_ENABLE,0,PPMSV_PEN_PAUSE_ENABLE_MIN,PPMSV_PEN_PAUSE_ENABLE_MAX,0 ,
  175.  "Touch Pause",PPMSV_TOUCH_PAUSE,0,PPMSV_TOUCH_PAUSE_MIN,PPMSV_TOUCH_PAUSE_MAX,0 ,
  176.  "Touch Pause Enable",PPMSV_TOUCH_PAUSE_ENABLE,0,PPMSV_TOUCH_PAUSE_ENABLE_MIN,PPMSV_TOUCH_PAUSE_ENABLE_MAX,0 ,
  177.  "Mouse Pause",PPMSV_MOUSE_PAUSE,0,PPMSV_MOUSE_PAUSE_MIN,PPMSV_MOUSE_PAUSE_MAX,0 ,
  178.  "Mouse Pause Enable",PPMSV_MOUSE_PAUSE_ENABLE,0,PPMSV_MOUSE_PAUSE_ENABLE_MIN,PPMSV_MOUSE_PAUSE_ENABLE_MAX,0 ,
  179.  "Other Pause",PPMSV_OTHER_PAUSE,0,PPMSV_OTHER_PAUSE_MIN,PPMSV_OTHER_PAUSE_MAX,0 ,
  180.  "Other Pause Enable",PPMSV_OTHER_PAUSE_ENABLE,0,PPMSV_OTHER_PAUSE_ENABLE_MIN,PPMSV_OTHER_PAUSE_ENABLE_MAX,0 ,
  181.  "Pause Beep Freq.",PPMSV_PAUSEBEEPFREQ,0,PPMSV_PAUSEBEEPFREQ_MIN,PPMSV_PAUSEBEEPFREQ_MAX,1 ,
  182.  "Reco Beep Enable",PPMSV_RECO_BEEP_ENABLE,0,PPMSV_RECO_BEEP_ENABLE_MIN,PPMSV_RECO_BEEP_ENABLE_MAX,1 ,
  183.  "Min. Gesture Points",PPMSV_MINGESTUREPOINTS,0,PPMSV_MINGESTUREPOINTS_MIN,PPMSV_MINGESTUREPOINTS_MAX,0 ,
  184.  "Reco. Ptr. Timer",PPMSV_RECOPTRTIMER,0,PPMSV_RECOPTRTIMER_MIN,PPMSV_RECOPTRTIMER_MAX,1 ,
  185.  "Gesture Cancel Timeout",PPMSV_GESTURE_CANCEL_TIMEOUT,0,PPMSV_GESTURE_CANCEL_TIMEOUT_MIN,PPMSV_GESTURE_CANCEL_TIMEOUT_MAX,0 ,
  186.  "Gesture Timeout",PPMSV_GESTURE_TIMEOUT,0,PPMSV_GESTURE_TIMEOUT_MIN,PPMSV_GESTURE_TIMEOUT_MAX,0 ,
  187.  "Standardized Resolution",PPMSV_STANDARDIZED_RESOLUTION,0,PPMSV_STANDARDIZED_RESOLUTION_MIN,PPMSV_STANDARDIZED_RESOLUTION_MAX,0 ,
  188.  "Character Box DX",PPMSV_CHARACTER_BOX_DX,0,0,0,0 ,
  189.  "Character Box DY",PPMSV_CHARACTER_BOX_DY,0,0,0,0 };
  190. INT AUXTEST = 0;
  191. INT EVENTTEST = 0;
  192. HWND     hwndFrame;
  193. HWND     hwndAuxDLG;
  194. HWND     hwndEventDLG;
  195. BOOL       btoggle_aux = 0;
  196. BOOL       btoggle_event = FALSE;
  197. #else
  198. extern HAB               habMain;
  199. extern ULONG             ulocindx;
  200. extern BOOL              blocarr[10];
  201. extern WRTLOCATORDEVINFO ldiarr[10];
  202. extern ULONG             ulNumDrivers;
  203. extern CHAR              szDriverName[10][32];
  204. extern AUXPOINTDATA      apdExtra;
  205. extern WRTEVENTDATA      edInfo;
  206. extern PWRTEVENTDATA     pedInfo;
  207. extern ULONG             ulbacklight_displayID[10];
  208. extern PPMID             ppmid[PPMIDSIZE];
  209. extern QSVSTRUCT1        qsvalue[QSVALUESIZE];
  210. extern INT      AUXTEST;
  211. extern INT      EVENTTEST;
  212. extern HWND     hwndFrame;
  213. extern HWND     hwndDLG;
  214. extern BOOL     btoggle_aux;
  215. extern BOOL     btoggle_event;
  216. #endif
  217.  
  218. INT main ( VOID );
  219. MRESULT EXPENTRY ClientWndProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  220. MRESULT EXPENTRY MGDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  221. MRESULT EXPENTRY ButCapDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  222. MRESULT EXPENTRY LocCapDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  223. MRESULT EXPENTRY SysCapDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  224. MRESULT EXPENTRY DisCapDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  225. MRESULT EXPENTRY SysValDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  226. MRESULT EXPENTRY SSysVlDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  227. MRESULT EXPENTRY WSysVlDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  228. MRESULT EXPENTRY RSysVlDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  229. MRESULT EXPENTRY EnumDrvDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  230. MRESULT EXPENTRY QInpDevDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  231. MRESULT EXPENTRY SInpDevDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  232. MRESULT EXPENTRY QInDevNDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  233. MRESULT EXPENTRY AUXPNTDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  234. MRESULT EXPENTRY EVNTDTDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  235. MRESULT EXPENTRY BACKLTDlgProc ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  236. MRESULT EXPENTRY ThreadWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  237. MRESULT EXPENTRY ThreadLiftOffProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  238. VOID DisplayError ( HWND hwnd, APIRET errcode );
  239. VOID init_sysval( HWND hwnd, INT r_sw );
  240. VOID enter_sysval( HWND hwnd, INT r_sw );
  241. VOID updwn_sysval ( HWND hwnd );
  242. VOID set_sysval ( HWND hwnd );
  243. VOID disp_loccaps ( HWND hwnd, PWRTLOCATORDEVINFO lcInfo );
  244. VOID disp_butcaps ( HWND hwnd, PWRTBUTTONDEVINFO bcInfo );
  245. VOID disp_discaps ( HWND hwnd, PWRTDISPLAYDEVINFO dcInfo );
  246. VOID init_invar ( HWND hwnd, INT q_s );
  247. VOID updatecntrl ( HWND hwnd, INT q_s, HWND hwnd_temp );
  248. VOID update3 (HWND hwnd, INT q_s );
  249. VOID BackThread ( VOID * arg );
  250. VOID LiftOffThread ( VOID * arg );
  251.