summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2010-09-14 23:40:04 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-09-23 16:24:41 +0200
commit3e89220729b2243fec365c5a871c95b8b4ee55b4 (patch)
treecab5c0c2295e6014986e7b475b7c0291989f777f /src
parent40a4529c09a270c5fc53aea0f89a6eb92bac1961 (diff)
downloadfpGUI-3e89220729b2243fec365c5a871c95b8b4ee55b4.tar.xz
Adds a reverse lookup: GetAtomFromDropAction()
Diffstat (limited to 'src')
-rw-r--r--src/corelib/x11/fpg_x11.pas14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index e07b31ba..5f5b2c07 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -270,6 +270,7 @@ type
function KeySymToKeycode(KeySym: TKeySym): Word;
function StartComposing(const Event: TXEvent): TKeySym;
function GetDropActionFromAtom(const AAtom: TAtom): TfpgDropAction;
+ function GetAtomFromDropAction(const AAction: TfpgDropAction): TAtom;
procedure XdndInit;
procedure ResetDNDVariables;
procedure HandleDNDenter(ATopLevelWindow: TfpgX11Window; const ASource: TWindow; const ev: TXEvent);
@@ -754,7 +755,18 @@ begin
else if AAtom = XdndActionLink then
Result := daLink
else
- Result := daCopy; { the save fallback option }
+ Result := daCopy; { the safe fallback option }
+end;
+
+function TfpgX11Application.GetAtomFromDropAction(const AAction: TfpgDropAction): TAtom;
+begin
+ case AAction of
+ daCopy: Result := XdndActionCopy;
+ daMove: Result := XdndActionMove;
+ daLink: Result := XdndActionLink;
+ else
+ Result := XdndActionCopy; { the safe fallback option }
+ end;
end;
procedure TfpgX11Application.XdndInit;