Skip to content
Snippets Groups Projects
scintilla.rb 100 KiB
Newer Older
  • Learn to ignore specific revisions
  • 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423
          sendMessage(2373, zoom, 0)
        end
        # Retrieve the zoom level.
        def getZoom
          sendMessage(2374, 0, 0)
        end
    
        # Create a new document object.
        # Starts with reference count of 1 and not selected into editor.
        def createDocument
          sendMessage(2375, 0, 0)
        end
        # Extend life of document.
        def addRefDocument(doc)
          sendMessage(2376, 0, doc)
        end
        # Release a reference to the document, deleting document if it fades to black.
        def releaseDocument(doc)
          sendMessage(2377, 0, doc)
        end
    
        # Get which document modification events are sent to the container.
        def getModEventMask
          sendMessage(2378, 0, 0)
        end
    
        # Change internal focus flag.
        def setFocusFlag(focus)
          sendMessage(2380, focus, 0)
        end
        # Get internal focus flag.
        def getFocus
          sendMessage(2381, 0, 0) == 1 ? true : false
        end
    
        # Change error status - 0 = OK.
        def setStatus(statusCode)
          sendMessage(2382, statusCode, 0)
        end
        # Get error status.
        def getStatus
          sendMessage(2383, 0, 0)
        end
    
        # Set whether the mouse is captured when its button is pressed.
        def setMouseDownCaptures(captures)
          sendMessage(2384, captures, 0)
        end
        # Get whether mouse gets captured.
        def getMouseDownCaptures
          sendMessage(2385, 0, 0) == 1 ? true : false
        end
    
        SC_CURSORNORMAL = -1
        SC_CURSORWAIT = 4
        # Sets the cursor to one of the SC_CURSOR* values.
        def setCursor(cursorType)
          sendMessage(2386, cursorType, 0)
        end
        # Get cursor type.
        def getCursor
          sendMessage(2387, 0, 0)
        end
    
        # Change the way control characters are displayed:
        # If symbol is < 32, keep the drawn way, else, use the given character.
        def setControlCharSymbol(symbol)
          sendMessage(2388, symbol, 0)
        end
        # Get the way control characters are displayed.
        def getControlCharSymbol
          sendMessage(2389, 0, 0)
        end
    
        # Move to the previous change in capitalisation.
        def wordPartLeft
          sendMessage(2390, 0, 0)
        end
        # Move to the previous change in capitalisation extending selection
        # to new caret position.
        def wordPartLeftExtend
          sendMessage(2391, 0, 0)
        end
        # Move to the change next in capitalisation.
        def wordPartRight
          sendMessage(2392, 0, 0)
        end
        # Move to the next change in capitalisation extending selection
        # to new caret position.
        def wordPartRightExtend
          sendMessage(2393, 0, 0)
        end
    
        # Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
        VISIBLE_SLOP = 0x01
        VISIBLE_STRICT = 0x04
        # Set the way the display area is determined when a particular line
        # is to be moved to by Find, FindNext, GotoLine, etc.
        def setVisiblePolicy(visiblePolicy, visibleSlop)
          sendMessage(2394, visiblePolicy, visibleSlop)
        end
    
        # Delete back from the current position to the start of the line.
        def delLineLeft
          sendMessage(2395, 0, 0)
        end
    
        # Delete forwards from the current position to the end of the line.
        def delLineRight
          sendMessage(2396, 0, 0)
        end
    
        # Get and Set the xOffset (ie, horizonal scroll position).
        def setXOffset(newOffset)
          sendMessage(2397, newOffset, 0)
        end
        def getXOffset
          sendMessage(2398, 0, 0)
        end
    
        # Set the last x chosen value to be the caret x position.
        def chooseCaretX
          sendMessage(2399, 0, 0)
        end
    
        # Set the focus to this Scintilla widget.
        def grabFocus
          sendMessage(2400, 0, 0)
        end
    
        # Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
        # If CARET_SLOP is set, we can define a slop value: caretSlop.
        # This value defines an unwanted zone (UZ) where the caret is... unwanted.
        # This zone is defined as a number of pixels near the vertical margins,
        # and as a number of lines near the horizontal margins.
        # By keeping the caret away from the edges, it is seen within its context,
        # so it is likely that the identifier that the caret is on can be completely seen,
        # and that the current line is seen with some of the lines following it which are
        # often dependent on that line.
        CARET_SLOP = 0x01
        # If CARET_STRICT is set, the policy is enforced... strictly.
        # The caret is centred on the display if slop is not set,
        # and cannot go in the UZ if slop is set.
        CARET_STRICT = 0x04
        # If CARET_JUMPS is set, the display is moved more energetically
        # so the caret can move in the same direction longer before the policy is applied again.
        CARET_JUMPS = 0x10
        # If CARET_EVEN is not set, instead of having symmetrical UZs,
        # the left and bottom UZs are extended up to right and top UZs respectively.
        # This way, we favour the displaying of useful information: the begining of lines,
        # where most code reside, and the lines after the caret, eg. the body of a function.
        CARET_EVEN = 0x08
    
        # Set the way the caret is kept visible when going sideway.
        # The exclusion zone is given in pixels.
        def setXCaretPolicy(caretPolicy, caretSlop)
          sendMessage(2402, caretPolicy, caretSlop)
        end
    
        # Set the way the line the caret is on is kept visible.
        # The exclusion zone is given in lines.
        def setYCaretPolicy(caretPolicy, caretSlop)
          sendMessage(2403, caretPolicy, caretSlop)
        end
    
        # Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
        def setPrintWrapMode(mode)
          sendMessage(2406, mode, 0)
        end
    
        # Is printing line wrapped?
        def getPrintWrapMode
          sendMessage(2407, 0, 0)
        end
    
        # Set a fore colour for active hotspots.
        def setHotspotActiveFore(useSetting, fore)
          sendMessage(2410, useSetting, fore & 0xffffff)
        end
    
        # Set a back colour for active hotspots.
        def setHotspotActiveBack(useSetting, back)
          sendMessage(2411, useSetting, back & 0xffffff)
        end
    
        # Enable / Disable underlining active hotspots.
        def setHotspotActiveUnderline(underline)
          sendMessage(2412, underline, 0)
        end
    
        # Limit hotspots to single line so hotspots on two lines don't merge.
        def setHotspotSingleLine(singleLine)
          sendMessage(2421, singleLine, 0)
        end
    
        # Move caret between paragraphs (delimited by empty lines).
        def paraDown
          sendMessage(2413, 0, 0)
        end
        def paraDownExtend
          sendMessage(2414, 0, 0)
        end
        def paraUp
          sendMessage(2415, 0, 0)
        end
        def paraUpExtend
          sendMessage(2416, 0, 0)
        end
    
        # Given a valid document position, return the previous position taking code
        # page into account. Returns 0 if passed 0.
        def positionBefore(pos)
          sendMessage(2417, pos, 0)
        end
    
        # Given a valid document position, return the next position taking code
        # page into account. Maximum value returned is the last position in the document.
        def positionAfter(pos)
          sendMessage(2418, pos, 0)
        end
    
        # Copy a range of text to the clipboard. Positions are clipped into the document.
        def copyRange(start, last)
          sendMessage(2419, start, last)
        end
    
        # Copy argument text to the clipboard.
        def copyText(length, text)
          sendMessage(2420, length, text)
        end
    
        SC_SEL_STREAM = 0
        SC_SEL_RECTANGLE = 1
        SC_SEL_LINES = 2
    
        # Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or
        # by lines (SC_SEL_LINES).
        def setSelectionMode(mode)
          sendMessage(2422, mode, 0)
        end
    
        # Get the mode of the current selection.
        def getSelectionMode
          sendMessage(2423, 0, 0)
        end
    
        # Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).
        def getLineSelStartPosition(line)
          sendMessage(2424, line, 0)
        end
    
        # Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
        def getLineSelEndPosition(line)
          sendMessage(2425, line, 0)
        end
    
        # Move caret down one line, extending rectangular selection to new caret position.
        def lineDownRectExtend
          sendMessage(2426, 0, 0)
        end
    
        # Move caret up one line, extending rectangular selection to new caret position.
        def lineUpRectExtend
          sendMessage(2427, 0, 0)
        end
    
        # Move caret left one character, extending rectangular selection to new caret position.
        def charLeftRectExtend
          sendMessage(2428, 0, 0)
        end
    
        # Move caret right one character, extending rectangular selection to new caret position.
        def charRightRectExtend
          sendMessage(2429, 0, 0)
        end
    
        # Move caret to first position on line, extending rectangular selection to new caret position.
        def homeRectExtend
          sendMessage(2430, 0, 0)
        end
    
        # Move caret to before first visible character on line.
        # If already there move to first character on line.
        # In either case, extend rectangular selection to new caret position.
        def vCHomeRectExtend
          sendMessage(2431, 0, 0)
        end
    
        # Move caret to last position on line, extending rectangular selection to new caret position.
        def lineEndRectExtend
          sendMessage(2432, 0, 0)
        end
    
        # Move caret one page up, extending rectangular selection to new caret position.
        def pageUpRectExtend
          sendMessage(2433, 0, 0)
        end
    
        # Move caret one page down, extending rectangular selection to new caret position.
        def pageDownRectExtend
          sendMessage(2434, 0, 0)
        end
    
    
        # Move caret to top of page, or one page up if already at top of page.
        def stutteredPageUp
          sendMessage(2435, 0, 0)
        end
    
        # Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
        def stutteredPageUpExtend
          sendMessage(2436, 0, 0)
        end
    
        # Move caret to bottom of page, or one page down if already at bottom of page.
        def stutteredPageDown
          sendMessage(2437, 0, 0)
        end
    
        # Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
        def stutteredPageDownExtend
          sendMessage(2438, 0, 0)
        end
    
    
        # Move caret left one word, position cursor at end of word.
        def wordLeftEnd
          sendMessage(2439, 0, 0)
        end
    
        # Move caret left one word, position cursor at end of word, extending selection to new caret position.
        def wordLeftEndExtend
          sendMessage(2440, 0, 0)
        end
    
        # Move caret right one word, position cursor at end of word.
        def wordRightEnd
          sendMessage(2441, 0, 0)
        end
    
        # Move caret right one word, position cursor at end of word, extending selection to new caret position.
        def wordRightEndExtend
          sendMessage(2442, 0, 0)
        end
    
        # Set the set of characters making up whitespace for when moving or selecting by word.
        # Should be called after SetWordChars.
        def setWhitespaceChars(characters)
          sendMessage(2443, 0, characters)
        end
    
        # Reset the set of characters for whitespace and word characters to the defaults.
        def setCharsDefault
          sendMessage(2444, 0, 0)
        end
    
        # Get currently selected item position in the auto-completion list
        def autoCGetCurrent
          sendMessage(2445, 0, 0)
        end
    
        # Enlarge the document to a particular size of text bytes.
        def allocate(bytes)
          sendMessage(2446, bytes, 0)
        end
    
        # Returns the target converted to UTF8.
        # Return the length in bytes.
        def targetAsUTF8
          sendMessage(2447, 0, s)
        end
    
        # Set the length of the utf8 argument for calling EncodedFromUTF8.
        # Set to -1 and the string will be measured to the first nul.
        def setLengthForEncode(bytes)
          sendMessage(2448, bytes, 0)
        end
    
        # Translates a UTF8 string into the document encoding.
        # Return the length of the result in bytes.
        # On error return 0.
        def encodedFromUTF8(utf8)
          buffer = "".ljust(utf8)
          sendMessage(2449, utf8, buffer)
          buffer
        end
    
        # Find the position of a column on a line taking into account tabs and
        # multi-byte characters. If beyond end of line, return line end position.
        def findColumn(line, column)
          sendMessage(2456, line, column)
        end
    
        # Can the caret preferred x position only be changed by explicit movement commands?
        def getCaretSticky
          sendMessage(2457, 0, 0) == 1 ? true : false
        end
    
        # Stop the caret preferred x position changing when the user types.
        def setCaretSticky(useCaretStickyBehaviour)
          sendMessage(2458, useCaretStickyBehaviour, 0)
        end
    
        # Switch between sticky and non-sticky: meant to be bound to a key.
        def toggleCaretSticky
          sendMessage(2459, 0, 0)
        end
    
        # Enable/Disable convert-on-paste for line endings
        def setPasteConvertEndings(convert)
          sendMessage(2467, convert, 0)
        end
    
        # Get convert-on-paste setting
        def getPasteConvertEndings
          sendMessage(2468, 0, 0) == 1 ? true : false
        end
    
        # Duplicate the selection. If selection empty duplicate the line containing the caret.
        def selectionDuplicate
          sendMessage(2469, 0, 0)
        end
    
    
        SC_ALPHA_TRANSPARENT = 0
        SC_ALPHA_OPAQUE = 255
        SC_ALPHA_NOALPHA = 256
    
        # Set background alpha of the caret line.
        def setCaretLineBackAlpha(alpha)
          sendMessage(2470, alpha, 0)
        end
    
        # Get the background alpha of the caret line.
        def getCaretLineBackAlpha
          sendMessage(2471, 0, 0)
        end
    
    
        # Start notifying the container of all key presses and commands.
        def startRecord
          sendMessage(3001, 0, 0)
        end
    
        # Stop notifying the container of all key presses and commands.
        def stopRecord
          sendMessage(3002, 0, 0)
        end
    
        # Set the lexing language of the document.
        def setLexer(lexer)
          sendMessage(4001, lexer, 0)
        end
    
        # Retrieve the lexing language of the document.
        def getLexer
          sendMessage(4002, 0, 0)
        end
    
        # Colourise a segment of the document using the current lexing language.
        def colourise(start, last)
          sendMessage(4003, start, last)
        end
    
        # Set up a value that may be used by a lexer for some optional feature.
        def setProperty(key, value)
          sendMessage(4004, key, value)
        end
    
        # Maximum value of keywordSet parameter of SetKeyWords.
        KEYWORDSET_MAX = 8
    
        # Set up the key words used by the lexer.
        def setKeyWords(keywordSet, keyWords)
          sendMessage(4005, keywordSet, keyWords)
        end
    
        # Set the lexing language of the document based on string name.
        def setLexerLanguage(language)
          sendMessage(4006, 0, language)
        end
    
        # Load a lexer library (dll / so).
        def loadLexerLibrary(path)
          sendMessage(4007, 0, path)
        end
    
        # Retrieve a "property" value previously set with SetProperty.
        def getProperty(key)
          buffer = "".ljust(key)
          sendMessage(4008, key, buffer)
          buffer
        end
    
        # Retrieve a "property" value previously set with SetProperty,
        # with "$()" variable replacement on returned buffer.
        def getPropertyExpanded(key)
          buffer = "".ljust(key)
          sendMessage(4009, key, buffer)
          buffer
        end
    
        # Retrieve a "property" value previously set with SetProperty,
        # interpreted as an int AFTER any "$()" variable replacement.
        def getPropertyInt(key)
          sendMessage(4010, key, 0)
        end
    
        # Retrieve the number of bits the current lexer needs for styling.
        def getStyleBitsNeeded
          sendMessage(4011, 0, 0)
        end
    
        # Notifications
        # Type of modification and the action which caused the modification.
        # These are defined as a bit mask to make it easy to specify which notifications are wanted.
        # One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
        SC_MOD_INSERTTEXT = 0x1
        SC_MOD_DELETETEXT = 0x2
        SC_MOD_CHANGESTYLE = 0x4
        SC_MOD_CHANGEFOLD = 0x8
        SC_PERFORMED_USER = 0x10
        SC_PERFORMED_UNDO = 0x20
        SC_PERFORMED_REDO = 0x40
        SC_MULTISTEPUNDOREDO = 0x80
        SC_LASTSTEPINUNDOREDO = 0x100
        SC_MOD_CHANGEMARKER = 0x200
        SC_MOD_BEFOREINSERT = 0x400
        SC_MOD_BEFOREDELETE = 0x800
        SC_MULTILINEUNDOREDO = 0x1000
        SC_MODEVENTMASKALL = 0x1FFF
    
        # For compatibility, these go through the COMMAND notification rather than NOTIFY
        # and should have had exactly the same values as the EN_* constants.
        # Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_*
        # As clients depend on these constants, this will not be changed.
        SCEN_CHANGE = 768
        SCEN_SETFOCUS = 512
        SCEN_KILLFOCUS = 256
    
        # Symbolic key codes and modifier flags.
        # ASCII and other printable characters below 256.
        # Extended keys above 300.
    
        SCK_DOWN = 300
        SCK_UP = 301
        SCK_LEFT = 302
        SCK_RIGHT = 303
        SCK_HOME = 304
        SCK_END = 305
        SCK_PRIOR = 306
        SCK_NEXT = 307
        SCK_DELETE = 308
        SCK_INSERT = 309
        SCK_ESCAPE = 7
        SCK_BACK = 8
        SCK_TAB = 9
        SCK_RETURN = 13
        SCK_ADD = 310
        SCK_SUBTRACT = 311
        SCK_DIVIDE = 312
    
        SCMOD_NORM = 0
        SCMOD_SHIFT = 1
        SCMOD_CTRL = 2
        SCMOD_ALT = 4
    
        # For SciLexer.h
        SCLEX_CONTAINER = 0
        SCLEX_NULL = 1
        SCLEX_PYTHON = 2
        SCLEX_CPP = 3
        SCLEX_HTML = 4
        SCLEX_XML = 5
        SCLEX_PERL = 6
        SCLEX_SQL = 7
        SCLEX_VB = 8
        SCLEX_PROPERTIES = 9
        SCLEX_ERRORLIST = 10
        SCLEX_MAKEFILE = 11
        SCLEX_BATCH = 12
        SCLEX_XCODE = 13
        SCLEX_LATEX = 14
        SCLEX_LUA = 15
        SCLEX_DIFF = 16
        SCLEX_CONF = 17
        SCLEX_PASCAL = 18
        SCLEX_AVE = 19
        SCLEX_ADA = 20
        SCLEX_LISP = 21
        SCLEX_RUBY = 22
        SCLEX_EIFFEL = 23
        SCLEX_EIFFELKW = 24
        SCLEX_TCL = 25
        SCLEX_NNCRONTAB = 26
        SCLEX_BULLANT = 27
        SCLEX_VBSCRIPT = 28
        SCLEX_BAAN = 31
        SCLEX_MATLAB = 32
        SCLEX_SCRIPTOL = 33
        SCLEX_ASM = 34
        SCLEX_CPPNOCASE = 35
        SCLEX_FORTRAN = 36
        SCLEX_F77 = 37
        SCLEX_CSS = 38
        SCLEX_POV = 39
        SCLEX_LOUT = 40
        SCLEX_ESCRIPT = 41
        SCLEX_PS = 42
        SCLEX_NSIS = 43
        SCLEX_MMIXAL = 44
        SCLEX_CLW = 45
        SCLEX_CLWNOCASE = 46
        SCLEX_LOT = 47
        SCLEX_YAML = 48
        SCLEX_TEX = 49
        SCLEX_METAPOST = 50
        SCLEX_POWERBASIC = 51
        SCLEX_FORTH = 52
        SCLEX_ERLANG = 53
        SCLEX_OCTAVE = 54
        SCLEX_MSSQL = 55
        SCLEX_VERILOG = 56
        SCLEX_KIX = 57
        SCLEX_GUI4CLI = 58
        SCLEX_SPECMAN = 59
        SCLEX_AU3 = 60
        SCLEX_APDL = 61
        SCLEX_BASH = 62
        SCLEX_ASN1 = 63
        SCLEX_VHDL = 64
        SCLEX_CAML = 65
        SCLEX_BLITZBASIC = 66
        SCLEX_PUREBASIC = 67
        SCLEX_HASKELL = 68
        SCLEX_PHPSCRIPT = 69
        SCLEX_TADS3 = 70
        SCLEX_REBOL = 71
        SCLEX_SMALLTALK = 72
        SCLEX_FLAGSHIP = 73
        SCLEX_CSOUND = 74
        SCLEX_FREEBASIC = 75
    
        SCLEX_INNOSETUP = 76
        SCLEX_OPAL = 77
        SCLEX_SPICE = 78
    
    
        # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
        # value assigned in sequence from SCLEX_AUTOMATIC+1.
        SCLEX_AUTOMATIC = 1000
        # Lexical states for SCLEX_PYTHON
        SCE_P_DEFAULT = 0
        SCE_P_COMMENTLINE = 1
        SCE_P_NUMBER = 2
        SCE_P_STRING = 3
        SCE_P_CHARACTER = 4
        SCE_P_WORD = 5
        SCE_P_TRIPLE = 6
        SCE_P_TRIPLEDOUBLE = 7
        SCE_P_CLASSNAME = 8
        SCE_P_DEFNAME = 9
        SCE_P_OPERATOR = 10
        SCE_P_IDENTIFIER = 11
        SCE_P_COMMENTBLOCK = 12
        SCE_P_STRINGEOL = 13
        SCE_P_WORD2 = 14
        SCE_P_DECORATOR = 15
        # Lexical states for SCLEX_CPP
        SCE_C_DEFAULT = 0
        SCE_C_COMMENT = 1
        SCE_C_COMMENTLINE = 2
        SCE_C_COMMENTDOC = 3
        SCE_C_NUMBER = 4
        SCE_C_WORD = 5
        SCE_C_STRING = 6
        SCE_C_CHARACTER = 7
        SCE_C_UUID = 8
        SCE_C_PREPROCESSOR = 9
        SCE_C_OPERATOR = 10
        SCE_C_IDENTIFIER = 11
        SCE_C_STRINGEOL = 12
        SCE_C_VERBATIM = 13
        SCE_C_REGEX = 14
        SCE_C_COMMENTLINEDOC = 15
        SCE_C_WORD2 = 16
        SCE_C_COMMENTDOCKEYWORD = 17
        SCE_C_COMMENTDOCKEYWORDERROR = 18
        SCE_C_GLOBALCLASS = 19
    
        # Lexical states for SCLEX_TCL
        SCE_TCL_DEFAULT = 0
        SCE_TCL_COMMENT = 1
        SCE_TCL_COMMENTLINE = 2
        SCE_TCL_NUMBER = 3
        SCE_TCL_WORD_IN_QUOTE = 4
        SCE_TCL_IN_QUOTE = 5
        SCE_TCL_OPERATOR = 6
        SCE_TCL_IDENTIFIER = 7
        SCE_TCL_SUBSTITUTION = 8
        SCE_TCL_SUB_BRACE = 9
        SCE_TCL_MODIFIER = 10
        SCE_TCL_EXPAND = 11
        SCE_TCL_WORD = 12
        SCE_TCL_WORD2 = 13
        SCE_TCL_WORD3 = 14
        SCE_TCL_WORD4 = 15
        SCE_TCL_WORD5 = 16
        SCE_TCL_WORD6 = 17
        SCE_TCL_WORD7 = 18
        SCE_TCL_WORD8 = 19
        SCE_TCL_COMMENT_BOX = 20
        SCE_TCL_BLOCK_COMMENT = 21
    
        # Lexical states for SCLEX_HTML, SCLEX_XML
        SCE_H_DEFAULT = 0
        SCE_H_TAG = 1
        SCE_H_TAGUNKNOWN = 2
        SCE_H_ATTRIBUTE = 3
        SCE_H_ATTRIBUTEUNKNOWN = 4
        SCE_H_NUMBER = 5
        SCE_H_DOUBLESTRING = 6
        SCE_H_SINGLESTRING = 7
        SCE_H_OTHER = 8
        SCE_H_COMMENT = 9
        SCE_H_ENTITY = 10
        # XML and ASP
        SCE_H_TAGEND = 11
        SCE_H_XMLSTART = 12
        SCE_H_XMLEND = 13
        SCE_H_SCRIPT = 14
        SCE_H_ASP = 15
        SCE_H_ASPAT = 16
        SCE_H_CDATA = 17
        SCE_H_QUESTION = 18
        # More HTML
        SCE_H_VALUE = 19
        # X-Code
        SCE_H_XCCOMMENT = 20
        # SGML
        SCE_H_SGML_DEFAULT = 21
        SCE_H_SGML_COMMAND = 22
        SCE_H_SGML_1ST_PARAM = 23
        SCE_H_SGML_DOUBLESTRING = 24
        SCE_H_SGML_SIMPLESTRING = 25
        SCE_H_SGML_ERROR = 26
        SCE_H_SGML_SPECIAL = 27
        SCE_H_SGML_ENTITY = 28
        SCE_H_SGML_COMMENT = 29
        SCE_H_SGML_1ST_PARAM_COMMENT = 30
        SCE_H_SGML_BLOCK_DEFAULT = 31
        # Embedded Javascript
        SCE_HJ_START = 40
        SCE_HJ_DEFAULT = 41
        SCE_HJ_COMMENT = 42
        SCE_HJ_COMMENTLINE = 43
        SCE_HJ_COMMENTDOC = 44
        SCE_HJ_NUMBER = 45
        SCE_HJ_WORD = 46
        SCE_HJ_KEYWORD = 47
        SCE_HJ_DOUBLESTRING = 48
        SCE_HJ_SINGLESTRING = 49
        SCE_HJ_SYMBOLS = 50
        SCE_HJ_STRINGEOL = 51
        SCE_HJ_REGEX = 52
        # ASP Javascript
        SCE_HJA_START = 55
        SCE_HJA_DEFAULT = 56
        SCE_HJA_COMMENT = 57
        SCE_HJA_COMMENTLINE = 58
        SCE_HJA_COMMENTDOC = 59
        SCE_HJA_NUMBER = 60
        SCE_HJA_WORD = 61
        SCE_HJA_KEYWORD = 62
        SCE_HJA_DOUBLESTRING = 63
        SCE_HJA_SINGLESTRING = 64
        SCE_HJA_SYMBOLS = 65
        SCE_HJA_STRINGEOL = 66
        SCE_HJA_REGEX = 67
        # Embedded VBScript
        SCE_HB_START = 70
        SCE_HB_DEFAULT = 71
        SCE_HB_COMMENTLINE = 72
        SCE_HB_NUMBER = 73
        SCE_HB_WORD = 74
        SCE_HB_STRING = 75
        SCE_HB_IDENTIFIER = 76
        SCE_HB_STRINGEOL = 77
        # ASP VBScript
        SCE_HBA_START = 80
        SCE_HBA_DEFAULT = 81
        SCE_HBA_COMMENTLINE = 82
        SCE_HBA_NUMBER = 83
        SCE_HBA_WORD = 84
        SCE_HBA_STRING = 85
        SCE_HBA_IDENTIFIER = 86
        SCE_HBA_STRINGEOL = 87
        # Embedded Python
        SCE_HP_START = 90
        SCE_HP_DEFAULT = 91
        SCE_HP_COMMENTLINE = 92
        SCE_HP_NUMBER = 93
        SCE_HP_STRING = 94
        SCE_HP_CHARACTER = 95
        SCE_HP_WORD = 96
        SCE_HP_TRIPLE = 97
        SCE_HP_TRIPLEDOUBLE = 98
        SCE_HP_CLASSNAME = 99
        SCE_HP_DEFNAME = 100
        SCE_HP_OPERATOR = 101
        SCE_HP_IDENTIFIER = 102
        # PHP
        SCE_HPHP_COMPLEX_VARIABLE = 104
        # ASP Python
        SCE_HPA_START = 105
        SCE_HPA_DEFAULT = 106
        SCE_HPA_COMMENTLINE = 107
        SCE_HPA_NUMBER = 108
        SCE_HPA_STRING = 109
        SCE_HPA_CHARACTER = 110
        SCE_HPA_WORD = 111
        SCE_HPA_TRIPLE = 112
        SCE_HPA_TRIPLEDOUBLE = 113
        SCE_HPA_CLASSNAME = 114
        SCE_HPA_DEFNAME = 115
        SCE_HPA_OPERATOR = 116
        SCE_HPA_IDENTIFIER = 117
        # PHP
        SCE_HPHP_DEFAULT = 118
        SCE_HPHP_HSTRING = 119
        SCE_HPHP_SIMPLESTRING = 120
        SCE_HPHP_WORD = 121
        SCE_HPHP_NUMBER = 122
        SCE_HPHP_VARIABLE = 123
        SCE_HPHP_COMMENT = 124
        SCE_HPHP_COMMENTLINE = 125
        SCE_HPHP_HSTRING_VARIABLE = 126
        SCE_HPHP_OPERATOR = 127
        # Lexical states for SCLEX_PERL
        SCE_PL_DEFAULT = 0
        SCE_PL_ERROR = 1
        SCE_PL_COMMENTLINE = 2
        SCE_PL_POD = 3
        SCE_PL_NUMBER = 4
        SCE_PL_WORD = 5
        SCE_PL_STRING = 6
        SCE_PL_CHARACTER = 7
        SCE_PL_PUNCTUATION = 8
        SCE_PL_PREPROCESSOR = 9
        SCE_PL_OPERATOR = 10
        SCE_PL_IDENTIFIER = 11
        SCE_PL_SCALAR = 12
        SCE_PL_ARRAY = 13
        SCE_PL_HASH = 14
        SCE_PL_SYMBOLTABLE = 15
        SCE_PL_VARIABLE_INDEXER = 16
        SCE_PL_REGEX = 17
        SCE_PL_REGSUBST = 18
        SCE_PL_LONGQUOTE = 19
        SCE_PL_BACKTICKS = 20
        SCE_PL_DATASECTION = 21
        SCE_PL_HERE_DELIM = 22
        SCE_PL_HERE_Q = 23
        SCE_PL_HERE_QQ = 24
        SCE_PL_HERE_QX = 25
        SCE_PL_STRING_Q = 26
        SCE_PL_STRING_QQ = 27
        SCE_PL_STRING_QX = 28
        SCE_PL_STRING_QR = 29
        SCE_PL_STRING_QW = 30
        SCE_PL_POD_VERB = 31
        # Lexical states for SCLEX_RUBY
        SCE_RB_DEFAULT = 0
        SCE_RB_ERROR = 1
        SCE_RB_COMMENTLINE = 2
        SCE_RB_POD = 3
        SCE_RB_NUMBER = 4
        SCE_RB_WORD = 5
        SCE_RB_STRING = 6
        SCE_RB_CHARACTER = 7
        SCE_RB_CLASSNAME = 8
        SCE_RB_DEFNAME = 9
        SCE_RB_OPERATOR = 10
        SCE_RB_IDENTIFIER = 11
        SCE_RB_REGEX = 12
        SCE_RB_GLOBAL = 13
        SCE_RB_SYMBOL = 14
        SCE_RB_MODULE_NAME = 15
        SCE_RB_INSTANCE_VAR = 16
        SCE_RB_CLASS_VAR = 17
        SCE_RB_BACKTICKS = 18
        SCE_RB_DATASECTION = 19
        SCE_RB_HERE_DELIM = 20
        SCE_RB_HERE_Q = 21
        SCE_RB_HERE_QQ = 22
        SCE_RB_HERE_QX = 23
        SCE_RB_STRING_Q = 24
        SCE_RB_STRING_QQ = 25
        SCE_RB_STRING_QX = 26
        SCE_RB_STRING_QR = 27
        SCE_RB_STRING_QW = 28
        SCE_RB_WORD_DEMOTED = 29
        SCE_RB_STDIN = 30
        SCE_RB_STDOUT = 31
        SCE_RB_STDERR = 40
        SCE_RB_UPPER_BOUND = 41
        # Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC
        SCE_B_DEFAULT = 0
        SCE_B_COMMENT = 1
        SCE_B_NUMBER = 2
        SCE_B_KEYWORD = 3
        SCE_B_STRING = 4
        SCE_B_PREPROCESSOR = 5
        SCE_B_OPERATOR = 6
        SCE_B_IDENTIFIER = 7
        SCE_B_DATE = 8
        SCE_B_STRINGEOL = 9
        SCE_B_KEYWORD2 = 10
        SCE_B_KEYWORD3 = 11
        SCE_B_KEYWORD4 = 12
        SCE_B_CONSTANT = 13
        SCE_B_ASM = 14
        SCE_B_LABEL = 15
        SCE_B_ERROR = 16
        SCE_B_HEXNUMBER = 17
        SCE_B_BINNUMBER = 18
        # Lexical states for SCLEX_PROPERTIES
        SCE_PROPS_DEFAULT = 0
        SCE_PROPS_COMMENT = 1
        SCE_PROPS_SECTION = 2
        SCE_PROPS_ASSIGNMENT = 3
        SCE_PROPS_DEFVAL = 4
    
        # Lexical states for SCLEX_LATEX
        SCE_L_DEFAULT = 0
        SCE_L_COMMAND = 1
        SCE_L_TAG = 2
        SCE_L_MATH = 3
        SCE_L_COMMENT = 4
        # Lexical states for SCLEX_LUA
        SCE_LUA_DEFAULT = 0
        SCE_LUA_COMMENT = 1
        SCE_LUA_COMMENTLINE = 2
        SCE_LUA_COMMENTDOC = 3
        SCE_LUA_NUMBER = 4
        SCE_LUA_WORD = 5
        SCE_LUA_STRING = 6
        SCE_LUA_CHARACTER = 7
        SCE_LUA_LITERALSTRING = 8
        SCE_LUA_PREPROCESSOR = 9
        SCE_LUA_OPERATOR = 10
        SCE_LUA_IDENTIFIER = 11
        SCE_LUA_STRINGEOL = 12
        SCE_LUA_WORD2 = 13
        SCE_LUA_WORD3 = 14
        SCE_LUA_WORD4 = 15
        SCE_LUA_WORD5 = 16
        SCE_LUA_WORD6 = 17
        SCE_LUA_WORD7 = 18
        SCE_LUA_WORD8 = 19
        # Lexical states for SCLEX_ERRORLIST
        SCE_ERR_DEFAULT = 0
        SCE_ERR_PYTHON = 1
        SCE_ERR_GCC = 2
        SCE_ERR_MS = 3
        SCE_ERR_CMD = 4
        SCE_ERR_BORLAND = 5
        SCE_ERR_PERL = 6
        SCE_ERR_NET = 7
        SCE_ERR_LUA = 8
        SCE_ERR_CTAG = 9
        SCE_ERR_DIFF_CHANGED = 10
        SCE_ERR_DIFF_ADDITION = 11
        SCE_ERR_DIFF_DELETION = 12
        SCE_ERR_DIFF_MESSAGE = 13
        SCE_ERR_PHP = 14
        SCE_ERR_ELF = 15
        SCE_ERR_IFC = 16
        SCE_ERR_IFORT = 17
        SCE_ERR_ABSF = 18
        SCE_ERR_TIDY = 19
        SCE_ERR_JAVA_STACK = 20
        # Lexical states for SCLEX_BATCH
        SCE_BAT_DEFAULT = 0
        SCE_BAT_COMMENT = 1
        SCE_BAT_WORD = 2
        SCE_BAT_LABEL = 3
        SCE_BAT_HIDE = 4
        SCE_BAT_COMMAND = 5
        SCE_BAT_IDENTIFIER = 6
        SCE_BAT_OPERATOR = 7
        # Lexical states for SCLEX_MAKEFILE
        SCE_MAKE_DEFAULT = 0
        SCE_MAKE_COMMENT = 1
        SCE_MAKE_PREPROCESSOR = 2
        SCE_MAKE_IDENTIFIER = 3
        SCE_MAKE_OPERATOR = 4
        SCE_MAKE_TARGET = 5
        SCE_MAKE_IDEOL = 9
        # Lexical states for SCLEX_DIFF
        SCE_DIFF_DEFAULT = 0
        SCE_DIFF_COMMENT = 1
        SCE_DIFF_COMMAND = 2
        SCE_DIFF_HEADER = 3
        SCE_DIFF_POSITION = 4
        SCE_DIFF_DELETED = 5