Commit 360230eb authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

нигде не используется clipboard

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62378 954022d7-b5bf-4e40-9824-e11837661b57
parent 540fb443

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

This diff is collapsed.

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ClipboardParser", "ClipboardParser.vcproj", "{E721277C-B765-4B37-8638-97E6E33DBE75}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E721277C-B765-4B37-8638-97E6E33DBE75}.Debug|Win32.ActiveCfg = Debug|Win32
{E721277C-B765-4B37-8638-97E6E33DBE75}.Debug|Win32.Build.0 = Debug|Win32
{E721277C-B765-4B37-8638-97E6E33DBE75}.Release|Win32.ActiveCfg = Release|Win32
{E721277C-B765-4B37-8638-97E6E33DBE75}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="ClipboardParser"
ProjectGUID="{E721277C-B765-4B37-8638-97E6E33DBE75}"
RootNamespace="ClipboardParser"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
IgnoreAllDefaultLibraries="true"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\ClipboardParser\ClipboardDataFetcher.cpp"
>
</File>
<File
RelativePath=".\ClipboardParser\ClipboardFetcherLinux.cpp"
>
</File>
<File
RelativePath=".\ClipboardParser\ClipboardFetcherMacosx.cpp"
>
</File>
<File
RelativePath=".\ClipboardParser\ClipboardFetcherWin.cpp"
>
</File>
<File
RelativePath=".\ClipboardParser\ClipboardParser.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\ClipboardParser\ClipboardDataFetcher.h"
>
</File>
<File
RelativePath=".\ClipboardParser\ClipboardFetcherLinux.h"
>
</File>
<File
RelativePath=".\ClipboardParser\ClipboardFetcherMacosx.h"
>
</File>
<File
RelativePath=".\ClipboardParser\ClipboardFetcherWin.h"
>
</File>
<File
RelativePath=".\ClipboardParser\IClipboardFetcher.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
#include "ClipboardDataFetcher.h"
IClipboardFetcher* CClipboardDataFetcher::createClipboardFetcher ()
{
IClipboardFetcher* pFetcher = NULL;
// Windows
#if defined (_WIN32) || defined (__MINGW32__)
pFetcher = new CClipboardFetcherWin ();
#endif
// Macos X
#ifdef __APPLE__
pFetcher = new CClipboardFetcherMacosx ();
#endif
// GCC on Linux
#ifdef __GNUC__
pFetcher = new CClipboardFetcherLinux ();
#endif
return pFetcher;
}
CClipboardDataFetcher::CClipboardDataFetcher(void)
{
}
CClipboardDataFetcher::~CClipboardDataFetcher(void)
{
}
#ifndef _Clipboard_CClipboardDataFetcher_
#define _Clipboard_CClipboardDataFetcher_
#include "IClipboardFetcher.h"
// Windows MSDN
// For MingW on Windows
#if defined (_WIN32) || defined (__MINGW32__)
#include "ClipboardFetcherWin.h"
#endif
// Macos X
#ifdef __APPLE__
#include "ClipboardFetcherMacosx.h"
#endif
// GCC on Linux
#ifdef __GNUC__
#endif
class CClipboardDataFetcher
{
public:
IClipboardFetcher* createClipboardFetcher ();
public:
CClipboardDataFetcher(void);
~CClipboardDataFetcher(void);
};
#endif // #ifndef _Clipboard_CClipboardDataFetcher_
#include "ClipboardFetcherLinux.h"
// GCC on Linux
#ifdef __GNUC__
CClipboardFetcherLinux::CClipboardFetcherLinux(void)
{
}
CClipboardFetcherLinux::~CClipboardFetcherLinux(void)
{
}
#endif // #ifdef __GNUC__
\ No newline at end of file
#ifndef _Clipboard_CClipboardDataFetcherLinux_
#define _Clipboard_CClipboardDataFetcherLinux_
// GCC on Linux
#ifdef __GNUC__
#include "IClipboardFetcher.h"
class CClipboardFetcherLinux: public IClipboardFetcher
{
public:
CClipboardFetcherLinux(void);
~CClipboardFetcherLinux(void);
};
#endif // #ifdef __GNUC__
#endif // #ifndef _Clipboard_CClipboardDataFetcherLinux_
#include "ClipboardFetcherMacosx.h"
#ifdef __APPLE__
CClipboardFetcherMacosx::CClipboardFetcherMacosx(void)
{
}
CClipboardFetcherMacosx::~CClipboardFetcherMacosx(void)
{
}
#endif // #ifdef __APPLE__
\ No newline at end of file
#ifndef _Clipboard_CClipboardDataFetcherMacosx_
#define _Clipboard_CClipboardDataFetcherMacosx_
#ifdef __APPLE__
#include "IClipboardFetcher.h"
class CClipboardFetcherMacosx: public IClipboardFetcher
{
public:
CClipboardFetcherMacosx(void);
~CClipboardFetcherMacosx(void);
};
#endif // #ifdef __APPLE__
#endif // #ifndef _Clipboard_CClipboardDataFetcherMacosx_
#include "ClipboardFetcherWin.h"
#include <vector>
#include <map>
#if defined (_WIN32) || defined (__MINGW32__)
#pragma comment(lib, "User32.lib")
int CClipboardFetcherWin::m_nClipboardFormatID = 0;
CClipboardFetcherWin::CClipboardFetcherWin(void)
{
if (0 == m_nClipboardFormatID)
m_nClipboardFormatID = RegisterClipboardFormatW (L"HTML Format");
}
CClipboardFetcherWin::~CClipboardFetcherWin(void)
{
}
bool CClipboardFetcherWin::getUnicodeTextContent (std::wstring &aContent)
{
bool bResult = false;
if (!IsClipboardFormatAvailable(CF_UNICODETEXT))
return bResult;
BOOL bClipboardOpened = OpenClipboard (NULL);
if (0 == bClipboardOpened)
return bResult;
HANDLE hglb = GetClipboardData(CF_UNICODETEXT);
if (hglb != NULL)
{
LPWSTR pText = (LPWSTR) GlobalLock(hglb);
std::wstring sText = pText;
aContent.assign (sText.begin(), sText.end());
GlobalUnlock(hglb);
bResult = true;
}
CloseClipboard ();
return bResult;
}
bool CClipboardFetcherWin::getTextContent (std::wstring &aContent)
{
bool bResult = false;
if (!IsClipboardFormatAvailable(CF_TEXT))
return bResult;
BOOL bClipboardOpened = OpenClipboard (NULL);
if (0 == bClipboardOpened)
return bResult;
HANDLE hglb = GetClipboardData(CF_TEXT);
if (hglb != NULL)
{
LPSTR pText = (LPSTR) GlobalLock(hglb);
std::string sText = pText;
aContent.assign (sText.begin(), sText.end());
GlobalUnlock(hglb);
bResult = true;
}
CloseClipboard ();
return bResult;
}
bool CClipboardFetcherWin::getHtmlContent (std::wstring &aContent)
{
bool bResult = false;
if (0 == m_nClipboardFormatID || !IsClipboardFormatAvailable(m_nClipboardFormatID))
return bResult;
BOOL bClipboardOpened = OpenClipboard (NULL);
if (0 == bClipboardOpened)
return bResult;
/*
std::vector<UINT> vFormats;
UINT nFormats = EnumClipboardFormats (0);
while (0 != nFormats)
{
vFormats.push_back(nFormats);
nFormats = EnumClipboardFormats (nFormats);
//unsigned int dwError = GetLastError();
}
CloseClipboard ();
bClipboardOpened = OpenClipboard (NULL);
if (0 == bClipboardOpened)
return bResult;
*/
std::string sText;
HANDLE hglb = GetClipboardData(m_nClipboardFormatID);
if (hglb != NULL)
{
LPSTR pText = (LPSTR) GlobalLock(hglb);
sText = pText;
GlobalUnlock(hglb);
bResult = true;
}
CloseClipboard ();
if (bResult)
{
bResult &= extractHtmlClipboard (sText, aContent);
}
return bResult;
}
bool CClipboardFetcherWin::extractHtmlClipboard (const std::string &sText, std::wstring &aContent)
{
bool bResult = true;
try
{
//std::map<std::string, std::string> aParameters;
int nStartFragmentOffset = 0;
int nEndFragmentOffset = 0;
std::string::size_type nStartFragmentPos = sText.find ("StartFragment", 0);
if (nStartFragmentPos >= 0)
{
std::string::size_type nStartFragmentNewLinePos = sText.find ("\n", nStartFragmentPos);
std::string sStartFragmentText = sText.substr (nStartFragmentPos, nStartFragmentNewLinePos - nStartFragmentPos);
std::string::size_type nSeparatorPos = sStartFragmentText.find (":", 0);
if (nSeparatorPos >= 0)
{
std::string sStartFragmentOffset = sStartFragmentText.substr (nSeparatorPos + 1);
nStartFragmentOffset = atoi (sStartFragmentOffset.c_str());
}
if (0 == nStartFragmentOffset)
return false;
}
std::string::size_type nEndFragmentPos = sText.find ("EndFragment", nStartFragmentPos);
if (nEndFragmentPos >= 0)
{
std::string::size_type nEndFragmentNewLinePos = sText.find ("\n", nEndFragmentPos);
std::string sEndFragmentText = sText.substr (nEndFragmentPos, nEndFragmentNewLinePos - nEndFragmentPos);
std::string::size_type nSeparatorPos = sEndFragmentText.find (":", 0);
if (nSeparatorPos >= 0)
{
std::string sEndFragmentOffset = sEndFragmentText.substr (nSeparatorPos + 1);
nEndFragmentOffset = atoi (sEndFragmentOffset.c_str());
}
if (0 == nEndFragmentOffset)
return false;
}
std::string sHtmlContent = sText.substr (nStartFragmentOffset, nEndFragmentOffset - nStartFragmentOffset);
// convert UTF-8 to UTF-16
int nWideStringLength = MultiByteToWideChar (CP_UTF8, 0, sHtmlContent.c_str(), -1, NULL, 0);
WCHAR *pWideStringBuffer = new WCHAR [nWideStringLength + 1];
pWideStringBuffer [nWideStringLength] = 0x00;
int nConversionResult = MultiByteToWideChar (CP_UTF8, 0, sHtmlContent.c_str(), -1, pWideStringBuffer, nWideStringLength);
if (0 == nConversionResult || ERROR_NO_UNICODE_TRANSLATION == nConversionResult)
return false;
aContent = L"<body>";
aContent.append (pWideStringBuffer);
aContent += L"</body>";
delete [] pWideStringBuffer;
}
catch (...)
{
bResult = false;
}
return bResult;
}
bool CClipboardFetcherWin::setHtmlContent (const std::wstring &aContent)
{
bool bResult = false;
return bResult;
}
#endif // #if defined (_WIN32) || defined (__MINGW32__)
\ No newline at end of file
#ifndef _Clipboard_CClipboardDataFetcherWin_
#define _Clipboard_CClipboardDataFetcherWin_
#if defined (_WIN32) || defined (__MINGW32__)
#include <string>
#include "IClipboardFetcher.h"
#include "Windows.h"
class CClipboardFetcherWin: public IClipboardFetcher
{
public:
bool getTextContent (std::wstring &aContent);
bool getUnicodeTextContent (std::wstring &aContent);
bool getHtmlContent (std::wstring &aContent);
bool setHtmlContent (const std::wstring &aContent);
public:
CClipboardFetcherWin(void);
~CClipboardFetcherWin(void);
private:
bool extractHtmlClipboard (const std::string &sText, std::wstring &aContent);
private:
static int m_nClipboardFormatID;
};
#endif // #if defined (_WIN32) || defined (__MINGW32__)
#endif // #ifndef _Clipboard_CClipboardDataFetcherWin_
// ClipboardParser.cpp : Defines the entry point for the console application.
//
#include "ClipboardDataFetcher.h"
#include "IClipboardFetcher.h"
#include <iostream>
int main(int argc, char* argv[])
{
CClipboardDataFetcher fabric;
IClipboardFetcher* fetcher = fabric.createClipboardFetcher ();
std::wstring sContentText;
std::wstring sContentUnicodeText;
std::wstring sContentHtml;
bool bIsTextDataExists = fetcher->getTextContent (sContentText);
bool bIsHtmlDataExists = fetcher->getHtmlContent (sContentHtml);
bool bIsUnicodeTextDataExists = fetcher->getUnicodeTextContent (sContentUnicodeText);
std::wcout << L"Clipboard HTML get data: " << (bIsHtmlDataExists ? L"Success" : L"Failed" ) << std::endl;
if (bIsHtmlDataExists)
{
std::wcout << L"Content: " << sContentHtml << std::endl;
}
std::wcout << L"Clipboard TEXT get data: " << (bIsTextDataExists ? L"Success" : L"Failed" ) << std::endl;
if (bIsTextDataExists)
{
std::wcout << L"Content: " << sContentText << std::endl;
}
std::wcout << L"Clipboard UNICODE TEXT get data: " << (bIsUnicodeTextDataExists ? L"Success" : L"Failed" ) << std::endl;
if (bIsUnicodeTextDataExists)
{
std::wcout << L"Content: " << sContentUnicodeText << std::endl;
}
delete fetcher;
return 0;
}
#ifndef _Clipboard_IClipboardDataFetcher_
#define _Clipboard_IClipboardDataFetcher_
#define CLIPBOARD_FORMAT_TEXT 0x000001
#define CLIPBOARD_FORMAT_HTML 0x000002
// interface for clipboard fetcher. it's a parent for platform-dependent classes
#include <string>
class IClipboardFetcher
{
public:
virtual bool getTextContent (std::wstring &aContent) = 0;
virtual bool getUnicodeTextContent (std::wstring &aContent) = 0;
virtual bool getHtmlContent (std::wstring &aContent) = 0;
virtual bool setHtmlContent (const std::wstring &aContent) = 0;
};
#endif // #ifndef _Clipboard_IClipboardDataFetcher_
\ No newline at end of file
========================================================================
CONSOLE APPLICATION : ClipboardParser Project Overview
========================================================================
AppWizard has created this ClipboardParser application for you.
This file contains a summary of what you will find in each of the files that
make up your ClipboardParser application.
ClipboardParser.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
ClipboardParser.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named ClipboardParser.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////
========================================================================
CONSOLE APPLICATION : ClipboardParser Project Overview
========================================================================
AppWizard has created this ClipboardParser application for you.
This file contains a summary of what you will find in each of the files that
make up your ClipboardParser application.
ClipboardParser.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
ClipboardParser.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named ClipboardParser.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////
This source diff could not be displayed because it is too large. You can view the blob instead.
#-------------------------------------------------
#
# Project created by QtCreator 2014-05-30T18:51:02
#
#-------------------------------------------------
message($$PWD)
DEFINES += USE_X11 HAVE_SYS_TIME_H
#QT += core
QT -= gui
TARGET = clipboard_test
CONFIG += link_pkgconfig
CONFIG += console
CONFIG -= app_bundle
PKGCONFIG = gtk+-2.0
LIBS += -lX11 -lXfixes -lXrender -lXrandr -lXext -lxml2
TEMPLATE = app
INCLUDEPATH += \
../../src \
/usr/include/gtk-2.0 \
/usr/include/glib-2.0 \
/usr/include/libxml2
SOURCES += main.cpp \
../../src/ui/base/clipboard/clipboard.cc \
../../src/ui/base/clipboard/clipboard_gtk.cc \
../../src/ui/base/clipboard/custom_data_helper.cc \
../../src/ui/base/clipboard/custom_data_helper_linux.cc \
../../src/ui/base/clipboard/scoped_clipboard_writer.cc \
../../src/base/third_party/dmg_fp/dtoa.cc \
../../src/base/third_party/dmg_fp/g_fmt.cc \
../../src/base/third_party/icu/icu_utf.cc \
../../src/base/pickle.cc \
../../src/base/string16.cc \
../../src/base/string_util.cc \
../../src/base/strings/string_number_conversions.cc \
../../src/base/strings/string_piece.cc \
../../src/base/stringprintf.cc \
../../src/base/strings/utf_offset_string_conversions.cc \
../../src/base/strings/utf_string_conversions.cc \
../../src/base/strings/utf_string_conversion_utils.cc \
../../src/ui/gfx/size.cc \
../../src/ui/gfx/gtk_util.cc
HEADERS += \
../../src/ui/base/clipboard/clipboard.h \
../../src/ui/base/clipboard/custom_data_helper.h \
../../src/ui/base/clipboard/scoped_clipboard_writer.h \
../../src/build/build_config.h \
../../src/base/third_party/dmg_fp/dmg_fp.h \
../../src/base/third_party/icu/icu_utf.h \
../../src/base/pickle.h \
../../src/base/string16.h \
../../src/base/string_piece.h \
../../src/base/string_util.h \
../../src/base/string_util_posix.h \
../../src/base/strings/string_number_conversions.h \
../../src/base/strings/string_piece.h \
../../src/base/stringprintf.h \
../../src/base/strings/utf_offset_string_conversions.h \
../../src/base/strings/utf_string_conversions.h \
../../src/base/strings/utf_string_conversion_utils.h \
../../src/ui/gfx/size.h \
../../src/ui/gfx/gtk_util.h
//#include <QCoreApplication>
#include "../../src/ui/base/clipboard/clipboard.h"
#include <iostream>
#include "gtk/gtk.h"
// Qt debug (UBUNTU):
// sudo sysctl kernel.yama.ptrace_scope=0
// sudo apt-get install libx11-dev
// sudo apt-get install libglib2.0-dev
// sudo apt-get install libgtk2.0-0 libgtk2.0-dev
int main(int argc, char *argv[])
{
//QCoreApplication a(argc, argv);
gtk_init (&argc, &argv);
ui::Clipboard *pClipboard = ui::Clipboard::GetForCurrentThread();
bool bIsHtmlAvailable = pClipboard->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(), ui::Clipboard::BUFFER_STANDARD);
bool bIsTextAvailable = pClipboard->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), ui::Clipboard::BUFFER_STANDARD);
if (bIsHtmlAvailable)
{
base::string16 markup;
std::string src_url;
uint32 fragment_start;
uint32 fragment_end;
//pClipboard->ReadHTML(ui::Clipboard::BUFFER_STANDARD, &markup, &src_url, &fragment_start, &fragment_end);
pClipboard->ReadDoct (ui::Clipboard::BUFFER_STANDARD, &markup);
std::cout << "SRC Url: " << src_url << std::endl;
std::cout << "Markup: " << markup << std::endl;
}
ui::Clipboard::DestroyClipboardForCurrentThread (pClipboard);
//return a.exec();
return 0;
}
QMAKE_XCODE_DEVELOPER_PATH = /Applications/Xcode.app/Contents/Developer
QMAKE_XCODE_VERSION = 5.1.1
QMAKE_MAC_SDK.macosx10.8.path = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
QMAKE_MAC_SDK.macx-clang.macosx10.8.QMAKE_CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
QMAKE_MAC_SDK.macx-clang.macosx10.8.QMAKE_CXX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
QMAKE_MAC_SDK.macx-clang.macosx10.8.QMAKE_FIX_RPATH = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool \
-id
QMAKE_MAC_SDK.macx-clang.macosx10.8.QMAKE_AR = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar \
cq
QMAKE_MAC_SDK.macx-clang.macosx10.8.QMAKE_RANLIB = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib \
-s
QMAKE_MAC_SDK.macx-clang.macosx10.8.QMAKE_LINK = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
QMAKE_MAC_SDK.macx-clang.macosx10.8.QMAKE_LINK_SHLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
QMAKE_MAC_SDK.macosx10.8.platform_name = macosx
project(clipboard_test)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
#-------------------------------------------------
#
# Project created by QtCreator 2014-06-17T12:29:18
#
#-------------------------------------------------
#QT += core
QT -= gui
TARGET = clipboard_test
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
INCLUDEPATH += \
../../src \
/usr/include/libxml2
DEPENDPATH += /usr/lib
LIBS += -lxml2 -framework Cocoa
SOURCES += main.cpp \
../../src/ui/base/clipboard/clipboard.cc \
../../src/ui/base/clipboard/custom_data_helper.cc \
../../src/ui/base/clipboard/scoped_clipboard_writer.cc \
../../src/base/pickle.cc \
../../src/base/string_util.cc \
../../src/base/string16.cc \
../../src/base/stringprintf.cc \
../../src/base/third_party/dmg_fp/dtoa.cc \
../../src/base/third_party/dmg_fp/g_fmt.cc \
../../src/base/third_party/icu/icu_utf.cc \
../../src/base/strings/string_number_conversions.cc \
../../src/base/strings/string_piece.cc \
../../src/base/strings/utf_offset_string_conversions.cc \
../../src/base/strings/utf_string_conversion_utils.cc \
../../src/base/strings/utf_string_conversions.cc \
../../src/ui/gfx/size.cc
#\
# ../../src/base/mac/launch_services_util.cc \
# ../../src/base/mac/launchd.cc \
# ../../src/base/mac/libdispatch_task_runner.cc
HEADERS += \
../../src/ui/base/clipboard/clipboard.h \
../../src/ui/base/clipboard/custom_data_helper.h \
../../src/ui/base/clipboard/scoped_clipboard_writer.h \
../../src/base/pickle.h \
../../src/base/string_util.h \
../../src/base/string16.h \
../../src/base/stringprintf.h \
../../src/base/third_party/dmg_fp/dmg_fp.h \
../../src/base/third_party/icu/icu_utf.h \
../../src/base/strings/string_number_conversions.h \
../../src/base/strings/string_piece.h \
../../src/base/strings/utf_offset_string_conversions.h \
../../src/base/strings/utf_string_conversion_utils.h \
../../src/base/strings/utf_string_conversions.h \
../../src/ui/gfx/size.h \
../../src/third_party/mozilla/NSPasteboard+Utils.h
# ../../src/base/mac/foundation_util.h
#\
# ../../src/third_party/mozilla/ComplexTextInputPanel.h \
# \
# ../../src/third_party/mozilla/NSScreen+Utils.h \
# ../../src/third_party/mozilla/NSString+Utils.h \
# ../../src/third_party/mozilla/NSURL+Utils.h \
# ../../src/third_party/mozilla/NSWorkspace+Utils.h \
# ../../src/base/mac/mac_util.h \
# ../../src/base/mac/scoped_cftyperef.h \
# ../../src/base/mac/authorization_util.h \
# ../../src/base/mac/bind_objc_block.h \
# ../../src/base/mac/bundle_locations.h \
# ../../src/base/mac/cocoa_protocols.h \
# ../../src/base/mac/launch_services_util.h \
# ../../src/base/mac/launchd.h \
# ../../src/base/mac/libdispatch_task_runner.h \
# ../../src/base/mac/objc_property_releaser.h \
# ../../src/base/strings/sys_string_conversions.h
OBJECTIVE_SOURCES += \
../../src/ui/base/clipboard/custom_data_helper_mac.mm \
../../src/ui/base/clipboard/clipboard_mac.mm \
../../src/third_party/mozilla/NSPasteboard+Utils.mm \
../../src/base/strings/sys_string_conversions_mac.mm
# ../../src/base/mac/foundation_util.mm
# \
# ../../src/third_party/mozilla/ComplexTextInputPanel.mm \
#
# ../../src/third_party/mozilla/NSString+Utils.mm \
# ../../src/base/mac/mac_util.mm \
# ../../src/base/mac/authorization_util.mm \
# ../../src/base/mac/bundle_locations.mm \
# ../../src/base/mac/objc_property_releaser.mm \
# ../../src/base/strings/sys_string_conversions_mac.mm
OTHER_FILES += \
# ../../src/third_party/mozilla/NSScreen+Utils.m \
# ../../src/third_party/mozilla/NSURL+Utils.m \
# ../../src/third_party/mozilla/NSWorkspace+Utils.m
//#include <QCoreApplication>
#include "../src/ui/base/clipboard/clipboard.h"
#include <iostream>
int main(int argc, char *argv[])
{
//QCoreApplication a(argc, argv);
//return a.exec();
ui::Clipboard *pClipboard = ui::Clipboard::GetForCurrentThread();
bool bIsHtmlAvailable = pClipboard->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(), ui::Clipboard::BUFFER_STANDARD);
bool bIsTextAvailable = pClipboard->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), ui::Clipboard::BUFFER_STANDARD);
if (bIsHtmlAvailable)
{
base::string16 markup;
std::string src_url;
uint32_t fragment_start, fragment_end;
pClipboard->ReadDoct(ui::Clipboard::BUFFER_STANDARD, &markup);
std::cout << "SRC Url:" << src_url << std::endl;
std::cout << "Markup:" << markup << std::endl;
}
ui::Clipboard::DestroyClipboardForCurrentThread(pClipboard);
return 0;
}
include_rules = [
"+jni",
"+native_client/src/untrusted/irt/irt.h",
"+third_party/ashmem",
"+third_party/apple_apsl",
"+third_party/libevent",
"+third_party/dmg_fp",
"+third_party/GTM",
"+third_party/mach_override",
"+third_party/modp_b64",
"+third_party/tcmalloc",
# ICU dependendencies must be separate from the rest of base.
"-i18n",
]
mark@chromium.org
darin@chromium.org
brettw@chromium.org
willchan@chromium.org
jar@chromium.org
per-file *.isolate=csharp@chromium.org
per-file *.isolate=maruel@chromium.org
per-file bind.h=ajwong@chromium.org
per-file bind_helpers.cc=ajwong@chromium.org
per-file bind_helpers.h=ajwong@chromium.org
per-file bind_helpers_unittest.cc=ajwong@chromium.org
per-file bind.h.pump=ajwong@chromium.org
per-file bind_internal.h=ajwong@chromium.org
per-file bind_internal.h.pump=ajwong@chromium.org
per-file bind_internal_win.h=ajwong@chromium.org
per-file bind_internal_win.h.pump=ajwong@chromium.org
per-file bind_unittest.cc=ajwong@chromium.org
per-file bind_unittest.nc=ajwong@chromium.org
per-file callback_forward.h=ajwong@chromium.org
per-file callback.h=ajwong@chromium.org
per-file callback_helpers.h=ajwong@chromium.org
per-file callback.h.pump=ajwong@chromium.org
per-file callback_internal.cc=ajwong@chromium.org
per-file callback_internal.h=ajwong@chromium.org
per-file callback_unittest.cc=ajwong@chromium.org
per-file callback_unittest.h=ajwong@chromium.org
per-file callback_unittest.nc=ajwong@chromium.org
per-file security_unittest.cc=jln@chromium.org
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chromium presubmit script for src/base.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""
def _CheckNoInterfacesInBase(input_api, output_api):
"""Checks to make sure no files in libbase.a have |@interface|."""
pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE)
files = []
for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
if (f.LocalPath().startswith('base/') and
not "/test/" in f.LocalPath() and
not f.LocalPath().endswith('_unittest.mm')):
contents = input_api.ReadFile(f)
if pattern.search(contents):
files.append(f)
if len(files):
return [ output_api.PresubmitError(
'Objective-C interfaces or categories are forbidden in libbase. ' +
'See http://groups.google.com/a/chromium.org/group/chromium-dev/' +
'browse_thread/thread/efb28c10435987fd',
files) ]
return []
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
results.extend(_CheckNoInterfacesInBase(input_api, output_api))
return results
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))
return results
def CheckChangeOnCommit(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))
return results
def GetPreferredTrySlaves():
return [
'linux_rel:sync_integration_tests',
'mac_rel:sync_integration_tests',
'win_rel:sync_integration_tests',
]
Notes about the Chrome memory allocator.
Background
----------
We use this library as a generic way to fork into any of several allocators.
Currently we can, at runtime, switch between:
the default windows allocator
the windows low-fragmentation-heap
tcmalloc
jemalloc (the heap used most notably within Mozilla Firefox)
The mechanism for hooking LIBCMT in windows is rather tricky. The core
problem is that by default, the windows library does not declare malloc and
free as weak symbols. Because of this, they cannot be overriden. To work
around this, we start with the LIBCMT.LIB, and manually remove all allocator
related functions from it using the visual studio library tool. Once removed,
we can now link against the library and provide custom versions of the
allocator related functionality.
Source code
-----------
This directory contains just the allocator (i.e. shim) layer that switches
between the different underlying memory allocation implementations.
The tcmalloc and jemalloc libraries originate outside of Chromium
and exist in ../../third_party/tcmalloc and ../../third_party/jemalloc
(currently, the actual locations are defined in the allocator.gyp file).
The third party sources use a vendor-branch SCM pattern to track
Chromium-specific changes independently from upstream changes.
The general intent is to push local changes upstream so that over
time we no longer need any forked files.
Adding a new allocator
----------------------
Adding a new allocator requires definition of the following five functions:
extern "C" {
bool init();
void* malloc(size_t s);
void* realloc(void* p, size_t s);
void free(void* s);
size_t msize(void* p);
}
All other allocation related functions (new/delete/calloc/etc) have been
implemented generically to work across all allocators.
Usage
-----
You can use the different allocators by setting the environment variable
CHROME_ALLOCATOR to:
"tcmalloc" - TC Malloc (default)
"jemalloc" - JE Malloc
"winheap" - Windows default heap
"winlfh" - Windows Low-Fragmentation heap
bulach@chromium.org
joth@chromium.org
jcivelli@chromium.org
yfriedman@chromium.org
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment