本文整理汇总了C#中GLib.GetClassPtr方法的典型用法代码示例。如果您正苦于以下问题:C# GLib.GetClassPtr方法的具体用法?C# GLib.GetClassPtr怎么用?C# GLib.GetClassPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLib
的用法示例。
在下文中一共展示了GLib.GetClassPtr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetClassStruct
static GtkScrollbarClass GetClassStruct (GLib.GType gtype, bool use_cache)
{
if (class_structs == null)
class_structs = new Dictionary<GLib.GType, GtkScrollbarClass> ();
if (use_cache && class_structs.ContainsKey (gtype))
return class_structs [gtype];
else {
IntPtr class_ptr = new IntPtr (gtype.GetClassPtr ().ToInt64 () + class_offset);
GtkScrollbarClass class_struct = (GtkScrollbarClass) Marshal.PtrToStructure (class_ptr, typeof (GtkScrollbarClass));
if (use_cache)
class_structs.Add (gtype, class_struct);
return class_struct;
}
}
示例2: OverrideInsert
static void OverrideInsert (GLib.GType gtype, InsertNativeDelegate callback)
{
gtksharp_menushell_override_insert (gtype.GetClassPtr (), callback);
}
示例3: GetClassStruct
static GstMiniObjectClass GetClassStruct(GLib.GType gtype, bool use_cache)
{
if (class_structs == null)
class_structs = new Hashtable ();
if (use_cache && class_structs.Contains (gtype))
return (GstMiniObjectClass) class_structs [gtype];
else {
IntPtr class_ptr = gtype.GetClassPtr ();
GstMiniObjectClass class_struct = (GstMiniObjectClass) Marshal.PtrToStructure (class_ptr, typeof (GstMiniObjectClass));
if (use_cache)
class_structs.Add (gtype, class_struct);
return class_struct;
}
}
示例4: OverrideGetPathForChild
static void OverrideGetPathForChild (GLib.GType gtype, GetPathForChildNativeDelegate callback)
{
gtksharp_container_override_get_path_for_child (gtype.GetClassPtr (), callback);
}
示例5: OverrideFocusChildSet
static void OverrideFocusChildSet (GLib.GType gtype, FocusChildSetNativeDelegate callback)
{
gtksharp_container_override_set_focus_child (gtype.GetClassPtr (), callback);
}
示例6: OverrideCompositeName
static void OverrideCompositeName (GLib.GType gtype, CompositeNameNativeDelegate callback)
{
gtksharp_container_override_composite_name (gtype.GetClassPtr (), callback);
}
示例7: OverrideGetLabel
static void OverrideGetLabel (GLib.GType gtype, GetLabelNativeDelegate callback)
{
gtksharp_menuitem_override_get_label (gtype.GetClassPtr (), callback);
}
示例8: OverrideAdded
static void OverrideAdded (GLib.GType gtype, AddedNativeDelegate callback)
{
gtksharp_container_override_add (gtype.GetClassPtr (), callback);
}
示例9: OverrideActivateItem
static void OverrideActivateItem (GLib.GType gtype, ActivateItemNativeDelegate callback)
{
gtksharp_menuitem_override_activate_item (gtype.GetClassPtr (), callback);
}
示例10: OverrideToggleSizeAllocated
static void OverrideToggleSizeAllocated (GLib.GType gtype, ToggleSizeAllocatedNativeDelegate callback)
{
gtksharp_menuitem_override_toggle_size_allocate (gtype.GetClassPtr (), callback);
}
示例11: ClassInit
static void ClassInit (GLib.GType gtype, Type t)
{
object[] attrs = t.GetCustomAttributes (typeof (BindingAttribute), true);
if (attrs.Length == 0) return;
string signame = t.Name.Replace (".", "_") + "_bindings";
IntPtr native_signame = GLib.Marshaller.StringToPtrGStrdup (signame);
RegisterSignal (signame, gtype, GLib.Signal.Flags.RunLast | GLib.Signal.Flags.Action, GLib.GType.None, new GLib.GType[] {GLib.GType.Long}, BindingDelegate);
if (binding_invokers == null)
binding_invokers = new List<BindingInvoker> ();
foreach (BindingAttribute attr in attrs) {
System.Reflection.MethodInfo mi = t.GetMethod (attr.Handler, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public);
if (mi == null)
throw new Exception ("Instance method " + attr.Handler + " not found in " + t);
GtkBindingArg arg = new GtkBindingArg ();
arg.arg_type = GLib.GType.Long.Val;
var bi = new BindingInvoker (mi, attr.Parms);
binding_invokers.Add (bi);
int binding_invoker_idx = binding_invokers.IndexOf (bi);
#if WIN64LONGS
arg.data.long_data = binding_invoker_idx;
#else
arg.data.long_data = new IntPtr (binding_invoker_idx);
#endif
GLib.SList binding_args = new GLib.SList (new object[] {arg}, typeof (GtkBindingArg), false, false);
gtk_binding_entry_add_signall (gtk_binding_set_by_class (gtype.GetClassPtr ()), (uint) attr.Key, attr.Mod, native_signame, binding_args.Handle);
binding_args.Dispose ();
}
GLib.Marshaller.Free (native_signame);
}
示例12: OverrideClassStruct
static void OverrideClassStruct (GLib.GType gtype, GtkCellRendererSpinnerClass class_struct)
{
IntPtr class_ptr = new IntPtr (gtype.GetClassPtr ().ToInt64 () + class_offset);
Marshal.StructureToPtr (class_struct, class_ptr, false);
}
示例13: OverrideClassStruct
static void OverrideClassStruct(GLib.GType gtype, GstMiniObjectClass class_struct)
{
IntPtr class_ptr = gtype.GetClassPtr ();
Marshal.StructureToPtr (class_struct, class_ptr, false);
}
示例14: OverrideGetPopupDelay
static void OverrideGetPopupDelay (GLib.GType gtype, GetPopupDelayNativeDelegate callback)
{
gtksharp_menushell_override_get_popup_delay (gtype.GetClassPtr (), callback);
}
示例15: OverrideDeselected
static void OverrideDeselected (GLib.GType gtype, DeselectedNativeDelegate callback)
{
gtksharp_menuitem_override_deselect (gtype.GetClassPtr (), callback);
}