Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 24a3e9f

Browse files
committed
Prepare support for code geneating iface-enu definitions
1 parent 16d3fc0 commit 24a3e9f

File tree

4 files changed

+46
-17
lines changed

4 files changed

+46
-17
lines changed

ToolsForMaintainersOfTheProjectTemplate/Scintilla_iface_synchronizer/Face.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ def ReadFromFile(self, name):
113113
self.features[name] = {
114114
"FeatureType": featureType,
115115
"Category": currentCategory,
116-
"Value": value }
116+
"Value": value,
117+
"Comment": currentComment
118+
}
117119
self.order.append(name)
118120

ToolsForMaintainersOfTheProjectTemplate/Scintilla_iface_synchronizer/cs.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,27 @@ def getParameterList(param1Type, param1Name, param2Type, param2Name):
8383
separator = ", " if first and second else ""
8484
return first + separator + second
8585

86+
#def printEnumDefinitions(f):
87+
# out = []
88+
# for name in f.order:
89+
# v = f.features[name]
90+
#
91+
# iindent = indent + " "
92+
#
93+
# if v["FeatureType"] in ["enu"]:
94+
# appendComment(indent, out, v)
95+
# prefix = v["Value"]
96+
# out.append(indent + "public enum " + name)
97+
# out.append(indent + "{")
98+
# for ename in f.order:
99+
# ve = f.features[ename]
100+
# if ve["FeatureType"] in ["val"]:
101+
# if ename.startswith(prefix):
102+
# out.append(iindent + ename[len(prefix):] + " = " + ve["Value"] + "," )
103+
#
104+
# out.append(indent + "}")
105+
# return out
106+
86107
def printLexGatewayFile(f):
87108
out = []
88109
for name in f.order:
@@ -207,6 +228,7 @@ def main():
207228
Regenerate("../../Visual Studio Project Template C#/PluginInfrastructure/Scintilla_iface.cs", "/* ", printLexCSFile(f))
208229
Regenerate("../../Visual Studio Project Template C#/PluginInfrastructure/ScintillaGateWay.cs", "/* ", printLexGatewayFile(f))
209230
Regenerate("../../Visual Studio Project Template C#/PluginInfrastructure/IScintillaGateWay.cs", "/* ", printLexIGatewayFile(f))
231+
# Regenerate("../../Visual Studio Project Template C#/PluginInfrastructure/gatewaydomain.cs", "/* ", printEnumDefinitions(f))
210232

211233

212234
if __name__ == "__main__":

Visual Studio Project Template C#/PluginInfrastructure/GatewayDomain.cs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
namespace Kbg.NppPluginNET
88
{
99
/// <summary>
10-
/// Colours are set using the RGB format (Red, Green, Blue). The intensity of each colour is set in the range 0 to 255.
11-
/// If you have three such intensities, they are combined as: red | (green &lt;&lt; 8) | (blue &lt;&lt; 16).
12-
/// If you set all intensities to 255, the colour is white. If you set all intensities to 0, the colour is black.
10+
/// Colours are set using the RGB format (Red, Green, Blue). The intensity of each colour is set in the range 0 to 255.
11+
/// If you have three such intensities, they are combined as: red | (green &lt;&lt; 8) | (blue &lt;&lt; 16).
12+
/// If you set all intensities to 255, the colour is white. If you set all intensities to 0, the colour is black.
1313
/// When you set a colour, you are making a request. What you will get depends on the capabilities of the system and the current screen mode.
1414
/// </summary>
1515
public class Colour
@@ -49,17 +49,17 @@ public int Value
4949
}
5050

5151
/// <summary>
52-
/// Positions within the Scintilla document refer to a character or the gap before that character.
52+
/// Positions within the Scintilla document refer to a character or the gap before that character.
5353
/// The first character in a document is 0, the second 1 and so on. If a document contains nLen characters, the last character is numbered nLen-1. The caret exists between character positions and can be located from before the first character (0) to after the last character (nLen).
5454
///
55-
/// There are places where the caret can not go where two character bytes make up one character.
56-
/// This occurs when a DBCS character from a language like Japanese is included in the document or when line ends are marked with the CP/M
55+
/// There are places where the caret can not go where two character bytes make up one character.
56+
/// This occurs when a DBCS character from a language like Japanese is included in the document or when line ends are marked with the CP/M
5757
/// standard of a carriage return followed by a line feed.The INVALID_POSITION constant(-1) represents an invalid position within the document.
5858
///
59-
/// All lines of text in Scintilla are the same height, and this height is calculated from the largest font in any current style.This restriction
59+
/// All lines of text in Scintilla are the same height, and this height is calculated from the largest font in any current style.This restriction
6060
/// is for performance; if lines differed in height then calculations involving positioning of text would require the text to be styled first.
6161
///
62-
/// If you use messages, there is nothing to stop you setting a position that is in the middle of a CRLF pair, or in the middle of a 2 byte character.
62+
/// If you use messages, there is nothing to stop you setting a position that is in the middle of a CRLF pair, or in the middle of a 2 byte character.
6363
/// However, keyboard commands will not move the caret into such positions.
6464
/// </summary>
6565
public class Position : IEquatable<Position>
@@ -123,14 +123,14 @@ public override int GetHashCode()
123123
}
124124

125125
/// <summary>
126-
/// Class containing key and modifiers
126+
/// Class containing key and modifiers
127127
///
128128
/// The key code is a visible or control character or a key from the SCK_* enumeration, which contains:
129129
/// SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE, SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, SCK_INSERT, SCK_LEFT, SCK_MENU, SCK_NEXT(Page Down), SCK_PRIOR(Page Up), S
130130
/// CK_RETURN, SCK_RIGHT, SCK_RWIN, SCK_SUBTRACT, SCK_TAB, SCK_UP, and SCK_WIN.
131131
///
132-
/// The modifiers are a combination of zero or more of SCMOD_ALT, SCMOD_CTRL, SCMOD_SHIFT, SCMOD_META, and SCMOD_SUPER.
133-
/// On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to SCMOD_META.SCMOD_SUPER is only available on GTK+ which is commonly the Windows key.
132+
/// The modifiers are a combination of zero or more of SCMOD_ALT, SCMOD_CTRL, SCMOD_SHIFT, SCMOD_META, and SCMOD_SUPER.
133+
/// On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to SCMOD_META.SCMOD_SUPER is only available on GTK+ which is commonly the Windows key.
134134
/// If you are building a table, you might want to use SCMOD_NORM, which has the value 0, to mean no modifiers.
135135
/// </summary>
136136
public class KeyModifier
@@ -139,11 +139,11 @@ public class KeyModifier
139139

140140
/// <summary>
141141
/// The key code is a visible or control character or a key from the SCK_* enumeration, which contains:
142-
/// SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE, SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, SCK_INSERT, SCK_LEFT, SCK_MENU, SCK_NEXT(Page Down), SCK_PRIOR(Page Up),
142+
/// SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE, SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, SCK_INSERT, SCK_LEFT, SCK_MENU, SCK_NEXT(Page Down), SCK_PRIOR(Page Up),
143143
/// SCK_RETURN, SCK_RIGHT, SCK_RWIN, SCK_SUBTRACT, SCK_TAB, SCK_UP, and SCK_WIN.
144144
///
145-
/// The modifiers are a combination of zero or more of SCMOD_ALT, SCMOD_CTRL, SCMOD_SHIFT, SCMOD_META, and SCMOD_SUPER.
146-
/// On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to SCMOD_META.SCMOD_SUPER is only available on GTK+ which is commonly the Windows key.
145+
/// The modifiers are a combination of zero or more of SCMOD_ALT, SCMOD_CTRL, SCMOD_SHIFT, SCMOD_META, and SCMOD_SUPER.
146+
/// On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to SCMOD_META.SCMOD_SUPER is only available on GTK+ which is commonly the Windows key.
147147
/// If you are building a table, you might want to use SCMOD_NORM, which has the value 0, to mean no modifiers.
148148
/// </summary>
149149
public KeyModifier(SciMsg SCK_KeyCode, SciMsg SCMOD_modifier)
@@ -236,4 +236,9 @@ public void Dispose()
236236
Dispose();
237237
}
238238
}
239+
240+
241+
/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
242+
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
243+
239244
}

Visual Studio Project Template C#/PluginInfrastructure/Scintilla_iface.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Kbg.NppPluginNET.PluginInfrastructure
1313
/// <summary>
1414
/// Compatible with Windows NMHDR.
1515
/// hwndFrom is really an environment specific window handle or pointer
16-
/// but most clients of Scintilla.h do not have this type visible.
16+
/// but most clients of Scintilla.h do not have this type visible.
1717
/// </summary>
1818
[StructLayout(LayoutKind.Sequential)]
1919
public struct ScNotificationHeader
@@ -59,7 +59,7 @@ public struct ScNotification
5959

6060
/// <summary>
6161
/// Character of the notification - eg keydown
62-
/// SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETE, SCN_AUTOCSELECTION, SCN_USERLISTSELECTION
62+
/// SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETE, SCN_AUTOCSELECTION, SCN_USERLISTSELECTION
6363
/// </summary>
6464
public char Character { get { return (char) character; } }
6565
}

0 commit comments

Comments
 (0)