187 строки
6.6 KiB
Plaintext
187 строки
6.6 KiB
Plaintext
Array fields are not generated properly
|
|
---------------------------------------
|
|
|
|
warning: array field Dia.ShapeText.affine probably incorrectly generated
|
|
warning: array field Dia.CanvasIter.data probably incorrectly generated
|
|
warning: array field Dia.DashStyle.dash probably incorrectly generated
|
|
warning: array field Dia.ShapeImage.affine probably incorrectly generated
|
|
|
|
This seems to be a problem with the generator.
|
|
Array marshalling is not implemented in mono yet.
|
|
|
|
The xml has a format of:
|
|
<field cname="dash" array_len="1" type="gdouble"/>
|
|
|
|
The generated C# code is like this:
|
|
public IntPtr dash;
|
|
|
|
================================================================================
|
|
|
|
|
|
Type missing problems
|
|
---------------------
|
|
|
|
Property has unknown Type DiaAffine in Object Dia.CanvasItem
|
|
DiaAffine is not a real type, kind of halfish.
|
|
Its realy a double [6] array.
|
|
|
|
Property has unknown Type DiaCanvasItemHandles in Object Dia.CanvasItem
|
|
Defined in diatypes.c and diacanvas.h
|
|
Maybe make a real type in c or make a manual wrapper class in C#
|
|
|
|
Field has unknown Type GDestroyNotify
|
|
Part of GObject, probably not wraped.
|
|
http://developer.gnome.org/doc/API/2.0/glib/glib-Datasets.html#GDestroyNotify
|
|
|
|
================================================================================
|
|
|
|
|
|
Pango.FontDescription problem
|
|
-----------------------------
|
|
|
|
CanvasText text = new CanvasText();
|
|
text.Font = FontDescription.FromString ("sans 20");
|
|
|
|
Results in this:
|
|
|
|
(<unknown>:972): GLib-GObject-WARNING **: gvalue.c:93: cannot initialize GValue with type `GBoxed', this type has no GTypeValueTable implementation
|
|
(<unknown>:972): GLib-GObject-CRITICAL **: file gboxed.c: line 487 (g_value_set_boxed): assertion `G_VALUE_HOLDS_BOXED (value)' failed
|
|
|
|
(<unknown>:972): GLib-GObject-CRITICAL **: file gobject.c: line 1019 (g_object_set_property): assertion `G_IS_VALUE (value)' failed
|
|
|
|
================================================================================
|
|
|
|
|
|
CanvasView.FindViewItem casting problem
|
|
---------------------------------------
|
|
|
|
Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination typein <0x0007c> Dia.CanvasView:FindViewItem (Dia.CanvasItem)
|
|
in <0x0044d> .Sample:CreateItemsProgramatically ()
|
|
in <0x001a3> .Sample:.ctor ()
|
|
in <0x00023> .Sample:Main ()
|
|
|
|
================================================================================
|
|
|
|
Crashes
|
|
-------
|
|
|
|
o Select all, then try to move stuff around.
|
|
|
|
================================================================================
|
|
|
|
|
|
Fields which are not what they seem to be
|
|
--------------------------------------------
|
|
|
|
o dia-canvas.h
|
|
DiaCanvasItem *root is realy a DiaCanvasGroup
|
|
o dia-canvas-view.h
|
|
GnomeCanvasItem *handle_layer is realy a DiaHandleLayer
|
|
|
|
================================================================================
|
|
|
|
|
|
Wrong EventHandler
|
|
------------------
|
|
|
|
event Canvas.Item.Event has the wrong event handler DiaSharp.EventHandler, it
|
|
should just have System.EventHandler
|
|
|
|
================================================================================
|
|
|
|
|
|
Wrongly generated SetMethod, when there is a property
|
|
-----------------------------------------------------
|
|
|
|
DiaCanvasItem.Parent property is generated but
|
|
DiaCanvasItem.SetParent is also generated.
|
|
|
|
================================================================================
|
|
|
|
|
|
Character encoding problem (FIXED)
|
|
----------------------------------
|
|
|
|
When calling DiaPlacementTool (DiaCanvasImage.GType ...) the following error
|
|
occours:
|
|
|
|
(<unknown>:1938): GLib-GObject-WARNING **: gobject.c:663: object class `DiaCanvasImage' has no property named `'
|
|
|
|
(<unknown>:1938): GLib-GObject-WARNING **: gobject.c:663: object class `DiaCanvasImage' has no property named `'
|
|
|
|
(<unknown>:1938): GLib-GObject-WARNING **: gobject.c:663: object class `DiaCanvasImage' has no property named `'
|
|
|
|
(<unknown>:1938): GdkPixbuf-CRITICAL **: file gdk-pixbuf.c: line 389 (gdk_pixbuf_get_height): assertion `pixbuf != NULL' failed
|
|
|
|
(<unknown>:1938): GdkPixbuf-CRITICAL **: file gdk-pixbuf.c: line 373 (gdk_pixbuf_get_width): assertion `pixbuf != NULL' failed
|
|
|
|
** (<unknown>:1938): CRITICAL **: file dia-shape.c: line 1455 (dia_shape_image): assertion `GDK_IS_PIXBUF (image)' failed
|
|
|
|
Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was required
|
|
in (unmanaged) 06 Gtk.Application:gtk_main ()
|
|
in <0x00004> 06 Gtk.Application:gtk_main ()
|
|
in <0x00007> 00 Gtk.Application:Run ()
|
|
in <0x0002b> 00 .Sample:Main ()
|
|
|
|
It probably is a character encoding problem from Uni16 to utf-8/ascii.
|
|
|
|
************
|
|
* Solution *
|
|
************
|
|
|
|
Marshal.StringToHGlobalAnsi ("string")
|
|
|
|
================================================================================
|
|
|
|
|
|
DiaPoint Boxing problem (Fixed)
|
|
-------------------------------
|
|
|
|
The following code (DiaCanvas#):
|
|
CanvasLine line = new CanvasLine();
|
|
line.HeadPos = new Dia.Point (50, 50);
|
|
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)
|
|
in <0x00004> 06 GLib.Object:g_object_set_property (intptr,string,intptr)
|
|
in <0x00040> 00 GLib.Object:SetProperty (string,GLib.Value)
|
|
in <0x000bc> 00 Dia.CanvasLine:set_HeadPos (Dia.Point)
|
|
in <0x000e5> 00 .Sample:CreateItemsProgramatically ()
|
|
in <0x001a5> 00 .Sample:.ctor ()
|
|
in <0x00023> 00 .Sample:Main ()
|
|
|
|
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.
|
|
|
|
************
|
|
* Solution *
|
|
************
|
|
|
|
Glue code to create a native c DiaPoint, this is a workaround, bug 47168
|
|
has been posted.
|
|
|
|
================================================================================
|