home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / c / cwl30 / mc3lib / internal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-24  |  36.0 KB  |  674 lines

  1. /*** INTERNAL.H ***/
  2.  
  3. #ifndef INTERNAL_DEF
  4. #define INTERNAL_DEF
  5.  
  6. /* Written By P.A. McKenzie
  7.  * The C Window Library
  8.  * Copyright (C) 1993         All Rights Reserved
  9.  * Last updated : July 21, 1994
  10. */
  11.  
  12. #if defined (POWERC)
  13.   #define CWLmouse_hidden  mouhid_
  14. #endif
  15.  
  16. typedef struct tagSHADOWSAVE
  17. {
  18.   int sattr;
  19.   int swidth;
  20.   int sheight;
  21.   int spos;
  22.   int schar;
  23.   int t;
  24. } SHADOW_SAVE;
  25.  
  26. #ifdef SOURCE
  27. #include "cwldebug.h"
  28. #endif
  29.  
  30. typedef int (*OBJECTPROC)   _PROTO_((CWLOBJECTPTR object, VOIDPTR objecttype,
  31.                                      long objectnum));
  32.  
  33. /*  These are the prototypes for routines used internally */
  34. int          abs_shadow_coord _PROTO_((WPOINTER, int, int));
  35.  
  36. int          CWLadd_object _PROTO_((CWLOBJECTPTR, CWL_VOID *));
  37. CWLOBJECTPTR CWLinit_object_class _PROTO_((long numobjects, int objtype));
  38. int          CWLdelete_object _PROTO_((CWLOBJECTPTR objectptr, long which));
  39. CWL_VOID     CWLGetInDos _PROTO_((CWL_VOID));
  40. CWL_VOID  _FAR_   CWLAssignHandlers _PROTO_((CWL_VOID));
  41. CWL_VOID  _FAR_   CWLUnassignHandlers _PROTO_((CWL_VOID));
  42. int          CWLset_object _PROTO_((CWLOBJECTPTR objectptr, long which,
  43.                                     CWL_VOID *newobject));
  44. int          CWLchild_enum_proc _PROTO_((WPOINTER w, long lParam));
  45. VOIDPTR      CWLget_object _PROTO_((CWLOBJECTPTR objectptr, long which));
  46. int          CWLinsert_object _PROTO_((CWLOBJECTPTR objectptr, long which,
  47.                                        VOIDPTR newobject));
  48. int          CWLenum_objects _PROTO_((CWLOBJECTPTR objectptr,
  49.                                       OBJECTPROC ofunc));
  50. long         CWLget_object_count _PROTO_((CWLOBJECTPTR objectptr));
  51. int          CWLdispose_object_class _PROTO_((CWLOBJECTPTR objectptr));
  52. long         CWLfind_object _PROTO_((CWLOBJECTPTR objectptr, void *object));
  53. CWLOBJECTPTR CWLcopy_object_class _PROTO_((CWLOBJECTPTR objectptr, long *num));
  54. int          CWLcompare_rank _PROTO_((WPOINTER w1, WPOINTER w2));
  55. int          CWLwindow_in_point _PROTO_((WPOINTER w, int row, int col));
  56. CWL_VOID     CWLsave_shadow    _PROTO_((WPOINTER w, SHADOW_SAVE *sstruct));
  57. CWL_VOID     CWLrestore_shadow _PROTO_((WPOINTER w, SHADOW_SAVE *sstruct));
  58. int          CWLchild_move_proc _PROTO_((WPOINTER w, long lParam));
  59. CWL_VOID     CWLupdate_all _PROTO_((WPOINTER w, CWLOBJECTPTR wobject,
  60.                                     int numobjects, int endpos,
  61.                                     CWLRECT *pRect));
  62. int          CWLclose_window _PROTO_((WPOINTER w));
  63. long         CWLdelete_all_objects _PROTO_((CWLOBJECTPTR objectptr));
  64. int          CWLdisk_active _PROTO_((CWL_VOID));
  65. int          CWLInDos _PROTO_((CWL_VOID));
  66.  
  67. int          CWLcapture_window_func _PROTO_((WPOINTER *w, int x, int y,
  68.                                     int event, CWLMSG *mouevent,
  69.                                     int doing_default,
  70.                                     WPOINTER *current_window, int newy,
  71.                                     int newx, int htwhere, int *ny, int *nx,
  72.                                     long *current_mouse_pos, int *dblclk,
  73.                                     int minmax_press));
  74.  
  75. int          CWLscroll_window_highlight _PROTO_((WPOINTER w, int wrow, int wcol, int stype));
  76.  
  77. int          CWLpopup_undef_proc _PROTO_((POPUP_MENU_PTR p, int prefuncdone,
  78.                                      int stray_click,
  79.                                      int *current_selection, int sel,
  80.                                      int mouse_done, int undefval, int last,
  81.                                      int rehighlight, int *nextrow,
  82.                                      int *trow, int *sp, int *bselect));
  83.  
  84. int          CWLcheck_popup_hotkey _PROTO_((POPUP_MENU_PTR p,
  85.                                             int *i, unsigned sel,
  86.                                             int *nextrow, int *trow,
  87.                                             int nset));
  88.  
  89. int          CWLprocess_mouse _PROTO_((POPUP_MENU_PTR p, int *sel, int *which,
  90.                                        int *mouse_press, int *current_selection,
  91.                                        int *keypress, int *cascade,
  92.                                        int *trow, int *last, int *nextrow,
  93.                                        int *rehighlight, int *prefuncdone,
  94.                                        int *last_cascade, int *undefval,
  95.                                        int *mouse_done, int *sp,
  96.                                        int *outofbounds, int *menu_choice,
  97.                                        int *initial_press, int *mouse_release));
  98.  
  99.  
  100. int          CWLwindow_on_scrollbar _PROTO_((WPOINTER w, int row, int col));
  101.  
  102. CWL_VOID     CWLmove_bar_to_popup_entry _PROTO_((POPUP_MENU_PTR p,
  103.                                                 int sel,
  104.                                                 int *nextrow, int *trow,
  105.                                                 int *last));
  106.  
  107. CWL_VOID     CWLmove_popup_bar_down _PROTO_((POPUP_MENU_PTR p,
  108.                                              int *current_selection,
  109.                                              int *last,
  110.                                              int *nextrow,
  111.                                              int *trow,
  112.                                              int which));
  113.  
  114. CWL_VOID     CWLmove_popup_bar_up _PROTO_((POPUP_MENU_PTR p,
  115.                                            int *current_selection,
  116.                                            int *last,
  117.                                            int *nextrow,
  118.                                            int *trow,
  119.                                            int which));
  120.  
  121. CWL_VOID     CWLpopup_pagedown _PROTO_((POPUP_MENU_PTR p, int *trow,
  122.                                         int *current_selection,
  123.                                         int *last, int which));
  124.  
  125. CWL_VOID     CWLpopup_pageup _PROTO_((POPUP_MENU_PTR p, int *trow,
  126.                                       int *current_selection, int *last,
  127.                                       int which));
  128.  
  129. CWL_VOID     CWLmove_bar_to_window _PROTO_((POPUP_MENU_PTR p,
  130.                                             int trow,
  131.                                             int current,
  132.                                             int *last,
  133.                                             int which));
  134.  
  135. CWL_VOID     CWLdisplay_cascade _PROTO_((POPUP_MENU_PTR p,
  136.                                          int selection, int dispflag));
  137.  
  138. int          CWLmouse_in_cascade _PROTO_((POPUP_MENU_PTR p,
  139.                                           int selection, int nrow,
  140.                                           int ncol));
  141.  
  142. int          CWLmouse_in_parent _PROTO_((POPUP_MENU_PTR p, int nrow, int ncol,
  143.                                          POPUP_MENU_PTR *pw));
  144.  
  145. int          CWLcall_cascade_popup _PROTO_((POPUP_MENU_PTR p,
  146.                                             int current_selection,
  147.                                             int menu_choice, int keypress));
  148.  
  149. int          CWLclose_cascade_popup _PROTO_((POPUP_MENU_PTR p,
  150.                                              POPUP_MENU_PTR ptemp,
  151.                                              int menu_choice,
  152.                                              int current_selection,
  153.                                              int mousepress));
  154. int          CWLwindow_resize_height _PROTO_((WPOINTER w,
  155.                                               int newheight,
  156.                                               int flag,
  157.                                               int capflag));
  158.  
  159. int          CWLwindow_resize_width _PROTO_((WPOINTER w,
  160.                                              int newwidth,
  161.                                              int flag,
  162.                                              int capflag));
  163.  
  164. CWL_VOID     CWLprocess_mousemove _PROTO_((CWLMSG *mouevent));
  165.  
  166. CWL_VOID     CWLprocess_timer _PROTO_((CWLMSG *mouevent));
  167.  
  168. CWL_VOID     CWLprocess_kbdmsg _PROTO_((WPOINTER focus_window, CWLMSG *mouevent,
  169.                                         long *current_mouse_pos, int doing_default));
  170.  
  171. int          CWLresize_window _PROTO_((WPOINTER w, unsigned event, int area,
  172.                                        int pos1, int pos2, int htwhere,
  173.                                         WPOINTER *current_window));
  174.  
  175. CWL_VOID     CWLdisplay_seethru_window _PROTO_((WPOINTER w, WPOINTER tempw,
  176.                                                 int rank, int flag));
  177.  
  178. int          CWLscroll_window_hotspot _PROTO_((WPOINTER w, int event,
  179.                                                int area, int wrow,
  180.                                                int wcol, int chkflag));
  181.  
  182. int          CWLprocess_mousemsg _PROTO_((WPOINTER *w,int newy, int newx, int *ny,
  183.                                           int *nx, int x, int y,
  184.                                           int event, int *dblclk,
  185.                                           WPOINTER *current_window,
  186.                                           WPOINTER focus_window,
  187.                                           int *first_press_flag,
  188.                                           CWLMSG *msg, CWLMSG *mouevent,
  189.                                           int htwhere, long current_mouse_pos,
  190.                                           int *minmax_press));
  191.  
  192. int          CWLmove_window _PROTO_((WPOINTER w, unsigned event, int area,
  193.                                      int pos1, int pos2, WPOINTER *current_window,
  194.                                      int *dblclk));
  195.  
  196. int          CWLdo_mouse_zoom _PROTO_((WPOINTER w, int retval, int event,
  197.                                        int posy, int posx));
  198.  
  199. int          CWLon_size_button _PROTO_((WPOINTER w, int row, int col));
  200.  
  201. int          CWLwindow_mouse_func _PROTO_((int type, WPOINTER w, int event,
  202.                                            long mouseparam, int param1,
  203.                                            long param2, WPOINTER *current_window,
  204.                                            int *dblclk, int minmax_press));
  205.  
  206. int          CWLpoint_in_client _PROTO_((WPOINTER w, int row, int col));
  207. int          CWLon_resize_pos _PROTO_((WPOINTER w, int wrow, int wcol));
  208. int          CWLon_caption _PROTO_((WPOINTER w, int row, int col));
  209.  
  210.  
  211. int          MouseOff _PROTO_((CWL_VOID));
  212. int          MouseOn  _PROTO_((int status));
  213.  
  214. int          compare_rank _PROTO_((WPOINTER w1, WPOINTER w2));
  215.  
  216. CWL_VOID     bios_write_vertical _PROTO_((UNKNOWNARGS));
  217. CWL_VOID     calibrate_timer _PROTO_((CWL_VOID));
  218. int          CWLcheck_existence _PROTO_((unsigned, VWPOINTER, WPOINTER));
  219. int          check_transparent_attribute _PROTO_((WPOINTER, int, int, int *));
  220. int          clear_window_region _PROTO_((WPOINTER, int, int, int, int, int));
  221.  
  222. CWL_VOID     draw_caption _PROTO_((WPOINTER w));
  223. CWL_VOID     draw_separator _PROTO_((POPUP_MENU_PTR p, int where));
  224. int          draw_window_box _PROTO_((WPOINTER,int));
  225. int          explode_buffer _PROTO_((WPOINTER, int, unsigned char *, int));
  226. CWL_VOID     fill_wblock _PROTO_((WPOINTER, unsigned char *, int,
  227.                                   int, int, int));
  228. CWL_VOID     free_virtual_window_buffers _PROTO_((unsigned char _FAR_ * _FAR_ *, int));
  229. int          CWLget_masked_input _PROTO_((WPOINTER, int, int, char *, char *, int,
  230.                                  int, int, int, char *, int, int, int,
  231.                                  long, char, int, unsigned *, int *));
  232. int          CWLget_numchars _PROTO_((char *, char));
  233. CWL_VOID     get_xy _PROTO_((UNKNOWNARGS));
  234. CWL_VOID     hide_all_children _PROTO_((WPOINTER w, int hflag));
  235. int          init_key_defs _PROTO_((CWL_VOID));
  236. int          nabs_shadow_coord _PROTO_((WPOINTER, int, int));
  237. int          CWLinit_screen_image _PROTO_((int));
  238. CWL_VOID     paint_seethru _PROTO_((WPOINTER));
  239. CWL_VOID     nosnow_move _PROTO_((UNKNOWNARGS));
  240. CWL_VOID     nosnow_read _PROTO_((UNKNOWNARGS));
  241. CWL_VOID     nosnow_write_attr _PROTO_((UNKNOWNARGS));
  242. CWL_VOID     nosnow_write_string _PROTO_((UNKNOWNARGS));
  243. CWL_VOID     nosnow_write_vertical _PROTO_((UNKNOWNARGS));
  244. char *       parse_regexp _PROTO_((char *, char *, int, int *, int));
  245. CWL_VOID     bios_save_restore _PROTO_((int ux, int uy, int lx, int ly,
  246.                               WBUFPTR scrnsptr, int option, int page));
  247. int          CWLrank_window _PROTO_((WPOINTER w, int rank, int uflag));
  248. CWL_VOID     read_bios_attr _PROTO_((UNKNOWNARGS));
  249. CWL_VOID     read_bios_string _PROTO_((UNKNOWNARGS));
  250. CWL_VOID     read_bios_char_attr _PROTO_((UNKNOWNARGS));
  251. CWL_VOID     read_window_text_buffer _PROTO_((int, WPOINTER, int, int, int,
  252.                                     unsigned char *));
  253. CWL_VOID     redraw_border _PROTO_((WPOINTER,int,int));
  254. int          CWLremove_screen_image _PROTO_((int));
  255. int          setup_regexp _PROTO_((char *, int));
  256. int          test_mono _PROTO_((UNKNOWNARGS));
  257. int          translate_scrollpos_to_row _PROTO_((WPOINTER w, SCROLLPTR sptr,
  258.                                            int side));
  259. int          translate_row_to_scrollpos _PROTO_((WPOINTER w, SCROLLPTR sptr,
  260.                                            int side));
  261. int          get_scrollbox_pos _PROTO_((SCROLLPTR sptr));
  262.  
  263. #if defined (MSC) || (LATTICE) || (__ZTC__)
  264. unsigned     TCpeek _PROTO_((unsigned seg, unsigned off));
  265. unsigned     TCpoke _PROTO_((unsigned seg, unsigned off, unsigned num));
  266. #endif
  267.  
  268. CWL_VOID     update_children _PROTO_((WPOINTER w));
  269. CWL_VOID     mark_children_enum _PROTO_((WPOINTER parent, int mark));
  270. int          window_enum_children _PROTO_((WPOINTER parent,
  271.                                            CWLENUMPROC enumproc, long lParam));
  272.  
  273. CWL_VOID     update_children_block _PROTO_((WPOINTER w, CWLRECT *wRect,
  274.                                             int action, int value));
  275.  
  276. CWL_VOID     update_screen_image _PROTO_((WPOINTER, int, int));
  277. CWL_VOID     update_screen_image_block _PROTO_((WPOINTER, CWLRECT *, int, int));
  278. CWL_VOID     update_shadow _PROTO_((WPOINTER w));
  279. CWL_VOID     update_viewport _PROTO_((WPOINTER, VWPOINTER));
  280. CWL_VOID     update_viewport_line _PROTO_((WPOINTER, VWPOINTER, unsigned, unsigned,
  281.                                        int, int));
  282. CWL_VOID     vblock_save_restore _PROTO_((UNKNOWNARGS));
  283. CWL_VOID     video_draw_box _PROTO_((int, int, int, int, int, char *, int));
  284. CWL_VOID     video_write_CC _PROTO_((char *, int, int, int, int));
  285. CWL_VOID     video_write_center _PROTO_((char *, int, int, int));
  286. CWL_VOID     video_write_RJ _PROTO_((char *, int, int, int, int));
  287. int          CWLvirtual_clear _PROTO_((VWPOINTER , int , int ));
  288. int          CWLvirtual_clear_region _PROTO_((VWPOINTER vw, unsigned uy,unsigned ux,
  289.                                      unsigned ly, unsigned lx, int attr,
  290.                                      int flag));
  291. int          CWLvirtual_printf _PROTO_((VWPOINTER, unsigned char *, int, int));
  292. int          CWLvirtual_read_write_chars _PROTO_((VWPOINTER,char *,unsigned,unsigned,
  293.                                               unsigned,int,int,int,int));
  294. int          virtual_write_cjust_string _PROTO_((VWPOINTER,char *,unsigned,unsigned,int,
  295.                                            int));
  296. int          virtual_write_center_string _PROTO_((VWPOINTER,char *,unsigned,int,int));
  297. int          virtual_write_rjstring _PROTO_((VWPOINTER,char *,unsigned,unsigned,int,
  298.                                        int));
  299. int          virtual_write_string _PROTO_((VWPOINTER,char *,unsigned,unsigned,int,
  300.                                      int));
  301. int          what_xy _PROTO_((UNKNOWNARGS));
  302. int          window_addto_transparent _PROTO_((WPOINTER));
  303. CWL_VOID     write_bios_char_attr _PROTO_((UNKNOWNARGS));
  304. int          CWLwindow_clear_region _PROTO_((WPOINTER,int,int,int,int,int));
  305. int          window_covered _PROTO_((WPOINTER));
  306. int          window_delete_transparent _PROTO_((WPOINTER));
  307. int          CWLwindow_draw_box _PROTO_((WPOINTER,int,int,int,int,int,char *));
  308. int          window_draw_title _PROTO_((WPOINTER, char *, int, int, int, int));
  309. CWL_VOID     window_get_valid _PROTO_((WPOINTER, int *, int *, int *, int *));
  310. int          window_hide _PROTO_((WPOINTER,int,int));
  311. int          CWLwindow_open _PROTO_((WPOINTER w));
  312. CWL_VOID     window_paint _PROTO_((WPOINTER));
  313. CWL_VOID     window_paint_region _PROTO_((WPOINTER w, CWLRECT *wRect));
  314. int          window_print_char _PROTO_((WPOINTER,int,int));
  315. int          window_printf _PROTO_((WPOINTER w, char *str, int attr));
  316. int          CWLwindow_read_chars _PROTO_((WPOINTER,char *,int,int,int,int));
  317. int          CWLtoggle_seethru _PROTO_((WPOINTER,int));
  318. WPOINTER     window_top _PROTO_((int));
  319. CWL_VOID     window_unrank _PROTO_((WPOINTER));
  320. CWL_VOID     window_update_region _PROTO_((WPOINTER w, CWLRECT *wRect));
  321. int          window_write_center_string _PROTO_((WPOINTER, char *, int, int));
  322. int          window_write_rjstring _PROTO_((WPOINTER, char *, int, int, int));
  323. int          window_write_characters _PROTO_((WPOINTER, char *, int, int, int,
  324.                                         int, int, int,int));
  325.  
  326. int          window_write_client _PROTO_((WPOINTER w, char *buf, int row,
  327.                                           int col, int len, int opt, int ch,     /* character if repeat option is chosen */
  328.                                           int sflag, int vscroll));
  329.  
  330. int          window_write_string _PROTO_((WPOINTER, char *, int, int, int, int));
  331. int          window_write_cjust_string _PROTO_((WPOINTER, char *, int, int, int));
  332. CWL_VOID     write_bios_char_attr _PROTO_((UNKNOWNARGS));
  333. CWL_VOID     write_screen_image_area _PROTO_((WPOINTER,CWLRECT *,int,int,int));
  334. int          CWLwindow_scroll _PROTO_((WPOINTER, int, int, int, int, int, int, int));
  335. CWL_VOID     write_bios_attr _PROTO_((UNKNOWNARGS));
  336. CWL_VOID     write_bios_string _PROTO_((UNKNOWNARGS));
  337. CWL_VOID     write_bios_str_with_attr _PROTO_((UNKNOWNARGS));
  338. CWL_VOID     write_shadow _PROTO_((WPOINTER));
  339. int          write_temp_screen_buffer _PROTO_((WPOINTER, int, int, int, int));
  340. CWL_VOID     write_vertical _PROTO_((UNKNOWNARGS));
  341. CWL_VOID     write_viewport _PROTO_((VWPOINTER));
  342. CWL_VOID     write_window_text_buffer _PROTO_((int, WPOINTER, int, int, int,
  343.                                          unsigned char *, int));
  344.  
  345. /* Internal Macros */
  346. #define      WRITE_SCREEN_BLOCK(rect,p)  \
  347.              write_screen_image_area((CWLWINDOW *)0,(rect),0,(p),0)
  348.  
  349. #define      WRITE_SCREEN_BLOCK_ATTR(w,rect,a,p) \
  350.              write_screen_image_area((w),(rect),(a),(p),1)
  351.  
  352.  
  353. /* Queue functions */
  354. int          queue_initialize _PROTO_((QUEUE *queue, int size, int allocsize));
  355. int          queue_add _PROTO_((QUEUE *queue, CWLMSG *mouevent));
  356. int          queue_delete _PROTO_((QUEUE *queue, int position));
  357. int          queue_insert _PROTO_((QUEUE *queue, CWLMSG *mouevent, int position)                                                                  );
  358. int          get_queue _PROTO_((QUEUE *queue, int item, CWLMSG *mouevent));
  359. int          queue_destroy _PROTO_((QUEUE *queue));
  360. int          dequeue_queue _PROTO_((QUEUE *queue, CWLMSG *mouevent));
  361. int          find_queue _PROTO_((QUEUE *queue, CWLMSG *msg, char *findtype));
  362. int          change_queue _PROTO_((QUEUE *queue, int item, CWLMSG *mouevent));
  363.  
  364.  
  365.  
  366. /* Prototypes for Non-window related internal functions */
  367. int          get_max_pages _PROTO_((CWL_VOID));
  368. CWL_VOID     get_screen_type _PROTO_((CWL_VOID));
  369. char *       get_start_colRJ _PROTO_((char *, unsigned *));
  370. unsigned     get_start_colCC _PROTO_((char *, unsigned));
  371. int          get_video_info _PROTO_((int));
  372. CWL_VOID     get_screen_segment _PROTO_((CWL_VOID));
  373. int          get_chat _PROTO_((int, int, int, int));
  374. CWL_VOID     goto_xy _PROTO_((int,int,int));
  375. CWL_VOID     video_draw_box _PROTO_((int, int, int, int, int, char *, int));
  376. CWL_VOID     video_write_center _PROTO_((char *, int, int, int));
  377. CWL_VOID     video_write_CC _PROTO_((char *, int, int, int, int));
  378. CWL_VOID     video_write_RJ _PROTO_((char *, int, int, int, int));
  379.  
  380.  
  381. /* Prototypes for scrollbar functions */
  382. CWL_VOID     draw_scroll_bars _PROTO_((WPOINTER,int));
  383. CWL_VOID     scrollbar_status _PROTO_((WPOINTER, int *, int *));
  384.  
  385. #define MOUSEHIDE() {if (CWLmouse_active && !CWLmouse_hidden) (*CWLmouse_hide_func)();}
  386. #define MOUSESHOW() {if (CWLmouse_active && CWLmouse_hidden) (*CWLmouse_show_func)();}
  387.  
  388. /* Internal form functions */
  389.  
  390. int          CWLcheck_fields _PROTO_((FORMPTR form, int *entry));
  391. int          CWLprocess_field_error _PROTO_((int errtype, char *str, int errval, int flag));
  392. CWL_VOID     clear_form _PROTO_((FORMPTR form, int entry, int *status));
  393. CWL_VOID     erase_comma_field _PROTO_((FORMPTR form, int entry));
  394. int          CWLget_field _PROTO_((FORMPTR form, int entry, int *status, int inform));
  395. CWL_VOID     get_data_from_field _PROTO_((FORMPTR form, int entry, VOIDPTR data));
  396. CWL_VOID     display_mask _PROTO_((FIELDPTR f, VOIDPTR win, int doattr, int vflag));
  397. int          form_exist _PROTO_((FORMPTR form));
  398. int          add_form _PROTO_((FORMPTR form));
  399. int          delete_form _PROTO_((FORMPTR form));
  400. CWL_VOID     zero_suppress _PROTO_((char *buf, int opt));
  401. CWL_VOID     form_free _PROTO_((FORMPTR form));
  402. CWL_VOID     print_justified _PROTO_((VOIDPTR win, FIELDPTR field, int flag, int col,
  403.                         int just, int doattr, int vflag));
  404. CWL_VOID     left_justify _PROTO_((char *str));
  405. CWL_VOID     right_justify _PROTO_((char *str, int bufwidth));
  406. int          find_next_field _PROTO_((FORMPTR form, int entry, int dir, int *fstatus));
  407. CWL_VOID     paste_value _PROTO_((FORMPTR form, int entry, char *data, int flag));
  408. int          CWLform_test _PROTO_((FORMPTR form, int entry, int options));
  409. char         *CWLcomma_fmt _PROTO_((char *buf1, char *buf2));
  410. int          CWLprocess_field_error _PROTO_((int, char *, int, int));
  411. int          do_undef_form_func _PROTO_((char *, int, int *, int));
  412. int          check_form_change_status _PROTO_((FORMPTR form));
  413. int          CWLform_get_fieldnum _PROTO_((FORMPTR form, unsigned row,
  414.                                          unsigned col, int flag));
  415. void         CWLdisplay_list _PROTO_((FORMPTR form, int hideflag));
  416. unsigned int CWLform_search _PROTO_((int row, int col));
  417. CWL_VOID     CWLget_field_rowcol _PROTO_((FORMPTR form, int entry,
  418.                                        int *row, int *col));
  419. CWL_VOID     CWLreadjust_rowcol _PROTO_((FORMPTR form, int entry, int *row, int *col,
  420.                                       int *extra, int flag));
  421.  
  422. int          CWLprocess_picklist _PROTO_((POPUP_MENU_PTR p, unsigned sel));
  423. CWL_VOID     convert_data_to_string _PROTO_((FORMPTR form, int entry, VOIDPTR dataptr,
  424.                                              char *buf));
  425. CWL_VOID     convert_double_to_string _PROTO_((FORMPTR form, int entry, char *buf,
  426.                                                VOIDPTR data));
  427. CWL_VOID     convert_string_to_double _PROTO_((char *buf, VOIDPTR uservar, int ftype));
  428. int          field_double_compare _PROTO_((double num1, double r1, double r2,
  429.                                            int options));
  430. int          field_float_compare _PROTO_((float num1, float r1, float r2,
  431.                                           int options));
  432. int          CWLform_close_help _PROTO_((FORMPTR form, int online));
  433.  
  434. CWL_VOID     CWLwrite_radio_button _PROTO_((FORMPTR form, int entry,
  435.                                          RADIO_FIELD_PTR radio, int pos,
  436.                                          int attr1, int attr2, int newflag));
  437.  
  438. int          CWLget_toggle _PROTO_((FORMPTR form, int entry, unsigned row,
  439.                                  unsigned col, int *new_entry));
  440.  
  441. int          get_subform_info _PROTO_((FORMPTR form, int entry));
  442. int          CWLget_radio_field _PROTO_((FORMPTR form, int entry, int *new_entry));
  443. int          CWLget_button _PROTO_((FORMPTR form, int entry, int *new_entry));
  444. int          CWLget_picklist _PROTO_((FORMPTR form, int entry, int *new_entry));
  445. int          CWLsearch_radio_or_check _PROTO_((FORMPTR form, int entry, int nrow, int ncol,
  446.                                           int type, int flag));
  447. int          CWLget_checkbox_field _PROTO_((FORMPTR form, int entry, int *new_entry));
  448. CWL_VOID     CWLcheckbox_setup _PROTO_((FORMPTR form, int entry, int centry));
  449. CWL_VOID     write_checkbox_char _PROTO_((FORMPTR form, int entry, int pos,
  450.                             int cchar));
  451.  
  452. CWL_VOID CWLradio_setup _PROTO_((FORMPTR form, int entry, int rentry));
  453. CWL_VOID CWLwrite_radio_check_hotkey _PROTO_((FORMPTR form, int entry,  VOIDPTR box,
  454.                                  int entrynum, int type));
  455. int      CWLset_radio_check_status _PROTO_((FORMPTR form, int entry, int entrynum,
  456.                               int flag, int type));
  457. CWL_VOID CWLpending_func _PROTO_((int));
  458.  
  459. int      CWLget_special_field_selection _PROTO_((FORMPTR form, int entry,
  460.                                    int ftype, int choice));
  461. int      CWLget_next_radio _PROTO_((FORMPTR form, int entry, int dir));
  462. int      CWLget_next_checkbox _PROTO_((FORMPTR form, int entry, int dir));
  463. CWL_VOID write_checkbox _PROTO_((FORMPTR form, int entry, int current));
  464. int      CWLcheck_field_type _PROTO_((FORMPTR form, int entry, int ftype));
  465. int      CWLspecial_field_test _PROTO_((FORMPTR form, int entry, int cond, int ftype));
  466. int      CWLsearch_list _PROTO_((FORMPTR form, int entry, int row, int col));
  467.  
  468.  
  469. SUBFORM_FIELD_PTR get_new_subform _PROTO_((FORMPTR form, FORMPTR subform,
  470.                                      int rank,
  471.                                      int start));
  472.  
  473.  
  474. int           CWLparse_hotkey _PROTO_((char *str));
  475.  
  476. int           CWLdisplay_bar_entries _PROTO_((BAR_MENU_PTR b, int where,
  477.                                               int newone));
  478. int           CWLbar_set_options _PROTO_((BAR_MENU_PTR b, int option,
  479.                                           int flag));
  480. CWL_VOID      write_barmenu_entry _PROTO_((BAR_MENU_PTR, int));
  481. int           display_barmenu_window _PROTO_((BAR_MENU_PTR, int, int));
  482. int           get_barmenu_entry _PROTO_((BAR_MENU_PTR, int, int *));
  483. CWL_VOID      highlight_barmenu_entry _PROTO_((BAR_MENU_PTR, int, int));
  484. int           call_barmenu_function _PROTO_((BAR_MENU_PTR, int, int *));
  485. int           move_barmenu_highlight _PROTO_((BAR_MENU_PTR, int ,int));
  486. int           bar_hide_entry _PROTO_((BAR_MENU_PTR, unsigned, int));
  487. CWL_VOID      write_popupmenu_entry _PROTO_((POPUP_MENU_PTR, int));
  488. int           display_popupmenu_window _PROTO_((POPUP_MENU_PTR, int, unsigned));
  489. int           call_popupmenu_function _PROTO_((POPUP_MENU_PTR, int, int *));
  490. CWL_VOID      highlight_popupmenu_entry _PROTO_((POPUP_MENU_PTR, unsigned, int));
  491. int           process_popupmenu _PROTO_((POPUP_MENU_PTR, int, int *, int *));
  492. int           CWLpopup_hide_entry _PROTO_((POPUP_MENU_PTR, int, int));
  493. int           popup_set_options _PROTO_((POPUP_MENU_PTR p,
  494.                                          unsigned options,
  495.                                          int flag));
  496. CWL_VOID      write_barmenu_hotkey _PROTO_((BAR_MENU_PTR , unsigned));
  497. CWL_VOID      write_popupmenu_hotkey _PROTO_((POPUP_MENU_PTR, int));
  498. int           process_barmenu _PROTO_((BAR_MENU_PTR, unsigned int, int *, int));
  499. CWL_VOID      write_popup_scroll_chars _PROTO_((POPUP_MENU_PTR p));
  500. int           CWLmove_bar_highlight_far _PROTO_((BAR_MENU_PTR, int, int *));
  501. CWL_VOID      highlight_popup_scroll _PROTO_((POPUP_MENU_PTR p, int where, int flag));
  502. int       CWLinit_list_highlight _PROTO_((POPUP_MENU_PTR p, int *start));
  503.  
  504.  
  505.  
  506. int      scroll_bar_assign _PROTO_((WPOINTER w, SCROLLPTR sptr, int pos1,
  507.                                     int pos2, int flag));
  508. int      reset_scrollbar _PROTO_((SCROLLPTR sbar, int minnum, int maxnum, int length,
  509.                                   int pos1, int pos2, int repaint));
  510. int      set_scroll_pos _PROTO_((SCROLLPTR sptr, int npos, int repaint));
  511. int      scrollbar_paintbox _PROTO_((SCROLLPTR sptr, int attr));
  512. int      scrollbar_repaint _PROTO_((SCROLLPTR sptr, int hideflag));
  513. int      assign_scroll_chars _PROTO_((SCROLLPTR sptr, unsigned char *schars));
  514. int      on_scrollbar _PROTO_((SCROLLPTR sptr, int row, int col));
  515. int      set_scrollpos_approx _PROTO_((SCROLLPTR sptr, int pos));
  516. int      hide_scrollbar _PROTO_((SCROLLPTR sptr));
  517. CWL_VOID      resolve_hotspot_conflict _PROTO_((WPOINTER w));
  518. CWL_VOID      assign_hotspots _PROTO_((WPOINTER w));
  519. CWL_VOID      draw_all_hotspots _PROTO_((WPOINTER w,int capflag));
  520. CWL_VOID      draw_zoom_hotspot _PROTO_((WPOINTER w, int which, int highflag));
  521. CWL_VOID      draw_hide_close_button _PROTO_((WPOINTER w));
  522. unsigned      get_mouse_or_key _PROTO_((int flag, int *which));
  523. unsigned      getmousekey _PROTO_((int flag, int *which, int *hpos, int *vpos));
  524. CWL_VOID      mouse_wait_for_release _PROTO_((CWL_VOID));
  525. CWL_VOID      CWLdo_mouse_scroll _PROTO_((WPOINTER w, int dir, int button));
  526. int           scroll_window_hotspot _PROTO_((WPOINTER w, int event, int area,
  527.                                       int wrow, int wcol, int chkflag));
  528. int           scroll_bar_assign _PROTO_((WPOINTER w, SCROLLPTR sptr, int pos1,
  529.                                   int pos2, int flag));
  530. int           reset_scrollbar _PROTO_((SCROLLPTR sbar, int minnum, int maxnum, int length,
  531.                                 int pos1, int pos2, int repaint));
  532. int           set_scroll_pos _PROTO_((SCROLLPTR sptr, int npos, int repaint));
  533. int           approx_delay _PROTO_((int mil, int button));
  534. int           IsPressed _PROTO_((int button));
  535. int           IsReleased _PROTO_((int button));
  536. CWL_VOID      get_minimize_rowcol _PROTO_((int *row, int *col));
  537. CWL_VOID      uninit_minimize     _PROTO_((CWL_VOID));
  538. int           initialize_minimize _PROTO_((int minwidth));
  539. int           get_minmax_colpos   _PROTO_((WPOINTER w, int *col1, int *col2));
  540.  
  541. CWL_VOID      popup_disable_scrollbar _PROTO_((POPUP_MENU_PTR p));
  542. CWL_VOID      popup_enable_scrollbar  _PROTO_((POPUP_MENU_PTR p));
  543. CWL_VOID      popup_set_scroll        _PROTO_((POPUP_MENU_PTR p, int flag));
  544.  
  545.  
  546.  
  547. #define clear_bits(b,s,e)  set_clear_bits((b),(s),(e),0)
  548. #define set_bits(b,s,e)    set_clear_bits((b),(s),(e),1)
  549.  
  550. /* These work using the BITSTRING structure */
  551. #define test_bit(b,bit)    (((b).bit_string[(bit) / (sizeof(char) << 3)] & \
  552.                            (1 << ((bit) % (sizeof(char) << 3))))?1:0)
  553. #define set_bit(b,bit) ((b).bit_string[(bit) / (sizeof(char) << 3)] |= \
  554.                         (1U << ((bit) % (sizeof(char) << 3))))
  555.  
  556. #define clear_bit(b,bit) ((b).bit_string[(bit) / (sizeof(char) << 3)] &= \
  557.                          ~(1U << ((bit) % (sizeof(char) << 3))))
  558.  
  559.  
  560. int          create_bit_string _PROTO_((BITSTRING *, unsigned));
  561. CWL_VOID     free_bit_string _PROTO_((BITSTRING *));
  562. CWL_VOID     set_clear_bits _PROTO_((BITSTRING *, unsigned, unsigned, int));
  563. unsigned     get_bits_set _PROTO_((BITSTRING *, int));
  564. unsigned     get_first_bit_set _PROTO_((BITSTRING *, unsigned, int, int *));
  565. unsigned     search_bit_set _PROTO_((BITSTRING *, unsigned, int, int *));
  566. CWL_VOID     copy_bits_to_char _PROTO_((BITSTRING *b, unsigned char *ch,
  567.                                         int start, int len));
  568.  
  569. int          get_num_bits _PROTO_((BITSTRING *b));
  570. int          insert_bit_string _PROTO_((BITSTRING *b, unsigned bit, int flag));
  571. int          delete_bit_string _PROTO_((BITSTRING *b, unsigned bit));
  572. int          copy_bits _PROTO_((BITSTRING *dest, BITSTRING *source));
  573.  
  574.  
  575. /* structures used internally for input functions */
  576.  
  577. typedef struct {
  578.   unsigned formflag:1;       /* tells if input is coming from a form */
  579.   unsigned autoreturn:1;     /* tells if input is accepted if last character
  580.                               * is typed in */
  581.   unsigned autobackward:1;   /* tells if previous field is activated if the
  582.                               * cursor goes before the first column (used
  583.                               * in forms only) */
  584.   unsigned password:1;       /* tells if input field is a password field */
  585.   unsigned insert:1;         /* tells if in insert mode */
  586.   unsigned uppercase:1;      /* tells if alpha characters are displayed in
  587.                               * upper case */
  588.   unsigned lowercase:1;      /* tells if alpha characters are displayed in
  589.                               * lower case */
  590.   unsigned checkspaces:1;    /* tells if input manager should check for
  591.                               * blank spaces when checking input
  592.                               * requirements */
  593.   unsigned enhancedkey:1;    /* Tells if enhanced keys should be detected */
  594.   unsigned checkregexp:1;    /* tells if each input position matches the
  595.                               * regular expression desired */
  596.   unsigned checkregexp_ign:1; /* tells if checking should be case insensitive */
  597.   unsigned homecursor:1;      /* tells if input is shifted to first position
  598.                                * after accepting */
  599.     unsigned use_mouse:1;      /* use the mouse for this input field */
  600.   unsigned clear_field:1;    /* clear field flag */
  601.   unsigned use_virtual:1;    /* use virtual window input */
  602. } IFLAG;
  603.  
  604. typedef struct tagISTRUCT{
  605.   WPOINTER w;             /* window to get input from */
  606.   char *savestring;       /* original default string */
  607.   char *inputstring;      /* string currently being inputted */
  608.   char *mask;             /* character mask to use */
  609.   char *regexp;           /* regular expression to use */
  610.   char *imask;            /* temporary input mask */
  611.   unsigned row;           /* row to get input */
  612.   unsigned col;           /* column to get input */
  613.   int attr;               /* attribute to use */
  614.   int maxwidth;           /* width of displayed input field */
  615.   int retkey;             /* key when hit */
  616.   char maskchar;          /* input mask character */
  617.   char fc;                /* fill character */
  618.   char pchar;             /* password character */
  619.   int minchars;           /* minimum number of characters to accept */
  620.   unsigned current_string_pos;  /* current input position */
  621.   unsigned current_mask_pos;    /* current input position if using the
  622.                                  * character mask */
  623.   int left_mask_pos;      /* first character of mask that appears on the
  624.                            * left of the displayed input field */
  625.   int right_mask_pos;     /* last character of mask that appears on the
  626.                            * right of the displayed input field */
  627.   int first_input_pos;    /* first position in entered string that appears
  628.                            * on the left of the displayed input field */
  629.   int last_input_pos;     /* last position in entered string that appears
  630.                              * on the right of the displayed input field */
  631.   int abs_left_pos;       /* first position in mask that is an input position */
  632.   int first_mask_pos;     /* first displayable mask position */
  633.   int num_total_chars;    /* number of total characters that can be input */
  634.   int nullpos;            /* position of null terminator in entered string */
  635.   int string_nullpos;     /*   */
  636.   IFLAG flags;            /* input flags */
  637.   unsigned *editkey;     /* array of keys to use to edit this field */
  638.     int startpos;          /* starting position in field */
  639. }  INP_STRUCT;
  640.  
  641.  
  642. CWL_VOID Iinsert_character _PROTO_((INP_STRUCT *, unsigned));
  643. int  Ifind_next_pos  _PROTO_((INP_STRUCT *, int));
  644. int  Ifind_prev_pos  _PROTO_((INP_STRUCT *, int));
  645. CWL_VOID Ireset_mask _PROTO_((INP_STRUCT *,char *,int));
  646. int  Iclean_up _PROTO_((INP_STRUCT *));
  647. int  process_keystroke _PROTO_((INP_STRUCT *, unsigned, int, int, int));
  648. int  default_key_process _PROTO_((INP_STRUCT *, int, int, int, int));
  649. int  Icheck_regexp _PROTO_((INP_STRUCT *, int *));
  650. int  window_get_input _PROTO_((INP_STRUCT *));
  651.  
  652.  
  653. #ifdef POWERC
  654. int count_events(int event);
  655. int save_cap_(int seg, int off);
  656. int TranslateMessage(int event);
  657. int FindMessage(int message);
  658. void ReplaceMessage(int message, int y, int x, int pos);
  659. void SetVKbits(int message);
  660. int SwapButtons(int message);
  661. void AddMessage(int message, int y, int x, pos, WPOINTER w);
  662. int GetQueueBack();
  663. int GetWPtrOffset(int y, int x);
  664. int CWLqueue_full();
  665. int GetWPtrPos(int offset, int sseg, int soff);
  666. void far *GetWPtr(int offset, int sseg, int ssof);
  667. #endif
  668.  
  669.  
  670.  
  671. #define FORM_ON() (CWLformlib_exist && istruct->flags.formflag)
  672.  
  673. #endif
  674.