]> O.S.I.I.S - jp/crowedit.git/commitdiff
wip
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 7 Mar 2025 18:30:10 +0000 (19:30 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 7 Mar 2025 18:30:10 +0000 (19:30 +0100)
plugins/CECrowPlugin/src/CrowService.cs
plugins/CECrowPlugin/src/DebugInterfaceWidget.cs
plugins/CECrowPlugin/src/ForeignWidgetContainer.cs
plugins/CECrowPlugin/src/PropertyContainer.cs
plugins/CECrowPlugin/ui/winProperties.crow
plugins/CEEbnfPlugin/AllItemsFullPathWithTargetPath.txt [deleted file]
plugins/CEEbnfPlugin/src/Parsing/EbnfDocument.cs
plugins/CEEbnfPlugin/src/Parsing/EbnfTokenizer.cs

index 54f88e546719cd4bdc855c228a102fb91b0ec6b2..bd33ec7a7a14f9319afb5061b88a07a5b63d2b2e 100644 (file)
@@ -579,6 +579,10 @@ namespace CECrowPlugin
                        fiWidget_design_style_values = typeWidget.GetField("design_style_values");
                        fiWidget_design_style_locations = typeWidget.GetField("design_style_locations");
                        fiWidget_design_iml_values = typeWidget.GetField("design_iml_values");
+                       fiWidget_design_line = typeWidget.GetField("design_line");
+                       fiWidget_design_column = typeWidget.GetField("design_column");
+                       fiWidget_design_imlPath = typeWidget.GetField("design_imlPath");
+
                        //***********************************
                        fiWidget_slot = typeWidget.GetField("Slot");
 
index 97a6fdb6d5b816e51f7dd3afb48e949636308d28..997ab66abae4e21d87d523bd06f3c7136aca06bb 100644 (file)
@@ -220,23 +220,19 @@ namespace CECrowPlugin
                                if (hoverWidget != null && hoverWidget != currentWidget) {
                                        //currentWidget.
                                        RectangleD r = hoverWidget.GetScreenCoordinate() + Slot.Position + Parent.ClientRectangle.Position;
-                                       //ctx.ResetClip();
-                                       ctx.LineWidth = 1;
                                        ctx.SetDash([1,3]);
-                                       ctx.Rectangle(r.Inflated(2));
                                        ctx.SetSource(Colors.Yellow);
-                                       ctx.Stroke();
+                                       ctx.Rectangle(r, 1);
                                        ctx.SetDash([]);
                                }                               
                                if (currentWidget != null) {
                                        //currentWidget.
                                        RectangleD r = currentWidget.GetScreenCoordinate() + Slot.Position + Parent.ClientRectangle.Position;
                                        //ctx.ResetClip();
-                                       ctx.LineWidth = 1.0;
                                        //ctx.SetDash([2,3]);
-                                       ctx.Rectangle(r.Inflated(1));
                                        ctx.SetSource(Colors.White);
-                                       ctx.Stroke();
+                                       ctx.Rectangle(r.Inflated(1), 1);
+//                                     ctx.Stroke();
                                        //ctx.SetDash([0]);
                                }                               
                                //crowIFaceService.UnlockRenderMutex();
index f45ead3d58b69f985b55d19809f15dc60500a27b..2cae562a20ba7a03e21589f99223c2dc1c736c11 100644 (file)
@@ -20,6 +20,7 @@ namespace CECrowPlugin
                internal static Type typeWidget;//, typeGroup, typeContainer, typeTemplatedContainer, typeTemplatedGroup;
                //design mode members, present only if crow compiled with DESIGN_MODE enabled
                internal static FieldInfo fiWidget_design_id, fiWidget_design_style_values,     fiWidget_design_iml_values, fiWidget_design_style_locations,
+                                                                       fiWidget_design_line, fiWidget_design_column, fiWidget_design_imlPath,
                                                                        fiWidget_slot;
                Func<string> delGetName;
                Func<Rectangle,Rectangle> delGetScreenCoordinates;
@@ -28,7 +29,8 @@ namespace CECrowPlugin
                Type type;
                object instance;
                ForeignWidgetContainer parent;
-               string designId;
+               string designId, designImlPath;
+               int designLine, designColumn;
                public ForeignWidgetContainer(Type widgetType, object instance, ForeignWidgetContainer parent = null) {
                        type = widgetType;
                        this.instance = instance;
@@ -38,7 +40,10 @@ namespace CECrowPlugin
                        delGetScreenCoordinates = (Func<Rectangle,Rectangle>)Delegate.CreateDelegate(typeof(Func<Rectangle,Rectangle>), instance, type.GetMethod("ScreenCoordinates"));
 
                        designId = (string)fiWidget_design_id?.GetValue(instance);
-                       
+                       designLine = (int)fiWidget_design_line?.GetValue(instance);
+                       designColumn = (int)fiWidget_design_column?.GetValue(instance);
+                       designImlPath = (string)fiWidget_design_imlPath?.GetValue(instance);
+
                        Console.WriteLine($"new ForeignWidgetContainer: {this} {parent}");
                }
 
@@ -52,6 +57,9 @@ namespace CECrowPlugin
                public string Icon => $"#icons.{type.FullName}.svg";
                public string Name => delGetName();
                public string DesignId => designId;
+               public string DesignPath => designImlPath;
+               public int DesignLine => designLine;
+               public int DesignColumn => designColumn;
                public Rectangle GetScreenCoordinate() => delGetScreenCoordinates(Slot);
                public Rectangle Slot => (Rectangle)fiWidget_slot?.GetValue(instance);
 
index 06433362e61b3ddd2fb3d4d49d1d8503cdcfa168..458d678004ab8ea4187c200c78d34a7cb14e6d03 100644 (file)
@@ -46,7 +46,14 @@ namespace CECrowPlugin
                }
                public string Name => pi.Name;
                public object Value {
-                       get => pi.GetValue(host.Instance);
+                       get {
+                               if (IsSetByIML) {
+                                       return host.ImlValues[Name];
+                               } else if (IsSetByStyling) {
+                                       return host.StyleValues[Name];
+                               } else
+                                       return pi.GetValue(host.Instance);
+                       } 
                        set {
                                
                                        
index 8b19e3827867021ea8df4fcbf804b70cd439addb..fb80901bf6f733e8eef81e73ff4543bcb2a5bfaa 100644 (file)
@@ -9,6 +9,11 @@
                         <Label Text="{TypeName}" Width="Stretched" TextAlignment="Left" />
                         <Label Font="mono bold, 16" Foreground="PaleGreen" Text="{DesignId}" Width="Fit" Margin="4" />
                     </HorizontalStack>
+                    <HorizontalStack Height="Fit" Spacing="10" >
+                        <Label Text="{DesignPath}" />
+                        <Label Text="{DesignLine}" />
+                        <Label Text="{DesignColumn}" />
+                    </HorizontalStack>                    
                     <HorizontalStack Margin="1">
                         <Scroller Name="ItemsScroller" Margin="2">
                             <VerticalStack Height="Fit" MinimumSize="10,10"
diff --git a/plugins/CEEbnfPlugin/AllItemsFullPathWithTargetPath.txt b/plugins/CEEbnfPlugin/AllItemsFullPathWithTargetPath.txt
deleted file mode 100644 (file)
index 5fbfe94..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/mnt/sdata/devel/CrowEdit/plugins/CEEbnfPlugin/CEEbnfPlugin.csproj -> AllItemsFullPathWithTargetPath
-       /home/jp/.nuget/packages/glfw-sharp/0.2.15/content/glfw-sharp.dll.config
-               CopyToOutputDirectory                              = PreserveNewest
-               TargetPath                                         = glfw-sharp.dll.config
-               FullPath                                           = /home/jp/.nuget/packages/glfw-sharp/0.2.15/content/glfw-sharp.dll.config
-               RootDir                                            = /
-               Filename                                           = glfw-sharp.dll
-               Extension                                          = .config
-               RelativeDir                                        = /home/jp/.nuget/packages/glfw-sharp/0.2.15/content/
-               Directory                                          = home/jp/.nuget/packages/glfw-sharp/0.2.15/content/
-               RecursiveDir                                       = 
-               Identity                                           = /home/jp/.nuget/packages/glfw-sharp/0.2.15/content/glfw-sharp.dll.config
-               ModifiedTime                                       = 2024-07-10 07:28:58.0000000
-               CreatedTime                                        = 2024-07-10 07:28:58.0000000
-               AccessedTime                                       = 2025-03-04 12:31:37.7520082
-               DefiningProjectFullPath                            = /usr/share/dotnet/sdk/9.0.200/Microsoft.Common.CurrentVersion.targets
-               DefiningProjectDirectory                           = /usr/share/dotnet/sdk/9.0.200/
-               DefiningProjectName                                = Microsoft.Common.CurrentVersion
-               DefiningProjectExtension                           = .targets
index 9c9a3b588ab90d4e7d29f885ab356ab003cf4500..d32410ddfe7f268f651a8fd36976c5253992892f 100644 (file)
@@ -24,6 +24,7 @@ namespace CrowEdit.Ebnf
 
                }
                protected override SyntaxAnalyser CreateSyntaxAnalyser() => new EbnfSyntaxAnalyser (this);
+               public override string GetTokenTypeString (TokenType tokenType) => ((EbnfTokenType)tokenType).ToString();
 
                public override IList GetSuggestions (int absoluteTextPos, int currentTokenIndex, SyntaxNode CurrentNode, CharLocation loc) {
                        Token currentToken = GetTokenByIndex(currentTokenIndex);
@@ -36,9 +37,13 @@ namespace CrowEdit.Ebnf
                        if (xmlTokType == EbnfTokenType.OpenBracket || xmlTokType == EbnfTokenType.ClosingBracket)
                                return Colors.RebeccaPurple;
                        if (xmlTokType == EbnfTokenType.StringDelimiter)
-                               return Colors.DarkGoldenRod;
+                               return Colors.Teal;
                        if (xmlTokType == EbnfTokenType.StringLiteral)
-                               return Colors.DarkGoldenRod;
+                               return Colors.Teal;
+                       if (xmlTokType.HasFlag(EbnfTokenType.CharMatch))
+                               return Colors.Green;
+                       if (xmlTokType.HasFlag(EbnfTokenType.Operator))
+                               return Colors.Fuchsia;
 
                        if (xmlTokType.HasFlag (EbnfTokenType.Punctuation))
                                return Colors.DarkGrey;
index 039dca5373b35f7e9800306e84c2198b121ffeab..16dad5d15bf3ef44d75b7345dedcf45385cc48da 100644 (file)
@@ -67,7 +67,8 @@ namespace CrowEdit.Ebnf
                                switch (reader.Peek) {
                                case '/':
                                        reader.Advance ();
-                                       if (reader.TryRead ('*')) {
+                                       if (reader.TryPeek ('*')) {
+                                               reader.Advance ();
                                                addTok (ref reader, EbnfTokenType.BlockCommentStart);
                                                while (!reader.EndOfSpan) {
                                                        if (reader.Eol()) {
@@ -78,13 +79,15 @@ namespace CrowEdit.Ebnf
                                                        }
                                                        if (reader.TryPeek ("*/")) {
                                                                addTok (ref reader, EbnfTokenType.BlockComment);
-                                                               reader.Advance (3);
+                                                               reader.Advance (2);
                                                                addTok (ref reader, EbnfTokenType.BlockCommentEnd);
                                                                break;
                                                        } else
                                                                reader.Read ();
-                                               }                                               
+                                               }
+                                               break;                                  
                                        }
+                                       addTok (ref reader, EbnfTokenType.Unknown);
                                        break;
                                case '"':
                                case '\'':