Module_tail_build.mk | 8 RepositoryExternal.mk | 13 RepositoryModule_ooo.mk | 1 config_host.mk.in | 1 configure.in | 7 extensions/Executable_pluginapp.bin.mk | 2 extensions/Library_pl.mk | 2 extensions/Library_scn.mk | 11 extensions/StaticLibrary_plugcon.mk | 2 extensions/source/scanner/twain.cxx | 478 --------------------------------- extensions/source/scanner/twain.hxx | 95 ------ np_sdk/Module_np_sdk.mk | 6 np_sdk/Package_inc.mk | 8 np_sdk/Package_mozilla_inc.mk | 35 ++ sane/Module_sane.mk | 4 15 files changed, 66 insertions(+), 607 deletions(-)
New commits: commit 8f6510b31f47e7f21a460fefce74842cdb2ba07f Author: Matúš Kukan <matus.ku...@gmail.com> Date: Sat Jun 2 21:54:26 2012 +0200 np_sdk: separate system and internal headers Change-Id: I4c61dcb40acf12fa0fe4cf4d6c39a8bfd7b7c9b4 diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 780f4a4..326a9a6 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -54,22 +54,21 @@ endif ifeq ($(SYSTEM_MOZILLA_HEADERS),YES) define gb_LinkTarget__use_mozilla_headers -$(eval $(call gb_LinkTarget_use_package,$(1),np_sdk_inc)) -$(eval $(call gb_LinkTarget_set_include,$(1),\ +$(call gb_LinkTarget_set_include,$(1),\ $(MOZILLA_HEADERS_CFLAGS) \ $$(INCLUDE) \ -)) +) endef else #!SYSTEM_MOZILLA_HEADERS define gb_LinkTarget__use_mozilla_headers -$(eval $(call gb_LinkTarget_use_package,$(1),np_sdk_inc)) -$(eval $(call gb_LinkTarget_set_include,$(1),\ - -I$(OUTDIR)/inc/npsdk \ +$(call gb_LinkTarget_use_package,$(1),mozilla_inc) +$(call gb_LinkTarget_set_include,$(1),\ + -I$(OUTDIR)/inc/external/npsdk \ $$(INCLUDE) \ -)) +) endef diff --git a/extensions/Executable_pluginapp.bin.mk b/extensions/Executable_pluginapp.bin.mk index 57bbb18..4fd84f0 100644 --- a/extensions/Executable_pluginapp.bin.mk +++ b/extensions/Executable_pluginapp.bin.mk @@ -30,6 +30,8 @@ $(eval $(call gb_Executable_Executable,pluginapp.bin)) +$(eval $(call gb_Executable_use_package,pluginapp.bin,np_sdk_inc)) + $(eval $(call gb_Executable_use_external,pluginapp.bin,mozilla_headers)) $(eval $(call gb_Executable_set_include,pluginapp.bin,\ diff --git a/extensions/Library_pl.mk b/extensions/Library_pl.mk index 8db7fba..cbcfc79 100644 --- a/extensions/Library_pl.mk +++ b/extensions/Library_pl.mk @@ -32,6 +32,8 @@ $(eval $(call gb_Library_Library,pl)) $(eval $(call gb_Library_set_componentfile,pl,extensions/source/plugin/pl)) +$(eval $(call gb_Library_use_package,pl,np_sdk_inc)) + $(eval $(call gb_Library_use_external,pl,mozilla_headers)) $(eval $(call gb_Library_set_include,pl,\ diff --git a/extensions/StaticLibrary_plugcon.mk b/extensions/StaticLibrary_plugcon.mk index 50e90d0..0ef41af 100644 --- a/extensions/StaticLibrary_plugcon.mk +++ b/extensions/StaticLibrary_plugcon.mk @@ -31,6 +31,8 @@ endif $(eval $(call gb_StaticLibrary_StaticLibrary,plugcon)) +$(eval $(call gb_StaticLibrary_use_package,plugcon,np_sdk_inc)) + $(eval $(call gb_StaticLibrary_use_external,plugcon,mozilla_headers)) $(eval $(call gb_StaticLibrary_set_include,plugcon,\ diff --git a/np_sdk/Module_np_sdk.mk b/np_sdk/Module_np_sdk.mk index 6a60e3f..eabc6f8 100644 --- a/np_sdk/Module_np_sdk.mk +++ b/np_sdk/Module_np_sdk.mk @@ -33,6 +33,12 @@ $(eval $(call gb_Module_add_targets,np_sdk,\ Package_inc \ )) +ifeq ($(SYSTEM_MOZILLA_HEADERS),NO) +$(eval $(call gb_Module_add_targets,np_sdk,\ + Package_mozilla_inc \ +)) +endif + ifeq ($(ENABLE_NSPLUGIN),YES) $(eval $(call gb_Module_add_targets,np_sdk,\ StaticLibrary_nputils \ diff --git a/np_sdk/Package_inc.mk b/np_sdk/Package_inc.mk index 26dc537..841b1bd 100644 --- a/np_sdk/Package_inc.mk +++ b/np_sdk/Package_inc.mk @@ -32,12 +32,4 @@ $(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jri_md.h,mozsrc/jri_md.h) $(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jritypes.h,mozsrc/jritypes.h)) $(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/npupp.h,mozsrc/npupp.h)) -ifeq ($(SYSTEM_MOZILLA_HEADERS),NO) -$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/npapi.h,inc/npapi.h)) -$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/npfunctions.h,inc/npfunctions.h)) -$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/npruntime.h,inc/npruntime.h)) -$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/nptypes.h,inc/nptypes.h)) - -endif - # vim: set noet sw=4 ts=4: diff --git a/np_sdk/Package_mozilla_inc.mk b/np_sdk/Package_mozilla_inc.mk new file mode 100644 index 0000000..20b94f1 --- /dev/null +++ b/np_sdk/Package_mozilla_inc.mk @@ -0,0 +1,35 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2012 Matúš Kukan <matus.ku...@gmail.com> (initial developer) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(eval $(call gb_Package_Package,mozilla_inc,$(SRCDIR)/np_sdk)) + +$(eval $(call gb_Package_add_file,mozilla_inc,inc/external/npsdk/npapi.h,inc/npapi.h)) +$(eval $(call gb_Package_add_file,mozilla_inc,inc/external/npsdk/npfunctions.h,inc/npfunctions.h)) +$(eval $(call gb_Package_add_file,mozilla_inc,inc/external/npsdk/npruntime.h,inc/npruntime.h)) +$(eval $(call gb_Package_add_file,mozilla_inc,inc/external/npsdk/nptypes.h,inc/nptypes.h)) + +# vim: set noet sw=4 ts=4: commit 0d59b7bf1bd03e7149b8e6ea147c5c39f114f925 Author: Matúš Kukan <matus.ku...@gmail.com> Date: Sat Jun 2 10:15:04 2012 +0200 deliver sane header only when it's being used Change-Id: I38a3dfb14375bb4abee7beaa3127c3a4cce1b9a2 diff --git a/Module_tail_build.mk b/Module_tail_build.mk index 719a6e6..949195a 100644 --- a/Module_tail_build.mk +++ b/Module_tail_build.mk @@ -85,9 +85,7 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\ reportbuilder \ reportdesign \ rsc \ - $(if $(filter SANE,$(BUILD_TYPE)),\ - sane \ - ) \ + sane \ sax \ sc \ scaddins \ diff --git a/config_host.mk.in b/config_host.mk.in index ee0ce10..11b3a16 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -526,7 +526,6 @@ export SYSTEM_PYTHON=@SYSTEM_PYTHON@ export SYSTEM_REDLAND=@SYSTEM_REDLAND@ export SYSTEM_RHINO=@SYSTEM_RHINO@ export SYSTEM_SAMPLEICC=@SYSTEM_SAMPLEICC@ -export SYSTEM_SANE_HEADER=@SYSTEM_SANE_HEADER@ export SYSTEM_SAXON=@SYSTEM_SAXON@ export SYSTEM_SERVLETAPI=@SYSTEM_SERVLETAPI@ export SYSTEM_STDLIBS=@SYSTEM_STDLIBS@ diff --git a/configure.in b/configure.in index 3233266..911588f 100644 --- a/configure.in +++ b/configure.in @@ -7799,15 +7799,12 @@ dnl =================================================================== AC_MSG_CHECKING([which sane header to use]) if test "$with_system_sane" = "yes"; then AC_MSG_RESULT([external]) - SYSTEM_SANE_HEADER=YES AC_CHECK_HEADER(sane/sane.h, [], [AC_MSG_ERROR(sane not found. install sane)], []) else AC_MSG_RESULT([internal]) - SYSTEM_SANE_HEADER=NO BUILD_TYPE="$BUILD_TYPE SANE" fi -AC_SUBST(SYSTEM_SANE_HEADER) dnl =================================================================== dnl Check for system icu diff --git a/extensions/Library_scn.mk b/extensions/Library_scn.mk index 1a884a6..83a0b6d 100644 --- a/extensions/Library_scn.mk +++ b/extensions/Library_scn.mk @@ -30,10 +30,6 @@ $(eval $(call gb_Library_Library,scn)) $(eval $(call gb_Library_set_componentfile,scn,extensions/source/scanner/scn)) -$(eval $(call gb_Library_use_packages,scn,\ - sane_inc \ -)) - $(eval $(call gb_Library_use_api,scn,\ udkapi \ offapi \ @@ -63,6 +59,10 @@ $(eval $(call gb_Library_add_exception_objects,scn,\ )) else ifeq ($(GUI),UNX) +ifneq (,$(filter SANE,$(BUILD_TYPE))) +$(eval $(call gb_Library_use_packages,scn,sane_inc)) +endif + $(eval $(call gb_Library_add_exception_objects,scn,\ extensions/source/scanner/grid \ extensions/source/scanner/sane \ diff --git a/sane/Module_sane.mk b/sane/Module_sane.mk index f77ea2e..f812df7 100644 --- a/sane/Module_sane.mk +++ b/sane/Module_sane.mk @@ -29,6 +29,10 @@ $(eval $(call gb_Module_Module,sane)) +ifeq ($(GUI),UNX) +ifneq (,$(filter SANE,$(BUILD_TYPE))) $(eval $(call gb_Module_add_targets,sane,\ Package_inc \ )) +endif +endif commit fb3b9777a4b8ceda19fabb918eb33a3e0c94f156 Author: Matúš Kukan <matus.ku...@gmail.com> Date: Sat Jun 2 01:21:50 2012 +0200 extensions: bin unused source files Change-Id: I134b1bd60552cb5c9b973a97501baf4b37473efe diff --git a/extensions/source/scanner/twain.cxx b/extensions/source/scanner/twain.cxx deleted file mode 100644 index 02e2bbf..0000000 --- a/extensions/source/scanner/twain.cxx +++ /dev/null @@ -1,478 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include <string.h> -#include <math.h> - -#if defined( WNT ) -#include <windows.h> -#endif -#include <osl/module.hxx> -#include <tools/stream.hxx> -#include <vcl/svapp.hxx> -#include <vcl/wrkwin.hxx> -#include <vcl/sysdata.hxx> -#include "twain.hxx" - -// ----------- -// - Defines - -// ----------- - -#define PFUNC (*pDSM) -#define FIXTODOUBLE( nFix ) ((double)nFix.Whole+(double)nFix.Frac/65536.) -#define FIXTOLONG( nFix ) ((long)floor(FIXTODOUBLE(nFix)+0.5)) - -#if defined WNT -#define TWAIN_LIBNAME "TWAIN_32.DLL" -#define TWAIN_FUNCNAME "DSM_Entry" -#endif - -// ----------- -// - Statics - -// ----------- - -static ImpTwain* pImpTwainInstance = NULL; - -// --------- -// - Procs - -// --------- - - #define PTWAINMSG MSG* - - // ------------------------------------------------------------------------- - - 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; - - if( ( nCode < 0 ) || - ( pImpTwainInstance->hTwainWnd != pMsg->hwnd ) || - !pImpTwainInstance->ImplHandleMsg( (void*) lParam ) ) - { - return CallNextHookEx( pImpTwainInstance->hTwainHook, nCode, wParam, lParam ); - } - else - { - pMsg->message = WM_USER; - pMsg->lParam = 0; - - return 0; - } - } - -// ------------ -// - ImpTwain - -// ------------ - -ImpTwain::ImpTwain( const Link& rNotifyLink ) : - aNotifyLink ( rNotifyLink ), - pDSM ( NULL ), - pMod ( NULL ), - hTwainWnd ( 0 ), - hTwainHook ( 0 ), - nCurState ( 1 ) -{ - pImpTwainInstance = this; - - aAppIdent.Id = 0; - aAppIdent.Version.MajorNum = 1; - aAppIdent.Version.MinorNum = 0; - aAppIdent.Version.Language = TWLG_USA; - aAppIdent.Version.Country = TWCY_USA; - aAppIdent.ProtocolMajor = TWON_PROTOCOLMAJOR; - aAppIdent.ProtocolMinor = TWON_PROTOCOLMINOR; - aAppIdent.SupportedGroups = DG_IMAGE | DG_CONTROL; - strcpy( aAppIdent.Version.Info, "6.0" ); - strcpy( aAppIdent.Manufacturer, "Sun Microsystems"); - strcpy( aAppIdent.ProductFamily,"Office"); - strcpy( aAppIdent.ProductName, "Office"); - - HWND hParentWnd = HWND_DESKTOP; - WNDCLASS aWc = { 0, &TwainWndProc, 0, sizeof( WNDCLASS ), GetModuleHandle( NULL ), - NULL, NULL, NULL, NULL, "TwainClass" }; - - RegisterClass( &aWc ); - hTwainWnd = CreateWindowEx( WS_EX_TOPMOST, aWc.lpszClassName, "TWAIN", 0, 0, 0, 0, 0, hParentWnd, NULL, aWc.hInstance, 0 ); - hTwainHook = SetWindowsHookEx( WH_GETMESSAGE, &TwainMsgProc, NULL, GetCurrentThreadId() ); -} - -// ----------------------------------------------------------------------------- - -ImpTwain::~ImpTwain() -{ -} - -// ----------------------------------------------------------------------------- - -void ImpTwain::Destroy() -{ - ImplFallback( TWAIN_EVENT_NONE ); - Application::PostUserEvent( LINK( this, ImpTwain, ImplDestroyHdl ), NULL ); -} - -// ----------------------------------------------------------------------------- - -sal_Bool ImpTwain::SelectSource() -{ - TW_UINT16 nRet = TWRC_FAILURE; - - if( !!aBitmap ) - aBitmap = Bitmap(); - - ImplOpenSourceManager(); - - if( 3 == nCurState ) - { - TW_IDENTITY aIdent; - - aIdent.Id = 0, aIdent.ProductName[ 0 ] = '\0'; - aNotifyLink.Call( (void*) TWAIN_EVENT_SCANNING ); - nRet = PFUNC( &aAppIdent, NULL, DG_CONTROL, DAT_IDENTITY, MSG_USERSELECT, &aIdent ); - } - - ImplFallback( TWAIN_EVENT_QUIT ); - - return( nRet == TWRC_SUCCESS || nRet == TWRC_CANCEL ); -} - -// ----------------------------------------------------------------------------- - -sal_Bool ImpTwain::InitXfer() -{ - sal_Bool bRet = sal_False; - - if( !!aBitmap ) - aBitmap = Bitmap(); - - ImplOpenSourceManager(); - - if( 3 == nCurState ) - { - ImplOpenSource(); - - if( 4 == nCurState ) - bRet = ImplEnableSource(); - } - - if( !bRet ) - ImplFallback( TWAIN_EVENT_QUIT ); - - return bRet; -} - -// ----------------------------------------------------------------------------- - -Bitmap ImpTwain::GetXferBitmap() -{ - Bitmap aRet( aBitmap ); - aBitmap = Bitmap(); - return aRet; -} - -// ----------------------------------------------------------------------------- - -void ImpTwain::ImplOpenSourceManager() -{ - if( 1 == nCurState ) - { - pMod = new osl::Module(); - - if( pMod->load( TWAIN_LIBNAME ) ) - { - nCurState = 2; - - if( ( ( pDSM = (DSMENTRYPROC) pMod->getSymbol( TWAIN_FUNCNAME ) ) != NULL ) && - ( PFUNC( &aAppIdent, NULL, DG_CONTROL, DAT_PARENT, MSG_OPENDSM, &hTwainWnd ) == TWRC_SUCCESS ) ) - { - nCurState = 3; - } - } - else - { - delete pMod; - pMod = NULL; - } - } -} - -// ----------------------------------------------------------------------------- - -void ImpTwain::ImplOpenSource() -{ - if( 3 == nCurState ) - { - if( ( PFUNC( &aAppIdent, NULL, DG_CONTROL, DAT_IDENTITY, MSG_GETDEFAULT, &aSrcIdent ) == TWRC_SUCCESS ) && - ( PFUNC( &aAppIdent, NULL, DG_CONTROL, DAT_IDENTITY, MSG_OPENDS, &aSrcIdent ) == TWRC_SUCCESS ) ) - { - - TW_CAPABILITY aCap = { CAP_XFERCOUNT, TWON_ONEVALUE, GlobalAlloc( GHND, sizeof( TW_ONEVALUE ) ) }; - TW_ONEVALUE* pVal = (TW_ONEVALUE*) GlobalLock( aCap.hContainer ); - - pVal->ItemType = TWTY_INT16, pVal->Item = 1; - GlobalUnlock( aCap.hContainer ); - PFUNC( &aAppIdent, &aSrcIdent, DG_CONTROL, DAT_CAPABILITY, MSG_SET, &aCap ); - GlobalFree( aCap.hContainer ); - - nCurState = 4; - } - } -} - -// ----------------------------------------------------------------------------- - -BOOL ImpTwain::ImplEnableSource() -{ - BOOL bRet = FALSE; - - if( 4 == nCurState ) - { - TW_USERINTERFACE aUI = { TRUE, TRUE, hTwainWnd }; - - aNotifyLink.Call( (void*) TWAIN_EVENT_SCANNING ); - nCurState = 5; - - if( PFUNC( &aAppIdent, &aSrcIdent, DG_CONTROL, DAT_USERINTERFACE, MSG_ENABLEDS, &aUI ) == TWRC_SUCCESS ) - bRet = TRUE; - else - nCurState = 4; - } - - return bRet; -} - -// ----------------------------------------------------------------------------- - -BOOL ImpTwain::ImplHandleMsg( void* pMsg ) -{ - TW_UINT16 nRet; - PTWAINMSG pMess = (PTWAINMSG) pMsg; - TW_EVENT aEvt = { pMess, MSG_NULL }; - - nRet = PFUNC( &aAppIdent, &aSrcIdent, DG_CONTROL, DAT_EVENT, MSG_PROCESSEVENT, &aEvt ); - - if( aEvt.TWMessage != MSG_NULL ) - { - switch( aEvt.TWMessage ) - { - case MSG_XFERREADY: - { - ULONG nEvent = TWAIN_EVENT_QUIT; - - if( 5 == nCurState ) - { - nCurState = 6; - ImplXfer(); - - if( !!aBitmap ) - nEvent = TWAIN_EVENT_XFER; - } - - ImplFallback( nEvent ); - } - break; - - case MSG_CLOSEDSREQ: - ImplFallback( TWAIN_EVENT_QUIT ); - break; - - default: - break; - } - } - else - nRet = TWRC_NOTDSEVENT; - - return( TWRC_DSEVENT == nRet ); -} - -// ----------------------------------------------------------------------------- - -void ImpTwain::ImplXfer() -{ - if( nCurState == 6 ) - { - TW_IMAGEINFO aInfo; - TW_UINT32 hDIB = 0; - long nWidth = aInfo.ImageWidth; - long nHeight = aInfo.ImageLength; - long nXRes = FIXTOLONG( aInfo.XResolution ); - long nYRes = FIXTOLONG( aInfo.YResolution ); - - if( PFUNC( &aAppIdent, &aSrcIdent, DG_IMAGE, DAT_IMAGEINFO, MSG_GET, &aInfo ) == TWRC_SUCCESS ) - { - nWidth = aInfo.ImageWidth; - nHeight = aInfo.ImageLength; - nXRes = FIXTOLONG( aInfo.XResolution ); - nYRes = FIXTOLONG( aInfo.YResolution ); - } - else - nWidth = nHeight = nXRes = nYRes = -1L; - - switch( PFUNC( &aAppIdent, &aSrcIdent, DG_IMAGE, DAT_IMAGENATIVEXFER, MSG_GET, &hDIB ) ) - { - case( TWRC_CANCEL ): - nCurState = 7; - break; - - case( TWRC_XFERDONE ): - { - const ULONG nSize = GlobalSize( (HGLOBAL) hDIB ); - char* pBuf = (char*) GlobalLock( (HGLOBAL) hDIB ); - - if( pBuf ) - { - SvMemoryStream aMemStm; - aMemStm.SetBuffer( pBuf, nSize, FALSE, nSize ); - aBitmap.Read( aMemStm, FALSE ); - GlobalUnlock( (HGLOBAL) hDIB ); - } - - GlobalFree( (HGLOBAL) hDIB ); - - // set resolution of bitmap if neccessary - if ( ( nXRes != -1 ) && ( nYRes != - 1 ) && ( nWidth != - 1 ) && ( nHeight != - 1 ) ) - { - const MapMode aMapMode( MAP_100TH_INCH, Point(), Fraction( 100, nXRes ), Fraction( 100, nYRes ) ); - aBitmap.SetPrefMapMode( aMapMode ); - aBitmap.SetPrefSize( Size( nWidth, nHeight ) ); - } - - nCurState = 7; - } - break; - - default: - break; - } - } -} - -// ----------------------------------------------------------------------------- - -void ImpTwain::ImplFallback( ULONG nEvent ) -{ - Application::PostUserEvent( LINK( this, ImpTwain, ImplFallbackHdl ), (void*) nEvent ); -} - -// ----------------------------------------------------------------------------- - -IMPL_LINK( ImpTwain, ImplFallbackHdl, void*, pData ) -{ - const ULONG nEvent = (ULONG) pData; - sal_Bool bFallback = sal_True; - - switch( nCurState ) - { - case( 7 ): - case( 6 ): - { - TW_PENDINGXFERS aXfers; - - if( PFUNC( &aAppIdent, &aSrcIdent, DG_CONTROL, DAT_PENDINGXFERS, MSG_ENDXFER, &aXfers ) == TWRC_SUCCESS ) - { - if( aXfers.Count != 0 ) - PFUNC( &aAppIdent, &aSrcIdent, DG_CONTROL, DAT_PENDINGXFERS, MSG_RESET, &aXfers ); - } - - nCurState = 5; - } - break; - - case( 5 ): - { - TW_USERINTERFACE aUI = { TRUE, TRUE, hTwainWnd }; - - PFUNC( &aAppIdent, &aSrcIdent, DG_CONTROL, DAT_USERINTERFACE, MSG_DISABLEDS, &aUI ); - nCurState = 4; - } - break; - - case( 4 ): - { - PFUNC( &aAppIdent, NULL, DG_CONTROL, DAT_IDENTITY, MSG_CLOSEDS, &aSrcIdent ); - nCurState = 3; - } - break; - - case( 3 ): - { - PFUNC( &aAppIdent, NULL, DG_CONTROL, DAT_PARENT, MSG_CLOSEDSM, &hTwainWnd ); - nCurState = 2; - } - break; - - case( 2 ): - { - delete pMod; - pMod = NULL; - nCurState = 1; - } - break; - - default: - { - if( nEvent != TWAIN_EVENT_NONE ) - aNotifyLink.Call( (void*) nEvent ); - - bFallback = sal_False; - } - break; - } - - if( bFallback ) - ImplFallback( nEvent ); - - return 0L; -} - -// ----------------------------------------------------------------------------- - -IMPL_LINK( ImpTwain, ImplDestroyHdl, void*, p ) -{ - - if( hTwainWnd ) - DestroyWindow( hTwainWnd ); - - if( hTwainHook ) - UnhookWindowsHookEx( hTwainHook ); - - delete this; - pImpTwainInstance = NULL; - - return 0L; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/scanner/twain.hxx b/extensions/source/scanner/twain.hxx deleted file mode 100644 index 84596b2..0000000 --- a/extensions/source/scanner/twain.hxx +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _TWAIN_HXX -#define _TWAIN_HXX - -#include <osl/module.hxx> -#include <vcl/bitmap.hxx> -#include "twain/twain.h" - - -// ----------- -// - Defines - -// ----------- - -#define TWAIN_SELECT 0x00000001UL -#define TWAIN_ACQUIRE 0x00000002UL -#define TWAIN_TERMINATE 0xFFFFFFFFUL - -#define TWAIN_EVENT_NONE 0x00000000UL -#define TWAIN_EVENT_QUIT 0x00000001UL -#define TWAIN_EVENT_SCANNING 0x00000002UL -#define TWAIN_EVENT_XFER 0x00000004UL - -// ------------ -// - ImpTwain - -// ------------ - -class ImpTwain -{ - TW_IDENTITY aAppIdent; - TW_IDENTITY aSrcIdent; - Link aNotifyLink; - Bitmap aBitmap; - DSMENTRYPROC pDSM; - osl::Module pMod; - sal_uLong nCurState; - - void ImplCreate(); - void ImplOpenSourceManager(); - void ImplOpenSource(); - sal_Bool ImplEnableSource(); - void ImplXfer(); - void ImplFallback( sal_uLong nEvent ); - - DECL_LINK( ImplFallbackHdl, void* ); - DECL_LINK( ImplDestroyHdl, void* ); - -public: - - sal_Bool ImplHandleMsg( void* pMsg ); - - HWND hTwainWnd; - HHOOK hTwainHook; - -public: - - ImpTwain( const Link& rNotifyLink ); - ~ImpTwain(); - - void Destroy(); - - sal_Bool SelectSource(); - sal_Bool InitXfer(); - Bitmap GetXferBitmap(); -}; - -#endif // _TWAIN_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit a9f170c1045e642bfbd22fc323b635a4870e2d07 Author: Matúš Kukan <matus.ku...@gmail.com> Date: Sat Jun 2 01:05:16 2012 +0200 twain header is only for Windows Change-Id: I7b1cee3bde17fc9e52b7fcf06d1d5215a9396814 diff --git a/Module_tail_build.mk b/Module_tail_build.mk index 02a7d43..719a6e6 100644 --- a/Module_tail_build.mk +++ b/Module_tail_build.mk @@ -112,9 +112,7 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\ test \ toolkit \ tools \ - $(if $(filter TWAIN,$(BUILD_TYPE)),\ - twain \ - ) \ + twain \ ucb \ unixODBC \ UnoControls \ diff --git a/configure.in b/configure.in index 04df981..3233266 100644 --- a/configure.in +++ b/configure.in @@ -2524,10 +2524,6 @@ dnl =================================================================== dnl Windows specific tests and stuff dnl =================================================================== if test "$_os" = "WINNT"; then - - dnl Include twain scanners - BUILD_TYPE="$BUILD_TYPE TWAIN" - dnl Set the CL_X64 variable if we are building a 64-bit LibreOffice. AC_MSG_CHECKING([whether to build a 64-bit LibreOffice]) if test "$enable_cl_x64" = "" -o "$enable_cl_x64" = "no"; then diff --git a/extensions/Library_scn.mk b/extensions/Library_scn.mk index 2942b2b..1a884a6 100644 --- a/extensions/Library_scn.mk +++ b/extensions/Library_scn.mk @@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_componentfile,scn,extensions/source/scanner/scn)) $(eval $(call gb_Library_use_packages,scn,\ sane_inc \ - twain_inc \ )) $(eval $(call gb_Library_use_api,scn,\ @@ -57,6 +56,8 @@ $(eval $(call gb_Library_add_exception_objects,scn,\ )) ifeq ($(GUI),WNT) +$(eval $(call gb_Library_use_packages,scn,twain_inc)) + $(eval $(call gb_Library_add_exception_objects,scn,\ extensions/source/scanner/scanwin \ )) commit 1c4605d1e07a6264ef8bdac556fff575c2bd6e2d Author: Matúš Kukan <matus.ku...@gmail.com> Date: Fri Jun 1 22:05:37 2012 +0200 add missing registry module Change-Id: I4dfc5f6fced60f884b67e9bdca2f66d32cc835cb diff --git a/RepositoryModule_ooo.mk b/RepositoryModule_ooo.mk index 1cd30dc..ca84fcc 100644 --- a/RepositoryModule_ooo.mk +++ b/RepositoryModule_ooo.mk @@ -98,6 +98,7 @@ $(eval $(call gb_Module_add_moduledirs,ooo,\ ) \ rdbmaker \ regexp \ + registry \ remotebridges \ reportbuilder \ reportdesign \
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits