| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="CodeHighlighter" inherits="SyntaxHighlighter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A syntax highlighter intended for code. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | By adjusting various properties of this resource, you can change the colors of strings, comments, numbers, and other text patterns inside a [TextEdit] control. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | </tutorials> |
| 11 | <methods> |
| 12 | <method name="add_color_region"> |
| 13 | <return type="void" /> |
| 14 | <param index="0" name="start_key" type="String" /> |
| 15 | <param index="1" name="end_key" type="String" /> |
| 16 | <param index="2" name="color" type="Color" /> |
| 17 | <param index="3" name="line_only" type="bool" default="false" /> |
| 18 | <description> |
| 19 | Adds a color region (such as for comments or strings) from [param start_key] to [param end_key]. Both keys should be symbols, and [param start_key] must not be shared with other delimiters. |
| 20 | If [param line_only] is [code]true[/code] or [param end_key] is an empty [String], the region does not carry over to the next line. |
| 21 | </description> |
| 22 | </method> |
| 23 | <method name="add_keyword_color"> |
| 24 | <return type="void" /> |
| 25 | <param index="0" name="keyword" type="String" /> |
| 26 | <param index="1" name="color" type="Color" /> |
| 27 | <description> |
| 28 | Sets the color for a keyword. |
| 29 | The keyword cannot contain any symbols except '_'. |
| 30 | </description> |
| 31 | </method> |
| 32 | <method name="add_member_keyword_color"> |
| 33 | <return type="void" /> |
| 34 | <param index="0" name="member_keyword" type="String" /> |
| 35 | <param index="1" name="color" type="Color" /> |
| 36 | <description> |
| 37 | Sets the color for a member keyword. |
| 38 | The member keyword cannot contain any symbols except '_'. |
| 39 | It will not be highlighted if preceded by a '.'. |
| 40 | </description> |
| 41 | </method> |
| 42 | <method name="clear_color_regions"> |
| 43 | <return type="void" /> |
| 44 | <description> |
| 45 | Removes all color regions. |
| 46 | </description> |
| 47 | </method> |
| 48 | <method name="clear_keyword_colors"> |
| 49 | <return type="void" /> |
| 50 | <description> |
| 51 | Removes all keywords. |
| 52 | </description> |
| 53 | </method> |
| 54 | <method name="clear_member_keyword_colors"> |
| 55 | <return type="void" /> |
| 56 | <description> |
| 57 | Removes all member keywords. |
| 58 | </description> |
| 59 | </method> |
| 60 | <method name="get_keyword_color" qualifiers="const"> |
| 61 | <return type="Color" /> |
| 62 | <param index="0" name="keyword" type="String" /> |
| 63 | <description> |
| 64 | Returns the color for a keyword. |
| 65 | </description> |
| 66 | </method> |
| 67 | <method name="get_member_keyword_color" qualifiers="const"> |
| 68 | <return type="Color" /> |
| 69 | <param index="0" name="member_keyword" type="String" /> |
| 70 | <description> |
| 71 | Returns the color for a member keyword. |
| 72 | </description> |
| 73 | </method> |
| 74 | <method name="has_color_region" qualifiers="const"> |
| 75 | <return type="bool" /> |
| 76 | <param index="0" name="start_key" type="String" /> |
| 77 | <description> |
| 78 | Returns [code]true[/code] if the start key exists, else [code]false[/code]. |
| 79 | </description> |
| 80 | </method> |
| 81 | <method name="has_keyword_color" qualifiers="const"> |
| 82 | <return type="bool" /> |
| 83 | <param index="0" name="keyword" type="String" /> |
| 84 | <description> |
| 85 | Returns [code]true[/code] if the keyword exists, else [code]false[/code]. |
| 86 | </description> |
| 87 | </method> |
| 88 | <method name="has_member_keyword_color" qualifiers="const"> |
| 89 | <return type="bool" /> |
| 90 | <param index="0" name="member_keyword" type="String" /> |
| 91 | <description> |
| 92 | Returns [code]true[/code] if the member keyword exists, else [code]false[/code]. |
| 93 | </description> |
| 94 | </method> |
| 95 | <method name="remove_color_region"> |
| 96 | <return type="void" /> |
| 97 | <param index="0" name="start_key" type="String" /> |
| 98 | <description> |
| 99 | Removes the color region that uses that start key. |
| 100 | </description> |
| 101 | </method> |
| 102 | <method name="remove_keyword_color"> |
| 103 | <return type="void" /> |
| 104 | <param index="0" name="keyword" type="String" /> |
| 105 | <description> |
| 106 | Removes the keyword. |
| 107 | </description> |
| 108 | </method> |
| 109 | <method name="remove_member_keyword_color"> |
| 110 | <return type="void" /> |
| 111 | <param index="0" name="member_keyword" type="String" /> |
| 112 | <description> |
| 113 | Removes the member keyword. |
| 114 | </description> |
| 115 | </method> |
| 116 | </methods> |
| 117 | <members> |
| 118 | <member name="color_regions" type="Dictionary" setter="set_color_regions" getter="get_color_regions" default="{}"> |
| 119 | Sets the color regions. All existing regions will be removed. The [Dictionary] key is the region start and end key, separated by a space. The value is the region color. |
| 120 | </member> |
| 121 | <member name="function_color" type="Color" setter="set_function_color" getter="get_function_color" default="Color(0, 0, 0, 1)"> |
| 122 | Sets color for functions. A function is a non-keyword string followed by a '('. |
| 123 | </member> |
| 124 | <member name="keyword_colors" type="Dictionary" setter="set_keyword_colors" getter="get_keyword_colors" default="{}"> |
| 125 | Sets the keyword colors. All existing keywords will be removed. The [Dictionary] key is the keyword. The value is the keyword color. |
| 126 | </member> |
| 127 | <member name="member_keyword_colors" type="Dictionary" setter="set_member_keyword_colors" getter="get_member_keyword_colors" default="{}"> |
| 128 | Sets the member keyword colors. All existing member keyword will be removed. The [Dictionary] key is the member keyword. The value is the member keyword color. |
| 129 | </member> |
| 130 | <member name="member_variable_color" type="Color" setter="set_member_variable_color" getter="get_member_variable_color" default="Color(0, 0, 0, 1)"> |
| 131 | Sets color for member variables. A member variable is non-keyword, non-function string proceeded with a '.'. |
| 132 | </member> |
| 133 | <member name="number_color" type="Color" setter="set_number_color" getter="get_number_color" default="Color(0, 0, 0, 1)"> |
| 134 | Sets the color for numbers. |
| 135 | </member> |
| 136 | <member name="symbol_color" type="Color" setter="set_symbol_color" getter="get_symbol_color" default="Color(0, 0, 0, 1)"> |
| 137 | Sets the color for symbols. |
| 138 | </member> |
| 139 | </members> |
| 140 | </class> |