/* * X-Window XDND Protocol Implementation * Nana C++ Library(http://www.nanapro.org) * Copyright(C) 2018 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * @file: nana/detail/posix/xdnd_protocol.hpp * * The XDS is not supported. */ #ifndef NANA_DETAIL_POSIX_XDND_PROTOCOL_INCLUDED #define NANA_DETAIL_POSIX_XDND_PROTOCOL_INCLUDED #include "platform_spec.hpp" #include #include "theme.hpp" #include #include #define DEBUG_XDND_PROTOCOL #ifdef DEBUG_XDND_PROTOCOL #include //debug #endif namespace nana{ namespace detail { struct xdnd_data { Atom requested_action; std::vector files; }; class xdnd_protocol { public: enum class xdnd_status_state { normal, position, drop, //Use the 'accept' flag of XdndStatus when mouse has released(XdndDrop has been sent). status_ignore }; xdnd_protocol(Window source): spec_(nana::detail::platform_spec::instance()), source_(source) { auto disp = spec_.open_display(); detail::platform_scope_guard lock; ::XSetSelectionOwner(disp, spec_.atombase().xdnd_selection, source, CurrentTime); #ifdef DEBUG_XDND_PROTOCOL std::cout<<"XSetSelectionOwner "<(xclient.data.l[0]); bool is_accepted_by_target = (xclient.data.l[1] & 1); #ifdef DEBUG_XDND_PROTOCOL std::cout<<"XdndStatus: Accepted="< mvout_table_; struct cursor_rep { Cursor dnd_copy{ 0 }; Cursor dnd_move{ 0 }; Cursor dnd_none{ 0 }; }cursor_; }; //end class xdnd_protocol } } #endif