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 <wx/wx.h>
34 #include <wx/xml/xml.h>
35 #include <xnode.h>
36 
37 #include <eda_text.h>
38 
39 namespace PCAD2KICAD
40 {
41 
42 #define PCAD2KICAD_SCALE_SCH_TO_INCH_GRID
43 
45 {
55 };
56 
57 typedef struct _TTEXTVALUE
58 {
59  wxString text;
65 } TTEXTVALUE;
66 
67 extern wxString GetWord( wxString* aStr );
68 extern XNODE* FindPinMap( XNODE* aNode );
69 extern int StrToIntUnits( wxString aStr, char aAxe, wxString aActualConversion );
70 extern wxString GetAndCutWordWithMeasureUnits( wxString* aStr,
71  wxString aDefaultMeasurementUnit );
72 extern int StrToInt1Units( wxString aStr );
73 extern wxString ValidateName( wxString aName );
74 extern void SetWidth( wxString aStr,
75  wxString aDefaultMeasurementUnit,
76  int* aWidth,
77  wxString aActualConversion );
78 extern void SetPosition( wxString aStr,
79  wxString aDefaultMeasurementUnit,
80  int* aX,
81  int* aY,
82  wxString aActualConversion );
83 extern void SetDoublePrecisionPosition( wxString aStr,
84  wxString aDefaultMeasurementUnit,
85  double* aX,
86  double* aY,
87  wxString aActualConversion );
88 extern TTEXT_JUSTIFY GetJustifyIdentificator( wxString aJustify );
89 extern void SetTextParameters( XNODE* aNode,
90  TTEXTVALUE* aTextValue,
91  wxString aDefaultMeasurementUnit,
92  wxString aActualConversion );
93 extern void SetFontProperty( XNODE* aNode,
94  TTEXTVALUE* aTextValue,
95  wxString aDefaultMeasurementUnit,
96  wxString aActualConversion );
97 extern void SetTextJustify( EDA_TEXT* aText, TTEXT_JUSTIFY aJustify );
98 extern int CalculateTextLengthSize( TTEXTVALUE* aText );
99 extern void CorrectTextPosition( TTEXTVALUE* aValue );
100 extern void SetTextSizeFromStrokeFontHeight( EDA_TEXT* aText,
101  int aTextHeight );
102 
103 extern XNODE* FindNode( XNODE* aChild, wxString aTag );
104 extern wxString FindNodeGetContent( XNODE* aChild, wxString aTag );
105 extern void InitTTextValue( TTEXTVALUE* aTextValue );
106 
107 } // namespace PCAD2KICAD
108 
109 #endif // PCAD2KICAD_COMMON_H_
void SetWidth(wxString aStr, wxString aDefaultMeasurementUnit, int *aWidth, wxString aActualConversion)
wxString GetWord(wxString *aStr)
int StrToInt1Units(wxString aStr)
TTEXT_JUSTIFY GetJustifyIdentificator(wxString aJustify)
wxString GetAndCutWordWithMeasureUnits(wxString *aStr, wxString aDefaultMeasurementUnit)
void SetTextParameters(XNODE *aNode, TTEXTVALUE *aTextValue, wxString aDefaultMeasurementUnit, wxString aActualConversion)
Definition of base KiCad text object.
struct PCAD2KICAD::_TTEXTVALUE TTEXTVALUE
Class EDA_TEXT is a mix-in class (via multiple inheritance) that handles texts such as labels...
Definition: eda_text.h:114
wxString FindNodeGetContent(XNODE *aChild, wxString aTag)
wxString ValidateName(wxString aName)
int CalculateTextLengthSize(TTEXTVALUE *aText)
void SetPosition(wxString aStr, wxString aDefaultMeasurementUnit, int *aX, int *aY, wxString aActualConversion)
void SetFontProperty(XNODE *aNode, TTEXTVALUE *aTextValue, wxString aDefaultMeasurementUnit, wxString aActualConversion)
Class XNODE holds an XML or S-expression element.
Definition: xnode.h:43
void SetTextJustify(EDA_TEXT *aText, TTEXT_JUSTIFY aJustify)
int StrToIntUnits(wxString aStr, char aAxe, wxString aActualConversion)
void CorrectTextPosition(TTEXTVALUE *aValue)
void InitTTextValue(TTEXTVALUE *aTextValue)
XNODE * FindNode(XNODE *aChild, wxString aTag)
void SetTextSizeFromStrokeFontHeight(EDA_TEXT *aText, int aTextHeight)
XNODE * FindPinMap(XNODE *aNode)
void SetDoublePrecisionPosition(wxString aStr, wxString aDefaultMeasurementUnit, double *aX, double *aY, wxString aActualConversion)