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)
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"
OSD_PerfMeter.cxx
OSD_PerfMeter.h
OSD_PerfMeter.hxx
-OSD_Printer.cxx
-OSD_Printer.hxx
OSD_Process.cxx
OSD_Process.hxx
OSD_Protection.cxx
class OSD_Directory;
class OSD_DirectoryIterator;
class OSD_Timer;
-class OSD_Printer;
class OSD_Host;
class OSD_Environment;
class OSD_EnvironmentIterator;
#include <OSD_FromWhere.hxx>
#include <OSD_OSDError.hxx>
#include <OSD_Path.hxx>
-#include <OSD_Printer.hxx>
#include <OSD_Protection.hxx>
#include <OSD_WhoAmI.hxx>
#include <Standard_PCharacter.hxx>
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
// --------------------------------------------------------------------------
#include <OSD_File.hxx>
#include <OSD_Protection.hxx>
-#include <OSD_Printer.hxx>
#include <Standard_ProgramError.hxx>
#include <OSD_WNT_1.hxx>
#include <Standard_PCharacter.hxx>
#include <TCollection_ExtendedString.hxx>
-#ifndef _INC_TCHAR
-# include <tchar.h>
-#endif // _INC_TCHAR
-
#include <Strsafe.h>
#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 ) )
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 );
#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
// --------------------------------------------------------------------------
} // 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 ;
class OSD_Path;
class OSD_Protection;
class TCollection_AsciiString;
-class OSD_Printer;
//! Basic tools to manage files
//! Returns actual number of bytes of <me>.
Standard_EXPORT Standard_Size Size();
-
- //! Prints a file on selected printer.
- Standard_EXPORT void Print (const OSD_Printer& WhichPrinter);
-
+
//! Returns TRUE if <me> is open.
Standard_EXPORT Standard_Boolean IsOpen() const;
+++ /dev/null
-// 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 <OSD_OSDError.hxx>
-#include <OSD_Printer.hxx>
-#include <OSD_WhoAmI.hxx>
-#include <Standard_ConstructionError.hxx>
-#include <Standard_NullObject.hxx>
-#include <TCollection_AsciiString.hxx>
-
-#include <errno.h>
-//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 <OSD_OSDError.hxx>
-#include <OSD_Printer.hxx>
-#include <Standard_ConstructionError.hxx>
-#include <Standard_NullObject.hxx>
-#include <TCollection_AsciiString.hxx>
-
-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
+++ /dev/null
-// 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 <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <OSD_Error.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Integer.hxx>
-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
OSD_WChronometer,
OSD_WTimer,
OSD_WPackage,
-OSD_WPrinter,
OSD_WEnvironmentIterator
};
CSF_TBB
CSF_dl
CSF_wsock32
-CSF_winspool
CSF_psapi