当前位置: 首页>>代码示例>>C#>>正文


C# GLib.GetClassPtr方法代码示例

本文整理汇总了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;
			}
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:15,代码来源:Scrollbar.cs

示例2: OverrideInsert

		static void OverrideInsert (GLib.GType gtype, InsertNativeDelegate callback)
		{
			gtksharp_menushell_override_insert (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:MenuShell.cs

示例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;
              }
        }
开发者ID:Forage,项目名称:gstreamer-sharp,代码行数:15,代码来源:MiniObject.cs

示例4: OverrideGetPathForChild

		static void OverrideGetPathForChild (GLib.GType gtype, GetPathForChildNativeDelegate callback)
		{
			gtksharp_container_override_get_path_for_child (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:Container.cs

示例5: OverrideFocusChildSet

		static void OverrideFocusChildSet (GLib.GType gtype, FocusChildSetNativeDelegate callback)
		{
			gtksharp_container_override_set_focus_child (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:Container.cs

示例6: OverrideCompositeName

		static void OverrideCompositeName (GLib.GType gtype, CompositeNameNativeDelegate callback)
		{
			gtksharp_container_override_composite_name (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:Container.cs

示例7: OverrideGetLabel

		static void OverrideGetLabel (GLib.GType gtype, GetLabelNativeDelegate callback)
		{
			gtksharp_menuitem_override_get_label (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:MenuItem.cs

示例8: OverrideAdded

		static void OverrideAdded (GLib.GType gtype, AddedNativeDelegate callback)
		{
			gtksharp_container_override_add (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:Container.cs

示例9: OverrideActivateItem

		static void OverrideActivateItem (GLib.GType gtype, ActivateItemNativeDelegate callback)
		{
			gtksharp_menuitem_override_activate_item (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:MenuItem.cs

示例10: OverrideToggleSizeAllocated

		static void OverrideToggleSizeAllocated (GLib.GType gtype, ToggleSizeAllocatedNativeDelegate callback)
		{
			gtksharp_menuitem_override_toggle_size_allocate (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:MenuItem.cs

示例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);
		}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:35,代码来源:Widget.cs

示例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);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:5,代码来源:CellRendererSpinner.cs

示例13: OverrideClassStruct

 static void OverrideClassStruct(GLib.GType gtype, GstMiniObjectClass class_struct)
 {
     IntPtr class_ptr = gtype.GetClassPtr ();
       Marshal.StructureToPtr (class_struct, class_ptr, false);
 }
开发者ID:Forage,项目名称:gstreamer-sharp,代码行数:5,代码来源:MiniObject.cs

示例14: OverrideGetPopupDelay

		static void OverrideGetPopupDelay (GLib.GType gtype, GetPopupDelayNativeDelegate callback)
		{
			gtksharp_menushell_override_get_popup_delay (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:MenuShell.cs

示例15: OverrideDeselected

		static void OverrideDeselected (GLib.GType gtype, DeselectedNativeDelegate callback)
		{
			gtksharp_menuitem_override_deselect (gtype.GetClassPtr (), callback);
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:4,代码来源:MenuItem.cs


注:本文中的GLib.GetClassPtr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。