diff options
author | Po Lu <luangruo@yahoo.com> | 2022-03-18 05:48:10 +0000 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-03-18 05:48:10 +0000 |
commit | a96f6de5447f296dbadc90de9a1157062e9ba491 (patch) | |
tree | 7fdd12ab7af138d8c55b3e9988c7906aa2a1d595 /src/haiku_select.cc | |
parent | 45609c347e7810b20c54bedc1ce5355182f240e5 (diff) | |
download | emacs-a96f6de5447f296dbadc90de9a1157062e9ba491.tar.gz emacs-a96f6de5447f296dbadc90de9a1157062e9ba491.tar.bz2 emacs-a96f6de5447f296dbadc90de9a1157062e9ba491.zip |
Allow dragging messages with file names on Haiku
* src/haiku_select.cc (be_add_refs_data): New function.
* src/haikuselect.c (haiku_lisp_to_message): Handle `ref' type
correctly.
* src/haikuselect.h: Update prototypes.
Diffstat (limited to 'src/haiku_select.cc')
-rw-r--r-- | src/haiku_select.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/haiku_select.cc b/src/haiku_select.cc index 4212f60a480..9012639d6af 100644 --- a/src/haiku_select.cc +++ b/src/haiku_select.cc @@ -337,3 +337,20 @@ be_add_message_data (void *message, const char *name, return msg->AddData (name, type_code, buf, buf_size) != B_OK; } + +int +be_add_refs_data (void *message, const char *name, + const char *filename) +{ + BEntry entry (filename); + entry_ref ref; + BMessage *msg = (BMessage *) message; + + if (entry.InitCheck () != B_OK) + return 1; + + if (entry.GetRef (&ref) != B_OK) + return 1; + + return msg->AddRef (name, &ref) != B_OK; +} |