KiCad PCB EDA Suite
pcad2kicad_common.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2007, 2008 Lubo Racko <developer@lura.sk>
5  * Copyright (C) 2008, 2012 Alexander Lunev <al.lunev@yahoo.com>
6  * Copyright (C) 2012 KiCad Developers, see CHANGELOG.TXT for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
30 #ifndef PCAD2KICAD_COMMON_H_
31 #define PCAD2KICAD_COMMON_H_
32 
33 #include <eda_text.h>
34 
35 class wxString;
36 class XNODE;
37 
38 namespace PCAD2KICAD
39 {
40 
41 #define PCAD2KICAD_SCALE_SCH_TO_INCH_GRID
42 
44 {
54 };
55 
56 typedef struct _TTEXTVALUE
57 {
58  wxString text;
64  bool isBold;
65  bool isItalic;
66  bool isTrueType;
67 } TTEXTVALUE;
68 
69 extern wxString GetWord( wxString* aStr );
70 extern XNODE* FindPinMap( XNODE* aNode );
71 extern int StrToIntUnits( const wxString& aStr, char aAxe, const wxString& aActualConversion );
72 extern wxString GetAndCutWordWithMeasureUnits( wxString* aStr,
73  const wxString& aDefaultMeasurementUnit );
74 extern int StrToInt1Units( const wxString& aStr );
75 extern wxString ValidateName( wxString aName );
76 extern wxString ValidateReference( wxString aRef );
77 extern void SetWidth( wxString aStr,
78  const wxString& aDefaultMeasurementUnit,
79  int* aWidth,
80  const wxString& aActualConversion );
81 extern void SetPosition( wxString aStr,
82  const wxString& aDefaultMeasurementUnit,
83  int* aX,
84  int* aY,
85  const wxString& aActualConversion );
86 extern void SetDoublePrecisionPosition( wxString aStr,
87  const wxString& aDefaultMeasurementUnit,
88  double* aX,
89  double* aY,
90  const wxString& aActualConversion );
91 extern TTEXT_JUSTIFY GetJustifyIdentificator( const wxString& aJustify );
92 extern void SetTextParameters( XNODE* aNode,
93  TTEXTVALUE* aTextValue,
94  const wxString& aDefaultMeasurementUnit,
95  const wxString& aActualConversion );
96 extern void SetFontProperty( XNODE* aNode,
97  TTEXTVALUE* aTextValue,
98  const wxString& aDefaultMeasurementUnit,
99  const wxString& aActualConversion );
100 extern void SetTextJustify( EDA_TEXT* aText, TTEXT_JUSTIFY aJustify );
101 extern int CalculateTextLengthSize( TTEXTVALUE* aText );
102 extern void CorrectTextPosition( TTEXTVALUE* aValue );
103 extern void SetTextSizeFromStrokeFontHeight( EDA_TEXT* aText, int aTextHeight );
104 extern void SetTextSizeFromTrueTypeFontHeight( EDA_TEXT* aText, int aTextHeight );
105 extern XNODE* FindNode( XNODE* aChild, const wxString& aTag );
106 extern wxString FindNodeGetContent( XNODE* aChild, const wxString& aTag );
107 extern void InitTTextValue( TTEXTVALUE* aTextValue );
108 
109 } // namespace PCAD2KICAD
110 
111 #endif // PCAD2KICAD_COMMON_H_
wxString GetWord(wxString *aStr)
void SetFontProperty(XNODE *aNode, TTEXTVALUE *aTextValue, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
void SetPosition(wxString aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
wxString GetAndCutWordWithMeasureUnits(wxString *aStr, const wxString &aDefaultMeasurementUnit)
void SetWidth(wxString aStr, const wxString &aDefaultMeasurementUnit, int *aWidth, const wxString &aActualConversion)
void SetTextSizeFromTrueTypeFontHeight(EDA_TEXT *aText, int aTextHeight)
struct PCAD2KICAD::_TTEXTVALUE TTEXTVALUE
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:119
wxString ValidateName(wxString aName)
int CalculateTextLengthSize(TTEXTVALUE *aText)
wxString FindNodeGetContent(XNODE *aChild, const wxString &aTag)
void SetTextParameters(XNODE *aNode, TTEXTVALUE *aTextValue, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
wxString ValidateReference(wxString aRef)
void SetDoublePrecisionPosition(wxString aStr, const wxString &aDefaultMeasurementUnit, double *aX, double *aY, const wxString &aActualConversion)
int StrToIntUnits(const wxString &aStr, char aAxe, const wxString &aActualConversion)
Hold an XML or S-expression element.
Definition: xnode.h:43
void SetTextJustify(EDA_TEXT *aText, TTEXT_JUSTIFY aJustify)
void CorrectTextPosition(TTEXTVALUE *aValue)
TTEXT_JUSTIFY GetJustifyIdentificator(const wxString &aJustify)
XNODE * FindNode(XNODE *aChild, const wxString &aTag)
void InitTTextValue(TTEXTVALUE *aTextValue)
void SetTextSizeFromStrokeFontHeight(EDA_TEXT *aText, int aTextHeight)
XNODE * FindPinMap(XNODE *aNode)
int StrToInt1Units(const wxString &aStr)