Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
4.9 KiB

  1. /*
  2. * tpriv.h
  3. *
  4. * data structures used internally by table class.
  5. *
  6. * include after table.h
  7. */
  8. #ifndef abs
  9. #define abs(x) (((x) > 0)? (x) : -(x))
  10. #endif
  11. /* one of these per visible line */
  12. typedef struct {
  13. CellPos linepos; /* posn and clipping info for line */
  14. lpCellData pdata; /* array of CellData structs for all cells */
  15. } LineData, *lpLineData;
  16. /* master info struct pointed to by window extra bytes */
  17. typedef struct {
  18. /* table info */
  19. TableHdr hdr; /* main hdr info from owner */
  20. lpColProps pcolhdr; /* ptr to array of phdr->ncols hdrs */
  21. /* window info */
  22. int avewidth; /* font ave width - for default cell sizing */
  23. int rowheight; /* height of one row */
  24. int rowwidth; /* total width of one row in pixels */
  25. int winwidth; /* width of window */
  26. int nlines; /* actual lines currently visible */
  27. lpCellPos pcellpos; /* array of cell position structs */
  28. /* scroll settings */
  29. long scrollscale; /* scaling factor (force 16-bit range) */
  30. long toprow; /* 0-based rownr of top moveable line */
  31. int scroll_dx; /* horz scroll posn in pixels. */
  32. /* column data */
  33. lpLineData pdata; /* ptr to array of nlines of LineData */
  34. /* selection/dragging */
  35. UINT trackmode; /* current mouse-tracking mode */
  36. int tracknr; /* col or row being resized */
  37. int trackline1; /* currently drawn track lines */
  38. int trackline2;
  39. BOOL selvisible; /* used during mouse-down: T if sel drawn */
  40. TableSelection select;
  41. // tab expansion
  42. int tabchars;
  43. // show whitespace chars
  44. BOOL show_whitespace;
  45. } Table, *lpTable;
  46. /* trackmode constants */
  47. #define TRACK_NONE 0
  48. #define TRACK_COLUMN 1
  49. #define TRACK_CELL 2
  50. /* private flags in CellData struct */
  51. #define CELL_VALID 1
  52. /* window extra bytes are used to hold the owner, heap and Table structs */
  53. #define WW_OWNER 0 /* HWND of owner */
  54. #define WW_HEAP (WW_OWNER + sizeof(HWND)) /* gmem heap */
  55. #define WL_TABLE (WW_HEAP + sizeof(HANDLE)) /* lpTable */
  56. #define WLTOTAL (WL_TABLE + sizeof(lpTable)) /* total extra bytes */
  57. /* ---------- global data -------------------*/
  58. extern HPEN hpenDotted; /* in table.c */
  59. extern HANDLE hVertCurs; /* in table.c */
  60. extern HANDLE hNormCurs; /* in table.c */
  61. /*------function prototypes ---------------------------------------*/
  62. /* in table.c */
  63. void gtab_init(void); /* called from DLL startup function */
  64. INT_PTR gtab_sendtq(HWND hwnd, UINT cmd, LPARAM lParam);
  65. void gtab_invallines(HWND hwnd, lpTable ptab, int start, int count);
  66. void gtab_setsize(HWND hwnd, lpTable ptab);
  67. void gtab_calcwidths(HWND hwnd, lpTable ptab);
  68. void gtab_deltable(HWND hwnd, lpTable ptab);
  69. BOOL gtab_alloclinedata(HWND hwnd, HANDLE heap, lpTable ptab);
  70. /* in tpaint.c */
  71. void gtab_paint(HWND hwnd);
  72. void gtab_paintline(HWND hwnd, HDC hdc, lpTable ptab, int line, BOOL show_whitespace, BOOL fPrinting);
  73. void gtab_paintunused(HWND hwnd, HDC hdc, lpTable ptab, int y);
  74. void gtab_vsep(HWND hwnd, lpTable ptab, HDC hdc);
  75. void gtab_hsep(HWND hwnd, lpTable ptab, HDC hdc);
  76. void gtab_invertsel(HWND hwnd, lpTable ptab, HDC hdc_in);
  77. void gtab_drawvertline(HWND hwnd, lpTable ptab);
  78. /* in tscroll.c */
  79. void gtab_dovscroll(HWND hwnd, lpTable ptab, long change);
  80. void gtab_dohscroll(HWND hwnd, lpTable ptab, long change);
  81. long gtab_linetorow(HWND hwnd, lpTable ptab, int line);
  82. int gtab_rowtoline(HWND hwnd, lpTable ptab, long row);
  83. void gtab_msg_vscroll(HWND hwnd, lpTable ptab, int opcode, int pos);
  84. void gtab_msg_hscroll(HWND hwnd, lpTable ptab, int opcode, int pos);
  85. void gtab_select(HWND hwnd, lpTable ptab, long row, long col, long nrows, long ncells, BOOL bNotify);
  86. void gtab_enter(HWND hwnd, lpTable ptab, long row, long col, long nrows, long ncells);
  87. void gtab_press(HWND hwnd, lpTable ptab, int x, int y);
  88. void gtab_rightclick(HWND hwnd, lpTable ptab, int x, int y);
  89. void gtab_release(HWND hwnd, lpTable ptab, int x, int y);
  90. void gtab_move(HWND hwnd, lpTable ptab, int x, int y);
  91. void gtab_dblclick(HWND hwnd, lpTable ptab, int x, int y);
  92. void gtab_showsel(HWND hwnd, lpTable ptab, BOOL bToBottom);
  93. void gtab_showsel_middle(HWND hwnd, lpTable ptab, long dyRowsFromTop);
  94. int gtab_key(HWND hwnd, lpTable ptab, int vkey);
  95. int gtab_mousewheel(HWND hwnd, lpTable ptab, DWORD fwKeys, int zDelta);
  96. /* in tprint.c */
  97. BOOL gtab_print(HWND hwnd, lpTable ptab, HANDLE heap, lpPrintContext pcontext);
  98. void gtab_boxcell(HWND hwnd, HDC hdc, LPRECT rcp, LPRECT pclip, UINT boxmode);