home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / CKPM5X_S.ZIP / CKOPM.H < prev    next >
C/C++ Source or Header  |  1990-05-27  |  5KB  |  170 lines

  1. /******************************************************************************
  2. Header name:   ckopm.h    Rev: 01  Date: 07-Dec-89 Programmer: C.P.Armstrong
  3.  
  4. Header title:  Definition of structures and functions used by the PM interface
  5.                outines.
  6.  
  7. Description:    
  8.  
  9. Modification History:
  10.     01  07-Dec-89   C.P.Armstrong   created
  11.         31-Jan-90   C.P.Armstrong   Gin and vector stuff added
  12. ******************************************************************************/
  13. /* Nominal maximum plot resolution */
  14. #define MAXXRES             1024
  15. #define MAXYRES              780
  16. #define MAXCHARHEIGHT         15
  17. #define MAXCHARWIDTH          14 
  18.  
  19.  
  20. /* User defined window messages */
  21. /* WM_USER is used by Gpi */
  22. #define WM_KERAVIO    WM_USER+1
  23. #define WM_HIDE       WM_USER+2
  24. #define WM_GIN        WM_USER+3       /* Used by Gpi */
  25. #define WM_TITLETEXT  WM_USER+4
  26. #define WM_CURCHECK   WM_USER+5
  27.  
  28.  
  29. /* avio_command command definitions */
  30. #define RDCELLSTR   0
  31. #define WRCELLSTR   1
  32. #define WRNCELL     2
  33. #define SCROLLRT    3
  34. #define SCROLLLF    4
  35. #define SCROLLUP    5
  36. #define SCROLLDN    6
  37. #define WRCCHSTAT   7
  38. #define SETCURPOS   8
  39. #define GETCURPOS   9
  40. #define GETCURTYP   10
  41. #define SETCURTYP   11
  42. #define PRINTF      12
  43. #define WRCCHSTATD  13
  44.  
  45. ///* Resource file definitions */   Moved to ckorc.h
  46. //#define ID_RESOURCE 1
  47.  
  48. /* Vector font ID */
  49. #define LCID_VECTFONT 1L
  50. #define LCID_TEKFONT  2L
  51.  
  52.  
  53. struct dlgopn
  54.     {
  55.     char * name;   /* Pointer to the buffer for the returned filename */
  56.     char * title;  /* Pointer to the dialog title */
  57.     };
  58.  
  59.  
  60. /* Structure definitions */
  61. struct avio_cellstr
  62.     {
  63.     int fun;
  64.     char * string;
  65.     PUSHORT  plen;
  66.     int    len;
  67.     SHORT  row;
  68.     SHORT  col;
  69.     int    hite;
  70.     int    wid;
  71.     char * pcell;
  72.     };
  73.     
  74. struct plot_command
  75.     {
  76.     char   c;
  77.     POINTL ptl;
  78.     struct plot_command * next;
  79.     };
  80.     
  81. struct TitleText_command
  82.     {
  83.     char action;    /* 0 for set, 1 for get, 2 for len */
  84.     HWND hwnd;      /* Window to set text in */
  85.     char * buffer;  /* buffer containing the text or to receive the text */
  86.     SHORT len;
  87.     PULONG sem;     /* Semaphore to clear when command is processed */
  88.     };                                                                
  89. #define SET    0    /* defines for use with TitleText */
  90. #define GET    1
  91. #define LENGTH 2
  92.  
  93. /* Info requried to select a font with SelectVectFont */
  94. struct fontstuff
  95.     {
  96.     char * name;  /* Name of font */
  97.     int vect;     /* 0 for bitmap, 1 for vector font */
  98.     int h;        /* Height of bitmap font */
  99.     int w;        /* Width of bitmap font */
  100.     };
  101.  
  102. /* Structure passed to pc_paint_thread.  Must be declared as static by the */
  103. /* thread initiating the paint thread.                                     */
  104. struct pc_paint
  105.     {
  106.     ULONG StartPaintSem;    /* Set when repaint desired */
  107.     ULONG StopPaintSem;     /* Used to stop a reapint in progress */
  108.     ULONG EndPaintThread;   /* Terminate the thread */
  109.     SWP   pc_swp;           /* Dimensions of the repaint window */
  110.     struct plot_command * root; /* First plot_command in linked list */
  111.     HWND hwnd;              /* Handle of window to plot in */
  112.     COLOR fgcol;            /* Default foreground colour */
  113.     COLOR bkcol;            /* Default background colour */
  114.     struct fontstuff * fnt; /* Default font - for use with SelectVectFont */
  115.     };
  116.  
  117.  
  118.  
  119. /* Function definitions */
  120. void far cdecl window_thread();
  121. int  cdecl buff_empty(void);
  122. int  cdecl buff_test(void);
  123. int  cdecl buff_getch(void);
  124. int  cdecl buff_tgetch(long);
  125. void cdecl buff_insert(int);
  126. void cdecl buff_strins(char *);
  127. void cdecl vWrtchar(char*,int,HVPS);
  128. BYTE cdecl RgbToVioColor(COLOR);
  129. LONG cdecl VioToRgbColor(BYTE);
  130. BOOL cdecl show_cursor(BOOL,HVPS);
  131. void flash_cursor(HVPS);
  132. void cdecl pm_err(char *);
  133. void cdecl pc_interp(struct plot_command,PSWP,char,HPS);
  134. void cdecl pc_delete(struct plot_command *);
  135. struct plot_command * cdecl pc_save(struct plot_command *,MPARAM,MPARAM); 
  136. void cdecl pm_err(char *);
  137. void cdecl pm_msg(char*,char*);
  138. void       dbprintf(const char far *,...);
  139. void Put_cursor_onscreen(HWND,HVPS);
  140. void CurScrChk(void);
  141.  
  142. long cdecl SelectFont(HPS,LONG,CHAR*,int,int,int);
  143. void cdecl SetCharBox(HPS,int,int);
  144. HSWITCH cdecl AddToSwitch(HWND, HWND, CHAR*);
  145. void cdecl SetPMGinMode(HWND,MPARAM,HPOINTER);
  146. int  cdecl DoPMGin(HWND,PUSHORT);
  147. BOOL cdecl TestPMGinMode(void);
  148. void cdecl SetGinMode(HWND,int);
  149. void cdecl GetGinCoords(int*,int*,char*);
  150. void cdecl process_avio(struct avio_cellstr *,HVPS);
  151.  
  152. int numlock_status(void);
  153. int numlock_toggle(void);
  154.  
  155. MRESULT EXPENTRY FileOpnDlgProc(HWND,USHORT,MPARAM,MPARAM);
  156. MRESULT EXPENTRY FileClsDlgProc(HWND,USHORT,MPARAM,MPARAM);
  157. int FileOpnDlgInit(HWND,MPARAM,char *);
  158. int FileOpnDlgExit(HWND,char*);
  159. int FileOpnDlgCmnd(HWND,int);
  160.  
  161. /* Block marking and copying routiens */
  162. int do_copy(int,HVPS,HAB);
  163. int do_paste(HAB);
  164.  
  165. /* Graphics metafile and printing routines - ckopm6.c */
  166. int do_print(HAB,HWND);
  167. int do_meta(HAB,HWND);
  168. int MakeMetaFile(char * metname,HAB hab,HWND hwnd);
  169.  
  170.