home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / window / winedit / w_def.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-28  |  11.5 KB  |  436 lines

  1. #ifndef va_start
  2.     #include <stdarg.h>
  3. #endif
  4.  
  5.  
  6. /*
  7. Verkürzte Typbezeichner
  8. */
  9. typedef unsigned int     word;
  10. typedef unsigned char    byte;
  11.  
  12.  
  13.  
  14. typedef struct
  15.     {
  16.     int  year;
  17.     int  day;
  18.     int  mon;
  19.     }
  20.     DAte;
  21.  
  22. typedef struct
  23.     {
  24.     int hour;
  25.     int min;
  26.     int sec;
  27.     }
  28.     TIme;
  29.  
  30. typedef struct
  31.     {
  32.     long mark;
  33.     int  pfen;
  34.     }
  35.     DMark;
  36.  
  37.  
  38.  
  39.  
  40. /*
  41. Tastaturcodes
  42. */
  43. #define     KEY_C_L            0X14B
  44. #define     KEY_C_R            0X14D
  45. #define     KEY_C_U            0X148
  46. #define     KEY_C_D            0X150
  47.  
  48. #define     KEY_BS          8
  49. #define     KEY_CR             13
  50. #define     KEY_ESC         27
  51. #define     KEY_HOME         327
  52. #define     KEY_END            335
  53. #define     KEY_PGUP         329
  54. #define     KEY_PGDN        337
  55. #define     KEY_INS         338
  56. #define     KEY_DEL         339
  57. #define     KEY_CTRLLEFT      371
  58. #define     KEY_CTRLRIGHT     372
  59. #define     KEY_F1             315
  60. #define     KEY_F2             316
  61. #define     KEY_F3             317
  62. #define     KEY_F4             318
  63. #define     KEY_F5             319
  64. #define     KEY_F6             320
  65. #define     KEY_F7             321
  66. #define     KEY_F8             322
  67. #define     KEY_F9             323
  68. #define     KEY_F10         324
  69. #define     KEY_CNTRLA        1
  70. #define     KEY_CNTRLB        2
  71. #define     KEY_CNTRLC        3
  72. #define     KEY_CNTRLD        4
  73. #define     KEY_CNTRLE        5
  74. #define     KEY_CNTRLF        6
  75. #define     KEY_CNTRLG        7
  76. #define     KEY_CNTRLH        8
  77. #define     KEY_CNTRLI        9
  78. #define     KEY_CNTRLJ       10
  79. #define     KEY_CNTRLK       11
  80. #define     KEY_CNTRLL       12
  81. #define     KEY_CNTRLM       13
  82. #define     KEY_CNTRLN       14
  83. #define     KEY_CNTRLO       15
  84. #define     KEY_CNTRLP       16
  85. #define     KEY_CNTRLQ       17
  86. #define     KEY_CNTRLR       18
  87. #define     KEY_CNTRLS       19
  88. #define     KEY_CNTRLT       20
  89. #define     KEY_CNTRLU       21
  90. #define     KEY_CNTRLV       22
  91. #define     KEY_CNTRLW       23
  92. #define     KEY_CNTRLX       24
  93. #define     KEY_CNTRLY       25
  94. #define     KEY_CNTRLZ       26
  95.  
  96.  
  97. #define     KEY_ALTF1       0x168
  98. #define     KEY_ALTF2       0x169
  99. #define     KEY_ALTF3       0x16a
  100. #define     KEY_ALTF4       0x16b
  101. #define     KEY_ALTF5       0x16c
  102. #define     KEY_ALTF6       0x16d
  103. #define     KEY_ALTF7       0x16e
  104. #define     KEY_ALTF8       0x16f
  105. #define     KEY_ALTF9       0x170
  106. #define     KEY_ALTF10      0x171
  107. #define     KEY_ALTA        0x11e
  108. #define     KEY_ALTB        0x130
  109. #define     KEY_ALTC        0x12e
  110. #define     KEY_ALTD        0x120
  111. #define     KEY_ALTE        0x112
  112. #define     KEY_ALTF        0x121
  113. #define     KEY_ALTG        0x122
  114. #define     KEY_ALTH        0x123
  115. #define     KEY_ALTI        0x117
  116. #define     KEY_ALTJ        0x124
  117. #define     KEY_ALTK        0x125
  118. #define     KEY_ALTL        0x126
  119. #define     KEY_ALTM        0x132
  120. #define     KEY_ALTN        0x131
  121. #define     KEY_ALTO        0x118
  122. #define     KEY_ALTP        0x119
  123. #define     KEY_ALTQ        0x110
  124. #define     KEY_ALTR        0x113
  125. #define     KEY_ALTS        0x11f
  126. #define     KEY_ALTT        0x114
  127. #define     KEY_ALTU        0x116
  128. #define     KEY_ALTV        0x12f
  129. #define     KEY_ALTW        0x111
  130. #define     KEY_ALTX        0x12d
  131. #define     KEY_ALTY        0x115
  132. #define     KEY_ALTZ        0x12c
  133.  
  134.  
  135. /*
  136. Mauscodes für Tastendruck rechts (R), links (L) und mitte (M)
  137. */
  138.  
  139.  
  140.  
  141. /*
  142. Ein kurzer Maustastendruck liefert
  143. */
  144. #define     MOUSE_L_B        0x3001
  145. #define     MOUSE_R_B        0x3002
  146. #define     MOUSE_M_B        0x3004
  147.  
  148.  
  149. /*
  150. Das Drücken einer Taste (mit anschließendem Bewegen der Maus) liefert:
  151. */
  152. #define     MOUSE_L_B_P      0x3011
  153. #define     MOUSE_R_B_P      0x3012
  154. #define     MOUSE_M_B_P      0x3014
  155.  
  156.  
  157. /*
  158. Eine Mausbewegung wird angezeigt mit dem Zeichen
  159. */
  160. #define     MOUSE_MOVE       0x300a
  161.  
  162.  
  163. /*
  164. Das Loslassen einer Taste (nach Bewegen der Maus) liefert:
  165. */
  166. #define     MOUSE_L_B_R      0x3021
  167. #define     MOUSE_R_B_R      0x3022
  168. #define     MOUSE_M_B_R      0x3024
  169.  
  170.  
  171. #define     MOUSE_PRESS        0x3010
  172. #define     MOUSE_RELEASE   0x3020
  173. #define     MOUSE_KLICK     0x3000
  174.  
  175.  
  176. /*
  177. Folgende zwei Konstanten dienen der Einstellung der Betriebsart
  178. der Funktionen w_kbd und w_mousekbd
  179. */
  180. #define     SAMPLE            0
  181. #define     REQUEST            1
  182.  
  183.  
  184.  
  185. /*
  186. Mit den folgenden Konstanten läßt sich festlegen, ob eine Ausgabe links-
  187. oder rechtsbündig auf einen Kanal erfolgt.
  188. */
  189. #define LINKSBUENDIG         0
  190. #define RECHTSBUENDIG        1
  191.  
  192.  
  193.  
  194.  
  195. /*
  196. Bei Aufruf von w_init(..) zur Steuerung der Ausgabe
  197. */
  198. #define DIREKT               0
  199. #define BIOS                 1
  200.  
  201.  
  202. /*
  203. Zum Laden einer Maske mit oder ohne virtuellem Schirm
  204. */
  205. #define VIRTUELL             0
  206. #define NOVIRTUELL           1
  207.  
  208.  
  209. /***************************************************************************
  210. Konstanten zur Klassifizierung eines Feldes
  211. */
  212. #define ISSTRING     0
  213. #define ISCHAR       1
  214. #define ISBYTE       2
  215. #define ISINT        3
  216. #define ISWORD       4
  217. #define ISLONG       5
  218. #define ISDOUBLE     6
  219. #define ISDATE       7
  220. #define ISTIME       8
  221. #define ISDMARK      9
  222.  
  223.  
  224.  
  225.  
  226.  
  227. /*
  228. Basis-Routinen
  229. */
  230. int  w_init(int bios);
  231. int  w_deinit(void);
  232. int  w_error(void);
  233. int  w_load(char *filename,int mode);
  234. int  w_erase(int wnum);
  235. int  w_open(int wnum);
  236. int  w_close(void);
  237. int  w_lib_open(char *lib_name);
  238. int  w_lib_close(void);
  239. void w_setcolors(byte colortable[256]);
  240. byte *w_getcolortable(void);
  241.  
  242.  
  243. /*
  244. Routinen zum Menü-Aufbau
  245. */
  246. int  w_switch(int wnum);
  247. int  w_switch_pos(int wnum,int position);
  248. int  w_switch_mouse_esc(int wnum,int mode);
  249. int  w_switch_mark_mode(int wnum,int mode);
  250. int  w_switch_mouse_cr(int wnum,int mode);
  251. int  w_switch_visible_cr(int wnum);
  252. int  w_switch_unvisible_cr(int wnum);
  253. int  w_switch_auto_esc(int wnum);
  254. int  w_switch_break_on_key(int wnum,int mode);
  255. int  w_switch_last_key(int wnum);
  256. int  w_switch_first_key(int wnum,int key);
  257. int  w_switch_matrix(int wnum,int mode,int left,int right,int top,int bottom);
  258. int  w_switch_range(int wnum,int first,int last);
  259.  
  260.  
  261. /*
  262. Routinen zur Ein-und Ausgabe
  263. */
  264.  
  265.  
  266. int  strtodate(char *s,DAte *d);
  267. int  strtotime(char *s,TIme *d);
  268. int  strtodmark(char *s,DMark *d);
  269. int  w_in_long(int wnum,int fnum,long *destin,long min,long max);
  270. int  w_in_double(int wnum,int fnum,double *destin,double *min,double *max);
  271. int  w_in_date(int wnum,int fnum,DAte *destin,DAte *min,DAte *max);
  272. int  w_in_time(int wnum,int fnum,TIme *destin,TIme *min,TIme *max);
  273. int  w_in_dmark(int wnum,int fnum,DMark *destin,DMark *min,DMark *max);
  274. int  w_in_int(int wnum,int fnum,int *destin,int min,int max);
  275. int  w_in_word(int wnum,int fnum,word *destin,word min,word max);
  276. int  w_in_str(int wnum,int fnum,int stringlen,char *s,char *legal);
  277. int  w_in_break_on_key(int mode);
  278. int  w_in_last_key(void);
  279. void w_in_first_key(int key);
  280. void w_in_reset_curpos(void);
  281.  
  282.  
  283.  
  284. int  w_out_str(int wnum,int fnum,char *s);
  285. int  w_vout_str(int wnum,int fnum,char *s);
  286. int  w_printf(int wnum, int fnum,va_list arg_list, ...);
  287. int  w_vprintf(int wnum, int fnum,va_list arg_list, ...);
  288. int  w_out_byte(int wnum,int fnum,byte b);
  289. int  w_vout_byte(int wnum,int fnum,byte b);
  290. int  w_out_char(int wnum,int fnum,char c);
  291. int  w_vout_char(int wnum,int fnum,char c);
  292. int  w_out_int(int wnum,int fnum,int i);
  293. int  w_vout_int(int wnum,int fnum,int i);
  294. int  w_out_word(int wnum,int fnum,word w);
  295. int  w_vout_word(int wnum,int fnum,word w);
  296. int  w_out_long(int wnum,int fnum,long l);
  297. int  w_vout_long(int wnum,int fnum,long l);
  298. int  w_out_double(int wnum,int fnum,double *d);
  299. int  w_vout_double(int wnum,int fnum,double *d);
  300. int  w_out_date(int wnum,int fnum,DAte *d);
  301. int  w_vout_date(int wnum,int fnum,DAte *d);
  302. int  w_out_time(int wnum,int fnum,TIme *d);
  303. int  w_vout_time(int wnum,int fnum,TIme *d);
  304. int  w_out_dmark(int wnum,int fnum,DMark *d);
  305. int  w_vout_dmark(int wnum,int fnum,DMark *d);
  306. int  w_vout(int wnum);
  307. void w_out_temp_attribute(byte attribute);
  308. void w_out_temp_format(int format);
  309.  
  310.  
  311.  
  312. int  w_in_field(int wnum,int fnum,void *buffer);
  313. int  w_out_field(int wnum,int fnum,void *buffer);
  314. int  w_vout_field(int wnum,int fnum,void *buffer);
  315. int  w_out_struct(int wnum,int first,int last,void *source);
  316. int  w_vout_struct(int wnum,int first,int last,void *source);
  317. int  w_in_struct(int wnum,int first,int last,void *destin);
  318. int  w_struct_sizeof(int wnum,int first,int last);
  319. int  w_struct_init(int wnum,int first,int last,void *destin,int max);
  320.  
  321.  
  322.  
  323.  
  324.  
  325. /*
  326. Routinen zur Mausverwaltung
  327. */
  328. int  w_mouse_init(void);
  329. int  w_mouse_deinit(void);
  330. int  w_mouse_exist(void);
  331. void w_mouse_gotoxy(int x,int y);                                                  ;
  332. int  w_mouse_cur_x(void);
  333. int  w_mouse_cur_y(void);
  334. int  w_mouse_pre_x(void);
  335. int  w_mouse_pre_y(void);
  336. int  w_mouse_rel_x(void);
  337. int  w_mouse_rel_y(void);
  338.  
  339.  
  340.  
  341. /*
  342. Maus- und Tastaturabfrage
  343. */
  344. int  w_kbd(int mode);
  345. int  w_mousekbd(int mode);
  346.  
  347.  
  348. /*
  349. Abruf von Maskeninformationen
  350. */
  351.  
  352.  
  353.  
  354. int w_xyon_field(int wnum,int x,int y);
  355. int w_xyon_win(int wnum,int x,int y);
  356.  
  357.  
  358.  
  359. int   w_is_wnum(int wnum);
  360. int   w_is_field(int wnum,int fnum);
  361. char *w_info_vscreen(int wnum);
  362. char *w_info_bscreen(int wnum);
  363. int   w_info_win_left(int wnum);
  364. int   w_info_win_right(int wnum);
  365. int   w_info_win_top(int wnum);
  366. int   w_info_win_bottom(int wnum);
  367. byte  w_info_attr(int wnum,int x,int y);
  368. char  w_info_text(int wnum,int x,int y);
  369. int   w_info_field_num(int wnum);
  370. int   w_info_field_x(int wnum,int fnum);
  371. int   w_info_field_y(int wnum,int fnum);
  372. int   w_info_field_width(int wnum,int fnum);
  373. int   w_info_field_rev_attrib(int wnum,int fnum);
  374. int   w_info_field_out_attrib(int wnum,int fnum);
  375. int   w_info_field_in_attrib(int wnum,int fnum);
  376. int   w_info_field_type(int wnum,int fnum);
  377. int   w_info_field_in_right(int wnum,int fnum);
  378. int   w_info_field_out_right(int wnum,int fnum);
  379. int   w_info_field_in_owrite(int wnum,int fnum);
  380. int   w_info_field_del(int wnum,int fnum);
  381. void *w_info_field_min(int wnum,int fnum,void *min);
  382. void *w_info_field_max(int wnum,int fnum,void *max);
  383.  
  384.  
  385.  
  386. /*
  387. Bildschirmroutinen
  388. */
  389. void v_init(int bios);
  390. int  v_mono(void);
  391. int  v_movewin(int sx1, int sy1, int sx2, int sy2, int dx1, int dy1);
  392. int  v_getwin (int left, int top, int right, int bottom, void *buffer);
  393. int  v_putwin (int left, int top, int right, int bottom, void *buffer);
  394. int  v_gettext(int left, int top, int right, int bottom, void *buffer);
  395. int  v_puttext(int left, int top, int right, int bottom, void *buffer);
  396. int  v_getattr(int left, int top, int right, int bottom, void *buffer);
  397. int  v_putattr(int left, int top, int right, int bottom, void *buffer);
  398. void v_gotoxy(int x, int y);
  399. word v_wherexy(void);
  400. int  v_wherex(void);
  401. int  v_wherey(void);
  402. word v_getcursor(void);
  403. void v_setcursor(word shape);
  404. void v_hidecursor(void);
  405. void v_showcursor(void);
  406. void v_cls(void);
  407. void v_clrscr(void);
  408.  
  409.  
  410. /*
  411. Funktionen zum MICROSOFT-Maus-Interface
  412. */
  413. int  mouse_init(word *buttons);
  414. void mouse_show_cursor(void);
  415. void mouse_hide_cursor(void);
  416. word mouse_get_status(word *buttons,word *xpos,word *ypos);
  417. void mouse_set_pos(word xpos,word ypos);
  418. word mouse_get_press_status(word button,word *status,word *presses,word *xppos,word *yppos);
  419. word mouse_get_release_status(word button,word *status,word *releases,word *xrpos,word *yrpos);
  420. void mouse_set_xrange(word xmin,word xmax);
  421. void mouse_set_yrange(word ymin,word ymax);
  422. void mouse_def_graphcursorblock(word xhotspot,word yhotspot,word cursormaskpointer);
  423. void mouse_def_textcursor(word cursorselect,word screenmask,word cursormask);
  424. void mouse_get_motioncounter(word *xcount,word *ycount);
  425. void mouse_def_eventhandler(word eventmask,void (far *handler)(void));
  426. void mouse_ligthpen_emulation_on(void);
  427. void mouse_ligthpen_emulation_off(word xpos,word ypos);
  428. void mouse_set_motion_per_pixel(word xstep,word ystep);
  429. void mouse_conditional_hide_cursor(word left, word right, word top, word bottom);
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.