public static BuildTargetTable ( TransferDataType types ) : Gtk.TargetList | ||
types | TransferDataType | |
return | Gtk.TargetList |
public void SetDragSource(string[] types, DragDropAction dragAction) { sourceDragAction = ConvertDragAction(dragAction); var table = Util.BuildTargetTable(types); Gtk.Drag.SourceSet(Widget, (Gdk.ModifierType) 0, (Gtk.TargetEntry[])table, sourceDragAction); }
IEnumerable <Gdk.Atom> GetAtomsForType(TransferDataType type) { foreach (Gtk.TargetEntry te in (Gtk.TargetEntry[])Util.BuildTargetTable(new TransferDataType[] { type })) { yield return(Gdk.Atom.Intern(te.Target, false)); } }
public void SetDragSource(TransferDataType[] types, DragDropAction dragAction) { DragDropInfo.SourceDragAction = ConvertDragAction(dragAction); var table = Util.BuildTargetTable(types); OnSetDragSource(Gdk.ModifierType.Button1Mask, (Gtk.TargetEntry[])table, DragDropInfo.SourceDragAction); }
public void SetDragTarget(TransferDataType[] types, DragDropAction dragAction) { DragDropInfo.DestDragAction = ConvertDragAction(dragAction); var table = Util.BuildTargetTable(types); DragDropInfo.ValidDropTypes = (Gtk.TargetEntry[])table; OnSetDragTarget(DragDropInfo.ValidDropTypes, DragDropInfo.DestDragAction); }
public void SetDragTarget(string[] types, DragDropAction dragAction) { destDragAction = ConvertDragAction(dragAction); var table = Util.BuildTargetTable(types); validDropTypes = (Gtk.TargetEntry[])table; Gtk.Drag.DestSet(Widget, Gtk.DestDefaults.Highlight, validDropTypes, destDragAction); }
public void DragStart(TransferDataSource data, DragDropAction dragAction, object imageBackend, double hotX, double hotY) { Gdk.DragAction action = ConvertDragAction(dragAction); currentDragData = data; Widget.DragBegin += HandleDragBegin; IconInitializer.Init(Widget, (Gdk.Pixbuf)imageBackend, hotX, hotY); Gtk.Drag.Begin(Widget, Util.BuildTargetTable(data.DataTypes), action, 1, Gtk.Global.CurrentEvent); }
public void DragStart(DragStartData sdata) { Gdk.DragAction action = ConvertDragAction(sdata.DragAction); DragDropInfo.CurrentDragData = sdata.Data; Widget.DragBegin += HandleDragBegin; if (sdata.ImageBackend != null) { IconInitializer.Init(Widget, (Gdk.Pixbuf)sdata.ImageBackend, sdata.HotX, sdata.HotY); } Gtk.Drag.Begin(Widget, Util.BuildTargetTable(sdata.Data.DataTypes), action, 1, Gtk.Global.CurrentEvent); }
public void DragStart(DragStartData sdata) { AllocEventBox(); Gdk.DragAction action = ConvertDragAction(sdata.DragAction); DragDropInfo.CurrentDragData = sdata.Data; EventsRootWidget.DragBegin += HandleDragBegin; if (sdata.ImageBackend != null) { var img = ((GtkImage)sdata.ImageBackend).ToPixbuf(ApplicationContext, Widget); IconInitializer.Init(EventsRootWidget, img, sdata.HotX, sdata.HotY); } Gtk.Drag.Begin(EventsRootWidget, Util.BuildTargetTable(sdata.Data.DataTypes), action, 1, Gtk.Global.CurrentEvent ?? new Gdk.Event(IntPtr.Zero)); }
public void SetData(TransferDataType type, Func <object> dataSource) { clipboard.SetWithData((Gtk.TargetEntry[])Util.BuildTargetTable(new TransferDataType[] { type }), delegate(Gtk.Clipboard cb, Gtk.SelectionData data, uint id) { TransferDataType ttype = Util.AtomToType(data.Target.Name); if (ttype == type) { Util.SetSelectionData(data, data.Target.Name, dataSource()); } }, delegate { }); }