BuildTargetTable() public static méthode

public static BuildTargetTable ( TransferDataType types ) : Gtk.TargetList
types TransferDataType
Résultat Gtk.TargetList
Exemple #1
0
        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);
        }
Exemple #2
0
 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));
     }
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
 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);
 }
Exemple #7
0
 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);
 }
Exemple #8
0
 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));
 }
Exemple #9
0
 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 {
     });
 }