diff options
Diffstat (limited to 'extensions/source/scanner/scanwin.cxx')
-rw-r--r-- | extensions/source/scanner/scanwin.cxx | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx index 020ad5a74a06..e52b68867ff8 100644 --- a/extensions/source/scanner/scanwin.cxx +++ b/extensions/source/scanner/scanwin.cxx @@ -52,10 +52,6 @@ using namespace ::com::sun::star; -// ----------- -// - Defines - -// ----------- - #define TWAIN_SELECT 0x00000001UL #define TWAIN_ACQUIRE 0x00000002UL #define TWAIN_TERMINATE 0xFFFFFFFFUL @@ -75,10 +71,6 @@ using namespace ::com::sun::star; #define TWAIN_FUNCNAME "DSM_Entry" #endif -// -------------- -// - TwainState - -// -------------- - enum TwainState { TWAIN_STATE_NONE = 0, @@ -87,10 +79,6 @@ enum TwainState TWAIN_STATE_CANCELED = 3 }; -// ------------ -// - ImpTwain - -// ------------ - class ImpTwain : public ::cppu::WeakImplHelper1< util::XCloseListener > { friend LRESULT CALLBACK TwainMsgProc( int nCode, WPARAM wParam, LPARAM lParam ); @@ -142,21 +130,13 @@ public: bool InitXfer(); }; -// --------- -// - Procs - -// --------- - static ImpTwain* pImpTwainInstance = NULL; -// ------------------------------------------------------------------------- - LRESULT CALLBACK TwainWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 ) { return DefWindowProc( hWnd, nMsg, nPar1, nPar2 ); } -// ------------------------------------------------------------------------- - LRESULT CALLBACK TwainMsgProc( int nCode, WPARAM wParam, LPARAM lParam ) { MSG* pMsg = (MSG*) lParam; @@ -174,8 +154,6 @@ LRESULT CALLBACK TwainMsgProc( int nCode, WPARAM wParam, LPARAM lParam ) } } -// ----------------------------------------------------------------------------- - // #107835# hold reference to ScannerManager, to prevent premature death ImpTwain::ImpTwain( ScannerManager& rMgr, const Link& rNotifyLink ) : mxMgr( uno::Reference< scanner::XScannerManager >( static_cast< OWeakObject* >( &rMgr ), uno::UNO_QUERY) ), @@ -218,8 +196,6 @@ ImpTwain::ImpTwain( ScannerManager& rMgr, const Link& rNotifyLink ) : mxSelfRef = static_cast< ::cppu::OWeakObject* >( this ); } -// ----------------------------------------------------------------------------- - ImpTwain::~ImpTwain() { // are we responsible for application shutdown? @@ -227,16 +203,12 @@ ImpTwain::~ImpTwain() ImplSendCloseEvent(); } -// ----------------------------------------------------------------------------- - void ImpTwain::Destroy() { ImplFallback( TWAIN_EVENT_NONE ); Application::PostUserEvent( LINK( this, ImpTwain, ImplDestroyHdl ), NULL ); } -// ----------------------------------------------------------------------------- - bool ImpTwain::SelectSource() { TW_UINT16 nRet = TWRC_FAILURE; @@ -257,8 +229,6 @@ bool ImpTwain::SelectSource() return( TWRC_SUCCESS == nRet ); } -// ----------------------------------------------------------------------------- - bool ImpTwain::InitXfer() { bool bRet = false; @@ -279,8 +249,6 @@ bool ImpTwain::InitXfer() return bRet; } -// ----------------------------------------------------------------------------- - void ImpTwain::ImplOpenSourceManager() { if( 1 == nCurState ) @@ -305,8 +273,6 @@ void ImpTwain::ImplOpenSourceManager() } } -// ----------------------------------------------------------------------------- - void ImpTwain::ImplOpenSource() { if( 3 == nCurState ) @@ -326,8 +292,6 @@ void ImpTwain::ImplOpenSource() } } -// ----------------------------------------------------------------------------- - bool ImpTwain::ImplEnableSource() { bool bRet = false; @@ -358,8 +322,6 @@ bool ImpTwain::ImplEnableSource() return bRet; } -// ----------------------------------------------------------------------------- - bool ImpTwain::ImplHandleMsg( void* pMsg ) { TW_UINT16 nRet; @@ -403,8 +365,6 @@ bool ImpTwain::ImplHandleMsg( void* pMsg ) return( TWRC_DSEVENT == nRet ); } -// ----------------------------------------------------------------------------- - void ImpTwain::ImplXfer() { if( nCurState == 6 ) @@ -460,15 +420,11 @@ void ImpTwain::ImplXfer() } } -// ----------------------------------------------------------------------------- - void ImpTwain::ImplFallback( ULONG nEvent ) { Application::PostUserEvent( LINK( this, ImpTwain, ImplFallbackHdl ), (void*) nEvent ); } -// ----------------------------------------------------------------------------- - IMPL_LINK( ImpTwain, ImplFallbackHdl, void*, pData ) { const ULONG nEvent = (ULONG) pData; @@ -541,8 +497,6 @@ IMPL_LINK( ImpTwain, ImplFallbackHdl, void*, pData ) return 0L; } -// ----------------------------------------------------------------------------- - IMPL_LINK( ImpTwain, ImplDestroyHdl, void*, /*p*/ ) { if( hTwainWnd ) @@ -559,8 +513,6 @@ IMPL_LINK( ImpTwain, ImplDestroyHdl, void*, /*p*/ ) return 0L; } -// ----------------------------------------------------------------------------- - uno::Reference< frame::XFrame > ImpTwain::ImplGetActiveFrame() { try @@ -583,8 +535,6 @@ uno::Reference< frame::XFrame > ImpTwain::ImplGetActiveFrame() return uno::Reference< frame::XFrame >(); } -// ----------------------------------------------------------------------------- - uno::Reference< util::XCloseBroadcaster > ImpTwain::ImplGetActiveFrameCloseBroadcaster() { try @@ -599,8 +549,6 @@ uno::Reference< util::XCloseBroadcaster > ImpTwain::ImplGetActiveFrameCloseBroad return uno::Reference< util::XCloseBroadcaster >(); } -// ----------------------------------------------------------------------------- - void ImpTwain::ImplRegisterCloseListener() { try @@ -626,8 +574,6 @@ void ImpTwain::ImplRegisterCloseListener() OSL_FAIL("ImpTwain::ImplRegisterCloseListener: Could not register as close listener!"); } -// ----------------------------------------------------------------------------- - void ImpTwain::ImplDeregisterCloseListener() { try @@ -654,8 +600,6 @@ void ImpTwain::ImplDeregisterCloseListener() OSL_FAIL("ImpTwain::ImplDeregisterCloseListener: Could not deregister as close listener!"); } -// ----------------------------------------------------------------------------- - void SAL_CALL ImpTwain::queryClosing( const lang::EventObject& /*Source*/, sal_Bool GetsOwnership ) throw (util::CloseVetoException, uno::RuntimeException) { // shall we re-send the close query later on? @@ -665,23 +609,17 @@ void SAL_CALL ImpTwain::queryClosing( const lang::EventObject& /*Source*/, sal_B throw util::CloseVetoException(); } -// ----------------------------------------------------------------------------- - void SAL_CALL ImpTwain::notifyClosing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException) { // should not happen OSL_FAIL("ImpTwain::notifyClosing called, but we vetoed the closing before!"); } -// ----------------------------------------------------------------------------- - void SAL_CALL ImpTwain::disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException) { // we're not holding any references to the frame, thus noop } -// ----------------------------------------------------------------------------- - void ImpTwain::ImplSendCloseEvent() { try @@ -699,10 +637,6 @@ void ImpTwain::ImplSendCloseEvent() } -// --------- -// - Twain - -// --------- - class Twain { uno::Reference< lang::XEventListener > mxListener; @@ -724,8 +658,6 @@ public: TwainState GetState() const { return meState; } }; -// ------------------------------------------------------------------------ - Twain::Twain() : mpCurMgr( NULL ), mpImpTwain( NULL ), @@ -733,16 +665,12 @@ Twain::Twain() : { } -// ------------------------------------------------------------------------ - Twain::~Twain() { if( mpImpTwain ) mpImpTwain->Destroy(); } -// ------------------------------------------------------------------------ - bool Twain::SelectSource( ScannerManager& rMgr ) { bool bRet; @@ -763,8 +691,6 @@ bool Twain::SelectSource( ScannerManager& rMgr ) return bRet; } -// ------------------------------------------------------------------------ - bool Twain::PerformTransfer( ScannerManager& rMgr, const uno::Reference< lang::XEventListener >& rxListener ) { bool bRet; @@ -786,8 +712,6 @@ bool Twain::PerformTransfer( ScannerManager& rMgr, const uno::Reference< lang::X return bRet; } -// ------------------------------------------------------------------------ - IMPL_LINK( Twain, ImpNotifyHdl, ImpTwain*, nEvent ) { switch( (ULONG)(void*) nEvent ) @@ -840,16 +764,8 @@ IMPL_LINK( Twain, ImpNotifyHdl, ImpTwain*, nEvent ) return 0L; } -// ----------- -// - statics - -// ----------- - static Twain aTwain; -// ------------------ -// - ScannerManager - -// ------------------ - void ScannerManager::AcquireData() { } @@ -863,8 +779,6 @@ void ScannerManager::ReleaseData() } } -// ----------------------------------------------------------------------------- - AWT::Size ScannerManager::getSize() throw() { AWT::Size aRet; @@ -890,8 +804,6 @@ AWT::Size ScannerManager::getSize() throw() return aRet; } -// ----------------------------------------------------------------------------- - SEQ( sal_Int8 ) ScannerManager::getDIB() throw() { SEQ( sal_Int8 ) aRet; @@ -952,8 +864,6 @@ SEQ( sal_Int8 ) ScannerManager::getDIB() throw() return aRet; } -// ----------------------------------------------------------------------------- - SEQ( ScannerContext ) SAL_CALL ScannerManager::getAvailableScanners() throw() { osl::MutexGuard aGuard( maProtector ); @@ -965,8 +875,6 @@ SEQ( ScannerContext ) SAL_CALL ScannerManager::getAvailableScanners() throw() return aRet; } -// ----------------------------------------------------------------------------- - sal_Bool SAL_CALL ScannerManager::configureScannerAndScan( ScannerContext& rContext, const uno::Reference< lang::XEventListener >& ) throw( ScannerException ) { @@ -981,8 +889,6 @@ sal_Bool SAL_CALL ScannerManager::configureScannerAndScan( ScannerContext& rCont return aTwain.SelectSource( *this ); } -// ----------------------------------------------------------------------------- - void SAL_CALL ScannerManager::startScan( const ScannerContext& rContext, const uno::Reference< lang::XEventListener >& rxListener ) throw( ScannerException ) { @@ -996,8 +902,6 @@ void SAL_CALL ScannerManager::startScan( const ScannerContext& rContext, const u aTwain.PerformTransfer( *this, rxListener ); } -// ----------------------------------------------------------------------------- - ScanError SAL_CALL ScannerManager::getError( const ScannerContext& rContext ) throw( ScannerException ) { @@ -1010,8 +914,6 @@ ScanError SAL_CALL ScannerManager::getError( const ScannerContext& rContext ) return( ( aTwain.GetState() == TWAIN_STATE_CANCELED ) ? ScanError_ScanCanceled : ScanError_ScanErrorNone ); } -// ----------------------------------------------------------------------------- - uno::Reference< awt::XBitmap > SAL_CALL ScannerManager::getBitmap( const ScannerContext& /*rContext*/ ) throw( ScannerException ) { |