diff --git a/adm/cmake/occt_csf.cmake b/adm/cmake/occt_csf.cmake index 47071f8e86..315417a0f5 100644 --- a/adm/cmake/occt_csf.cmake +++ b/adm/cmake/occt_csf.cmake @@ -33,7 +33,6 @@ if (WIN32) set (CSF_gdi32 "gdi32.lib") set (CSF_user32 "user32.lib") set (CSF_wsock32 "wsock32.lib") - set (CSF_winspool "Winspool.lib") set (CSF_psapi "Psapi.lib") set (CSF_AviLibs "ws2_32.lib vfw32.lib") if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2) diff --git a/adm/genproj.tcl b/adm/genproj.tcl index 237f05a367..14d4b46864 100644 --- a/adm/genproj.tcl +++ b/adm/genproj.tcl @@ -1109,7 +1109,6 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } { if { "$::HAVE_GLES2" == "true" } { set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2" } - set aLibsMap(CSF_winspool) "Winspool" set aLibsMap(CSF_psapi) "Psapi" set aLibsMap(CSF_d3d9) "d3d9" diff --git a/src/OSD/FILES b/src/OSD/FILES index 689218cfdd..c9e53811a0 100755 --- a/src/OSD/FILES +++ b/src/OSD/FILES @@ -62,8 +62,6 @@ OSD_Path.hxx OSD_PerfMeter.cxx OSD_PerfMeter.h OSD_PerfMeter.hxx -OSD_Printer.cxx -OSD_Printer.hxx OSD_Process.cxx OSD_Process.hxx OSD_Protection.cxx diff --git a/src/OSD/OSD.hxx b/src/OSD/OSD.hxx index 2520b43b8d..8f9ec3460b 100644 --- a/src/OSD/OSD.hxx +++ b/src/OSD/OSD.hxx @@ -34,7 +34,6 @@ class OSD_FileIterator; class OSD_Directory; class OSD_DirectoryIterator; class OSD_Timer; -class OSD_Printer; class OSD_Host; class OSD_Environment; class OSD_EnvironmentIterator; diff --git a/src/OSD/OSD_File.cxx b/src/OSD/OSD_File.cxx index 4977f34737..b7170a359a 100644 --- a/src/OSD/OSD_File.cxx +++ b/src/OSD/OSD_File.cxx @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -725,33 +724,6 @@ Standard_Size OSD_File::Size(){ return (Standard_Size)buffer.st_size; } - -// -------------------------------------------------------------------------- -// Print contains of a file -// -------------------------------------------------------------------------- - -void OSD_File::Print (const OSD_Printer &WhichPrinter ){ -char buffer[255]; -TCollection_AsciiString PrinterName; - - if (myPath.Name().Length()==0) - Standard_ProgramError::Raise("OSD_File::Print : empty file name"); - - WhichPrinter.Name(PrinterName); - - TCollection_AsciiString aBuffer; - myPath.SystemName ( aBuffer ); - - if (PrinterName.Length()==0) - sprintf(buffer,"lp %s",aBuffer.ToCString()); - else - sprintf(buffer,"lpr -P%s %s",PrinterName.ToCString(),aBuffer.ToCString()); - - if (system(buffer) != 0) - Standard_ProgramError::Raise("OSD_File::Print : No output device was available, or an error occurred"); -} - - // -------------------------------------------------------------------------- // Test if a file is open // -------------------------------------------------------------------------- @@ -825,7 +797,6 @@ void OSD_File::Rewind() { #include #include -#include #include #include @@ -835,21 +806,12 @@ void OSD_File::Rewind() { #include #include -#ifndef _INC_TCHAR -# include -#endif // _INC_TCHAR - #include #if defined(__CYGWIN32__) || defined(__MINGW32__) #define VAC #endif -#if defined(_MSC_VER) - #pragma comment( lib, "WSOCK32.LIB" ) - #pragma comment( lib, "WINSPOOL.LIB" ) -#endif - #define ACE_HEADER_SIZE ( sizeof ( ACCESS_ALLOWED_ACE ) - sizeof ( DWORD ) ) #define RAISE( arg ) Standard_ProgramError :: Raise ( ( arg ) ) @@ -865,7 +827,6 @@ PSECURITY_DESCRIPTOR __fastcall _osd_wnt_protection_to_sd ( const OSD_Protection BOOL __fastcall _osd_wnt_sd_to_protection ( PSECURITY_DESCRIPTOR, OSD_Protection&, BOOL ); -BOOL __fastcall _osd_print (const Standard_PCharacter, const wchar_t* ); static int __fastcall _get_buffer(HANDLE, Standard_PCharacter&, DWORD, BOOL, BOOL); #endif static void __fastcall _test_raise ( HANDLE, Standard_CString ); @@ -1674,29 +1635,6 @@ Standard_Size OSD_File::Size() #endif } -// -------------------------------------------------------------------------- -// Print contains of a file -// -------------------------------------------------------------------------- -void OSD_File :: Print ( const OSD_Printer& WhichPrinter) { -#ifndef OCCT_UWP - if (myFileHandle != INVALID_HANDLE_VALUE) - - RAISE( "OSD_File :: Print (): incorrect call - file opened" ); - - TCollection_AsciiString pName, fName; - - WhichPrinter.Name ( pName ); - myPath.SystemName ( fName ); - TCollection_ExtendedString fNameW(fName); - - if ( !_osd_print ( (Standard_PCharacter)pName.ToCString (), - (const wchar_t*)fNameW.ToExtString () ) ) - - _osd_wnt_set_error ( myError, OSD_WFile ); -#else - (void)WhichPrinter; -#endif -} // end OSD_File :: Print // -------------------------------------------------------------------------- // Test if a file is open // -------------------------------------------------------------------------- @@ -2771,99 +2709,6 @@ static OSD_SingleProtection __fastcall _get_protection_dir ( DWORD mask ) { } // end _get_protection_dir #endif -#if defined(__CYGWIN32__) || defined(__MINGW32__) -#define __try -#define __finally -#define __leave return fOK -#endif - -#ifndef OCCT_UWP -BOOL __fastcall _osd_print (const Standard_PCharacter pName, const wchar_t* fName ) { - - BOOL fOK, fJob; - HANDLE hPrinter = NULL; - BYTE jobInfo[ MAX_PATH + sizeof ( DWORD ) ]; - DWORD dwNeeded, dwCode = 0; - - fOK = fJob = FALSE; - - __try { - - if ( !OpenPrinter ( Standard_PCharacter(pName), &hPrinter, NULL ) ) { - - hPrinter = NULL; - __leave; - - } // end if - - if ( !AddJobW ( - hPrinter, 1, jobInfo, MAX_PATH + sizeof ( DWORD ), &dwNeeded - ) - ) __leave; - - fJob = TRUE; - - if ( !CopyFileW ( - fName, (LPWSTR) ( ( ADDJOB_INFO_1* )jobInfo ) -> Path, FALSE - ) - ) __leave; - - if ( !ScheduleJob ( - hPrinter, ( ( ADDJOB_INFO_1* )jobInfo ) -> JobId - ) - ) __leave; - - fOK = TRUE; - - } // end __try - - __finally { - - if ( !fOK ) { - - BYTE info[ 1024 ]; - DWORD dwBytesNeeded; - - dwCode = GetLastError (); - - if ( fJob && hPrinter != NULL ) { - - GetJob ( - hPrinter, ( ( ADDJOB_INFO_1* )jobInfo ) -> JobId, 1, - info, 1024, &dwBytesNeeded - ); - - if ( fJob ) SetJob ( - hPrinter, - ( ( ADDJOB_INFO_1* )jobInfo ) -> JobId, - 1, info, JOB_CONTROL_CANCEL - ); - - } // end if - - } // end if - - if ( hPrinter != NULL ) ClosePrinter ( hPrinter ); - - } // end __finally - -#ifdef VAC -leave: ; // added for VisualAge -#endif - - if ( !fOK ) SetLastError ( dwCode ); - - return fOK; - -} // end _osd_print -#endif - -#if defined(__CYGWIN32__) || defined(__MINGW32__) -#undef __try -#undef __finally -#undef __leave -#endif - Standard_Boolean OSD_File::IsReadable() { TCollection_AsciiString FileName ; diff --git a/src/OSD/OSD_File.hxx b/src/OSD/OSD_File.hxx index c37bd772cb..6d1fe2006b 100644 --- a/src/OSD/OSD_File.hxx +++ b/src/OSD/OSD_File.hxx @@ -34,7 +34,6 @@ class Standard_ProgramError; class OSD_Path; class OSD_Protection; class TCollection_AsciiString; -class OSD_Printer; //! Basic tools to manage files @@ -158,10 +157,7 @@ public: //! Returns actual number of bytes of . Standard_EXPORT Standard_Size Size(); - - //! Prints a file on selected printer. - Standard_EXPORT void Print (const OSD_Printer& WhichPrinter); - + //! Returns TRUE if is open. Standard_EXPORT Standard_Boolean IsOpen() const; diff --git a/src/OSD/OSD_Printer.cxx b/src/OSD/OSD_Printer.cxx deleted file mode 100644 index 91dad41881..0000000000 --- a/src/OSD/OSD_Printer.cxx +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _WIN32 - - -#include -#include -#include -#include -#include -#include - -#include -//const OSD_WhoAmI Iam = OSD_WPrinter; -// ------------------------------------------------------------- -// ------------------------------------------------------------- -OSD_Printer::OSD_Printer (const TCollection_AsciiString& Name){ - SetName(Name); -} - - -// ------------------------------------------------------------- -// ------------------------------------------------------------- -void OSD_Printer::SetName (const TCollection_AsciiString& Name){ - - if (!Name.IsAscii()) - Standard_ConstructionError::Raise("OSD_Printer::SetName"); - - myName = Name; -} - - -// ------------------------------------------------------------- -// ------------------------------------------------------------- -void OSD_Printer::Name (TCollection_AsciiString &Name)const{ - Name = myName; -} - - -// ------------------------------------------------------------- -// ------------------------------------------------------------- -void OSD_Printer::Reset(){ - myError.Reset(); -} - -// ------------------------------------------------------------- -// ------------------------------------------------------------- -Standard_Boolean OSD_Printer::Failed()const{ - return( myError.Failed()); -} - -// ------------------------------------------------------------- -// ------------------------------------------------------------- -void OSD_Printer::Perror() { - myError.Perror(); -} - - -// ------------------------------------------------------------- -// ------------------------------------------------------------- -Standard_Integer OSD_Printer::Error()const{ - return( myError.Error()); -} -#else - -//------------------------------------------------------------------------ -//------------------- Windows NT sources for OSD_Printer ---------------- -//------------------------------------------------------------------------ - -#include -#include -#include -#include -#include - -OSD_Printer :: OSD_Printer ( const TCollection_AsciiString& Name ) { - - SetName ( Name ); - -} // end constructor - -void OSD_Printer :: SetName ( const TCollection_AsciiString& Name ) { - - myName = Name; - -} // end OSD_Printer :: SetName - -void OSD_Printer :: Name ( TCollection_AsciiString& Name ) const { - - Name = myName; - -} // end OSD_Printer :: Name - -Standard_Boolean OSD_Printer :: Failed () const { - - return myError.Failed (); - -} // end OSD_Printer :: Failed - -void OSD_Printer :: Reset () { - - myError.Reset (); - -} // end OSD_Printer :: Reset - -void OSD_Printer :: Perror () { - - myError.Perror (); - -} // end OSD_Printer :: Perror - -Standard_Integer OSD_Printer :: Error () const { - - return myError.Error (); - -} // end OSD_Printer :: Error - - -#endif diff --git a/src/OSD/OSD_Printer.hxx b/src/OSD/OSD_Printer.hxx deleted file mode 100644 index d5f66776e4..0000000000 --- a/src/OSD/OSD_Printer.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// Created on: 2018-03-15 -// Created by: Stephan GARNAUD (ARM) -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _OSD_Printer_HeaderFile -#define _OSD_Printer_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include -class Standard_ConstructionError; -class Standard_NullObject; -class OSD_OSDError; -class TCollection_AsciiString; - - -//! Selects a printer (used by File). -class OSD_Printer -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Initializes printer to use with its name. - //! The string must contain only ASCII characters - //! between ' ' and '~'; this means no control character - //! and no extended ASCII code. If it is not the case the - //! exception ConstructionError is raised. - Standard_EXPORT OSD_Printer(const TCollection_AsciiString& Name); - - //! Changes name of printer to use. - Standard_EXPORT void SetName (const TCollection_AsciiString& Name); - - //! Returns name of current printer - Standard_EXPORT void Name (TCollection_AsciiString& Name) const; - - //! Returns TRUE if an error occurs - Standard_EXPORT Standard_Boolean Failed() const; - - //! Resets error counter to zero - Standard_EXPORT void Reset(); - - //! Raises OSD_Error - Standard_EXPORT void Perror(); - - //! Returns error number if 'Failed' is TRUE. - Standard_EXPORT Standard_Integer Error() const; - - - - -protected: - - - - - -private: - - - - TCollection_AsciiString myName; - OSD_Error myError; - - -}; - - - - - - - -#endif // _OSD_Printer_HeaderFile diff --git a/src/OSD/OSD_WhoAmI.hxx b/src/OSD/OSD_WhoAmI.hxx index cccc77cf41..4dcc794924 100644 --- a/src/OSD/OSD_WhoAmI.hxx +++ b/src/OSD/OSD_WhoAmI.hxx @@ -33,7 +33,6 @@ OSD_WDisk, OSD_WChronometer, OSD_WTimer, OSD_WPackage, -OSD_WPrinter, OSD_WEnvironmentIterator }; diff --git a/src/TKernel/EXTERNLIB b/src/TKernel/EXTERNLIB index c7ceace8fd..a62f5cb0ef 100755 --- a/src/TKernel/EXTERNLIB +++ b/src/TKernel/EXTERNLIB @@ -5,5 +5,4 @@ CSF_user32 CSF_TBB CSF_dl CSF_wsock32 -CSF_winspool CSF_psapi