1 | /*
|
---|
2 | * synergy -- mouse and keyboard sharing utility
|
---|
3 | * Copyright (C) 2002 Chris Schoeneman
|
---|
4 | *
|
---|
5 | * This package is free software; you can redistribute it and/or
|
---|
6 | * modify it under the terms of the GNU General Public License
|
---|
7 | * found in the file COPYING that should have accompanied this file.
|
---|
8 | *
|
---|
9 | * This package is distributed in the hope that it will be useful,
|
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
12 | * GNU General Public License for more details.
|
---|
13 | */
|
---|
14 |
|
---|
15 | #include "CXWindowsClipboardUCS2Converter.h"
|
---|
16 | #include "CUnicode.h"
|
---|
17 |
|
---|
18 | //
|
---|
19 | // CXWindowsClipboardUCS2Converter
|
---|
20 | //
|
---|
21 |
|
---|
22 | CXWindowsClipboardUCS2Converter::CXWindowsClipboardUCS2Converter(
|
---|
23 | Display* display, const char* name) :
|
---|
24 | m_atom(XInternAtom(display, name, False))
|
---|
25 | {
|
---|
26 | // do nothing
|
---|
27 | }
|
---|
28 |
|
---|
29 | CXWindowsClipboardUCS2Converter::~CXWindowsClipboardUCS2Converter()
|
---|
30 | {
|
---|
31 | // do nothing
|
---|
32 | }
|
---|
33 |
|
---|
34 | IClipboard::EFormat
|
---|
35 | CXWindowsClipboardUCS2Converter::getFormat() const
|
---|
36 | {
|
---|
37 | return IClipboard::kText;
|
---|
38 | }
|
---|
39 |
|
---|
40 | Atom
|
---|
41 | CXWindowsClipboardUCS2Converter::getAtom() const
|
---|
42 | {
|
---|
43 | return m_atom;
|
---|
44 | }
|
---|
45 |
|
---|
46 | int
|
---|
47 | CXWindowsClipboardUCS2Converter::getDataSize() const
|
---|
48 | {
|
---|
49 | return 16;
|
---|
50 | }
|
---|
51 |
|
---|
52 | CString
|
---|
53 | CXWindowsClipboardUCS2Converter::fromIClipboard(const CString& data) const
|
---|
54 | {
|
---|
55 | return CUnicode::UTF8ToUCS2(data);
|
---|
56 | }
|
---|
57 |
|
---|
58 | CString
|
---|
59 | CXWindowsClipboardUCS2Converter::toIClipboard(const CString& data) const
|
---|
60 | {
|
---|
61 | return CUnicode::UCS2ToUTF8(data);
|
---|
62 | }
|
---|