package Tk
::DragDrop
::SunSite
;
$VERSION = '3.011'; # $Id: //depot/Tk8/DragDrop/DragDrop/SunSite.pm#11 $
use Tk::DragDrop::SunConst;
use base qw(Tk::DropSite);
Tk
::DropSite
->Type('Sun');
my ($atom,$t,$x,$y,$id,$flags) = unpack('LLSSLL',$e->A);
my $seln = $w->GetAtomName($atom);
eval {local $SIG{__DIE__
}; $w->SelectionGet('-selection'=>$seln,'_SUN_DRAGDROP_ACK');};
$site->Callback(-dropcommand
=> $seln, $x, $y);
if ($flags & &TRANSIENT_FLAG
)
eval {local $SIG{__DIE__
}; $w->SelectionGet('-selection'=>$seln,'_SUN_DRAGDROP_DONE');};
$w->configure('-relief' => $w->{'_DND_RELIEF_'}) if (defined $w->{'_DND_RELIEF_'});
$site->Callback(-entercommand
=> 0, $x, $y);
my ($kind,$t,$x,$y,$id,$flags) = unpack('LLSSLL',$event->A);
$site->Callback(-entercommand
=> 1, $x, $y);
$site->Callback(-entercommand
=> 0, $x, $y);
$site->Callback(-motioncommand
=> $x, $y);
$w->BindClientMessage('_SUN_DRAGDROP_TRIGGER',[\
&SunDrop
,$site]);
$w->BindClientMessage('_SUN_DRAGDROP_PREVIEW',[\
&SunPreview
,$site]);
my ($class,$t,$sites) = @_;
my ($wrapper,$offset) = $t->wrapper;
my $by = $t->rooty - $offset;
push(@data,${$w->WindowId}); # XID
push(@data,$i++); # Our 'tag'
push(@data,ENTERLEAVE
|MOTION
); # Flags
push(@data,0); # Kind is 'rect'
push(@data,1); # Number of rects
push(@data,$s->X-$bx,$s->Y-$by,$s->width,$s->height); # The rect
'_SUN_DRAGDROP_INTEREST', # name
'_SUN_DRAGDROP_INTEREST', # type
\
@data,$wrapper); # the data
$t->property('delete','_SUN_DRAGDROP_INTEREST',$wrapper);