Beispiel #1
0
        static void OverrideClosed(GLib.GType gtype, ClosedNativeDelegate callback)
        {
            GtkPopoverClass class_iface = GetClassStruct(gtype, false);

            class_iface.Closed = callback;
            OverrideClassStruct(gtype, class_iface);
        }
Beispiel #2
0
        static GtkPopoverClass GetClassStruct(GLib.GType gtype, bool use_cache)
        {
            if (class_structs == null)
            {
                class_structs = new Dictionary <GLib.GType, GtkPopoverClass> ();
            }

            if (use_cache && class_structs.ContainsKey(gtype))
            {
                return(class_structs [gtype]);
            }
            else
            {
                IntPtr          class_ptr    = new IntPtr(gtype.GetClassPtr().ToInt64() + class_offset);
                GtkPopoverClass class_struct = (GtkPopoverClass)Marshal.PtrToStructure(class_ptr, typeof(GtkPopoverClass));
                if (use_cache)
                {
                    class_structs.Add(gtype, class_struct);
                }
                return(class_struct);
            }
        }
Beispiel #3
0
        static void OverrideClassStruct(GLib.GType gtype, GtkPopoverClass class_struct)
        {
            IntPtr class_ptr = new IntPtr(gtype.GetClassPtr().ToInt64() + class_offset);

            Marshal.StructureToPtr(class_struct, class_ptr, false);
        }