00001 /* 00002 * synergy -- mouse and keyboard sharing utility 00003 * Copyright (C) 2002 Chris Schoeneman 00004 * 00005 * This package is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * found in the file COPYING that should have accompanied this file. 00008 * 00009 * This package is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 */ 00014 00015 #include "CXWindowsClipboardUCS2Converter.h" 00016 #include "CUnicode.h" 00017 00018 // 00019 // CXWindowsClipboardUCS2Converter 00020 // 00021 00022 CXWindowsClipboardUCS2Converter::CXWindowsClipboardUCS2Converter( 00023 Display* display, const char* name) : 00024 m_atom(XInternAtom(display, name, False)) 00025 { 00026 // do nothing 00027 } 00028 00029 CXWindowsClipboardUCS2Converter::~CXWindowsClipboardUCS2Converter() 00030 { 00031 // do nothing 00032 } 00033 00034 IClipboard::EFormat 00035 CXWindowsClipboardUCS2Converter::getFormat() const 00036 { 00037 return IClipboard::kText; 00038 } 00039 00040 Atom 00041 CXWindowsClipboardUCS2Converter::getAtom() const 00042 { 00043 return m_atom; 00044 } 00045 00046 int 00047 CXWindowsClipboardUCS2Converter::getDataSize() const 00048 { 00049 return 16; 00050 } 00051 00052 CString 00053 CXWindowsClipboardUCS2Converter::fromIClipboard(const CString& data) const 00054 { 00055 return CUnicode::UTF8ToUCS2(data); 00056 } 00057 00058 CString 00059 CXWindowsClipboardUCS2Converter::toIClipboard(const CString& data) const 00060 { 00061 return CUnicode::UCS2ToUTF8(data); 00062 }