fixed clipboard waiting and kwrite targets

git-svn-id: trunk@2096 -
This commit is contained in:
mattias 2002-08-17 23:40:55 +00:00
parent b8f45dfe28
commit 0c16169447

View File

@ -342,7 +342,7 @@ var FormatAtom, FormatTry: Cardinal;
begin begin
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetData] A ClipboardWidget=',HexStr(Cardinal(ClipboardWidget),8),' Format=',ClipboardFormatToMimeType(FormatID)); writeln('[TgtkObject.ClipboardGetData] A ClipboardWidget=',HexStr(Cardinal(ClipboardWidget),8),' Format=',ClipboardFormatToMimeType(FormatID),' Now=',Now);
{$EndIf} {$EndIf}
Result:=false; Result:=false;
if (FormatID=0) or (Stream=nil) then exit; if (FormatID=0) or (Stream=nil) then exit;
@ -389,7 +389,7 @@ begin
end; end;
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetData] B Format=',ClipboardFormatToMimeType(FormatAtom)); writeln('[TgtkObject.ClipboardGetData] B Format=',ClipboardFormatToMimeType(FormatAtom),' Now=',Now);
{$EndIf} {$EndIf}
if FormatAtom=0 then exit; if FormatAtom=0 then exit;
@ -397,7 +397,7 @@ begin
SelData:=RequestSelectionData(ClipboardWidget,ClipboardType,FormatAtom); SelData:=RequestSelectionData(ClipboardWidget,ClipboardType,FormatAtom);
try try
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetData] C Length=',SelData.Length); writeln('[TgtkObject.ClipboardGetData] C Length=',SelData.Length,' Now=',Now);
{$EndIf} {$EndIf}
if (SelData.Selection<>ClipboardTypeAtoms[ClipboardType]) if (SelData.Selection<>ClipboardTypeAtoms[ClipboardType])
or (SelData.Target<>FormatAtom) then or (SelData.Target<>FormatAtom) then
@ -412,7 +412,7 @@ begin
CompoundTextCount:=gdk_text_property_to_text_list(SelData.theType, CompoundTextCount:=gdk_text_property_to_text_list(SelData.theType,
SelData.Format,SelData.Data,SelData.Length,@CompoundTextList); SelData.Format,SelData.Data,SelData.Length,@CompoundTextList);
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetData] D CompoundTextCount=',CompoundTextCount); writeln('[TgtkObject.ClipboardGetData] D CompoundTextCount=',CompoundTextCount,' Now=',Now);
{$EndIf} {$EndIf}
for i:=0 to CompoundTextCount-1 do for i:=0 to CompoundTextCount-1 do
if (CompoundTextList[i]<>nil) then if (CompoundTextList[i]<>nil) then
@ -426,7 +426,7 @@ begin
end; end;
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetData] END'); writeln('[TgtkObject.ClipboardGetData] END ',' Now=',Now);
{$EndIf} {$EndIf}
finally finally
if SelData.Data<>nil then FreeMem(SelData.Data); if SelData.Data<>nil then FreeMem(SelData.Data);
@ -490,7 +490,7 @@ writeln(' IsFormatSupported ',Format,' ',FormatAtoms[a]);
begin begin
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetFormats] A ClipboardWidget=',HexStr(Cardinal(ClipboardWidget),8)); writeln('[TgtkObject.ClipboardGetFormats] A ClipboardWidget=',HexStr(Cardinal(ClipboardWidget),8),' Now=',Now);
{$EndIf} {$EndIf}
Result:=false; Result:=false;
Count:=0; Count:=0;
@ -503,11 +503,25 @@ writeln('[TgtkObject.ClipboardGetFormats] A ClipboardWidget=',HexStr(Cardinal(Cl
try try
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetFormats] A2 ',AllID); writeln('[TgtkObject.ClipboardGetFormats] Checking TARGETS answer ',
' selection: ',SelData.Selection,'=',ClipboardTypeAtoms[ClipboardType],
' "',gdk_atom_name(SelData.Selection),'"',
' target: ',SelData.Target,'=',AllID,
' "',gdk_atom_name(SelData.Target),'"',
' theType: ',SelData.TheType,'=',gdk_atom_intern('ATOM',0),
' "',gdk_atom_name(SelData.theType),'"',
' Length=',SelData.Length,
' Format=',SelData.Format,
' Data=',HexStr(Cardinal(SelData.Data),8),
' Now=',Now
);
{$EndIf} {$EndIf}
if (SelData.Selection<>ClipboardTypeAtoms[ClipboardType]) if (SelData.Selection<>ClipboardTypeAtoms[ClipboardType])
or (SelData.Target<>AllID) or (SelData.Target<>AllID)
or (SelData.TheType<>gdk_atom_intern('ATOM',0)) then or (SelData.Format<=0)
or ((SelData.TheType<>gdk_atom_intern('ATOM',0))
and (SelData.TheType<>AllID))
then
exit; exit;
Cnt:=SelData.Length div (SelData.Format shr 3); Cnt:=SelData.Length div (SelData.Format shr 3);
@ -534,8 +548,9 @@ writeln('[TgtkObject.ClipboardGetFormats] A2 ',AllID);
i:=0; i:=0;
while (i<Cnt) do begin while (i<Cnt) do begin
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln(' ',i,': ',FormatAtoms[i]); writeln('[TgtkObject.ClipboardGetFormats] Supported formats: ',
writeln(' "',ClipboardFormatToMimeType(FormatAtoms[i]),'"'); i,'/',Cnt,': ',FormatAtoms[i]);
writeln(' MimeType="',ClipboardFormatToMimeType(FormatAtoms[i]),'"');
{$EndIf} {$EndIf}
List[i]:=FormatAtoms[i]; List[i]:=FormatAtoms[i];
inc(i); inc(i);
@ -7645,6 +7660,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.207 2003/01/24 11:58:01 mattias
fixed clipboard waiting and kwrite targets
Revision 1.206 2003/01/06 14:41:24 mattias Revision 1.206 2003/01/06 14:41:24 mattias
fixed synedit mouse pos to logical column fixed synedit mouse pos to logical column