Example #1
0
		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;
			}
		}
Example #2
0
		static void OverrideInsert (GLib.GType gtype, InsertNativeDelegate callback)
		{
			gtksharp_menushell_override_insert (gtype.GetClassPtr (), callback);
		}
Example #3
0
        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;
              }
        }
Example #4
0
		static void OverrideGetPathForChild (GLib.GType gtype, GetPathForChildNativeDelegate callback)
		{
			gtksharp_container_override_get_path_for_child (gtype.GetClassPtr (), callback);
		}
Example #5
0
		static void OverrideFocusChildSet (GLib.GType gtype, FocusChildSetNativeDelegate callback)
		{
			gtksharp_container_override_set_focus_child (gtype.GetClassPtr (), callback);
		}
Example #6
0
		static void OverrideCompositeName (GLib.GType gtype, CompositeNameNativeDelegate callback)
		{
			gtksharp_container_override_composite_name (gtype.GetClassPtr (), callback);
		}
Example #7
0
		static void OverrideGetLabel (GLib.GType gtype, GetLabelNativeDelegate callback)
		{
			gtksharp_menuitem_override_get_label (gtype.GetClassPtr (), callback);
		}
Example #8
0
		static void OverrideAdded (GLib.GType gtype, AddedNativeDelegate callback)
		{
			gtksharp_container_override_add (gtype.GetClassPtr (), callback);
		}
Example #9
0
		static void OverrideActivateItem (GLib.GType gtype, ActivateItemNativeDelegate callback)
		{
			gtksharp_menuitem_override_activate_item (gtype.GetClassPtr (), callback);
		}
Example #10
0
		static void OverrideToggleSizeAllocated (GLib.GType gtype, ToggleSizeAllocatedNativeDelegate callback)
		{
			gtksharp_menuitem_override_toggle_size_allocate (gtype.GetClassPtr (), callback);
		}
Example #11
0
		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);
		}
Example #12
0
		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);
		}
Example #13
0
 static void OverrideClassStruct(GLib.GType gtype, GstMiniObjectClass class_struct)
 {
     IntPtr class_ptr = gtype.GetClassPtr ();
       Marshal.StructureToPtr (class_struct, class_ptr, false);
 }
Example #14
0
		static void OverrideGetPopupDelay (GLib.GType gtype, GetPopupDelayNativeDelegate callback)
		{
			gtksharp_menushell_override_get_popup_delay (gtype.GetClassPtr (), callback);
		}
Example #15
0
		static void OverrideDeselected (GLib.GType gtype, DeselectedNativeDelegate callback)
		{
			gtksharp_menuitem_override_deselect (gtype.GetClassPtr (), callback);
		}
Example #16
0
		static void OverrideMoveSelected (GLib.GType gtype, MoveSelectedNativeDelegate callback)
		{
			gtksharp_menushell_override_move_selected (gtype.GetClassPtr (), callback);
		}
Example #17
0
		static void OverrideDeactivated (GLib.GType gtype, DeactivatedNativeDelegate callback)
		{
			gtksharp_menushell_override_deactivate (gtype.GetClassPtr (), callback);
		}
Example #18
0
		static void OverrideResizeChecked (GLib.GType gtype, ResizeCheckedNativeDelegate callback)
		{
			gtksharp_container_override_check_resize (gtype.GetClassPtr (), callback);
		}
Example #19
0
		static void OverrideSelectionDone (GLib.GType gtype, SelectionDoneNativeDelegate callback)
		{
			gtksharp_menushell_override_selection_done (gtype.GetClassPtr (), callback);
		}
Example #20
0
		static void OverrideChildType (GLib.GType gtype, ChildTypeNativeDelegate callback)
		{
			gtksharp_container_override_child_type (gtype.GetClassPtr (), callback);
		}
Example #21
0
		static void OverrideActivateCurrent (GLib.GType gtype, ActivateCurrentNativeDelegate callback)
		{
			gtksharp_menushell_override_activate_current (gtype.GetClassPtr (), callback);
		}
Example #22
0
		static void OverrideGetChildProperty (GLib.GType gtype, GetChildPropertyNativeDelegate callback)
		{
			gtksharp_container_override_get_child_property (gtype.GetClassPtr (), callback);
		}
Example #23
0
		static void OverrideCanceled (GLib.GType gtype, CanceledNativeDelegate callback)
		{
			gtksharp_menushell_override_cancel (gtype.GetClassPtr (), callback);
		}
Example #24
0
		static void OverrideClassStruct (GLib.GType gtype, GtkRecentChooserDialogClass class_struct)
		{
			IntPtr class_ptr = new IntPtr (gtype.GetClassPtr ().ToInt64 () + class_offset);
			Marshal.StructureToPtr (class_struct, class_ptr, false);
		}
Example #25
0
		static void OverrideSelectItem (GLib.GType gtype, SelectItemNativeDelegate callback)
		{
			gtksharp_menushell_override_select_item (gtype.GetClassPtr (), callback);
		}
Example #26
0
		static void OverrideClassStruct (GLib.GType gtype, GDBusProxyClass class_struct)
		{
			IntPtr class_ptr = new IntPtr (gtype.GetClassPtr ().ToInt64 () + class_offset);
			Marshal.StructureToPtr (class_struct, class_ptr, false);
		}
		static void OverrideClassStruct (GLib.GType gtype, GSocketAddressEnumeratorClass class_struct)
		{
			IntPtr class_ptr = new IntPtr (gtype.GetClassPtr ().ToInt64 () + class_offset);
			Marshal.StructureToPtr (class_struct, class_ptr, false);
		}