linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #06388
[Branch ~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin] Rev 10: use dwt clipboard to copy
------------------------------------------------------------
revno: 10
committer: poy <poy@xxxxxxxxxx>
branch nick: DevPlugin
timestamp: Thu 2012-12-27 16:38:29 +0100
message:
use dwt clipboard to copy
modified:
projects/make/Makefile
projects/vs2012/Plugin.vcxproj
projects/vs2012/Plugin.vcxproj.filters
src/GUI.cpp
--
lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin
https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin
Your team Dcplusplus-team is subscribed to branch lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin/+edit-subscription
=== modified file 'projects/make/Makefile'
--- projects/make/Makefile 2012-12-27 14:05:05 +0000
+++ projects/make/Makefile 2012-12-27 15:38:29 +0000
@@ -71,10 +71,10 @@
LINKFLAGS += -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -lshlwapi -luuid -luxtheme
endif
OBJS += dwt/src/Application.o dwt/src/Bitmap.o dwt/src/Brush.o dwt/src/CanvasClasses.o \
- dwt/src/CommandLine.o dwt/src/Dispatcher.o dwt/src/DWTException.o dwt/src/Events.o \
- dwt/src/Font.o dwt/src/Icon.o dwt/src/ImageList.o dwt/src/LibraryLoader.o dwt/src/Message.o \
- dwt/src/Pen.o dwt/src/Point.o dwt/src/Rectangle.o dwt/src/Region.o dwt/src/Taskbar.o \
- dwt/src/Texts.o dwt/src/Theme.o dwt/src/Widget.o \
+ dwt/src/Clipboard.o dwt/src/CommandLine.o dwt/src/Dispatcher.o dwt/src/DWTException.o \
+ dwt/src/Events.o dwt/src/Font.o dwt/src/Icon.o dwt/src/ImageList.o dwt/src/LibraryLoader.o \
+ dwt/src/Message.o dwt/src/Pen.o dwt/src/Point.o dwt/src/Rectangle.o dwt/src/Region.o \
+ dwt/src/Taskbar.o dwt/src/Texts.o dwt/src/Theme.o dwt/src/Widget.o \
dwt/src/util/DateTimeUtil.o dwt/src/util/GDI.o dwt/src/util/RegKey.o \
dwt/src/util/StringUtils.o dwt/src/util/TimeSpan.o \
dwt/src/util/win32/ApiHelpers.o dwt/src/util/win32/Version.o \
=== modified file 'projects/vs2012/Plugin.vcxproj'
--- projects/vs2012/Plugin.vcxproj 2012-12-27 13:57:18 +0000
+++ projects/vs2012/Plugin.vcxproj 2012-12-27 15:38:29 +0000
@@ -105,6 +105,7 @@
<ClCompile Include="..\..\dwt\src\Bitmap.cpp" />
<ClCompile Include="..\..\dwt\src\Brush.cpp" />
<ClCompile Include="..\..\dwt\src\CanvasClasses.cpp" />
+ <ClCompile Include="..\..\dwt\src\Clipboard.cpp" />
<ClCompile Include="..\..\dwt\src\CommandLine.cpp" />
<ClCompile Include="..\..\dwt\src\Dispatcher.cpp" />
<ClCompile Include="..\..\dwt\src\DWTException.cpp" />
=== modified file 'projects/vs2012/Plugin.vcxproj.filters'
--- projects/vs2012/Plugin.vcxproj.filters 2012-12-27 13:57:18 +0000
+++ projects/vs2012/Plugin.vcxproj.filters 2012-12-27 15:38:29 +0000
@@ -345,6 +345,9 @@
<ClCompile Include="..\..\src\GUI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\dwt\src\Clipboard.cpp">
+ <Filter>Source Files\dwt</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\Plugin.h">
=== modified file 'src/GUI.cpp'
--- src/GUI.cpp 2012-12-27 13:57:18 +0000
+++ src/GUI.cpp 2012-12-27 15:38:29 +0000
@@ -26,6 +26,7 @@
#include <boost/lexical_cast.hpp>
#include <dwt/Application.h>
+#include <dwt/Clipboard.h>
#include <dwt/Events.h>
#include <dwt/util/HoldRedraw.h>
#include <dwt/widgets/Button.h>
@@ -285,30 +286,7 @@
}
}
- // the following has been taken from WinUtil::setClipboard
-
- if(!::OpenClipboard(window->handle())) {
- return;
- }
-
- EmptyClipboard();
-
- // Allocate a global memory object for the text.
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (str.size() + 1) * sizeof(TCHAR));
- if(hglbCopy == NULL) {
- CloseClipboard();
- return;
- }
-
- // Lock the handle and copy the text to the buffer.
- TCHAR* lptstrCopy = (TCHAR*) GlobalLock(hglbCopy);
- _tcscpy(lptstrCopy, str.c_str());
- GlobalUnlock(hglbCopy);
-
- // Place the handle on the clipboard.
- SetClipboardData(CF_UNICODETEXT, hglbCopy);
-
- CloseClipboard();
+ dwt::Clipboard::setData(str, window);
}
void GUI::clear() {