diff options
Diffstat (limited to 'dtrans/source/win32/clipb/MtaOleClipb.cxx')
-rw-r--r-- | dtrans/source/win32/clipb/MtaOleClipb.cxx | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/dtrans/source/win32/clipb/MtaOleClipb.cxx b/dtrans/source/win32/clipb/MtaOleClipb.cxx index 59c9a8b8e0f1..82d97c4a273a 100644 --- a/dtrans/source/win32/clipb/MtaOleClipb.cxx +++ b/dtrans/source/win32/clipb/MtaOleClipb.cxx @@ -52,10 +52,8 @@ #define __uuidof(I) IID_##I #endif - // namespace directives - using osl::Condition; using osl::Mutex; using osl::MutexGuard; @@ -66,10 +64,8 @@ namespace /* private */ char CLIPSRV_DLL_NAME[] = "sysdtrans.dll"; char g_szWndClsName[] = "MtaOleReqWnd###"; - // messages constants - const sal_uInt32 MSG_SETCLIPBOARD = WM_USER + 0x0001; const sal_uInt32 MSG_GETCLIPBOARD = WM_USER + 0x0002; const sal_uInt32 MSG_REGCLIPVIEWER = WM_USER + 0x0003; @@ -84,7 +80,6 @@ namespace /* private */ const sal_Bool AUTO_RESET = sal_False; const sal_Bool INIT_NONSIGNALED = sal_False; - /* Cannot use osl conditions because they are blocking without waking up on messages sent by another thread this leads to deadlocks because we are blocking the @@ -155,10 +150,8 @@ namespace /* private */ Win32Condition& operator=(const Win32Condition&); }; - // we use one condition for every request - struct MsgCtx { Win32Condition aCondition; @@ -167,16 +160,12 @@ namespace /* private */ } /* namespace private */ - // static member initialization - CMtaOleClipboard* CMtaOleClipboard::s_theMtaOleClipboardInst = NULL; - // marshal an IDataObject - //inline HRESULT MarshalIDataObjectInStream( IDataObject* pIDataObject, LPSTREAM* ppStream ) { @@ -191,10 +180,8 @@ HRESULT MarshalIDataObjectInStream( IDataObject* pIDataObject, LPSTREAM* ppStrea ); } - // unmarshal an IDataObject - //inline HRESULT UnmarshalIDataObjectAndReleaseStream( LPSTREAM lpStream, IDataObject** ppIDataObject ) { @@ -208,10 +195,8 @@ HRESULT UnmarshalIDataObjectAndReleaseStream( LPSTREAM lpStream, IDataObject** p reinterpret_cast<LPVOID*>(ppIDataObject)); } - // helper class to ensure that the calling thread has com initialized - class CAutoComInit { public: @@ -255,10 +240,8 @@ private: HRESULT m_hResult; }; - // ctor - CMtaOleClipboard::CMtaOleClipboard( ) : m_hOleThread( NULL ), m_uOleThreadId( 0 ), @@ -283,10 +266,8 @@ CMtaOleClipboard::CMtaOleClipboard( ) : NULL, 0, CMtaOleClipboard::oleThreadProc, this, 0, &m_uOleThreadId ); OSL_ASSERT( NULL != m_hOleThread ); - // setup the clipboard changed notifier thread - m_hClipboardChangedNotifierEvents[0] = CreateEventA( 0, MANUAL_RESET, INIT_NONSIGNALED, NULL ); OSL_ASSERT( NULL != m_hClipboardChangedNotifierEvents[0] ); @@ -300,10 +281,8 @@ CMtaOleClipboard::CMtaOleClipboard( ) : OSL_ASSERT( NULL != m_hClipboardChangedNotifierThread ); } - // dtor - CMtaOleClipboard::~CMtaOleClipboard( ) { // block calling threads out @@ -354,11 +333,6 @@ CMtaOleClipboard::~CMtaOleClipboard( ) "Clipboard viewer not properly unregistered" ); } - - -// - - HRESULT CMtaOleClipboard::flushClipboard( ) { if ( !WaitForThreadReady( ) ) @@ -381,10 +355,6 @@ HRESULT CMtaOleClipboard::flushClipboard( ) return aMsgCtx.hr; } - -// - - HRESULT CMtaOleClipboard::getClipboard( IDataObject** ppIDataObject ) { OSL_PRECOND( NULL != ppIDataObject, "invalid parameter" ); @@ -421,11 +391,9 @@ HRESULT CMtaOleClipboard::getClipboard( IDataObject** ppIDataObject ) return hr; } - // this is an asynchronous method that's why we don't wait until the // request is completed - HRESULT CMtaOleClipboard::setClipboard( IDataObject* pIDataObject ) { if ( !WaitForThreadReady( ) ) @@ -460,10 +428,8 @@ HRESULT CMtaOleClipboard::setClipboard( IDataObject* pIDataObject ) return S_OK; } - // register a clipboard viewer - bool CMtaOleClipboard::registerClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncClipViewerCallback ) { if ( !WaitForThreadReady( ) ) @@ -487,10 +453,8 @@ bool CMtaOleClipboard::registerClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncClipV return bRet; } - // register a clipboard viewer - bool CMtaOleClipboard::onRegisterClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncClipViewerCallback ) { bool bRet = true; @@ -528,19 +492,11 @@ bool CMtaOleClipboard::onRegisterClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncCli return bRet; } - -// - - LRESULT CMtaOleClipboard::onSetClipboard( IDataObject* pIDataObject ) { return static_cast<LRESULT>( OleSetClipboard( pIDataObject ) ); } - -// - - LRESULT CMtaOleClipboard::onGetClipboard( LPSTREAM* ppStream ) { OSL_ASSERT(NULL != ppStream); @@ -557,19 +513,15 @@ LRESULT CMtaOleClipboard::onGetClipboard( LPSTREAM* ppStream ) return static_cast<LRESULT>(hr); } - // flush the ole-clipboard - LRESULT CMtaOleClipboard::onFlushClipboard( ) { return static_cast<LRESULT>( OleFlushClipboard( ) ); } - // handle clipboard chain change event - LRESULT CMtaOleClipboard::onChangeCBChain( HWND hWndRemove, HWND hWndNext ) { if ( hWndRemove == m_hwndNextClipViewer ) @@ -591,10 +543,8 @@ LRESULT CMtaOleClipboard::onChangeCBChain( HWND hWndRemove, HWND hWndNext ) return 0; } - // handle draw clipboard event - LRESULT CMtaOleClipboard::onDrawClipboard( ) { // we don't send a notification if we are @@ -626,31 +576,24 @@ LRESULT CMtaOleClipboard::onDrawClipboard( ) return 0; } - // SendMessage so we don't need to supply the HWND if we send // something to our wrapped window - LRESULT CMtaOleClipboard::sendMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { return ::SendMessageA( m_hwndMtaOleReqWnd, msg, wParam, lParam ); } - // PostMessage so we don't need to supply the HWND if we send // something to our wrapped window - bool CMtaOleClipboard::postMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { return PostMessageA( m_hwndMtaOleReqWnd, msg, wParam, lParam ) ? true : false; } - - // the window proc - LRESULT CALLBACK CMtaOleClipboard::mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { LRESULT lResult = 0; @@ -734,10 +677,6 @@ LRESULT CALLBACK CMtaOleClipboard::mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARA return lResult; } - -// - - void CMtaOleClipboard::createMtaOleReqWnd( ) { WNDCLASSEXA wcex; @@ -767,10 +706,6 @@ void CMtaOleClipboard::createMtaOleReqWnd( ) g_szWndClsName, NULL, 0, 0, 0, 0, 0, NULL, NULL, hInst, NULL ); } - -// - - unsigned int CMtaOleClipboard::run( ) { #if OSL_DEBUG_LEVEL > 0 @@ -803,10 +738,6 @@ unsigned int CMtaOleClipboard::run( ) return nRet; } - -// - - unsigned int WINAPI CMtaOleClipboard::oleThreadProc( LPVOID pParam ) { CMtaOleClipboard* pInst = @@ -816,10 +747,6 @@ unsigned int WINAPI CMtaOleClipboard::oleThreadProc( LPVOID pParam ) return pInst->run( ); } - -// - - unsigned int WINAPI CMtaOleClipboard::clipboardChangedNotifierThreadProc( LPVOID pParam ) { CMtaOleClipboard* pInst = reinterpret_cast< CMtaOleClipboard* >( pParam ); @@ -860,10 +787,6 @@ unsigned int WINAPI CMtaOleClipboard::clipboardChangedNotifierThreadProc( LPVOID return ( 0 ); } - -// - - bool CMtaOleClipboard::WaitForThreadReady( ) const { bool bRet = false; |