home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / ftes46b5.zip / ftes46b5 / src / c_mode.h < prev    next >
C/C++ Source or Header  |  1998-01-27  |  7KB  |  257 lines

  1. /*    c_mode.h
  2.  *
  3.  *    Copyright (c) 1994-1996, Marko Macek
  4.  *
  5.  *    You may distribute under the terms of either the GNU General Public
  6.  *    License or the Artistic License, as specified in the README file.
  7.  *
  8.  */
  9.  
  10. #ifndef __EMODE_H__
  11. #define __EMODE_H__
  12.  
  13. #define CMD_EXT 0x1000  // max 4096 internal commands, check cfte.cpp
  14.  
  15. #define CONTEXT_NONE      0
  16. #define CONTEXT_FILE      1
  17. #define CONTEXT_DIRECTORY 2
  18. #define CONTEXT_MESSAGES  3
  19. #define CONTEXT_SHELL     4
  20. #define CONTEXT_INPUT     5
  21. #define CONTEXT_CHOICE    6
  22. #define CONTEXT_LIST      7
  23. #define CONTEXT_CHAR      8
  24. #define CONTEXT_BUFFERS   9
  25. #define CONTEXT_ROUTINES 10
  26. #define CONTEXT_MAPVIEW  11
  27.  
  28. typedef unsigned char ChColor;
  29.  
  30. #define HILIT_PLAIN   0
  31. #define HILIT_C       1
  32. #define HILIT_HTML    2
  33. #define HILIT_MAKE    3
  34. #define HILIT_REXX    4
  35. #define HILIT_DIFF    5
  36. #define HILIT_IPF     6
  37. #define HILIT_PERL    7
  38. #define HILIT_MERGE   8
  39. #define HILIT_ADA     9
  40. #define HILIT_MSG    10
  41. #define HILIT_SH     11
  42. #define HILIT_PASCAL 12
  43. #define HILIT_TEX    13
  44. #define HILIT_FTE    14
  45. #define HILIT_CATBS  15
  46. #define HILIT_SIMPLE 16
  47.  
  48. #define INDENT_PLAIN  0
  49. #define INDENT_C      1
  50. #define INDENT_REXX   2
  51. #define INDENT_SIMPLE 3
  52.  
  53. #define BFI_AutoIndent          0
  54. #define BFI_Insert              1
  55. #define BFI_DrawOn              2
  56. #define BFI_HilitOn             3
  57. #define BFI_ExpandTabs          4
  58. #define BFI_Trim                5
  59. #define BFI_TabSize             6
  60. #define BFI_ShowTabs            9
  61. #define BFI_HardMode           15
  62. #define BFI_Undo               16
  63. #define BFI_ReadOnly           17
  64. #define BFI_AutoSave           18
  65. #define BFI_KeepBackups        19
  66. #define BFI_MatchCase          22
  67. #define BFI_BackSpKillTab      23
  68. #define BFI_DeleteKillTab      24
  69. #define BFI_BackSpUnindents    25
  70. #define BFI_SpaceTabs          26
  71. #define BFI_IndentWithTabs     27
  72. #define BFI_SeeThruSel         30
  73. #define BFI_ShowMarkers        32
  74. #define BFI_CursorThroughTabs  33
  75. #define BFI_MultiLineHilit     35
  76.  
  77. #define BFI_WordWrap           31
  78. #define BFI_LeftMargin         28
  79. #define BFI_RightMargin        29
  80.  
  81. #define BFI_Colorizer           7
  82. #define BFI_IndentMode          8
  83.  
  84. #define BFI_LineChar           10
  85. #define BFI_StripChar          11
  86. #define BFI_AddLF              12
  87. #define BFI_AddCR              13
  88. #define BFI_ForceNewLine       14
  89. #define BFI_LoadMargin         20
  90. #define BFI_SaveFolds          34
  91.  
  92. #define BFI_UndoLimit          21
  93.  
  94. #define BFI_AutoHilitParen     36
  95. #define BFI_Abbreviations      37
  96. #define BFI_BackSpKillBlock    38
  97. #define BFI_DeleteKillBlock    39
  98. #define BFI_PersistentBlocks   40
  99. #define BFI_InsertKillBlock    41
  100. #define BFI_EventMap           42
  101. #define BFI_UndoMoves          43
  102. #define BFI_DetectLineSep      44
  103. #define BFI_TrimOnSave         45
  104.  
  105. #define BFI_COUNT              46
  106.  
  107. #define BFS_RoutineRegexp       (0 | 256)
  108. #define BFS_DefFindOpt          (1 | 256)
  109. #define BFS_DefFindReplaceOpt   (2 | 256)
  110. #define BFS_CommentStart        (3 | 256)
  111. #define BFS_CommentEnd          (4 | 256)
  112. #define BFS_FileNameRx          (5 | 256)
  113. #define BFS_FirstLineRx         (6 | 256)
  114. #define BFS_CompileCommand      (7 | 256)
  115.  
  116. #define BFS_COUNT               8
  117.  
  118. #define BFS_WordChars           (100 | 256) // ext
  119.  
  120. #define BFI(y,x) ((y)->Flags.num[(x) & 0xFF])
  121. #define BFS(y,x) ((y)->Flags.str[(x) & 0xFF])
  122.  
  123. #define WSETBIT(x,y,z) \
  124.     ((x)[(unsigned char)(y) >> 3] = char((z) ? \
  125.     ((x)[(unsigned char)(y) >> 3] |  (1 << ((unsigned char)(y) & 0x7))) : \
  126.     ((x)[(unsigned char)(y) >> 3] & ~(1 << ((unsigned char)(y) & 0x7)))))
  127.  
  128. #define WGETBIT(x,y) \
  129.     (((x)[(unsigned char)(y) / 8] &  (1 << ((unsigned char)(y) % 8))) ? 1 : 0)
  130.  
  131. typedef struct {
  132.     int num[BFI_COUNT];
  133.     char *str[BFS_COUNT];
  134.     char WordChars[32];
  135. } EBufferFlags;
  136.  
  137. extern EBufferFlags DefaultBufferFlags;
  138.  
  139. /* globals */
  140. #define FLAG_C_Indent            1
  141. #define FLAG_C_BraceOfs          2
  142. #define FLAG_REXX_Indent         3
  143. #define FLAG_ScreenSizeX         6
  144. #define FLAG_ScreenSizeY         7
  145. #define FLAG_CursorInsertStart   8
  146. #define FLAG_CursorInsertEnd     9
  147. #define FLAG_CursorOverStart    10
  148. #define FLAG_CursorOverEnd      11
  149. #define FLAG_SysClipboard       12
  150. #define FLAG_ShowHScroll        13
  151. #define FLAG_ShowVScroll        14
  152. #define FLAG_ScrollBarWidth     15
  153. #define FLAG_SelectPathname     16
  154. #define FLAG_C_CaseOfs          18
  155. #define FLAG_DefaultModeName    19
  156. #define FLAG_CompletionFilter   20
  157. #define FLAG_ShowMenuBar        22
  158. #define FLAG_C_CaseDelta        23
  159. #define FLAG_C_ClassOfs         24
  160. #define FLAG_C_ClassDelta       25
  161. #define FLAG_C_ColonOfs         26
  162. #define FLAG_C_CommentOfs       27
  163. #define FLAG_C_CommentDelta     28
  164. #define FLAG_OpenAfterClose     30
  165. #define FLAG_PrintDevice        31
  166. #define FLAG_CompileCommand     32
  167. #define FLAG_REXX_Do_Offset     33
  168. #define FLAG_KeepHistory        34
  169. #define FLAG_LoadDesktopOnEntry 35
  170. #define FLAG_SaveDesktopOnExit  36
  171. #define FLAG_WindowFont         37
  172. #define FLAG_KeepMessages       38
  173. #define FLAG_ScrollBorderX      39
  174. #define FLAG_ScrollBorderY      40
  175. #define FLAG_ScrollJumpX        41
  176. #define FLAG_ScrollJumpY        42
  177. #define FLAG_ShowToolBar        43
  178. #define FLAG_GUIDialogs         44
  179. #define FLAG_PMDisableAccel     45
  180. #define FLAG_SevenBit           46
  181. #define FLAG_WeirdScroll        47
  182. #define FLAG_LoadDesktopMode    48
  183. #define FLAG_HelpCommand        49
  184. #define FLAG_C_FirstLevelIndent 50
  185. #define FLAG_C_FirstLevelWidth  51
  186. #define FLAG_C_Continuation     52
  187. #define FLAG_C_ParenDelta       32
  188.  
  189. #define EM_MENUS 2
  190. #define EM_MainMenu 0
  191. #define EM_LocalMenu 1
  192.  
  193. #define COL_SyntaxParser 1
  194.  
  195. #define CLR_Normal         0
  196. #define CLR_Keyword        1
  197. #define CLR_String         2
  198. #define CLR_Comment        3
  199. #define CLR_CPreprocessor  4
  200. #define CLR_Regexp         5
  201. #define CLR_Header         6
  202. #define CLR_Quotes         7
  203. #define CLR_Number         8
  204. #define CLR_HexNumber      9
  205. #define CLR_OctalNumber   10
  206. #define CLR_FloatNumber   11
  207. #define CLR_Function      12
  208. #define CLR_Command       13
  209. #define CLR_Tag           14
  210. #define CLR_Punctuation   15
  211. #define CLR_New           16
  212. #define CLR_Old           17
  213. #define CLR_Changed       18
  214. #define CLR_Control       19
  215. #define CLR_Separator     20
  216. #define CLR_Variable      21
  217. #define CLR_Symbol        22
  218. #define CLR_Directive     23
  219. #define CLR_Label         24
  220. #define CLR_Special       25
  221. #define CLR_QuoteDelim    26
  222. #define CLR_RegexpDelim   27
  223.  
  224. #define COUNT_CLR         28
  225.  
  226. #define MATCH_MUST_BOL     0x0001
  227. #define MATCH_MUST_BOLW    0x0002
  228. #define MATCH_MUST_EOL     0x0004
  229. #define MATCH_MUST_EOLW    0x0008
  230. #define MATCH_NO_CASE      0x0010
  231. #define MATCH_SET          0x0020
  232. #define MATCH_NOTSET       0x0040
  233. #define MATCH_QUOTECH      0x0100
  234. #define MATCH_QUOTEEOL     0x0200
  235. #define MATCH_NOGRAB       0x0400
  236. #define MATCH_NEGATE       0x0800
  237. #define MATCH_TAGASNEXT    0x1000
  238.  
  239. #define ACTION_NXSTATE     0x0001
  240.  
  241. #define STATE_NOCASE       0x0001
  242. #define STATE_TAGASNEXT    0x0002
  243. #define STATE_NOGRAB       0x0004
  244.  
  245. typedef enum {
  246.     mvFilePath = 1,
  247.     mvFileName,
  248.     mvCurDirectory,
  249.     mvCurRow,
  250.     mvCurCol,
  251.     mvChar,
  252.     mvWord,
  253.     mvLine,
  254. } MacroVariable;
  255.  
  256. #endif
  257.