fix MinGW warnings of compiling dragdrop.cpp
This commit is contained in:
parent
6ac558e1b7
commit
2e0f29564f
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Drag and Drop Implementation
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2018 Jinhao(cnjinhao@hotmail.com)
|
||||
* Copyright(C) 2019 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -157,10 +157,16 @@ namespace nana
|
||||
};
|
||||
|
||||
#ifdef NANA_WINDOWS
|
||||
|
||||
template<typename Interface, const IID& iid>
|
||||
class win32com_iunknown : public Interface
|
||||
class win32com_iunknown final: public Interface
|
||||
{
|
||||
public:
|
||||
template<typename ...Args>
|
||||
win32com_iunknown(Args&& ... args) :
|
||||
Interface(std::forward<Args>(args)...)
|
||||
{}
|
||||
|
||||
//Implements IUnknown
|
||||
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
|
||||
{
|
||||
@ -188,6 +194,7 @@ namespace nana
|
||||
LONG ref_count_{ 1 };
|
||||
};
|
||||
|
||||
|
||||
class win32com_drop_target : public IDropTarget, public dragdrop_session
|
||||
{
|
||||
public:
|
||||
@ -273,10 +280,10 @@ namespace nana
|
||||
DWORD effect_{ DROPEFFECT_NONE };
|
||||
};
|
||||
|
||||
class drop_source : public win32com_iunknown<IDropSource, IID_IDropSource>
|
||||
class drop_source_impl : public IDropSource
|
||||
{
|
||||
public:
|
||||
drop_source(window wd) :
|
||||
drop_source_impl(window wd) :
|
||||
window_handle_(wd)
|
||||
{}
|
||||
|
||||
@ -305,8 +312,10 @@ namespace nana
|
||||
private:
|
||||
window const window_handle_;
|
||||
};
|
||||
using drop_source = win32com_iunknown<drop_source_impl, IID_IDropSource>;
|
||||
|
||||
class win32_dropdata : public win32com_iunknown<IDataObject, IID_IDataObject>
|
||||
|
||||
class win32_dropdata_impl: public IDataObject
|
||||
{
|
||||
public:
|
||||
struct data_entry
|
||||
@ -563,6 +572,8 @@ namespace nana
|
||||
std::vector<std::unique_ptr<data_entry>> entries_;
|
||||
};
|
||||
|
||||
using win32_dropdata = win32com_iunknown<win32_dropdata_impl, IID_IDataObject>;
|
||||
|
||||
|
||||
#elif defined(NANA_X11)
|
||||
class x11_dropdata
|
||||
@ -710,7 +721,7 @@ namespace nana
|
||||
i->second->set_current_source(drag_wd);
|
||||
|
||||
DWORD result_effect{ DROPEFFECT_NONE };
|
||||
auto status = ::DoDragDrop(dropdata, drop_src, DROPEFFECT_COPY, &result_effect);
|
||||
::DoDragDrop(dropdata, drop_src, DROPEFFECT_COPY, &result_effect);
|
||||
|
||||
i->second->set_current_source(nullptr);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user