1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,9 +1,14 @@
EXTERNLIB
Font_BRepFont.hxx
Font_BRepFont.cxx
Font_FTFont.hxx
Font_BRepFont.hxx
Font_FontAspect.hxx
Font_FontMgr.cxx
Font_FontMgr.hxx
Font_FTFont.cxx
Font_FTLibrary.hxx
Font_FTFont.hxx
Font_FTLibrary.cxx
Font_NListOfSystemFont.hxx
Font_FTLibrary.hxx
Font_NameOfFont.hxx
Font_NListOfSystemFont.hxx
Font_SystemFont.cxx
Font_SystemFont.hxx

View File

@@ -1,36 +0,0 @@
-- Copyright (c) 1992-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.
package Font
uses Standard,
Quantity,
TCollection,
OSD,
TColStd
is
enumeration FontAspect is FA_Undefined, FA_Regular, FA_Bold, FA_Italic, FA_BoldItalic;
---Purpose: Specifies aspect of system font.
class SystemFont;
imported NListOfSystemFont;
imported FTFont;
imported FTLibrary;
imported BRepFont;
class FontMgr;
end Font;

View File

@@ -0,0 +1,28 @@
// Copyright (c) 1992-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 _Font_FontAspect_HeaderFile
#define _Font_FontAspect_HeaderFile
//! Specifies aspect of system font.
enum Font_FontAspect
{
Font_FA_Undefined,
Font_FA_Regular,
Font_FA_Bold,
Font_FA_Italic,
Font_FA_BoldItalic
};
#endif // _Font_FontAspect_HeaderFile

View File

@@ -1,103 +0,0 @@
-- Created on: 2008-01-20
-- Created by: Alexander A. BORODIN
-- Copyright (c) 2008-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.
class FontMgr from Font inherits TShared from MMgt
---Purpose: Collects and provides information about available fonts in system.
---On Windows it gets information about available fonts from registry value
---"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts". If the description
---of the font does not contain the full path to it, FontMgr looks for it in the
---default fonts directory. (WinAPI function GetSystemWindowsDirectory is used
---to get the path of the shared Windows directory on a multi-user system.)
---On Linux and Mac OS X platforms for getting the directories with fonts, at first
---it checks X11 configuration files, which can be located at "/etc/X11/fs/config",
---"/usr/X11R6/lib/X11/fs/config" or "/usr/X11/lib/X11/fs/config". Then it adds
---default directories(for Linux: "/usr/share/fonts" and "/usr/local/share/fonts",
---for Mac OS X: "/System/Library/Fonts" and "/Library/Fonts"). After that FontMgr
---looks for the "fonts.dir" file in each stored directory. This file contain
---fonts description in XLFD (X Logical Font Description) format.
---On all platforms (Windows, Linux, Mac OS X) we use FreeType library for getting
---font name and aspect.
---On Linux and Mac OS X in cases when the font description obtained from FreeType
---does not match the description in XLFD, FontMgr stores such fonts as two different
---fonts (font management feature on Unix systems).
uses FontAspect,
SystemFont,
NListOfSystemFont,
Path from OSD,
AsciiString from TCollection,
HAsciiString from TCollection,
SequenceOfHAsciiString from TColStd
is
GetInstance(myclass) returns FontMgr;
---Level: Public
GetAvailableFonts(me) returns NListOfSystemFont;
---C++: return const &
GetAvailableFontsNames(me;
theFontsNames: out SequenceOfHAsciiString);
---Purpose: Returns sequence of available fonts names
---Level: Public
GetFont (me;
theFontName : HAsciiString;
theFontAspect : FontAspect;
theFontSize : Integer) returns SystemFont;
---Purpose: Returns font that match given parameters.
--- If theFontName is empty string returned font can have any FontName.
--- If theFontAspect is Font_FA_Undefined returned font can have any FontAspect.
--- If theFontSize is "-1" returned font can have any FontSize.
---Level: Public
FindFont (me;
theFontName : HAsciiString;
theFontAspect : FontAspect;
theFontSize : Integer) returns SystemFont;
---Purpose: Tries to find font by given parameters.
--- If the specified font is not found tries to use font names mapping.
--- If the requested family name not found -> search for any font family
--- with given aspect and height. If the font is still not found, returns
--- any font available in the system. Returns NULL in case when the fonts
--- are not found in the system.
---Level: Public
CheckFont (me; theFontPath : CString from Standard) returns SystemFont;
---Purpose: Read font file and retrieve information from it.
---Level: Public
RegisterFont (me : mutable;
theFont : SystemFont;
theToOverride : Boolean from Standard) returns Boolean from Standard;
---Purpose: Register new font.
--- If there is existing entity with the same name and properties but different path
--- then font will will be overridden or ignored depending on theToOverride flag.
---Level: Public
--- Private methods
Create returns FontMgr is private;
---Purpose: Creates empty font object
---Level: Private
InitFontDataBase(me:mutable) is private;
---Purpose: Collects available fonts paths.
---Level: Private
fields
myListOfFonts : NListOfSystemFont;
end FontMgr;

View File

@@ -13,18 +13,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Font_FontMgr.ixx>
#include <Font_FontMgr.hxx>
#include <Font_FTLibrary.hxx>
#include <OSD_Environment.hxx>
#include <Font_SystemFont.hxx>
#include <NCollection_List.hxx>
#include <NCollection_Map.hxx>
#include <OSD_Environment.hxx>
#include <Standard_Stream.hxx>
#include <Standard_Type.hxx>
#include <TCollection_HAsciiString.hxx>
#include <ft2build.h>
#include FT_FREETYPE_H
struct Font_FontMgr_FontAliasMapNode
{
const char * EnumName;

102
src/Font/Font_FontMgr.hxx Normal file
View File

@@ -0,0 +1,102 @@
// Created on: 2008-01-20
// Created by: Alexander A. BORODIN
// Copyright (c) 2008-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 _Font_FontMgr_HeaderFile
#define _Font_FontMgr_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Font_NListOfSystemFont.hxx>
#include <MMgt_TShared.hxx>
#include <TColStd_SequenceOfHAsciiString.hxx>
#include <Font_FontAspect.hxx>
#include <Standard_Integer.hxx>
#include <Standard_CString.hxx>
#include <Standard_Boolean.hxx>
class Font_SystemFont;
class TCollection_HAsciiString;
class Font_FontMgr;
DEFINE_STANDARD_HANDLE(Font_FontMgr, MMgt_TShared)
//! Collects and provides information about available fonts in system.
class Font_FontMgr : public MMgt_TShared
{
public:
Standard_EXPORT static Handle(Font_FontMgr) GetInstance();
Standard_EXPORT const Font_NListOfSystemFont& GetAvailableFonts() const;
//! Returns sequence of available fonts names
Standard_EXPORT void GetAvailableFontsNames (TColStd_SequenceOfHAsciiString& theFontsNames) const;
//! Returns font that match given parameters.
//! If theFontName is empty string returned font can have any FontName.
//! If theFontAspect is Font_FA_Undefined returned font can have any FontAspect.
//! If theFontSize is "-1" returned font can have any FontSize.
Standard_EXPORT Handle(Font_SystemFont) GetFont (const Handle(TCollection_HAsciiString)& theFontName, const Font_FontAspect theFontAspect, const Standard_Integer theFontSize) const;
//! Tries to find font by given parameters.
//! If the specified font is not found tries to use font names mapping.
//! If the requested family name not found -> search for any font family
//! with given aspect and height. If the font is still not found, returns
//! any font available in the system. Returns NULL in case when the fonts
//! are not found in the system.
Standard_EXPORT Handle(Font_SystemFont) FindFont (const Handle(TCollection_HAsciiString)& theFontName, const Font_FontAspect theFontAspect, const Standard_Integer theFontSize) const;
//! Read font file and retrieve information from it.
Standard_EXPORT Handle(Font_SystemFont) CheckFont (const Standard_CString theFontPath) const;
//! Register new font.
//! If there is existing entity with the same name and properties but different path
//! then font will will be overridden or ignored depending on theToOverride flag.
Standard_EXPORT Standard_Boolean RegisterFont (const Handle(Font_SystemFont)& theFont, const Standard_Boolean theToOverride);
DEFINE_STANDARD_RTTI(Font_FontMgr,MMgt_TShared)
protected:
private:
//! Creates empty font object
Standard_EXPORT Font_FontMgr();
//! Collects available fonts paths.
Standard_EXPORT void InitFontDataBase();
Font_NListOfSystemFont myListOfFonts;
};
#endif // _Font_FontMgr_HeaderFile

View File

@@ -1,71 +0,0 @@
-- Created on: 2008-01-20
-- Created by: Alexander A. BORODIN
-- Copyright (c) 2008-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.
class SystemFont from Font inherits TShared from MMgt
---Purpose: Structure for store of Font System Information
uses FontAspect,
HAsciiString from TCollection
is
Create returns SystemFont;
---Purpose: Creates empty font object
---Level: Public
Create (theFontName : HAsciiString;
theFontAspect : FontAspect;
theFilePath : HAsciiString ) returns SystemFont;
---Purpose: Creates Font object initialized with <FontName> as name
--- <FontAspect>.... TODO
---Level: Public
Create (theXLFD : HAsciiString;
theFilePath : HAsciiString ) returns SystemFont;
---Purpose: Creates Font object and initialize class fields with
--- values taken from XLFD (X Logical Font Description)
---Level: Public
FontName (me) returns HAsciiString;
--- Purpose: Returns font family name
---Level: Public
FontPath (me) returns HAsciiString;
--- Purpose: Returns font file path
--- Level: Public
FontAspect (me) returns FontAspect;
--- Purpose: Returns font aspect
--- Level: Public
FontHeight (me) returns Integer from Standard;
--- Purpose: Returns font height
--- If returned value is equal -1 it means that font is resizable
--- Level: Public
IsValid (me) returns Boolean;
IsEqual (me;
theOtherFont: SystemFont) returns Boolean;
--- Purpose: Return true if the FontName, FontAspect and FontSize are the same.
--- Level: Public
fields
MyFontName: HAsciiString; --Font family name
MyFontAspect: FontAspect;
MyFaceSize: Integer; --height of font
MyFilePath: HAsciiString; --absolute path to font file
MyVerification: Boolean; --indicator of font initialization errors. False if initialization is failed.
end SystemFont;

View File

@@ -15,11 +15,11 @@
// Updated:
#include <Font_SystemFont.ixx>
#include <Font_SystemFont.hxx>
#include <OSD_Path.hxx>
#include <Standard_Type.hxx>
#include <TCollection_HAsciiString.hxx>
Font_SystemFont::Font_SystemFont():
MyFontName(),
MyFontAspect(Font_FA_Undefined),

View File

@@ -0,0 +1,100 @@
// Created on: 2008-01-20
// Created by: Alexander A. BORODIN
// Copyright (c) 2008-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 _Font_SystemFont_HeaderFile
#define _Font_SystemFont_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Font_FontAspect.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <MMgt_TShared.hxx>
class TCollection_HAsciiString;
class Font_SystemFont;
DEFINE_STANDARD_HANDLE(Font_SystemFont, MMgt_TShared)
//! Structure for store of Font System Information
class Font_SystemFont : public MMgt_TShared
{
public:
//! Creates empty font object
Standard_EXPORT Font_SystemFont();
//! Creates Font object initialized with <FontName> as name
//! <FontAspect>.... TODO
Standard_EXPORT Font_SystemFont(const Handle(TCollection_HAsciiString)& theFontName, const Font_FontAspect theFontAspect, const Handle(TCollection_HAsciiString)& theFilePath);
//! Creates Font object and initialize class fields with
//! values taken from XLFD (X Logical Font Description)
Standard_EXPORT Font_SystemFont(const Handle(TCollection_HAsciiString)& theXLFD, const Handle(TCollection_HAsciiString)& theFilePath);
//! Returns font family name
Standard_EXPORT Handle(TCollection_HAsciiString) FontName() const;
//! Returns font file path
//! Level: Public
Standard_EXPORT Handle(TCollection_HAsciiString) FontPath() const;
//! Returns font aspect
//! Level: Public
Standard_EXPORT Font_FontAspect FontAspect() const;
//! Returns font height
//! If returned value is equal -1 it means that font is resizable
//! Level: Public
Standard_EXPORT Standard_Integer FontHeight() const;
Standard_EXPORT Standard_Boolean IsValid() const;
//! Return true if the FontName, FontAspect and FontSize are the same.
//! Level: Public
Standard_EXPORT Standard_Boolean IsEqual (const Handle(Font_SystemFont)& theOtherFont) const;
DEFINE_STANDARD_RTTI(Font_SystemFont,MMgt_TShared)
protected:
private:
Handle(TCollection_HAsciiString) MyFontName;
Font_FontAspect MyFontAspect;
Standard_Integer MyFaceSize;
Handle(TCollection_HAsciiString) MyFilePath;
Standard_Boolean MyVerification;
};
#endif // _Font_SystemFont_HeaderFile