Source code of Windows XP (NT5)
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.

768 lines
29 KiB

  1. /*
  2. Example
  3. vsDllExport("_command void proc1(int i,VSPSZ i,VSHVAR x)",0,0);
  4. Syntax:
  5. [_command] [return-type] func-name([type [var-name] [,type [var-name]...])
  6. type
  7. VSPVOID Pointer to something Slick-C can't call this.
  8. VSPSZ NULL terminated string
  9. VSPLSTR See typedef below.
  10. int
  11. long
  12. VSHVAR Handle to interpreter variable
  13. VSHREFVAR Call by reference handle to interpreter variable.
  14. This type can be used as input to functions which
  15. accept VSHVAR parameters.
  16. return-type may be one of the following
  17. VSPSZ
  18. VSPLSTR
  19. int
  20. long
  21. void
  22. Performance considerations:
  23. For best performance, use the VSHVAR or VSREFVAR param-type when
  24. operating on long strings instead of VSPSZ or VSPLSTR. Then
  25. use the "vsHvarGetLstr" function to return a pointer to the
  26. interpreter variable. WARNING: Pointers to interpreter variables
  27. returned by the vsHvarGetLstr function are NOT VALID after any
  28. interpreter variable is set. Be sure to reset any pointer after
  29. setting other interpreter variables or calling other macros.
  30. You may modify the contents of the VSPLSTR pointer returned by
  31. vsHvarGetLstr so long as you do not make the string any longer.
  32. We suspect that using the int and long parameter types are no
  33. slower than using the VSHVAR type and converting the parameter yourself.
  34. */
  35. #ifndef VSAPI_H
  36. #define VSAPI_H
  37. #if defined(OS2386APP)
  38. #define INCL_DEV
  39. #define INCL_WIN
  40. #define INCL_GPI
  41. #define INCL_GPILCIDS
  42. #define INCL_WINPOINTERS
  43. #define INCL_GPILOGCOLORTABLE
  44. #define INCL_WINSYS
  45. #define INCL_DOSPROCESS
  46. #define INCL_ERRORS
  47. #include <os2.h>
  48. #define VSAPI _System
  49. #define VSUNIX 0
  50. #define VSOS2 1
  51. #define VSNT 0
  52. #elif defined(WIN32)
  53. #ifndef _WINDOWS_
  54. #include <windows.h>
  55. #include <windowsx.h>
  56. #endif
  57. #define VSAPI __stdcall
  58. #define VSUNIX 0
  59. #define VSOS2 0
  60. #define VSNT 1
  61. #else
  62. #define VSAPI
  63. #define VSUNIX 1
  64. #define VSOS2 0
  65. #define VSNT 0
  66. #endif
  67. #include <rc.h>
  68. #define VSMAXLSTR 1024
  69. typedef struct {
  70. int len;
  71. unsigned char str[VSMAXLSTR];
  72. } VSLSTR, *VSPLSTR;
  73. #if !defined(VSXLATDLLNAMES)
  74. #define VSNOXLATDLLNAMES
  75. #else
  76. #undef VSNOXLATDLLNAMES
  77. #endif
  78. #define HVAR int
  79. #define VSHVAR int
  80. #define VSHREFVAR VSHVAR
  81. //typedef void *VSPVOID;
  82. //typedef char *VSPSZ;
  83. #define VSPVOID void *
  84. #define VSPSZ char *
  85. extern "C" {
  86. #define VSOI_MDI_FORM 1
  87. #define VSOI_FORM 2
  88. #define VSOI_TEXT_BOX 3
  89. #define VSOI_CHECK_BOX 4
  90. #define VSOI_COMMAND_BUTTON 5
  91. #define VSOI_RADIO_BUTTON 6
  92. #define VSOI_FRAME 7
  93. #define VSOI_LABEL 8
  94. #define VSOI_LIST_BOX 9
  95. #define VSOI_HSCROLL_BAR 10
  96. #define VSOI_VSCROLL_BAR 11
  97. #define VSOI_COMBO_BOX 12
  98. #define VSOI_HTHELP 13
  99. #define VSOI_PICTURE_BOX 14
  100. #define VSOI_IMAGE 15
  101. #define VSOI_GAUGE 16
  102. #define VSOI_SPIN 17
  103. #define VSOI_MENU 18
  104. #define VSOI_MENU_ITEM 19
  105. #define VSOI_TREE_VIEW 20
  106. #define VSOI_SSTAB 21
  107. #define VSOI_DESKTOP 22
  108. #define VSOI_SSTAB_CONTAINER 23
  109. #define VSOI_EDITOR 24
  110. #define VSSC_SIZE 0xF000
  111. #define VSSC_MOVE 0xF010
  112. #define VSSC_MINIMIZE 0xF020
  113. #define VSSC_MAXIMIZE 0xF030
  114. #define VSSC_NEXTWINDOW 0xF040
  115. #define VSSC_PREVWINDOW 0xF050
  116. #define VSSC_CLOSE 0xF060
  117. #define VSSC_RESTORE 0xF120
  118. // RefreshFlags
  119. #define VSREFRESH_BUFNAME 0x0002
  120. #define VSREFRESH_MODENAME 0x0004
  121. #define VSREFRESH_READONLY 0x0008
  122. #define VSREFRESH_LINE 0x0010
  123. #define VSREFRESH_COL 0x0020
  124. #define VSREFRESH_INSERTMODE 0x10000
  125. #define VSREFRESH_RECORDING 0x20000
  126. #define VSSTATUSFLAG_READONLY 0x0001
  127. #define VSSTATUSFLAG_INSERTMODE 0x0002
  128. #define VSSTATUSFLAG_RECORDING 0x0004
  129. #define VSNULLSEEK 0x7fffffffl
  130. #define VSRC_HVAR 1
  131. #define VSP_CANCEL 0 /* boolean*/
  132. #define VSP_DEFAULT 1 /* boolean*/
  133. #define VSP_ENABLED 2 /* boolean*/
  134. #define VSP_FONTBOLD 3 /* boolean*/
  135. #define VSP_FONTITALIC 4 /* boolean*/
  136. #define VSP_FONTSIZE 5 /* boolean*/
  137. #define VSP_FONTSTRIKETHRU 6 /* boolean*/
  138. /* #define 7 */
  139. #define VSP_FONTUNDERLINE 8 /* boolean*/
  140. #define VSP_MAXBUTTON 9 /* boolean*/
  141. #define VSP_MINBUTTON 10 /* boolean*/
  142. #define VSP_VISIBLE 11 /* boolean*/
  143. #define VSP_TABSTOP 12 /* boolean*/
  144. #define VSP_CONTROLBOX 13 /* boolean*/
  145. /* #define 14 */ /* boolean*/
  146. #define VSP_STYLE 15 /* int */
  147. #define VSP_BORDERSTYLE 16 /* int */
  148. #define VSP_DRAWSTYLE 17 /* int */
  149. #define VSP_SCROLLBARS 18 /* int */
  150. #define VSP_MULTISELECT 19 /* int */
  151. #define VSP_INITSTYLE 20 /* int */
  152. /* #define 21 */
  153. #define VSP_ALIGNMENT 22 /* int */
  154. #define VSP_WINDOWSTATE 23 /* string. */
  155. #define VSP_MOUSEPOINTER 24 /* int */
  156. #define VSP_INITINFO 25 /* int */
  157. #define VSP_VALIDATEINFO 26 /* int */
  158. #define VSP_EVENTTAB 27 /* int */
  159. #define VSP_NAME 28 /* string */
  160. #define VSP_CAPTION 29 /* string */
  161. #define VSP_FONTNAME 30 /* string. */
  162. #define VSP_BACKCOLOR 31 /* int */
  163. /* #define 32 *//* int */
  164. #define VSP_DRAWMODE 33 /* int */
  165. #define VSP_DRAWWIDTH 34 /* int */
  166. #define VSP_FORECOLOR 35 /* int */
  167. #define VSP_HEIGHT 36 /* int */
  168. #define VSP_INTERVAL 37 /* int */
  169. #define VSP_TABINDEX 38 /* int */
  170. #define VSP_WIDTH 39 /* int */
  171. #define VSP_X 40 /* int */
  172. #define VSP_Y 41 /* int */
  173. #define VSP_VALUE 42 /* int */
  174. #define VSP_INFROMLEFT 43 /* int */
  175. #define VSP_DOWNFROMTOP 44 /* int */
  176. #define VSP_INFROMRIGHT 45 /* int */
  177. #define VSP_UPFROMBOTTOM 46 /* int */
  178. #define VSP_SCALEMODE 47 /* int */
  179. #define VSP_X1 48 /* int */
  180. #define VSP_Y1 49 /* int */
  181. #define VSP_X2 50 /* int */
  182. #define VSP_Y2 51 /* int */
  183. #define VSP_TEXT 52 /* string */
  184. #define VSP_PICPOINTSCALE 53 /* int */
  185. #define VSP_AFTERPICINDENTX 54 /* int */
  186. #define VSP_PICSPACEY 55 /* int */
  187. #define VSP_PICINDENTX 56 /* int */
  188. #define VSP_PICTURE 57 /* int */
  189. #define VSP_CBACTIVE 58 /* int */
  190. #define VSP_STRETCH 59 /* boolean */
  191. #define VSP_FONTPRINTER 60 /* boolean */
  192. #define VSP_AUTOSIZE 61 /* boolean */
  193. #define VSP_CBPICTURE 62 /* int */
  194. #define VSP_CBLISTBOX 63 /* int */
  195. #define VSP_CBTEXTBOX 64 /* int */
  196. #define VSP_CB 65 /* int */
  197. #define VSP_OBJECT 66 /* string*/
  198. #define VSP_CHILD 67 /* int */
  199. #define VSP_NEXT 68 /* int */
  200. #define VSP_CLIPCONTROLS 69 /* boolean */
  201. #define VSP_WORDWRAP 70 /* boolean */
  202. #define VSP_ADEFAULT 71 /* boolean */
  203. #define VSP_EDIT 72 /* boolean */
  204. #define VSP_SELECTED 73 /* boolean */
  205. #define VSP_OBJECTMODIFY 74 /* boolean */
  206. #define VSP_FILLSTYLE 75 /* int */
  207. #define VSP_EVENTTAB2 76 /* int */
  208. #define VSP_MIN 77 /* int */
  209. #define VSP_MAX 78 /* int */
  210. #define VSP_LARGECHANGE 79 /* int */
  211. #define VSP_SMALLCHANGE 80 /* int */
  212. #define VSP_DELAY 81 /* int */
  213. #define VSP_CBEXTENDEDUI 82 /* boolean */
  214. #define VSP_NOFSTATES 83 /* int */
  215. #define VSP_ACTIVEFORM 84 /* int */
  216. #define VSP_TEMPLATE 85 /* int */
  217. #define VSP_COMPLETION 86 /* string */
  218. #define VSP_MAXCLICK 87 /* int */
  219. #define VSP_NOFSELECTED 88 /* int */
  220. #define VSP_AUTOSELECT 89 /* boolean */
  221. #define VSP_INCREMENT 90 /* int */
  222. #define VSP_PREV 91 /* int */
  223. #define VSP_COMMAND 92 /* string */
  224. #define VSP_MESSAGE 93 /* string */
  225. #define VSP_CATEGORIES 94 /* string */
  226. #define VSP_CHECKED 95 /* boolean */
  227. #define VSP_TILEID 100 /* int */
  228. #define VSP_WINDOWFLAGS 101 /* int */
  229. #define VSP_VSBBYTEDIVS 102 /* int */
  230. #define VSP_WINDOWID 103 /* int */
  231. #define VSP_LEFTEDGE 104 /* int */
  232. #define VSP_CURSORX 105 /* int */
  233. #define VSP_CURSORY 106 /* int */
  234. #define VSP_LINE 107 /* int */
  235. #define VSP_NOFLINES 108 /* int */
  236. #define VSP_COL 109 /* int */
  237. #define VSP_BUFNAME 110 /* string */
  238. #define VSP_MODIFY 111 /* int */
  239. #define VSP_BUFID 112 /* int */
  240. #define VSP_MARGINS 113 /* string */
  241. #define VSP_TABS 114 /* string */
  242. #define VSP_MODENAME 115 /* string */
  243. #define VSP_BUFWIDTH 116 /* int */
  244. #define VSP_WORDWRAPSTYLE 117 /* int */
  245. #define VSP_SHOWTABS 118 /* int */
  246. #define VSP_INDENTWITHTABS 119 /* boolean */
  247. #define VSP_BUFFLAGS 120 /* int */
  248. #define VSP_NEWLINE 121 /* string */
  249. #define VSP_UNDOSTEPS 122 /* int */
  250. #define VSP_INDEX 123 /* int */
  251. #define VSP_BUFSIZE 124 /* int */
  252. #define VSP_CHARHEIGHT 125 /* int */
  253. #define VSP_CHARWIDTH 126 /* int */
  254. #define VSP_VSBMAX 127 /* int */
  255. #define VSP_HSBMAX 128 /* int */
  256. #define VSP_FONTHEIGHT 129 /* int */
  257. #define VSP_FONTWIDTH 130 /* int */
  258. #define VSP_CLIENTHEIGHT 131 /* int */
  259. #define VSP_CLIENTWIDTH 132 /* int */
  260. #define VSP_OLDX 133 /* int */
  261. #define VSP_OLDY 134 /* int */
  262. #define VSP_OLDWIDTH 135 /* int */
  263. #define VSP_OLDHEIGHT 136 /* int */
  264. #define VSP_ONEVENT 137 /* int */
  265. #define VSP_SELLENGTH 138 /* int */
  266. #define VSP_SELSTART 139 /* int */
  267. #define VSP_CURRENTX 140 /* int */
  268. #define VSP_CURRENTY 141 /* int */
  269. #define VSP_PARENT 142 /* int */
  270. #define VSP_MDICHILD 143 /* int */
  271. #define VSP_WINDENTX 144 /* int */
  272. #define VSP_FIXEDFONT 145 /* int */
  273. #define VSP_RELLINE 146 /* int */
  274. #define VSP_SCROLLLEFTEDGE 147 /* int */
  275. #define VSP_DISPLAYXLAT 148 /* string */
  276. #define VSP_UNDOVISIBLE 149 /* int */
  277. #define VSP_MODAL 150 /* int */
  278. #define VSP_NOFWINDOWS 151 /* int */
  279. #define VSP_USER 152 /* string */
  280. #define VSP_USER2 153 /* string */
  281. #define VSP_NOSELECTCOLOR 154 /* boolean */
  282. #define VSP_VIEWID 155 /* int */
  283. #define VSP_INDENTSTYLE 156 /* int */
  284. #define VSP_MODEEVENTTAB 157 /* int */
  285. #define VSP_XYSCALEMODE 158 /* int */
  286. #define VSP_XYPARENT 159 /* int */
  287. #define VSP_BUTTONBAR 160 /* int */
  288. #define VSP_ISBUTTONBAR 161 /* int */
  289. #define VSP_MENUHANDLE 163 /* int */
  290. #define VSP_FILEDATE 164 /* string */
  291. #define VSP_REDRAW 165 /* boolean */
  292. #define VSP_WORDCHARS 166 /* string */
  293. #define VSP_LEXERNAME 167 /* string */
  294. #define VSP_BUSER 168 /* string */
  295. #define VSP_COLORFLAGS 169 /* int */
  296. #define VSP_HWND 170 /* long */
  297. #define VSP_HWNDFRAME 171 /* long */
  298. #define VSP_BINARY 172 /* boolean */
  299. #define VSP_SHOWEOF 173 /* boolean */
  300. //#define I_SHOWNLCHARS 174
  301. #define VSP_READONLYMODE 175 /* boolean */
  302. #define VSP_HEXNIBBLE 176 /* boolean */
  303. #define VSP_HEXMODE 177 /* boolean */
  304. #define VSP_HEXFIELD 178 /* int */
  305. #define VSP_HEXNOFCOLS 179 // int
  306. #define VSP_HEXTOPPAGE 180 // int
  307. #define VSP_NOFHIDDEN 181 // int
  308. #define VSP_LINENUMBERSLEN 182 // int
  309. #define VSP_READONLYSETBYUSER 183 // boolean
  310. #define VSP_WINDENT_Y 184 // int
  311. #define VSP_NOFSELDISPBITMAPS 185 // int
  312. #define VSP_LINESTYLE 186 // int
  313. #define VSP_LEVELINDENT 187 // int
  314. #define VSP_SPACEY 188 // int
  315. #define VSP_EXPANDPICTURE 189 // int
  316. #define VSP_COLLAPSEPICTURE 190 // int
  317. #define VSP_SHOWROOT 191 // int
  318. //#define VSP_CHECKLISTBOX 192 not supported
  319. //#define VSP_PASSWORD 198 not supported
  320. #define VSP_READONLY 199 // boolean
  321. #define VSP_SHOWSPECIALCHARS 200 // int
  322. #define VSP_MOUSEACTIVATE 201 // int
  323. #define VSP_MODIFYFLAGS 202 // int
  324. #define VSP_OLDLINENUMBER 203 // int
  325. #define VSP_NOFNOSAVE 204 // int
  326. #define VSP_CAPTIONCLICK 205 // boolean
  327. #define VSP_RLINE 206 // int
  328. #define VSP_RNOFLINES 207 // int
  329. // SSTab properties
  330. #define VSP_ACTIVETAB 208 // int
  331. #define VSP_ORIENTATION 209 // int
  332. #define VSP_TABSPERROW 210 // int
  333. #define VSP_MULTIROW 211 // boolean
  334. #define VSP_NOFTABS 212 // int
  335. #define VSP_ACTIVEORDER 213 // int
  336. #define VSP_ACTIVECAPTION 214 // int
  337. #define VSP_ACTIVEPICTURE 215 // int
  338. #define VSP_ACTIVEHELP 216 // string
  339. #define VSP_RBUFSIZE 217 // int
  340. #define VSP_ACTIVEENABLED 218 // boolean
  341. #define VSP_PICTUREONLY 219 // boolean
  342. #define VSP_SOURCERECORDING 220 // boolean
  343. /* Completion arguments */
  344. /* "!" indicates last argument. */
  345. #define VSMORE_ARG "*" /* Indicate more arguments. */
  346. #define VSWORD_ARG "w" /* Match what was typed. */
  347. #define VSFILE_ARG "f:18" /* Match one file. 18=FILE_CASE_MATCH|AUTO_DIR_MATCH*/
  348. #define VSMULTI_FILE_ARG FILE_ARG'*'
  349. #define VSBUFFER_ARG "b:2" /* Match buffer. */
  350. #define VSCOMMAND_ARG "c"
  351. #define VSPICTURE_ARG "_pic"
  352. #define VSFORM_ARG "_form"
  353. #define VSOBJECT_ARG "_object"
  354. #define VSMODULE_ARG "m"
  355. #define VSPC_ARG "pc" /* look for procedure or command . */
  356. /* look Slick-C tag cmd,proc,form */
  357. #define VSMACROTAG_ARG "mt:8" /* Any find-proc item. 8=REMOVE_DUPS_MATCH */
  358. #define VSMACRO_ARG "k" /* Recorded macro command. */
  359. #define VSPCB_TYPE_ARG "pcbt" /* list proc,command, and built-in types. */
  360. #define VSVAR_ARG "v" /* look for variable. Global vars not included.*/
  361. #define VSENV_ARG "e" /* look for environment variables. */
  362. #define VSMENU_ARG "_menu"
  363. #define VSHELP_ARG "h:37" /* (TERMINATE_MATCH|ONE_ARG_MATCH|NO_SORT_MATCH) */
  364. /* Match tag used by push-tag command. */
  365. #define VSTAG_ARG "tag:37" /* (REMOVE_DUPS_MATCH|NO_SORT_MATCH|TERMINATE_MATCH) */
  366. #define VSNCW_ARG2 0x1 // Command allowed when there are no MDI child windows.
  367. #define VSICON_ARG2 0x2 // Command allowed when active window is icon.
  368. #define VSCMDLINE_ARG2 0x4 // Command allowed/operates on command line.
  369. #define VSMARK_ARG2 0x8 // ON_SELECT psuedo event should pass control on
  370. // to this command and not deselect text first.
  371. #define VSREAD_ONLY_ARG2 0x10 // Command is allowed in read-only mode
  372. #define VSQUOTE_ARG2 0x40 // Indicates that this command must be quoted when
  373. // called during macro recording. Needed only if
  374. // command name is an invalid identifier or
  375. // keyword.
  376. #define VSLASTKEY_ARG2 0x80 // Command requires last_event value to be set
  377. // when called during macro recording.
  378. #define VSMACRO_ARG2 0x100 // This is a recorded macro command. Used for completion.
  379. #define VSHELP_ARG2 0x200 // Not used. Here for backward compatibility.
  380. #define VSHELPSALL_ARG2 0x400 // Not used. Here for backward compatibility.
  381. #define VSTEXT_BOX_ARG2 0x800 // function operates on text box control.
  382. #define VSNOEXIT_SCROLL_ARG2 0x1000 // Do not exit scroll caused by using scroll bars.
  383. #define VSEDITORCTL_ARG2 0x2000 // Command allowed in editor control.
  384. /* name_type flags. */
  385. #define VSPROC_TYPE 0x1
  386. #define VSVAR_TYPE 0x4
  387. #define VSEVENTTAB_TYPE 0x8
  388. #define VSCOMMAND_TYPE 0x10
  389. #define VSGVAR_TYPE 0x20
  390. #define VSGPROC_TYPE 0x40
  391. #define VSMODULE_TYPE 0x80
  392. #define VSPICTURE_TYPE 0x100
  393. #define VSBUFFER_TYPE 0x200
  394. #define VSOBJECT_TYPE 0x400
  395. #define VSOBJECT_MASK 0xf800
  396. #define VSOBJECT_SHIFT 11
  397. #define VSINFO_TYPE 0x10000
  398. #define VSMISC_TYPE 0x20000000
  399. #define DLLCALL_TYPE 0x40000 /* Entries with this flag MUST also have the
  400. COMMAND_TYPE or PROC_TYPE flag. */
  401. #define DLLMODULE_TYPE 0x80000
  402. #define VSBUILT_IN_TYPE 0x40000000
  403. #define VSHIDDEN_VIEWID -9
  404. // p_buf_flags
  405. #define VSHIDE_BUFFER 0x1 /* NEXT_BUFFER won't switch to this buffer */
  406. #define VSTHROW_AWAY_CHANGES 0x2 /* Allow quit without prompting on modified buffer */
  407. #define VSKEEP_ON_QUIT 0x4 /* Don't delete buffer on QUIT. */
  408. #define VSREVERT_ON_THROW_AWAY 0x10
  409. #define VSPROMPT_REPLACE_BFLAG 0x20
  410. #define VSDELETE_BUFFER_ON_CLOSE 0x40 /* Indicates whether a list box/ */
  411. // Predefined object handles
  412. #define VSWID_DESKTOP 1
  413. #define VSWID_APP 2
  414. #define VSWID_MDI 3
  415. #define VSWID_CMDLINE 4
  416. #define VSWID_HIDDEN 5
  417. // VSP_WINDOWFLAGS
  418. #define VSWINDOWFLAG_HIDDEN 0x1
  419. #define VSSELECT_INCLUSIVE 0x1
  420. #define VSSELECT_NONINCLUSIVE 0x2
  421. #define VSSELECT_CURSOREXTENDS 0x4
  422. #define VSSELECT_BEGINEND 0x8
  423. #define VSSELECT_PERSISTENT 0x10
  424. #define VSSELECT_LINE 1
  425. #define VSSELECT_CHAR 2
  426. #define VSSELECT_BLOCK 4
  427. // Only supported by vsSetSelectType
  428. #define VSSELECT_NONINCLUSIVEBLOCK 8
  429. #define VSOPTION_WARNING_ARRAY_SIZE 1
  430. #define VSOPTION_WARNING_STRING_LENGTH 2
  431. #define VSOPTION_VERTICAL_LINE_COL 3
  432. #define VSOPTION_WEAK_ERRORS 4
  433. #define VSOPTION_MAXIMIZE_FIRST_MDICHILD 5
  434. #define VSOPTION_MAXTABCOL 6
  435. #define VSOPTION_CURSOR_BLINK 7
  436. #define VSOPTION_DISPLAY_TEMP_CURSOR 8
  437. #define VSOPTION_LEFT_MARGIN 9
  438. #define VSOPTION_DISPLAY_TOP_OF_FILE 10
  439. #define VSOPTION_HORIZONTAL_SCROLL_BAR 11
  440. #define VSOPTION_VERTICAL_SCROLL_BAR 12
  441. #define VSOPTION_HIDE_MOUSE 13
  442. #define VSOPTION_ALT_ACTIVATES_MENU 14
  443. #define VSOPTION_DRAW_BOX_AROUND_CURRENT_LINE 15
  444. #define VSOPTION_MAX_MENU_FILENAME_LEN 16
  445. #define VSOPTION_PROTECT_READONLY_MODE 17
  446. #define VSOPTION_PROCESS_BUFFER_CR_ERASE_LINE 18
  447. #define VSOPTION_ENABLE_FONT_FLAGS 19
  448. #define VSOPTION_APIFLAGS 20
  449. #define VSOPTION_HAVECMDLINE 21
  450. #define VSOPTION_QUIET 22
  451. #define VSOPTION_SHOWTOOLTIPS 23
  452. #define VSOPTION_TOOLTIPDELAY 24
  453. #define VSOPTIONZ_PAST_EOF 1000
  454. #define VSOPTIONZ_SPECIAL_CHAR_XLAT_TAB 1001
  455. #define VSSPECIALCHAR_EOLCH1 0
  456. #define VSSPECIALCHAR_EOLCH2 1
  457. #define VSSPECIALCHAR_TAB 2
  458. #define VSSPECIALCHAR_SPACE 3
  459. #define VSSPECIALCHAR_VIRTUALSPACE 4
  460. #define VSSPECIALCHAR_EOF 5
  461. #define VSSPECIALCHAR_MAX 20
  462. int VSAPI vsLoadFiles(int wid,VSPSZ pszCmdline);
  463. int VSAPI vsGetText(int wid,int Nofbytes,long seekpos,VSPSZ pszBuf);
  464. int VSAPI vsGetLine(int wid,VSPSZ pszBuf,int BufLen);
  465. int VSAPI vsDeleteLine(int wid);
  466. void VSAPI vsInsertLine(int wid,char *pBuf,int BufLen);
  467. void VSAPI vsReplaceLine(int wid,char *pBuf,int BufLen);
  468. void VSAPI vsMessage(VSPSZ psz);
  469. void VSAPI vsTop(int wid);
  470. void VSAPI vsBottom(int wid);
  471. int VSAPI vsDown(int wid,int Noflines);
  472. int VSAPI vsUp(int wid,int Noflines);
  473. int VSAPI vsActivateView(int view_id);
  474. int VSAPI vsQLineLength(int wid,int IncludeNLChars);
  475. int VSAPI vsAllocSelection(int AllocBookmark);
  476. int VSAPI vsFreeSelection(int markid);
  477. int VSAPI vsDeselect(int markid=(-1));
  478. int VSAPI vsSelectLine(int wid,int markid=-1,int SelectFlags=0);
  479. int VSAPI vsSelectChar(int wid,int markid=-1,int SelectFlags=0);
  480. int VSAPI vsSelectBlock(int wid,int markid=-1,int SelectFlags=0);
  481. void VSAPI vsCopyToCursor(int wid,int markid=-1,int MustBeMinusOne=(-1));
  482. // pszOptions--> Start an undo step/Record Macro Source/Do refresh/Async shell
  483. // This default options are great for Menu Items and Tool bar
  484. // buttons. Don't use SMD options in the middle of a macro.
  485. long VSAPI vsExecute(int wid,VSPSZ pszCommand,VSPSZ pszOptions="SMDA");
  486. int VSAPI vsQTextWidth(int wid,char *pText,int TextLen);
  487. int VSAPI vsColWidthGet(int wid,int i,int *pwidth);
  488. int VSAPI vsColWidthSet(int wid,int i,int width);
  489. int VSAPI vsColWidthClear(int wid);
  490. #define VSTREE_ADD_BEFORE 0x1 /* Add a node before sibling in order */
  491. #define VSTREE_ADD_AS_CHILD 0x2
  492. //These sort flags cannot be used in combination with each other
  493. #define VSTREE_ADD_SORTED_CS 0x4
  494. #define VSTREE_ADD_SORTED_CI 0x8
  495. #define VSTREE_ADD_SORTED_FILENAME 0x10
  496. int VSAPI vsTreeSetUserInfo(int wid,int iHandle,VSHVAR hvar);
  497. int VSAPI vsTreeAddItem(int wid,int iRelativeIndex,VSPSZ pszCaption,int iFlags,
  498. int iCollapsedBMIndex,int iExpandedBMIndex,
  499. int iState);
  500. #define VSCOLORINDEX unsigned char
  501. VSCOLORINDEX VSAPI vsAllocColor(int wid);
  502. void VSAPI vsFreeColor(int wid,VSCOLORINDEX ColorIndex);
  503. void VSAPI vsSetTextColor(int wid,VSCOLORINDEX *pColor,int ColorLen);
  504. void VSAPI vsGetTextColor(int wid,VSCOLORINDEX *pColor,int ColorLen);
  505. #define VSCFG_SELECTION 1
  506. #define VSCFG_WINDOW_TEXT 2
  507. #define VSCFG_CLINE 3
  508. #define VSCFG_SELECTED_CLINE 4
  509. #define VSCFG_MESSAGE 5
  510. #define VSCFG_STATUS 6
  511. #define VSCFG_CMDLINE 7
  512. #define VSCFG_CURSOR 8
  513. //VSCFG_CMDLINE_SELECT = 9
  514. //VSCFG_LIST_BOX_SELECT = 10
  515. //VSCFG_LIST_BOX = 11
  516. //VSCFG_ERROR
  517. #define VSCFG_MODIFIED_LINE 13
  518. #define VSCFG_INSERTED_LINE 14
  519. //G_INSERTED_LINE =15
  520. //G_INSERTED_LINE =16
  521. #define VSCFG_KEYWORD 17
  522. #define VSCFG_LINENUM 18
  523. #define VSCFG_NUMBER 19
  524. #define VSCFG_STRING 20
  525. #define VSCFG_COMMENT 21
  526. #define VSCFG_PPKEYWORD 22
  527. #define VSCFG_SYMBOL1 23
  528. #define VSCFG_SYMBOL2 24
  529. #define VSCFG_SYMBOL3 25
  530. #define VSCFG_SYMBOL4 26
  531. #define VSCFG_IMAGINARY_LINE 27
  532. #define VSCFG_NOSAVE_LINE 27
  533. #define VSCFG_FUNCTION 28
  534. #define VSCFG_FILENAME 30
  535. #define VSCFG_HILIGHT 31
  536. #define VSFONTFLAG_BOLD 0x1
  537. #define VSFONTFLAG_ITALIC 0x2
  538. #define VSFONTFLAG_STRIKE_THRU 0x4
  539. #define VSFONTFLAG_UNDERLINE 0x8
  540. #define VSFONTFLAG_PRINTER 0x200
  541. void VSAPI vsDeleteSelection(int wid,int markid,int Reserved=-1);
  542. int VSAPI vsDuplicateSelection(int wid,int markid);
  543. void VSAPI vsShowSelection(int markid);
  544. void VSAPI vsExpandTabsC(int wid,
  545. VSPSZ pszDest,
  546. int *pDestLen,
  547. int StartCol,
  548. int ColWidth,
  549. char Option);
  550. int VSAPI vsTextColC(int wid,int col,char option='L');
  551. int VSAPI vsSetSelectType(int markid,int type,char option='L' /* T L */);
  552. int VSAPI vsQSelectType(int markid= -1,char option='T' /* T S P I U W*/);
  553. long VSAPI vsQROffset(int wid);
  554. int VSAPI vsGoToROffset(int wid,long offset);
  555. int VSAPI vsGetText2(int wid,int Nofbytes,long point,VSPSZ pszBuf,int *pNofbytesRead=0);
  556. void VSAPI vsGoToOldLineNumber(int wid,int OldLineNum,int Reserved=1);
  557. void VSAPI vsSetAllOldLineNumbers(int wid,int Reserved=1);
  558. int VSAPI vsDeleteText(int wid,int DelLen,char option=0);
  559. int VSAPI vsInsertText(int wid,char *pBuf,int BufLen=-1,int Binary=0,unsigned char NLCh1='\r',unsigned char NLCh2='\n');
  560. int VSAPI vsGoToPoint(int wid,long Point,long DownCount=0,int LineNum=(-1));
  561. void VSAPI vsQPoint(int wid,long *pPoint,long *pDownCount,char Option='P');
  562. long VSAPI vsQOffset(int wid);
  563. int VSAPI vsSearch(int wid,VSPSZ pszSearchString,VSPSZ pszOptions=0,VSPSZ pszReplaceString=0,int *pNofchanges=0);
  564. int VSAPI vsRepeatSearch(int wid,VSPSZ pszOptions=0,int StartCol=0);
  565. #ifndef COMMENTINFOMASK_LF
  566. #define COMMENTINFOMASK_LF 0x1f
  567. #define NOSAVE_LF 0x00000040 //Display this line in no save color
  568. #define VIMARK_LF 0x00000080 //Used by VImacro to mark lines
  569. //#define UNDOMASK_LF (COMMENTINFOMASK_LF|ALLDEBUGBITMAPS_LF)
  570. // Line flags below likely to be saved in file.
  571. #define MODIFY_LF 0x00000100 //Line has been modified
  572. #define INSERTED_LINE_LF 0x00000200 //Line was inserted
  573. #define HIDDEN_LF 0x00000400
  574. #define MINUSBITMAP_LF 0x00000800
  575. #define PLUSBITMAP_LF 0x00001000
  576. #define BREAKPOINTBITMAP_LF 0x00002000
  577. #define EXECPOINTBITMAP_LF 0x00004000
  578. #define STACKEXECBITMAP_LF 0x00008000
  579. #define BREAKPOINTNOTACTIVEBITMAP_LF 0x00010000
  580. #define ALLDEBUGBITMAPS_LF (BREAKPOINTBITMAP_LF|EXECPOINTBITMAP_LF|STACKEXECBITMAP_LF|BREAKPOINTNOTACTIVEBITMAP_LF)
  581. #define vsDebugBitmapIndex(bl_flags) (((bl_flags) & ALLDEBUGBITMAPS_LF)>>13)
  582. #define LEVEL_LF 0x007E0000
  583. #define NEXTLEVEL_LF 0x00020000
  584. #define LINEFLAGSMASK_LF 0x007fffff
  585. #define vsLevelIndex(bl_flags) (((bl_flags) & LEVEL_LF)>>17)
  586. #define vsIndex2Level(level) ((level)<<17)
  587. #endif
  588. int VSAPI vsQLineFlags(int wid);
  589. void VSAPI vsSetLineFlags(int wid,int Flags,int Mask=0);
  590. void VSAPI vsRefresh(int wid=0,char Option='A');
  591. void VSAPI vsQuitView(int wid);
  592. void VSAPI vsDeleteBuffer(int wid);
  593. int VSAPI vsQMaxTabCol();
  594. void VSAPI vsExpandTabs(int wid,
  595. VSPSZ pszDest,
  596. int *pDestLen,
  597. char *pSource,
  598. int SrcLen,
  599. int StartCol,
  600. int ColWidth,
  601. char Option);
  602. int VSAPI vsSaveFile(int wid,VSPSZ pszCmdLine);
  603. #define VSRC_HVAR 1
  604. #define VSDOT_HVAR 2
  605. typedef struct {
  606. int kind;
  607. #define VSARG_INT 0
  608. #define VSARG_LONG 1
  609. #define VSARG_HREFVAR 2
  610. #define VSARG_PSZ 3
  611. #define VSARG_PLSTR 4
  612. #define VSARG_HVAR 5
  613. union {
  614. int i;
  615. long l;
  616. VSHVAR hVar;
  617. char *psz;
  618. VSLSTR *plstr;
  619. }u;
  620. } VSARGTYPE;
  621. VSHVAR VSAPI vsHvarArrayEl(VSHVAR hVarArrayEl,int i);
  622. VSHVAR VSAPI vsHvarHashtabEl(VSHVAR hVarHashtab,char *pBuf,int BufLen=-1);
  623. VSPLSTR VSAPI vsHvarGetLstr(VSHVAR hVar);
  624. int VSAPI vsHvarGetI(VSHVAR hVar);
  625. int VSAPI vsHvarSetI(VSHVAR hVar,int value);
  626. int VSAPI vsHvarSetB(VSHVAR hVar,void *pBuf,int BufLen);
  627. int VSAPI vsHvarSetZ(VSHVAR hVar,VSPSZ pszValue);
  628. void VSAPI vsDllInit(void);
  629. void VSAPI vsDllExit(void);
  630. int VSAPI vsLIBExport(char *func_proto_p,char *name_info_p,int arg2,void *pfn);
  631. int VSAPI vsDllExport(VSPSZ pszFuncProto,VSPSZ pszNameInfo,int arg2);
  632. int VSAPI vsPropGetI(int wid,int prop_id);
  633. int VSAPI vsPropGetZ(int wid,int prop_id,VSPSZ pszValue,int ValueLen);
  634. int VSAPI vsPropGetB(int wid,int prop_id,void *pBuf,int BufLen);
  635. void VSAPI vsPropSetI(int wid,int prop_id,int value);
  636. void VSAPI vsPropSetZ(int wid,int prop_id,VSPSZ pszValue);
  637. void VSAPI vsPropSetB(int wid,int prop_id,void *pBuf,int BufLen);
  638. int VSAPI vsFileOpen(VSPSZ pszFilename,int option);
  639. int VSAPI vsFileClose(int fh);
  640. int VSAPI vsFileRead(int fh,void *pBuf,int BufLen);
  641. int VSAPI vsFileWrite(int fh,void *pBuf,int BufLen);
  642. long VSAPI vsFileSeek(int fh,long seekpos,int option);
  643. int VSAPI vsFileFlush(int fh);
  644. int VSAPI vsFindIndex(VSPSZ pszName,int flags);
  645. void VSAPI vsCallIndex(int wid,int index,int Nofargs,VSARGTYPE *pArgList);
  646. void VSAPI vsFree(void *pBuf);
  647. void *VSAPI vsAlloc(int len);
  648. void *VSAPI vsRealloc(void *pBuf,int len);
  649. VSHVAR VSAPI vsGetVar(int index);
  650. VSHVAR VSAPI vsArg(int ParamNum);
  651. VSPSZ VSAPI vsZLstrcpy(VSPSZ pszDest,VSPLSTR plstrSource,int DestLen);
  652. int VSAPI vsHvarFree(VSHVAR hVar);
  653. VSHVAR VSAPI vsHvarAlloc(VSHVAR InitTohVar=0);
  654. int VSAPI vsHvarGetLstr2(VSHVAR hVar,VSLSTR **pplstr,VSLSTR *ptemps);
  655. int VSAPI vsHvarGetBool(VSHVAR hVar,int *pbool);
  656. int VSAPI vsHvarGetI2(VSHVAR hVar,int *pi);
  657. int VSAPI vsHvarIsInt(VSHVAR hVar);
  658. int VSAPI vsHvarSetL(VSHVAR hVar,long i);
  659. int VSAPI vsHvarSetLstr(VSHVAR hVar,VSLSTR *plstr);
  660. int VSAPI vsHvarFormat(VSHVAR hVar);
  661. int vsShell(char *pszCommand,char *pszOptions,char *pszAltShell);
  662. void VSAPI vsPropSetL(int wid,int prop_id,long value);
  663. long VSAPI vsPropGetL(int wid,int prop_id);
  664. int VSAPI vsTopLstr(VSPLSTR *pplstr);
  665. int VSAPI vsPosInit(int LineOffset);
  666. void VSAPI vsPosGetLinePointers(unsigned char **pp,unsigned char **ppBeginLine,
  667. unsigned char **ppEndLine,int *pRelLine);
  668. int VSAPI vsPosIsEOL(int offset,int ReturnWhenBetweenNLChars=0);
  669. void VSAPI vsPosSetPointer(unsigned char *p);
  670. int VSAPI vsPosRelPGoTo(unsigned char *p);
  671. int VSAPI vsPosNextBOL(int Noflines);
  672. int VSAPI vsPosSave(void *pSavePos);
  673. int VSAPI vsPosRestore(void *pSavePos);
  674. int VSAPI vsPosIsEOR(int offset);
  675. void VSAPI vsPosGetPointers(unsigned char **pp,unsigned char **ppEndLine,
  676. unsigned char **ppEndBuf=0);
  677. int VSAPI vsPosSetCurLine();
  678. int VSAPI vsPosQCol();
  679. }
  680. #endif