From 29032d00985d862bfd3f358cd40f8786cf3b174c Mon Sep 17 00:00:00 2001 From: Martin Willemoes Hansen Date: Thu, 31 Jul 2003 09:18:15 +0000 Subject: [PATCH] * Upgraded to latest gtk# cvs svn path=/trunk/diacanvas-sharp/; revision=16932 --- ChangeLog | 4 ++ PROBLEMS | 30 +++++++-- api/dia-api.xml | 82 ++++++++++++++++++++++-- doc/en/Dia/Constraint.xml | 10 --- doc/en/Dia/ConstraintFunc.xml | 2 +- doc/en/Dia/Solver.xml | 30 --------- doc/en/DiaSharp/ConstraintFuncNative.xml | 2 +- sample/CanvasTextBox.cs | 2 +- sample/sample.cs | 10 ++- 9 files changed, 118 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index bcc2ec6..b1cd91a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-07-31 Martin Willemoes Hansen + + * Upgraded to latest gtk# cvs + 2003-07-28 Martin Willemoes Hansen * dia/CanvasBox.custom diff --git a/PROBLEMS b/PROBLEMS index 023ae50..cedde2e 100644 --- a/PROBLEMS +++ b/PROBLEMS @@ -64,10 +64,10 @@ It probably is a character encoding problem from Uni16 to utf-8/ascii. DiaPoint Boxing problem ----------------------- -The following code: +The following code (DiaCanvas#): CanvasLine line = new CanvasLine(); line.HeadPos = new Dia.Point (50, 50); -produces this: +produces this stacktrace: Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was required in (unmanaged) 06 GLib.Object:g_object_set_property (intptr,string,intptr) @@ -78,8 +78,30 @@ in <0x000e5> 00 .Sample:CreateItemsProgramatically () in <0x001a5> 00 .Sample:.ctor () in <0x00023> 00 .Sample:Main () -It might has something to do with how the DiaPoint is boxed .. the boxed version -does not have a valid .Handle +Dia.Point is a struct: + [StructLayout(LayoutKind.Sequential)] + public struct Point { ... } + +It does not have a Handle and thus shall be marshalled to the c world. + + +The code of the set property of HeadPos: + SetProperty("head_pos", new GLib.Value(Handle, "head_pos", new GLib.Boxed (value))); + +The boxed type: new GLib.Boxed (value), does not have a valid Handle. + +The code for the ctor of the Value type: + public Value (IntPtr obj, string prop_name, Boxed val) + { + _val = gtksharp_value_create_from_property (obj, prop_name); + //g_value_set_boxed (_val, val.Handle); + } + +This ctor looks halfbaked. val.Handle is 0, cause the Point does not have a +valid handle, it has not been marshalled yet. + +So some kind of magic needs to be done, to marshall the Boxed value and keep +track of resources etc. ================================================================================ diff --git a/api/dia-api.xml b/api/dia-api.xml index 11b6363..d7a1b13 100644 --- a/api/dia-api.xml +++ b/api/dia-api.xml @@ -108,7 +108,7 @@ - + @@ -977,7 +977,7 @@ - + @@ -1264,7 +1264,7 @@ - + @@ -1274,7 +1274,7 @@ - + @@ -2083,5 +2083,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/en/Dia/Constraint.xml b/doc/en/Dia/Constraint.xml index ba0676c..1437f99 100644 --- a/doc/en/Dia/Constraint.xml +++ b/doc/en/Dia/Constraint.xml @@ -200,15 +200,5 @@ To be added - - - Event - - - - To be added - To be added - - \ No newline at end of file diff --git a/doc/en/Dia/ConstraintFunc.xml b/doc/en/Dia/ConstraintFunc.xml index fc50160..cdb6bef 100644 --- a/doc/en/Dia/ConstraintFunc.xml +++ b/doc/en/Dia/ConstraintFunc.xml @@ -1,5 +1,5 @@ - + dia-sharp diff --git a/doc/en/Dia/Solver.xml b/doc/en/Dia/Solver.xml index 711d505..ae0ec6e 100644 --- a/doc/en/Dia/Solver.xml +++ b/doc/en/Dia/Solver.xml @@ -37,36 +37,6 @@ To be added - - - Method - - System.Void - - - - - - To be added - To be added: an object of type 'Dia.Constraint' - To be added - - - - - Method - - System.Void - - - - - - To be added - To be added: an object of type 'Dia.Constraint' - To be added - - Method diff --git a/doc/en/DiaSharp/ConstraintFuncNative.xml b/doc/en/DiaSharp/ConstraintFuncNative.xml index 337ad51..b6c6252 100644 --- a/doc/en/DiaSharp/ConstraintFuncNative.xml +++ b/doc/en/DiaSharp/ConstraintFuncNative.xml @@ -1,5 +1,5 @@ - + dia-sharp diff --git a/sample/CanvasTextBox.cs b/sample/CanvasTextBox.cs index 20c6a68..fb88906 100644 --- a/sample/CanvasTextBox.cs +++ b/sample/CanvasTextBox.cs @@ -11,7 +11,7 @@ public class CanvasTextBox : CanvasBox { public CanvasTextBox() : base() { text = new CanvasText(); - AddConstruction (text); + //AddConstruction (text); //text.Font = FontDescription.FromString ("sans 20"); text.Text = "Im a Canvas Text Box"; text.Width = Width - 20; diff --git a/sample/sample.cs b/sample/sample.cs index 0507c3b..52c4e79 100644 --- a/sample/sample.cs +++ b/sample/sample.cs @@ -51,8 +51,12 @@ public class Sample { Dia.Point p1 = new Dia.Point (50, 50); Dia.Point p2 = new Dia.Point (100, 100); - //line.HeadPos = p1; - //line.TailPos = p2; + try { + line.HeadPos = p1; + line.TailPos = p2; + } catch (Exception ex) { + Console.WriteLine (ex); + } line.Move (200, 200); canvas.Root.Add (line); @@ -65,7 +69,7 @@ public class Sample { CanvasText text = new CanvasText(); text.Move (250, 150); text.Text = "Hello, World!"; - text.Font = FontDescription.FromString ("sans 20"); + //text.Font = FontDescription.FromString ("sans 20"); text.Height = 50; text.Width = 100; canvas.Root.Add (text);