Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
d2eac37d
Commit
d2eac37d
authored
Nov 23, 2009
by
stambaughw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment translation complete, Yeah!!!!
parent
8d8bdc3e
Changes
29
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
1492 additions
and
1262 deletions
+1492
-1262
genorcad.cpp
cvpcb/genorcad.cpp
+1
-1
writenetlistpcbnew.cpp
cvpcb/writenetlistpcbnew.cpp
+1
-1
block.cpp
eeschema/block.cpp
+1
-1
cleanup.cpp
eeschema/cleanup.cpp
+2
-1
netlist.cpp
eeschema/netlist.cpp
+1
-2
appl_wxstruct.h
include/appl_wxstruct.h
+62
-58
base_struct.h
include/base_struct.h
+138
-102
bitmaps.h
include/bitmaps.h
+0
-2
block_commande.h
include/block_commande.h
+47
-33
class_base_screen.h
include/class_base_screen.h
+85
-68
class_collector.h
include/class_collector.h
+34
-34
class_drawpanel.h
include/class_drawpanel.h
+59
-38
class_pcb_screen.h
include/class_pcb_screen.h
+17
-13
colors.h
include/colors.h
+13
-15
common.h
include/common.h
+130
-109
confirm.h
include/confirm.h
+4
-14
eda_doc.h
include/eda_doc.h
+14
-16
fctsys.h
include/fctsys.h
+4
-3
gestfich.h
include/gestfich.h
+35
-57
gr_basic.h
include/gr_basic.h
+159
-120
kicad_string.h
include/kicad_string.h
+55
-59
pcbcommon.h
include/pcbcommon.h
+2
-4
pcbstruct.h
include/pcbstruct.h
+79
-78
pyhandler.h
include/pyhandler.h
+9
-9
trigo.h
include/trigo.h
+18
-19
worksheet.h
include/worksheet.h
+15
-20
wxBasePcbFrame.h
include/wxBasePcbFrame.h
+170
-124
wxPcbStruct.h
include/wxPcbStruct.h
+270
-194
wxstruct.h
include/wxstruct.h
+67
-67
No files found.
cvpcb/genorcad.cpp
View file @
d2eac37d
...
...
@@ -136,7 +136,7 @@ static void TriPinsModule( COMPONENT* CurrentCmp )
}
/*
**** JP translate ****
/*
???
*
* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
...
...
cvpcb/writenetlistpcbnew.cpp
View file @
d2eac37d
...
...
@@ -162,7 +162,7 @@ void WriteFootprintFilterInfos( FILE* file, COMPONENT_LIST& list )
}
/*
*** JP translate ***
/*
???
* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
*/
...
...
eeschema/block.cpp
View file @
d2eac37d
...
...
@@ -377,7 +377,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
case
BLOCK_DRAG
:
/* move to Drag */
/*
*JP translate*
/*
???
* Effacement de la liste des structures de pointage,
* qui est devenue erronnee
*/
...
...
eeschema/cleanup.cpp
View file @
d2eac37d
...
...
@@ -145,7 +145,8 @@ void BreakSegment( SCH_SCREEN* aScreen, wxPoint aBreakpoint )
if
(
!
TestSegmentHit
(
aBreakpoint
,
segment
->
m_Start
,
segment
->
m_End
,
0
)
)
continue
;
/* * JP translate * Segment connecte: doit etre coupe en 2 si px,py
/* ???
* Segment connecte: doit etre coupe en 2 si px,py
* n'est
* pas une extremite */
if
(
(
segment
->
m_Start
==
aBreakpoint
)
...
...
eeschema/netlist.cpp
View file @
d2eac37d
...
...
@@ -891,8 +891,7 @@ static void PointToPointConnect( NETLIST_OBJECT* Ref, int IsBus, int start )
* Search if a junction is connected to segments and include the Netcode
* objects connect to the junction.
* The junction must have a valid Netcode
* The list of objects is SUPPOSED class by NumSheet *JP translate*
* Croissants,
* The list of objects is SUPPOSED class by NumSheet ??? Croissants,
* And research is done from the start element, 1st element
* Leaf schema
* (There can be no physical connection between elements of different sheets)
...
...
include/appl_wxstruct.h
View file @
d2eac37d
/************************************************************/
/* appl_wxstruct.h: */
/* descriptions des principales classes derivees utilisees: */
/* Class "EDA_Appl: classe de l'application generale */
/************************************************************/
/* Ce fichier doit etre inclus dans "wxstruct.h"
*/
/******************************************/
/* appl_wxstruct.h */
/* Base application class implementation. */
/******************************************/
#ifndef APPL_WXSTRUCT_H
#define APPL_WXSTRUCT_H
...
...
@@ -39,8 +35,10 @@ class wxHtmlHelpController;
class
WinEDA_App
:
public
wxApp
{
public
:
id_app_type
m_Id
;
/* Used mainly to handle default paths libs
* m_Id = APP_TYPE_EESCHEMA, APP_TYPE_PCBNEW ...
id_app_type
m_Id
;
/* Used mainly to handle
* default paths libs
* m_Id = APP_TYPE_EESCHEMA,
* APP_TYPE_PCBNEW ...
*/
wxString
m_Project
;
wxSingleInstanceChecker
*
m_Checker
;
...
...
@@ -53,21 +51,20 @@ public:
wxFileConfig
*
m_ProjectConfig
;
wxString
m_HelpFileName
;
wxString
m_EditorName
;
wxString
m_CurrentOptionFile
;
// dernier fichier .cnf utilis
wxString
m_CurrentOptionFile
;
wxString
m_CurrentOptionFileDateAndTime
;
wxString
m_BinDir
;
/* Chemin ou reside l'executable
* (utilis si KICAD non dfini)*/
wxString
m_KicadEnv
;
/* Chemin de kicad dfini dans la
* variable d'environnement KICAD,
* typiquement /usr/local/kicad ou
* c:\kicad */
bool
m_Env_Defined
;
// TRUE si variable d'environnement KICAD definie
wxLocale
*
m_Locale
;
// Gestion de la localisation
int
m_LanguageId
;
// indicateur de choix du langage ( 0 = defaut)
wxString
m_PdfBrowser
;
// Name of the selected browser, for browsing pdf datasheets
bool
m_PdfBrowserIsDefault
;
// True if the pdf browser is the default (m_PdfBrowser not used)
wxString
m_BinDir
;
/* Kicad executable path.*/
wxString
m_KicadEnv
;
/* environment variable KICAD */
bool
m_Env_Defined
;
// TRUE if environment KICAD is
// defined.
wxLocale
*
m_Locale
;
// The current locale.
int
m_LanguageId
;
// The current language setting.
wxString
m_PdfBrowser
;
// Name of the selected browser,
// for browsing pdf datasheets
bool
m_PdfBrowserIsDefault
;
// True if the pdf browser is the
// default (m_PdfBrowser not used)
wxPathList
m_searchPaths
;
wxFileHistory
m_fileHistory
;
...
...
@@ -77,8 +74,7 @@ protected:
wxFileName
m_projectFileName
;
wxString
m_LastVisitedLibPath
;
public
:
WinEDA_App
();
public
:
WinEDA_App
();
~
WinEDA_App
();
bool
OnInit
();
int
OnRun
();
...
...
@@ -87,7 +83,7 @@ public:
void
SetDefaultSearchPaths
(
void
);
/** Function InitEDA_Appl
* initiali
s
e some general parameters
* initiali
z
e some general parameters
* - Default paths (help, libs, bin)and configuration files names
* - Language and locale
* - fonts
...
...
@@ -95,7 +91,8 @@ public:
* @param aId = flag : LIBRARY_TYPE_EESCHEMA or LIBRARY_TYPE_PCBNEW
* used to choose what default library path must be used
*/
void
InitEDA_Appl
(
const
wxString
&
aName
,
id_app_type
aId
=
APP_TYPE_UNKOWN
);
void
InitEDA_Appl
(
const
wxString
&
aName
,
id_app_type
aId
=
APP_TYPE_UNKOWN
);
bool
SetLanguage
(
bool
first_time
=
FALSE
);
...
...
@@ -104,8 +101,9 @@ public:
* Create menu list for language choice, and add it as submenu to a main
* menu
*
* @param MasterMenu : The main menu. The sub menu list will be accessible
* from the menu item with id ID_LANGUAGE_CHOICE
* @param MasterMenu : The main menu. The sub menu list will be
* accessible from the menu item with id
* ID_LANGUAGE_CHOICE
*
* @return the sub menu Language list
*/
...
...
@@ -114,13 +112,13 @@ public:
void
SetLanguagePath
(
void
);
void
InitOnLineHelp
();
// Sauvegarde de configurations et options:
/** Function GetSettings
* Get application settings
* @param aReopenLastUsedDirectory = true to switch to last opened directory, false to use current CWD
* @param aReopenLastUsedDirectory = true to switch to last opened
* directory, false to use current CWD
* @return none
*/
void
GetSettings
(
bool
aReopenLastUsedDirectory
);
void
GetSettings
(
bool
aReopenLastUsedDirectory
);
void
SaveSettings
();
...
...
@@ -133,7 +131,8 @@ public:
/** Function SaveCurrentSetupValues()
* Save the current setup values in m_EDA_Config
* saved parameters are parameters that have the .m_Setup member set to true
* saved parameters are parameters that have the .m_Setup member set to
* true
* @param aList = array of PARAM_CFG_BASE pointers
*/
void
SaveCurrentSetupValues
(
PARAM_CFG_BASE
**
aList
);
...
...
@@ -141,7 +140,8 @@ public:
/** Function ReadCurrentSetupValues()
* Raed the current setup values previously saved, from m_EDA_Config
* saved parameters are parameters that have the .m_Setup member set to true
* saved parameters are parameters that have the .m_Setup member set to
* true
* @param aList = array of PARAM_CFG_BASE pointers
*/
void
ReadCurrentSetupValues
(
PARAM_CFG_BASE
**
aList
);
...
...
@@ -188,24 +188,28 @@ public:
return
FindLibraryPath
(
fileName
.
GetFullPath
()
);
}
/** ReturnLastVisitedLibraryPath
* Returns the last visited library directory, or (if void) the first
* path in lib path list ( but not the CWD )
* @param aSubPathToSearch = Prefered sub path to search in path list
* @param aSubPathToSearch = Prefer
r
ed sub path to search in path list
*/
wxString
ReturnLastVisitedLibraryPath
(
const
wxString
&
aSubPathToSearch
=
wxEmptyString
);
void
SaveLastVisitedLibraryPath
(
const
wxString
&
aPath
);
wxString
ReturnLastVisitedLibraryPath
(
const
wxString
&
aSubPathToSearch
=
wxEmptyString
);
void
SaveLastVisitedLibraryPath
(
const
wxString
&
aPath
);
/** ReturnFilenameWithRelativePathInLibPath
* @return a short filename (with extension) with only a relative path if
this filename
* can be found in library paths
* @return a short filename (with extension) with only a relative path if
*
this filename
can be found in library paths
* @param aFullFilename = filename with path and extension.
*/
wxString
ReturnFilenameWithRelativePathInLibPath
(
const
wxString
&
aFullFilename
);
wxString
ReturnFilenameWithRelativePathInLibPath
(
const
wxString
&
aFullFilename
);
/** Function RemoveLibraryPath
* Removes the given path(s) from the library path list
* @param aPaths = path or path list to remove. paths must be separated by ";"
* @param aPaths = path or path list to remove. paths must be separated by
* ";"
*/
void
RemoveLibraryPath
(
const
wxString
&
aPaths
);
...
...
include/base_struct.h
View file @
d2eac37d
...
...
@@ -7,7 +7,7 @@
#include "colors.h"
#if defined
(DEBUG)
#if defined(DEBUG)
#include <iostream> // needed for Show()
extern
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
wxSize
&
size
);
...
...
@@ -35,7 +35,8 @@ enum KICAD_T {
TYPE_EDGE_MODULE
,
// a footprint edge
TYPE_TRACK
,
// a track segment (segment on a copper layer)
TYPE_VIA
,
// a via (like atrack segment on a copper layer)
TYPE_ZONE
,
// a segment used to fill a zome area (segment on a copper layer)
TYPE_ZONE
,
// a segment used to fill a zone area (segment on a
// copper layer)
TYPE_MARKER_PCB
,
// a marker used to show something
TYPE_COTATION
,
// a dimension (graphic item)
TYPE_MIRE
,
// a target (graphic item)
...
...
@@ -123,7 +124,8 @@ public:
/**
* Function Inspect
* is the examining function within the INSPECTOR which is passed to the
* Iterate function. It is used primarily for searching, but not limited to
* Iterate function. It is used primarily for searching, but not limited
*to
* that. It can also collect or modify the scanned objects.
*
* @param testItem An EDA_BaseStruct to examine.
...
...
@@ -132,7 +134,7 @@ public:
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE;
*/
SEARCH_RESULT
virtual
Inspect
(
EDA_BaseStruct
*
testItem
,
SEARCH_RESULT
virtual
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
testData
)
=
0
;
};
...
...
@@ -153,17 +155,19 @@ public:
EDA_Rect
()
{
};
EDA_Rect
(
const
wxPoint
&
aPos
,
const
wxSize
&
aSize
)
:
m_Pos
(
aPos
)
,
m_Size
(
aSize
)
m_Pos
(
aPos
)
,
m_Size
(
aSize
)
{
}
wxPoint
Centre
()
{
return
wxPoint
(
m_Pos
.
x
+
(
m_Size
.
x
>>
1
),
m_Pos
.
y
+
(
m_Size
.
y
>>
1
)
);
return
wxPoint
(
m_Pos
.
x
+
(
m_Size
.
x
>>
1
),
m_Pos
.
y
+
(
m_Size
.
y
>>
1
)
);
}
void
Normalize
();
// Ensure the height and width are >= 0
void
Normalize
();
// Ensure the height and width are
// >= 0
bool
Inside
(
const
wxPoint
&
point
);
// Return TRUE if point is in Rect
bool
Inside
(
int
x
,
int
y
)
{
return
Inside
(
wxPoint
(
x
,
y
)
);
}
...
...
@@ -182,7 +186,8 @@ public:
void
SetSize
(
const
wxSize
&
size
)
{
m_Size
=
size
;
}
void
SetSize
(
int
w
,
int
h
)
{
m_Size
.
x
=
w
;
m_Size
.
y
=
h
;
}
void
Offset
(
int
dx
,
int
dy
)
{
m_Pos
.
x
+=
dx
;
m_Pos
.
y
+=
dy
;
}
void
Offset
(
const
wxPoint
&
offset
)
{
m_Pos
.
x
+=
offset
.
x
;
m_Pos
.
y
+=
offset
.
y
;
}
void
Offset
(
const
wxPoint
&
offset
)
{
m_Pos
.
x
+=
offset
.
x
;
m_Pos
.
y
+=
offset
.
y
;
}
void
SetX
(
int
val
)
{
m_Pos
.
x
=
val
;
}
void
SetY
(
int
val
)
{
m_Pos
.
y
=
val
;
}
void
SetWidth
(
int
val
)
{
m_Size
.
x
=
val
;
}
...
...
@@ -208,16 +213,16 @@ public:
operator
wxRect
()
const
{
return
wxRect
(
m_Pos
,
m_Size
);
}
/** Inflate
* Inflate this object: move each horizontal edge by dx and each vertical
edge by dy
* toward rect outside
* Inflate this object: move each horizontal edge by dx and each vertical
*
edge by dy
toward rect outside
* if dx and/or dy is negative, move toward rect inside (deflate)
* Works for positive and negative rect size
*/
EDA_Rect
&
Inflate
(
wxCoord
dx
,
wxCoord
dy
);
/** Inflate
* Inflate this object: move each horizontal edge and each vertical edge by
aDelta
* toward rect outside
* Inflate this object: move each horizontal edge and each vertical edge by
*
aDelta
toward rect outside
* if aDelta is negative, move toward rect inside (deflate)
* Works for positive and negative rect size
*/
...
...
@@ -240,9 +245,12 @@ class DHEAD;
/**
* Class EDA_BaseStruct
* is a base class for most all the kicad significant classes, used in schematics and boards.
* is a base class for most all the kicad significant classes, used in
* schematics and boards.
*/
// These define are used for the .m_Flags and .m_UndoRedoStatus member of the class EDA_BaseStruct
// These define are used for the .m_Flags and .m_UndoRedoStatus member of the
// class EDA_BaseStruct
#define IS_CHANGED (1 << 0)
#define IS_LINKED (1 << 1)
#define IN_EDIT (1 << 2)
...
...
@@ -255,13 +263,22 @@ class DHEAD;
#define STARTPOINT (1 << 9)
#define ENDPOINT (1 << 10)
#define SELECTED (1 << 11)
#define SELECTEDNODE (1 << 12) ///< flag indiquant que la structure a deja selectionnee
#define STRUCT_DELETED (1 << 13) ///< Bit flag de Status pour structures effacee
#define CANDIDATE (1 << 14) ///< flag indiquant que la structure est connectee
#define SKIP_STRUCT (1 << 15) ///< flag indiquant que la structure ne doit pas etre traitee
#define SELECTEDNODE (1 << 12) ///< flag indicating that the structure
// has already selected
#define STRUCT_DELETED (1 << 13) ///< flag indication structures to be
// erased
#define CANDIDATE (1 << 14) ///< flag indicating that the structure
// is connected
#define SKIP_STRUCT (1 << 15) ///< flag indicating that the structure
// should be ignored
#define DO_NOT_DRAW (1 << 16) ///< Used to disable draw function
#define DRAW_ERASED (1 << 17) ///< draw in background color, used by classs TRACK in gerbview
#define IS_CANCELLED (1 << 18) ///< flag set when edit dialogs are canceled when editing a new object
#define DRAW_ERASED (1 << 17) ///< draw in background color, used by
// class TRACK in gerbview
#define IS_CANCELLED (1 << 18) ///< flag set when edit dialogs are
// canceled when editing a new object
class
EDA_BaseStruct
{
...
...
@@ -269,7 +286,8 @@ private:
/**
* Run time identification, _keep private_ so it can never be changed after
* a constructor sets it. See comment near SetType() regarding virtual functions.
* a constructor sets it. See comment near SetType() regarding virtual
*functions.
*/
KICAD_T
m_StructType
;
...
...
@@ -285,10 +303,12 @@ public:
int
m_Flags
;
// flags for editing and other uses.
unsigned
long
m_TimeStamp
;
// Time stamp used for logical links
int
m_Selected
;
/* Used by block commands, and selective editing */
int
m_Selected
;
/* Used by block commands, and selective
* editing */
// member used in undo/redo function
EDA_BaseStruct
*
m_Image
;
// Link to an image copy to save a copy of old parmeters values
EDA_BaseStruct
*
m_Image
;
// Link to an image copy to save a copy of
// old parameters values
private
:
int
m_Status
;
...
...
@@ -306,8 +326,8 @@ public:
/**
* Function Type
* returns the type of object. This attribute should never be changed
after
* a constructor sets it, so there is no public "setter" method.
* returns the type of object. This attribute should never be changed
* a
fter a
constructor sets it, so there is no public "setter" method.
* @return KICAD_T - the type of object.
*/
KICAD_T
Type
()
const
{
return
m_StructType
;
}
...
...
@@ -325,7 +345,6 @@ public:
void
SetSon
(
EDA_BaseStruct
*
aSon
)
{
m_Son
=
aSon
;
}
void
SetList
(
DHEAD
*
aList
)
{
m_List
=
aList
;
}
/* Gestion de l'etat (status) de la structure (active, deleted..) */
int
GetState
(
int
type
)
const
{
...
...
@@ -352,8 +371,8 @@ public:
/**
* Function DisplayInfo
* has knowledge about the frame and how and where to put status
information
* about this object into the frame's message panel.
* has knowledge about the frame and how and where to put status
*
information
about this object into the frame's message panel.
* @param frame A WinEDA_DrawFrame in which to print status information.
*/
virtual
void
DisplayInfo
(
WinEDA_DrawFrame
*
frame
)
...
...
@@ -375,7 +394,7 @@ public:
/**
* Function HitTest (overla
ye
d)
* Function HitTest (overla
i
d)
* tests if the given EDA_Rect intersect this object.
* For now, an ending point must be inside this rect.
* @param refArea : the given EDA_Rect
...
...
@@ -389,19 +408,23 @@ public:
/**
* Function GetBoundingBox
* returns the orthogonal, bounding box of this object for display purposes.
* returns the orthogonal, bounding box of this object for display
* purposes.
* This box should be an enclosing perimeter for visible components of this
* object, and the units should be in the pcb or schematic coordinate system.
* object, and the units should be in the pcb or schematic coordinate
* system.
* It is OK to overestimate the size by a few counts.
*/
virtual
EDA_Rect
GetBoundingBox
()
{
#if defined
(DEBUG)
#if defined(DEBUG)
printf
(
"Missing GetBoundingBox()
\n
"
);
Show
(
0
,
std
::
cout
);
// tell me which classes still need GetBoundingBox support
Show
(
0
,
std
::
cout
);
// tell me which classes still need
// GetBoundingBox support
#endif
// return a zero-sized box per default. derived classes should override this
// return a zero-sized box per default. derived classes should override
// this
return
EDA_Rect
(
wxPoint
(
0
,
0
),
wxSize
(
0
,
0
)
);
}
...
...
@@ -433,7 +456,8 @@ public:
* Function Visit
* may be re-implemented for each derived class in order to handle
* all the types given by its member data. Implementations should call
* inspector->Inspect() on types in scanTypes[], and may use IterateForward()
* inspector->Inspect() on types in scanTypes[], and may use
* IterateForward()
* to do so on lists of such data.
* @param inspector An INSPECTOR instance to use in the inspection.
* @param testData Arbitrary data used by the inspector.
...
...
@@ -457,7 +481,7 @@ public:
}
#if defined
(DEBUG)
#if defined(DEBUG)
/**
* Function Show
...
...
@@ -501,7 +525,8 @@ enum GRTextVertJustifyType {
enum
GRTraceMode
{
FILAIRE
=
0
,
// segments are drawn as lines
FILLED
,
// normal mode: segments have thickness
SKETCH
// skect mode: segments have thickness, but are not filled
SKETCH
// sketcg mode: segments have thickness, but are not
// filled
};
/**
...
...
@@ -524,8 +549,8 @@ enum FILL_T {
/**
* Class EDA_TextStruct
* is a basic class to handle texts (labels, texts on components or footprints
..)
* not used directly.
* is a basic class to handle texts (labels, texts on components or footprints
*
..)
not used directly.
* The text classes are derived from EDA_BaseStruct and EDA_TextStruct
*/
class
EDA_TextStruct
...
...
@@ -538,12 +563,15 @@ public:
int
m_Orient
;
/* Orient in 0.1 degrees */
bool
m_Mirror
;
/* Display Normal / mirror */
int
m_Attributs
;
/* flags (visible...) */
bool
m_Italic
;
/* true to simulate (or use if exists) an italic font... */
bool
m_Italic
;
/* true to simulate (or use if exists)
* an italic font... */
bool
m_Bold
;
/* true to simulate a bold font ... */
GRTextHorizJustifyType
m_HJustify
;
/* Horiz justification */
GRTextVertJustifyType
m_VJustify
;
/* Vertical justification */
bool
m_MultilineAllowed
;
/* true to use multiline option, false to use only single line text
* Single line is faster in calculations than multiline */
bool
m_MultilineAllowed
;
/* true to use multiline option, false
* to use only single line text
* Single line is faster in
* calculations than multiline */
public
:
EDA_TextStruct
(
const
wxString
&
text
=
wxEmptyString
);
...
...
@@ -558,7 +586,8 @@ public:
* @param EDA_Colors aColor = text color
* @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
* @param GRTraceMode aDisplay_mode = FILAIRE, FILLED or SKETCH
* @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
* @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do
* not draw anchor ).
*/
void
Draw
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDC
,
const
wxPoint
&
aOffset
,
EDA_Colors
aColor
,
...
...
@@ -566,6 +595,7 @@ public:
EDA_Colors
aAnchor_color
=
UNSPECIFIED_COLOR
);
private
:
/** Function DrawOneLineOfText
* Draw a single text line.
* Used to draw each line of this EDA_TextStruct, that can be multiline
...
...
@@ -575,7 +605,8 @@ private:
* @param EDA_Colors aColor = text color
* @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
* @param aFillMode = FILAIRE, FILLED or SKETCH
* @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
* @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do
* not draw anchor ).
* @param EDA_Colors aText = the single line of text to draw.
* @param EDA_Colors aPos = the position of this line ).
*/
...
...
@@ -584,7 +615,9 @@ private:
int
aDrawMode
,
GRTraceMode
aFillMode
,
EDA_Colors
aAnchor_color
,
wxString
&
aText
,
wxPoint
aPos
);
public
:
/**
* Function TextHitTest
* tests if the given wxPoint is within the bounds of this object.
...
...
@@ -594,7 +627,7 @@ public:
bool
TextHitTest
(
const
wxPoint
&
ref_pos
);
/**
* Function TextHitTest (overl
ay
ed)
* Function TextHitTest (overl
oad
ed)
* tests if the given EDA_Rect intersect this object.
* For now, the anchor must be inside this rect.
* @param refArea : the given EDA_Rect
...
...
@@ -604,21 +637,24 @@ public:
/**
* Function LenSize
* @return the text leng
ht
in internal units
* @return the text leng
th
in internal units
* @param aLine : the line of text to consider.
* For single line text, this parameter is always m_Text
*/
int
LenSize
(
const
wxString
&
aLine
)
const
;
int
LenSize
(
const
wxString
&
aLine
)
const
;
/** Function GetTextBox
* useful in multiline texts to calculate the full text or a line area (for zones filling, locate functions....)
* @return the rect containing the line of text (i.e. the position and the size of one line)
* this rectangle is calculated for 0 orient text. if orient is not 0 the rect must be rotated to match the physical area
* useful in multiline texts to calculate the full text or a line area (for
* zones filling, locate functions....)
* @return the rect containing the line of text (i.e. the position and the
* size of one line)
* this rectangle is calculated for 0 orient text. if orient is not 0 the
* rect must be rotated to match the physical area
* @param aLine : the line of text to consider.
* for single line text, aLine is unused
* If aLine == -1, the full area (considering all lines) is returned
*/
EDA_Rect
GetTextBox
(
int
aLine
=
-
1
);
EDA_Rect
GetTextBox
(
int
aLine
=
-
1
);
/** Function GetInterline
* return the distance between 2 text lines
...
...
@@ -626,7 +662,7 @@ public:
*/
int
GetInterline
()
{
return
(
(
m_Size
.
y
*
13
)
/
10
)
+
m_Width
;
return
(
(
m_Size
.
y
*
13
)
/
10
)
+
m_Width
;
}
};
...
...
include/bitmaps.h
View file @
d2eac37d
// Largeur du toolbar vertical
#define VTOOLBAR_WIDTH 26
// dimension d'un tool vertical
#define TOOL_SIZE 23
// Please keep list sorted alphabetically, ignoring case.
...
...
include/block_commande.h
View file @
d2eac37d
/**
* This file is part of the common libary.
* This file is part of the common lib
r
ary.
* @file block_commande.h
* @see common.h
*/
...
...
@@ -18,19 +18,22 @@
/**************************/
/* class BLOCK_SELECTOR */
/**************************/
/**
* class BLOCK_SELECTOR is used to handle block selection and commands
*/
/* Block state codes. */
typedef
enum
{
/* definition de l'etat du block */
STATE_NO_BLOCK
,
/* Block non initialise */
STATE_BLOCK_INIT
,
/* Block initialise: 1er point defini */
STATE_BLOCK_END
,
/* Block initialise: 2eme point defini */
STATE_BLOCK_MOVE
,
/* Block en deplacement */
STATE_BLOCK_STOP
/* Block fixe (fin de deplacement) */
STATE_NO_BLOCK
,
STATE_BLOCK_INIT
,
STATE_BLOCK_END
,
STATE_BLOCK_MOVE
,
STATE_BLOCK_STOP
}
BlockState
;
/* codes des differentes commandes sur block: */
/* Block command codes. */
typedef
enum
{
BLOCK_IDLE
,
BLOCK_MOVE
,
...
...
@@ -53,13 +56,20 @@ typedef enum {
class
BLOCK_SELECTOR
:
public
EDA_BaseStruct
,
public
EDA_Rect
{
public
:
BlockState
m_State
;
/* Stae (enum BlockState) of the block */
CmdBlockType
m_Command
;
/* Type (enum CmdBlockType) d'operation */
PICKED_ITEMS_LIST
m_ItemsSelection
;
/* list of items selected in this block */
int
m_Color
;
/* Block Color (for drawings) */
wxPoint
m_MoveVector
;
/* Move distance in move, drag, copy ... command */
wxPoint
m_BlockLastCursorPosition
;
/* Last Mouse position in block command
* = last cursor position in move commands
BlockState
m_State
;
/* State (enum BlockState)
* of the block */
CmdBlockType
m_Command
;
/* Type (enum CmdBlockType)
* operation */
PICKED_ITEMS_LIST
m_ItemsSelection
;
/* list of items selected
* in this block */
int
m_Color
;
/* Block Color (for
* drawings) */
wxPoint
m_MoveVector
;
/* Move distance in move,
* drag, copy ... command */
wxPoint
m_BlockLastCursorPosition
;
/* Last Mouse position in
* block command
* = last cursor position in
* move commands
* = 0,0 in block paste */
public
:
...
...
@@ -67,9 +77,11 @@ public:
~
BLOCK_SELECTOR
();
/** function InitData
* Init the initial values of a BLOCK_SELECTOR, before starting a block command
* Init the initial values of a BLOCK_SELECTOR, before starting a block
*command
*/
void
InitData
(
WinEDA_DrawPanel
*
Panel
,
const
wxPoint
&
startpos
);
/** Function SetMessageBlock
* Displays the type of block command in the status bar of the window
*/
...
...
@@ -87,11 +99,13 @@ public:
void
PushItem
(
ITEM_PICKER
&
aItem
);
/** Function ClearListAndDeleteItems
* delete only the list of EDA_BaseStruct * pointers, AND the data pinted by m_Item
* delete only the list of EDA_BaseStruct * pointers, AND the data printed
* by m_Item
*/
void
ClearListAndDeleteItems
();
void
ClearItemsList
();
unsigned
GetCount
()
{
return
m_ItemsSelection
.
GetCount
();
...
...
@@ -100,12 +114,13 @@ public:
/* Cancel Current block operation.
*/
*/
void
AbortBlockCurrentCommand
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
);
/* Redraw the outlines of the block which shows the search area for block commands
* The first point of the rectangle showing the area is initialised
/* Redraw the outlines of the block which shows the search area for block
* commands
* The first point of the rectangle showing the area is initialized
* by InitBlockLocateDatas().
* The other point of the rectangle is the mouse cursor
*/
...
...
@@ -113,4 +128,3 @@ void DrawAndSizingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool eras
#endif
/* __INCLUDE__BLOCK_COMMANDE_H__ */
include/class_base_screen.h
View file @
d2eac37d
...
...
@@ -37,9 +37,10 @@ public:
return
*
this
;
}
const
bool
operator
==
(
const
GRID_TYPE
&
item
)
const
{
return
(
m_Size
==
item
.
m_Size
&&
m_Id
==
item
.
m_Id
)
;
return
m_Size
==
item
.
m_Size
&&
m_Id
==
item
.
m_Id
;
}
};
...
...
@@ -55,39 +56,45 @@ WX_DECLARE_OBJARRAY( GRID_TYPE, GridArray );
class
BASE_SCREEN
:
public
EDA_BaseStruct
{
public
:
wxPoint
m_DrawOrg
;
/* offsets pour tracer le circuit sur l'ecran */
wxPoint
m_Curseur
;
/* Screen cursor coordinate (on grid) in user units. */
wxPoint
m_MousePosition
;
/* Mouse cursor coordinate (off grid) in user units. */
wxPoint
m_DrawOrg
;
/* offsets for drawing the circuit on the
* screen */
wxPoint
m_Curseur
;
/* Screen cursor coordinate (on grid) in user
* units. */
wxPoint
m_MousePosition
;
/* Mouse cursor coordinate (off grid) in user
* units. */
wxPoint
m_MousePositionInPixels
;
wxPoint
m_O_Curseur
;
/* Relative Screen cursor coordinate (on grid) in user units.
wxPoint
m_O_Curseur
;
/* Relative Screen cursor coordinate (on grid)
* in user units.
* (coordinates from last reset position)*/
wxPoint
m_ScrollbarPos
;
// Position effective des Curseurs de scroll
wxSize
m_ScrollbarNumber
;
/* Valeur effective des Nombres de Scroo
l
* c.a.d taille en unites de scroll de la
* surface totale affichable */
wxPoint
m_StartVisu
;
/* Coord absolues du 1er pixel visualis�a
*
l'ecran (en nombre de pixels) *
/
wxSize
m_ScrollbarNumber
;
/* Current scroll bar posiition in scrol
l
* units. */
wxPoint
m_StartVisu
;
/* Coordinates in drawing units of the current
* view position (upper left corner of device)
*/
wxSize
m_SizeVisu
;
/* taille en pixels de l'ecran (fenetre de visu
* Utile pour recadrer les affichages lors de la
* navigation dans la hierarchie */
bool
m_Center
;
/* fix the coordinate (0,0) position on
* screen : if TRUE (0,0) in centered on screen
* TRUE: when coordinates can be < 0 and
* > 0 all but schematic
* FALSE: when coordinates can be only >= 0
bool
m_Center
;
/* Center on screen. If TRUE (0.0) is centered
* on screen coordinates can be < 0 and
* > 0 except for schematics.
* FALSE: when coordinates can only be >= 0
* Schematic */
bool
m_FirstRedraw
;
SCH_ITEM
*
EEDrawList
;
/* Object list (main data) for schematic */
// Undo/redo list of commands
UNDO_REDO_CONTAINER
m_UndoList
;
/* Objects list for the undo command (old data) */
UNDO_REDO_CONTAINER
m_RedoList
;
/* Objects list for the redo command (old data) */
UNDO_REDO_CONTAINER
m_UndoList
;
/* Objects list for the undo
* command (old data) */
UNDO_REDO_CONTAINER
m_RedoList
;
/* Objects list for the redo
* command (old data) */
unsigned
m_UndoRedoCountMax
;
// undo/Redo command Max depth
/* block control */
BLOCK_SELECTOR
m_BlockLocate
;
/* Block description for block commands */
BLOCK_SELECTOR
m_BlockLocate
;
/* Block description for block
* commands */
/* Page description */
Ki_PageDescr
*
m_CurrentSheetDesc
;
...
...
@@ -95,31 +102,33 @@ public:
int
m_NumberOfScreen
;
wxString
m_FileName
;
wxString
m_Title
;
/* titre de la feuille */
wxString
m_Date
;
/* date de mise a jour */
wxString
m_Revision
;
/* code de revision */
wxString
m_Company
;
/* nom du proprietaire */
wxString
m_Title
;
wxString
m_Date
;
wxString
m_Revision
;
wxString
m_Company
;
wxString
m_Commentaire1
;
wxString
m_Commentaire2
;
wxString
m_Commentaire3
;
wxString
m_Commentaire4
;
private
:
/* indicateurs divers */
char
m_FlagRefreshReq
;
/* indique que l'ecran doit redessine */
char
m_FlagModified
;
// indique modif du PCB,utilise pour eviter une sortie sans sauvegarde
char
m_FlagSave
;
// indique sauvegarde auto faite
char
m_FlagRefreshReq
;
/* indicates that the screen should
* be redrawn */
char
m_FlagModified
;
// indicates current drawing has
// been modified
char
m_FlagSave
;
// Perform automatica file save.
EDA_BaseStruct
*
m_CurrentItem
;
///< Currently selected object
GRID_TYPE
m_Grid
;
///< Current grid selection.
/*
Valeurs du pas de grille et du zoom
*/
/*
Grid and zoom values.
*/
public
:
GridArray
m_GridList
;
bool
m_UserGridIsON
;
wxArrayInt
m_ZoomList
;
/* Array of standard zoom coefficients. */
int
m_Zoom
;
/* Current zoom coefficient. */
int
m_ZoomScalar
;
/* Allow zooming to non-integer increments. */
int
m_ZoomScalar
;
/* Allow zooming to non-integer increments.
*/
bool
m_IsPrinting
;
public
:
...
...
@@ -138,7 +147,7 @@ public:
void
SetCurItem
(
EDA_BaseStruct
*
current
)
{
m_CurrentItem
=
current
;
}
EDA_BaseStruct
*
GetCurItem
()
const
{
return
m_CurrentItem
;
}
void
InitDatas
();
/* Inits completes des variables */
void
InitDatas
();
wxSize
ReturnPageSize
(
void
);
virtual
int
GetInternalUnits
(
void
);
...
...
@@ -154,31 +163,38 @@ public:
/** function ClearUndoORRedoList (virtual).
* this function must remove the aItemCount old commands from aList
* and delete commands, pickers and picked items if needed
* Because picked items must be deleted only if they are not in use, this is a virtual pure
* function that must be created for SCH_SCREEN and PCB_SCREEN
* Because picked items must be deleted only if they are not in use, this
* is a virtual pure function that must be created for SCH_SCREEN and
* PCB_SCREEN
* @param aList = the UNDO_REDO_CONTAINER of commands
* @param aItemCount = number of old commands to delete. -1 to remove all
old commands
* this will empty the list of commands.
* @param aItemCount = number of old commands to delete. -1 to remove all
*
old commands
this will empty the list of commands.
* Commands are deleted from the older to the last.
*/
virtual
void
ClearUndoORRedoList
(
UNDO_REDO_CONTAINER
&
aList
,
int
aItemCount
=
-
1
)
=
0
;
virtual
void
ClearUndoORRedoList
(
UNDO_REDO_CONTAINER
&
aList
,
int
aItemCount
=
-
1
)
=
0
;
/** Function ClearUndoRedoList
* clear undo and redo list, using ClearUndoORRedoList()
* picked items are deleted by ClearUndoORRedoList() according to their status
* picked items are deleted by ClearUndoORRedoList() according to their
* status
*/
virtual
void
ClearUndoRedoList
();
/** function PushCommandToUndoList
* add a command to undo in undo list
* delete the very old commands when the max count of undo commands is reached
* delete the very old commands when the max count of undo commands is
* reached
* ( using ClearUndoORRedoList)
*/
virtual
void
PushCommandToUndoList
(
PICKED_ITEMS_LIST
*
aItem
);
/** function PushCommandToRedoList
* add a command to redo in redo list
* delete the very old commands when the max count of redo commands is reached
* delete the very old commands when the max count of redo commands is
* reached
* ( using ClearUndoORRedoList)
*/
virtual
void
PushCommandToRedoList
(
PICKED_ITEMS_LIST
*
aItem
);
...
...
@@ -207,7 +223,6 @@ public:
}
/* Manipulation des flags */
void
SetRefreshReq
()
{
m_FlagRefreshReq
=
1
;
}
void
ClrRefreshReq
()
{
m_FlagRefreshReq
=
0
;
}
void
SetModify
()
{
m_FlagModified
=
1
;
m_FlagSave
=
0
;
}
...
...
@@ -219,7 +234,7 @@ public:
int
IsSave
()
{
return
m_FlagSave
&
1
;
}
//----<zoom stuff>---------------------------------------------------------
-
//----<zoom stuff>---------------------------------------------------------
/** Function GetScalingFactor
* @return the the current scale used to draw items on screen
...
...
@@ -253,7 +268,8 @@ public:
/**
* Function SetZoomList
* sets the list of zoom factors.
* @param aZoomList An array of zoom factors in ascending order, zero terminated
* @param aZoomList An array of zoom factors in ascending order, zero
* terminated
*/
void
SetZoomList
(
const
wxArrayInt
&
zoomlist
);
...
...
@@ -267,12 +283,13 @@ public:
void
Unscale
(
wxPoint
&
pt
);
void
Unscale
(
wxSize
&
sz
);
bool
SetNextZoom
();
/* ajuste le prochain coeff de zoom */
bool
SetPreviousZoom
();
/* ajuste le precedent coeff de zoom */
bool
SetFirstZoom
();
/* ajuste le coeff de zoom a 1*/
bool
SetLastZoom
();
/* ajuste le coeff de zoom au max */
bool
SetNextZoom
();
bool
SetPreviousZoom
();
bool
SetFirstZoom
();
bool
SetLastZoom
();
//----<grid stuff>----------------------------------------------------------
//----<grid
// stuff>----------------------------------------------------------
/**
* Return the command ID of the currently selected grid.
...
...
include/class_collector.h
View file @
d2eac37d
include/class_drawpanel.h
View file @
d2eac37d
...
...
@@ -3,9 +3,6 @@
* define class WinEDA_DrawPanel
*************************************/
/* Doit etre inclus dans "wxstruch.h"
*/
#ifndef PANEL_WXSTRUCT_H
#define PANEL_WXSTRUCT_H
...
...
@@ -17,49 +14,64 @@ class BASE_SCREEN;
class
PCB_SCREEN
;
/****************************************************/
/* classe representant un ecran graphique de dessin */
/****************************************************/
class
WinEDA_DrawPanel
:
public
wxScrolledWindow
{
public
:
WinEDA_DrawFrame
*
m_Parent
;
EDA_Rect
m_ClipBox
;
// the clipbox used in screen redraw (usually gives the visible area in internal units)
wxPoint
m_CursorStartPos
;
// utile dans controles du mouvement curseur
int
m_ScrollButt_unit
;
// Valeur de l'unite de scroll en pixels pour les boutons de scroll
EDA_Rect
m_ClipBox
;
// the clipbox used in screen
// redraw (usually gives the
// visible area in internal units)
wxPoint
m_CursorStartPos
;
// useful in testing the cursor
// movement
int
m_ScrollButt_unit
;
// scroll bar pixels per unit value
bool
m_AbortRequest
;
// Flag to abort long commands
bool
m_AbortEnable
;
// TRUE if abort button or menu to
// be displayed
bool
m_AbortRequest
;
// Flag d'arret de commandes longues
bool
m_AbortEnable
;
// TRUE si menu ou bouton Abort doit etre affiche
bool
m_AutoPAN_Enable
;
// TRUE to allow auto pan
bool
m_AutoPAN_Request
;
// TRUE to request an auto pan (will be made only if m_AutoPAN_Enable = true)
bool
m_AutoPAN_Request
;
// TRUE to request an auto pan
// (will be made only if
// m_AutoPAN_Enable = true)
int
m_IgnoreMouseEvents
;
// when non-zero (true), then ignore mouse events
int
m_IgnoreMouseEvents
;
// when non-zero (true), then
// ignore mouse events
bool
m_Block_Enable
;
// TRUE to accept Block Commands
int
m_CanStartBlock
;
// >= 0 (or >= n) if a block can start
bool
m_PrintIsMirrored
;
// True when drawing in mirror mode. Used in draw arc function,
// because arcs are oriented, and in mirror mode, orientations are reversed
// usefull to avoid false start block in certain cases (like switch from a sheet to an other scheet
int
m_PanelDefaultCursor
;
// Current mouse cursor default shape id for this window
int
m_PanelCursor
;
// Current mouse cursor shape id for this window
int
m_CursorLevel
;
// Index for cursor redraw in XOR mode
int
m_CanStartBlock
;
// >= 0 (or >= n) if a block can
// start
bool
m_PrintIsMirrored
;
// True when drawing in mirror
// mode. Used in draw arc function,
// because arcs are oriented, and
// in mirror mode, orientations are
// reversed
// useful to avoid false start block in certain cases (like switch from a
// sheet to an other sheet
int
m_PanelDefaultCursor
;
// Current mouse cursor default
// shape id for this window
int
m_PanelCursor
;
// Current mouse cursor shape id
// for this window
int
m_CursorLevel
;
// Index for cursor redraw in XOR
// mode
/* Cursor management (used in editing functions) */
void
(
*
ManageCurseur
)(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
bool
erase
);
/* Fonction d'affichage sur deplacement souris
* si erase : effacement ancien affichage */
void
(
*
ForceCloseManageCurseur
)(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
);
/* Fonction de fermeture forc�
* de la fonction ManageCurseur */
/* Mouse capture move callback function prototype. */
void
(
*
ManageCurseur
)(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
bool
erase
);
/* Abort managed cursor callback function prototype. */
void
(
*
ForceCloseManageCurseur
)(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
);
public
:
// Constructor and destructor
WinEDA_DrawPanel
(
WinEDA_DrawFrame
*
parent
,
int
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_DrawPanel
();
/****************************/
BASE_SCREEN
*
GetScreen
();
...
...
@@ -69,7 +81,10 @@ public:
void
OnSize
(
wxSizeEvent
&
event
);
void
SetBoundaryBox
();
void
ReDraw
(
wxDC
*
DC
,
bool
erasebg
=
TRUE
);
void
PrintPage
(
wxDC
*
DC
,
bool
Print_Sheet_Ref
,
int
PrintMask
,
bool
aPrintMirrorMode
);
void
PrintPage
(
wxDC
*
DC
,
bool
Print_Sheet_Ref
,
int
PrintMask
,
bool
aPrintMirrorMode
);
void
DrawBackGround
(
wxDC
*
DC
);
void
DrawAuxiliaryAxis
(
wxDC
*
DC
,
int
drawmode
);
void
OnEraseBackground
(
wxEraseEvent
&
event
);
...
...
@@ -83,8 +98,6 @@ public:
void
OnPan
(
wxCommandEvent
&
event
);
/*************************/
void
EraseScreen
(
wxDC
*
DC
);
void
OnScrollWin
(
wxCommandEvent
&
event
);
void
OnScroll
(
wxScrollWinEvent
&
event
);
...
...
@@ -100,7 +113,7 @@ public:
/** Function CursorRealPosition
* @return the position in user units of location ScreenPos
* @param ScreenPos = the screen (in pixel) position
c
o convert
* @param ScreenPos = the screen (in pixel) position
t
o convert
*/
wxPoint
CursorRealPosition
(
const
wxPoint
&
ScreenPos
);
...
...
@@ -116,8 +129,8 @@ public:
* along with any other recently posted rectangles is redrawn. Conversion
* to pixels is done in here.
* @param aRect The rectangle to append, it must be orthogonal
* (vertical and horizontal edges only), and it must be [,) in nature,
i.e.
* [pos, dim) == [inclusive, exclusive)
* (vertical and horizontal edges only), and it must be [,) in nature,
*
i.e.
[pos, dim) == [inclusive, exclusive)
*/
void
PostDirtyRect
(
EDA_Rect
aRect
);
...
...
@@ -132,8 +145,9 @@ public:
/**
* Function ConvertPcbUnitsToPixelsUnits
* converts a given wxPoint position (in internal units) to units of pixels,
* relative to the current draw area (origin 0,0 is the left top visible
* converts a given wxPoint position (in internal units) to units of
* pixels, relative to the current draw area (origin 0,0 is the left
* top visible
* corner of draw area) according to the current scroll and zoom.
* @param aPosition = the position to convert
*/
...
...
@@ -144,9 +158,16 @@ public:
void
MouseTo
(
const
wxPoint
&
Mouse
);
/* Cursor functions */
void
Trace_Curseur
(
wxDC
*
DC
,
int
color
=
WHITE
);
// Draw the user cursor (grid cursor)
void
CursorOff
(
wxDC
*
DC
);
// remove the grid cursor from the display
void
CursorOn
(
wxDC
*
DC
);
// display the grid cursor
void
Trace_Curseur
(
wxDC
*
DC
,
int
color
=
WHITE
);
// Draw the
// user cursor
// (grid
// cursor)
void
CursorOff
(
wxDC
*
DC
);
// remove the
// grid cursor
// from the
// display
void
CursorOn
(
wxDC
*
DC
);
// display the
// grid cursor
/**
* Release managed cursor.
...
...
include/class_pcb_screen.h
View file @
d2eac37d
/****************
**********************************************
/
/* pcbstruct.h
: definition des structures de donnees type PCB
*/
/****************
**********************************************
/
/****************/
/* pcbstruct.h */
/****************/
#ifndef __CLASSPCB_SCREEN_H__
#define __CLASSPCB_SCREEN_H__
#
/* Handle info to display a board */
class
PCB_SCREEN
:
public
BASE_SCREEN
{
public
:
int
m_Active_Layer
;
/* ref couche active */
int
m_Route_Layer_TOP
;
/* ref couches actives */
int
m_Route_Layer_BOTTOM
;
/* pour placement vias et routage 2 couches */
int
m_Active_Layer
;
int
m_Route_Layer_TOP
;
int
m_Route_Layer_BOTTOM
;
public
:
PCB_SCREEN
();
...
...
@@ -29,10 +27,14 @@ public:
/**
* Function GetCurItem
* returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem().
* returns the currently selected BOARD_ITEM, overriding
*BASE_SCREEN::GetCurItem().
* @return BOARD_ITEM* - the one selected, or NULL.
*/
BOARD_ITEM
*
GetCurItem
()
const
{
return
(
BOARD_ITEM
*
)
BASE_SCREEN
::
GetCurItem
();
}
BOARD_ITEM
*
GetCurItem
()
const
{
return
(
BOARD_ITEM
*
)
BASE_SCREEN
::
GetCurItem
();
}
/**
* Function SetCurItem
...
...
@@ -43,7 +45,7 @@ public:
/* Return true if a microvia can be put on board
* A microvia i
a a small via restricted to 2 near neighbou
r layers
* A microvia i
s a small via restricted to 2 near neighbo
r layers
* because its is hole is made by laser which can penetrate only one layer
* It is mainly used to connect BGA to the first inner layer
* And it is allowed from an external layer to the first inner layer
...
...
@@ -51,6 +53,7 @@ public:
bool
IsMicroViaAcceptable
(
void
);
/* full undo redo management : */
// use BASE_SCREEN::ClearUndoRedoList()
// use BASE_SCREEN::PushCommandToUndoList( PICKED_ITEMS_LIST* aItem )
// use BASE_SCREEN::PushCommandToRedoList( PICKED_ITEMS_LIST* aItem )
...
...
@@ -59,7 +62,8 @@ public:
* free the undo or redo list from List element
* Wrappers are deleted.
* datas pointed by wrappers are deleted if not in use in schematic
* i.e. when they are copy of a schematic item or they are no more in use (DELETED)
* i.e. when they are copy of a schematic item or they are no more in use
* (DELETED)
* @param aList = the UNDO_REDO_CONTAINER to clear
* @param aItemCount = the count of items to remove. < 0 for all items
* items are removed from the beginning of the list.
...
...
include/colors.h
View file @
d2eac37d
/************
********
/
/*
Fichier
colors.h */
/************
********
/
/************/
/* colors.h */
/************/
#ifndef _COLORS_H
#define _COLORS_H
/*
Definitions des Numeros des Couleurs ( palette de 32
) */
/*
Number of colors ( 32 bit palette.
) */
#define NBCOLOR 24
#define MASKCOLOR 31 ///< mask for color index into ColorRefs[]
///
bit indicateur d'affichage (vu / non vu) des items : (defini dans les valeurs des couleur
s
///
Flag bit display (seen / not seen) items: (defined in the color value
s
//IMB: Not used anymore #define ITEM_NOT_SHOW (1<<18) // 0x40000
/// Definition du bit de surbrillance
#define HIGHT_LIGHT_FLAG (1<<19) // 0x80000
#define HIGHT_LIGHT_FLAG ( 1<<19 ) // 0x80000
/**
...
...
@@ -102,8 +101,7 @@ static inline wxColour MakeColour( int aColor )
#endif
int
ndx
=
aColor
&
MASKCOLOR
;
return
wxColour
(
ColorRefs
[
ndx
].
m_Red
,
return
wxColour
(
ColorRefs
[
ndx
].
m_Red
,
ColorRefs
[
ndx
].
m_Green
,
ColorRefs
[
ndx
].
m_Blue
#if wxCHECK_VERSION(2,8,5)
...
...
include/common.h
View file @
d2eac37d
...
...
@@ -17,13 +17,17 @@ class WinEDA_DrawPanel;
/* Flag for special keys */
#define GR_KB_RIGHTSHIFT 0x10000000
/* Keybd states: right shift key depressed */
#define GR_KB_LEFTSHIFT 0x20000000
/* left shift key depressed */
#define GR_KB_RIGHTSHIFT 0x10000000
/* Keybd states: right
* shift key depressed */
#define GR_KB_LEFTSHIFT 0x20000000
/* left shift key depressed
*/
#define GR_KB_CTRL 0x40000000
/* CTRL depressed */
#define GR_KB_ALT 0x80000000
/* ALT depressed */
#define GR_KB_SHIFT (GR_KB_LEFTSHIFT | GR_KB_RIGHTSHIFT)
#define GR_KB_SHIFTCTRL (GR_KB_SHIFT | GR_KB_CTRL)
#define MOUSE_MIDDLE 0x08000000
/* Middle button mouse flag for block commands */
#define MOUSE_MIDDLE 0x08000000
/* Middle button mouse
* flag for block commands
*/
#define NB_ITEMS 11
...
...
@@ -104,7 +108,7 @@ private:
};
/* Cl
s
ass to handle pages sizes:
/* Class to handle pages sizes:
*/
class
Ki_PageDescr
{
...
...
@@ -144,7 +148,7 @@ extern wxString g_ProductName;
/* Default user lib path can be left void, if the standard lib path is used */
extern
wxString
g_UserLibDirBuffer
;
extern
int
g_DebugLevel
;
// 0= Pas de debug */
extern
int
g_DebugLevel
;
extern
int
g_MouseOldButtons
;
extern
int
g_KeyPressed
;
...
...
@@ -169,6 +173,7 @@ extern const wxString AllFilesWildcard;
// Name of default configuration file. (kicad.pro)
extern
wxString
g_Prj_Default_Config_FullFilename
;
// Name of local configuration file. (<curr projet>.pro)
extern
wxString
g_Prj_Config_LocalFilename
;
...
...
@@ -187,41 +192,46 @@ extern BASE_SCREEN* ActiveScreen;
/* COMMON.CPP */
/** function SetLocaleTo_C_standard
because kicad is internationalized, switch internatization to "C" standard
i.e. uses the . (dot) as separator in print/read float numbers
(some contries (France, Germany ..) use , (comma) as separator)
This function must be called before read or write ascii files using float numbers in data
the SetLocaleTo_C_standard function must be called after reading or writing the file
This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function,
but could make more easier an optional use of locale in kicad
*/
void
SetLocaleTo_C_standard
(
void
);
* because kicad is internationalized, switch internalization to "C" standard
* i.e. uses the . (dot) as separator in print/read float numbers
* (some countries (France, Germany ..) use , (comma) as separator)
* This function must be called before read or write ascii files using float
* numbers in data the SetLocaleTo_C_standard function must be called after
* reading or writing the file
*
* This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function,
* but could make more easier an optional use of locale in kicad
*/
void
SetLocaleTo_C_standard
(
void
);
/** function SetLocaleTo_Default
because kicad is internationalized, switch internatization to default
to use the default separator in print/read float numbers
(. (dot) but some contries (France, Germany ..) use , (comma) as separator)
This function must be called after a call to SetLocaleTo_C_standard
This is wrapper to the C setlocale( LC_NUMERIC, "" ) function,
but could make more easier an optional use of locale in kicad
*/
void
SetLocaleTo_Default
(
void
);
* because kicad is internationalized, switch internalization to default
* to use the default separator in print/read float numbers
* (. (dot) but some countries (France, Germany ..) use , (comma) as
* separator)
* This function must be called after a call to SetLocaleTo_C_standard
*
* This is wrapper to the C setlocale( LC_NUMERIC, "" ) function,
* but could make more easier an optional use of locale in kicad
*/
void
SetLocaleTo_Default
(
void
);
/**
* Function EnsureTextCtrlWidth
* sets the minimum pixel width on a text control in order to make a text string
* be fully visible within it. The current font within the text control is considered.
* sets the minimum pixel width on a text control in order to make a text
* string be fully visible within it. The current font within the text
* control is considered.
* The text can come either from the control or be given as an argument.
* If the text control is larger than needed, then nothing is done.
* @param aCtrl the text control to potentially make wider.
* @param aString the text that is used in sizing the control's pixel width. If NULL, then
* @param aString the text that is used in sizing the control's pixel width.
* If NULL, then
* the text already within the control is used.
* @return bool - true if the \a aCtrl had its size changed, else false.
*/
bool
EnsureTextCtrlWidth
(
wxTextCtrl
*
aCtrl
,
const
wxString
*
aString
=
NULL
);
bool
EnsureTextCtrlWidth
(
wxTextCtrl
*
aCtrl
,
const
wxString
*
aString
=
NULL
);
/**
...
...
@@ -238,7 +248,8 @@ wxString& operator <<( wxString& aString, const wxPoint& aPoint );
/**
* Function ProcessExecute
* runs a child process.
* @param aCommandLine The process and any arguments to it all in a single string.
* @param aCommandLine The process and any arguments to it all in a single
* string.
* @param aFlags The same args as allowed for wxExecute()
* @return bool - true if success, else false
*/
...
...
@@ -246,28 +257,29 @@ bool ProcessExecute( const wxString& aCommandLine,
int
aFlags
=
wxEXEC_ASYNC
);
/**
* Function ReturnPcbLayerName
* @return a wxString containing the name of the layer number "layer_number".
* @param layer_number the layer number of the layer
* @param is_filename if TRUE, the name can be used for a file name (not
* internatinalized, no space)
* internati
o
nalized, no space)
*/
wxString
ReturnPcbLayerName
(
int
layer_number
,
bool
is_filename
=
FALSE
);
wxString
ReturnPcbLayerName
(
int
layer_number
,
bool
is_filename
=
FALSE
);
/*******************/
/* about_kicad.cpp */
/*******************/
void
InitKiCadAbout
(
wxAboutDialogInfo
&
info
);
void
InitKiCadAbout
(
wxAboutDialogInfo
&
info
);
/**************/
/* common.cpp */
/**************/
wxString
GetBuildVersion
();
/* Return the build date */
wxString
GetAboutBuildVersion
();
/* Return custom build date for about dialog */
wxString
GetAboutBuildVersion
();
/* Return custom build date for about
* dialog */
/**
* function Affiche_1_Parametre
...
...
@@ -325,9 +337,12 @@ int ReturnValueFromString( int Units, const wxString& TextValue,
* @param aValue = value in Internal_Unit
* @param aInternal_Unit = units per inch for Value
* @param aAdd_unit_symbol = true to add symbol unit to the string value
* @return a wxString what contains value and optionnaly the sumbol unit (like 2.000 mm)
* @return a wxString what contains value and optionally the symbol unit (like
* 2.000 mm)
*/
wxString
ReturnStringFromValue
(
int
aUnits
,
int
aValue
,
int
aInternal_Unit
,
wxString
ReturnStringFromValue
(
int
aUnits
,
int
aValue
,
int
aInternal_Unit
,
bool
aAdd_unit_symbol
=
false
);
void
AddUnitSymbol
(
wxStaticText
&
Stext
,
int
Units
=
g_UnitMetric
);
...
...
@@ -338,24 +353,30 @@ void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value,
int
Internal_Unit
);
/* Convert the number Value in a string according to the internal units
* and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl */
* and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl
**/
int
ReturnValueFromTextCtrl
(
const
wxTextCtrl
&
TextCtr
,
int
Internal_Unit
);
/* return a String List from a string, w
h
ith a specific splitter*/
wxArrayString
*
wxStringSplit
(
wxString
txt
,
wxChar
splitter
);
/* return a String List from a string, with a specific splitter*/
wxArrayString
*
wxStringSplit
(
wxString
txt
,
wxChar
splitter
);
/**
* Function To_User_Unit
* Convert in inch or mm the variable "val" (double)given in internal units
* @return the converted value, in double
* @param is_metric : true if the result must be returned in mm , false if inches
* @param is_metric : true if the result must be returned in mm , false if
* inches
* @param val : double : the given value
* @param internal_unit_value = internal units per inch
*/
double
To_User_Unit
(
bool
is_metric
,
double
val
,
int
internal_unit_value
);
double
To_User_Unit
(
bool
is_metric
,
double
val
,
int
internal_unit_value
);
int
From_User_Unit
(
bool
is_metric
,
double
val
,
int
internal_unit_value
);
int
From_User_Unit
(
bool
is_metric
,
double
val
,
int
internal_unit_value
);
wxString
GenDate
();
void
MyFree
(
void
*
pt_mem
);
void
*
MyZMalloc
(
size_t
nb_octets
);
...
...
include/confirm.h
View file @
d2eac37d
...
...
@@ -9,27 +9,17 @@
#define __INCLUDE__CONFIRM_H__ 1
void
DisplayError
(
wxWindow
*
parent
,
const
wxString
&
msg
,
int
displaytime
=
0
);
void
DisplayInfoMessage
(
wxWindow
*
parent
,
const
wxString
&
msg
,
int
displaytime
=
0
);
/* Routines d'affichage messages ( disparait au bout de displaytime 0.1 secondes) */
void
DisplayError
(
wxWindow
*
parent
,
const
wxString
&
msg
,
int
displaytime
=
0
);
void
DisplayInfoMessage
(
wxWindow
*
parent
,
const
wxString
&
msg
,
int
displaytime
=
0
);
bool
IsOK
(
wxWindow
*
parent
,
const
wxString
&
msg
);
/* Routine affichant la fenetre "CONFIRMATION"
* Retourne 1 ou 0 selon reponse Yes / No */
int
Get_Message
(
const
wxString
&
title
,
const
wxString
&
frame_caption
,
wxString
&
buffer
,
wxWindow
*
frame
);
/* Fonction d'installation du menu de Dialogue
* entree: titre = titre a afficher
* entree/sortie :buffer : contient la reponse
* si a l'appel buffer n'est pas vide, son contenu est aussi
* affiche, mais disparait a la 1ere correction */
#endif
/* __INCLUDE__CONFIRM_H__ */
include/eda_doc.h
View file @
d2eac37d
/**
* This file is part of the common libary.
* This file is part of the common lib
r
ary.
* @file eda_doc.h
* @see common.h
*/
...
...
@@ -8,13 +8,11 @@
#define __INCLUDE__EDA_DOC_H__ 1
/* Recherche si dans le texte Database on retrouve tous les mots
* cles donnes dans KeyList ( KeyList = suite de mots cles
* separes par des espaces
* Retourne:
* 0 si aucun mot cle trouve
* 1 si mot cle trouve
/* Search the text Database for found all the key words in the KeyList.
*
* Returns:
* 0 if no keyword is found
* 1 if keyword found.
*/
int
KeyWordOk
(
const
wxString
&
KeyList
,
const
wxString
&
Database
);
...
...
@@ -23,7 +21,8 @@ int KeyWordOk( const wxString& KeyList,
* open a document (file) with the suitable browser
* @param aFrame = main frame
* @param aDocName = filename of file to open (Full filename or short filename)
* if DocName is starting by http: or ftp: or www. the default internet browser is launched
* if DocName is starting by http: or ftp: or www. the default internet
* browser is launched
* @param aPaths = a wxPathList to explore.
* if NULL or aDocName is a full filename, aPath is not used.
*/
...
...
@@ -33,4 +32,3 @@ bool GetAssociatedDocument( wxFrame* aFrame,
#endif
/* __INCLUDE__EDA_DOC_H__ */
include/fctsys.h
View file @
d2eac37d
/********************/
/*
includes systeme
*/
/*
System includes.
*/
/********************/
#ifndef FCTSYS_H
#define FCTSYS_H
...
...
@@ -56,7 +56,8 @@
#define USE_RESIZE_BORDER
#if defined(__UNIX__) || defined(USE_RESIZE_BORDER)
#define MAYBE_RESIZE_BORDER wxRESIZE_BORDER // linux users like resizeable borders
#define MAYBE_RESIZE_BORDER wxRESIZE_BORDER // linux users like resizeable
// borders
#else
#define MAYBE_RESIZE_BORDER 0 // no resizeable border
#endif
...
...
include/gestfich.h
View file @
d2eac37d
/**
* This file is part of the common libary
* This file is part of the common lib
r
ary
* TODO brief description
* @file gestfich.h
* @see common.h
...
...
@@ -25,73 +25,52 @@ bool OpenPDF( const wxString& file );
void
OpenFile
(
const
wxString
&
file
);
bool
EDA_DirectorySelector
(
const
wxString
&
Title
,
/* Titre de la fenetre */
wxString
&
Path
,
/* Chemin par defaut */
bool
EDA_DirectorySelector
(
const
wxString
&
Title
,
wxString
&
Path
,
int
flag
,
/* reserve */
wxWindow
*
Frame
,
/* parent frame */
wxWindow
*
Frame
,
const
wxPoint
&
Pos
);
wxString
EDA_FileSelector
(
const
wxString
&
Title
,
/* Window title */
const
wxString
&
Path
,
/* default path */
const
wxString
&
FileName
,
/* default filename */
const
wxString
&
Ext
,
/* default extension */
const
wxString
&
Mask
,
/* Display filename mask */
wxWindow
*
Frame
,
/* parent frame */
int
flag
,
/* wxSAVE, wxOPEN ..*/
const
bool
keep_working_directory
,
/* true = do not change the C.W.D. */
const
wxPoint
&
Pos
=
wxPoint
(
-
1
,
-
1
)
);
/* Calcule le nom complet d'un file d'apres les chaines
* dir = prefixe (chemin)
* shortname = nom avec ou sans chemin ou extension
* ext = extension
*
* si la chaine name possede deja un chemin ou une extension, elles
* ne seront pas modifiees
wxString
EDA_FileSelector
(
const
wxString
&
Title
,
const
wxString
&
Path
,
const
wxString
&
FileName
,
const
wxString
&
Ext
,
const
wxString
&
Mask
,
wxWindow
*
Frame
,
int
flag
,
const
bool
keep_working_directory
,
const
wxPoint
&
Pos
=
wxPoint
(
-
1
,
-
1
)
);
/* Return file name without path or extension.
*
* retourne la chaine calculee */
* If the path is in the default kicad path, ./ is prepended to the
* file name. If the file name has the default extension, the file
* name is returned without an extension.
*/
wxString
MakeReducedFileName
(
const
wxString
&
fullfilename
,
const
wxString
&
default_path
,
const
wxString
&
default_ext
);
/* Calcule le nom "reduit" d'un file d'apres les chaines
* fullfilename = nom complet
* default_path = prefixe (chemin) par defaut
* default_ext = extension par defaut
*
* retourne le nom reduit, c'est a dire:
* sans le chemin si le chemin est default_path
* avec ./ si si le chemin est le chemin courant
* sans l'extension si l'extension est default_ext
*
* Renvoie un chemin en notation unix ('/' en separateur de repertoire)
*/
WinEDAListBox
*
GetFileNames
(
char
*
Directory
,
char
*
Mask
);
/* Change l'extension du "filename FullFileName" en NewExt.
* Retourne FullFileName */
int
ExecuteFile
(
wxWindow
*
frame
,
const
wxString
&
ExecFile
,
const
wxString
&
param
=
wxEmptyString
);
void
AddDelimiterString
(
wxString
&
string
);
/* Find absolute path for kicad/help (or kicad/help/<language>) */
wxString
FindKicadHelpPath
();
/* Find absolute path for kicad/help (or kicad/help/<language>) */
/* Return the kicad common data path. */
wxString
ReturnKicadDatasPath
();
/* Retourne le chemin des donnees communes de kicad. */
wxString
FindKicadFile
(
const
wxString
&
shortname
);
/* Search the executable file shortname in kicad binary path and return
* full file name if found or shortname */
wxString
FindKicadFile
(
const
wxString
&
shortname
);
/**
...
...
@@ -105,4 +84,3 @@ extern wxString QuoteFullPath( wxFileName& fn,
wxPathFormat
format
=
wxPATH_NATIVE
);
#endif
/* __INCLUDE__GESTFICH_H__ */
include/gr_basic.h
View file @
d2eac37d
/**************/
/* gr_basic.h */
/**************/
/**************/
/* gr_basic.h */
/**************/
#ifndef GR_BASIC
#define GR_BASIC
...
...
@@ -10,8 +10,6 @@
class
EDA_Rect
;
/* Constantes utiles */
#define GR_COPY 0
#define GR_OR 0x01000000
#define GR_XOR 0x02000000
...
...
@@ -26,105 +24,138 @@ class EDA_Rect;
#define GR_M_DCLICK 0x80000000
/* variables generales */
extern
int
g_XorMode
;
extern
int
g_DrawBgColor
;
typedef
enum
{
/* Line styles for Get/SetLineStyle. */
typedef
enum
{
/* Line styles for Get/SetLineStyle. */
GR_SOLID_LINE
=
0
,
GR_DOTTED_LINE
=
1
,
GR_DASHED_LINE
=
3
}
GRLineStypeType
;
/*******************************************************/
/* Prototypage des fonctions definies dans gr_basic.cc */
/*******************************************************/
int
GRMapX
(
int
x
);
int
GRMapY
(
int
y
);
int
GRMapX
(
int
x
);
int
GRMapY
(
int
y
);
class
WinEDA_DrawPanel
;
/* routines generales */
void
GRSetDrawMode
(
wxDC
*
DC
,
int
mode
);
int
GRGetDrawMode
(
wxDC
*
DC
);
void
GRResetPenAndBrush
(
wxDC
*
DC
);
void
GRSetColorPen
(
wxDC
*
DC
,
int
Color
,
int
width
=
1
,
int
stype
=
wxSOLID
);
void
GRSetBrush
(
wxDC
*
DC
,
int
Color
,
int
fill
=
0
);
void
GRSetDrawMode
(
wxDC
*
DC
,
int
mode
);
int
GRGetDrawMode
(
wxDC
*
DC
);
void
GRResetPenAndBrush
(
wxDC
*
DC
);
void
GRSetColorPen
(
wxDC
*
DC
,
int
Color
,
int
width
=
1
,
int
stype
=
wxSOLID
);
void
GRSetBrush
(
wxDC
*
DC
,
int
Color
,
int
fill
=
0
);
/** function GRForceBlackPen
* @param flagforce True to force a black pen whenever the asked color
*/
void
GRForceBlackPen
(
bool
flagforce
);
void
GRForceBlackPen
(
bool
flagforce
);
/** function GetGRForceBlackPenState
* @return ForceBlackPen (True if a black pen was forced)
*/
bool
GetGRForceBlackPenState
(
void
);
void
SetPenMinWidth
(
int
minwidth
);
/* ajustage de la largeur mini de plume */
void
GRLine
(
EDA_Rect
*
aClipBox
,
wxDC
*
aDC
,
wxPoint
aStart
,
wxPoint
aEnd
,
int
aWidth
,
int
aColor
);
void
GRLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRMixedLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSMixedLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRDashedLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSDashedLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRDashedLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSDashedLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRMoveTo
(
int
x
,
int
y
);
void
GRSMoveTo
(
int
x
,
int
y
);
void
GRLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRSLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRMoveRel
(
int
x
,
int
y
);
void
GRSMoveRel
(
int
x
,
int
y
);
void
GRLineRel
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRSLineRel
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRPoly
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
n
,
wxPoint
Points
[],
bool
Fill
,
int
width
,
int
Color
,
int
BgColor
);
void
GRBezier
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
x3
,
int
y3
,
int
width
,
int
Color
);
void
GRBezier
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
x3
,
int
y3
,
int
x4
,
int
y4
,
int
width
,
int
Color
);
void
SetPenMinWidth
(
int
minwidth
);
void
GRLine
(
EDA_Rect
*
aClipBox
,
wxDC
*
aDC
,
wxPoint
aStart
,
wxPoint
aEnd
,
int
aWidth
,
int
aColor
);
void
GRLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRMixedLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSMixedLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRDashedLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSDashedLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRDashedLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSDashedLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSLine
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRMoveTo
(
int
x
,
int
y
);
void
GRSMoveTo
(
int
x
,
int
y
);
void
GRLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRSLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRMoveRel
(
int
x
,
int
y
);
void
GRSMoveRel
(
int
x
,
int
y
);
void
GRLineRel
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRSLineRel
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRPoly
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
n
,
wxPoint
Points
[],
bool
Fill
,
int
width
,
int
Color
,
int
BgColor
);
void
GRBezier
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
x3
,
int
y3
,
int
width
,
int
Color
);
void
GRBezier
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
x3
,
int
y3
,
int
x4
,
int
y4
,
int
width
,
int
Color
);
/**
* Function GRClosedPoly
* draws a closed polygon onto the drawing context \a aDC and optionally fills and/or
* draws a border around it.
* @param ClipBox defines a rectangular boundary outside of which no drawing will occur.
* draws a closed polygon onto the drawing context \a aDC and optionally fills
* and/or draws a border around it.
* @param ClipBox defines a rectangular boundary outside of which no drawing
* will occur.
* @param aDC the device context into which drawing should occur.
* @param aPointCount the number of points in the array \a aPointArray.
* @param aPointArray an array holding the wxPoints in the polygon.
* @param doFill true if polygon is to be filled, else false and only the boundary is drawn.
* @param doFill true if polygon is to be filled, else false and only the
* boundary is drawn.
* @param aPenColor the color index of the border.
* @param aFillColor the fill color of the polygon's interior.
*/
void
GRClosedPoly
(
EDA_Rect
*
ClipBox
,
wxDC
*
aDC
,
int
aPointCount
,
wxPoint
aPoints
[],
bool
doFill
,
int
aPenColor
,
int
aFillColor
);
void
GRClosedPoly
(
EDA_Rect
*
ClipBox
,
wxDC
*
aDC
,
int
aPointCount
,
wxPoint
aPoints
[],
bool
doFill
,
int
aPenColor
,
int
aFillColor
);
// @todo could make these 2 closed polygons calls a single function and default the aPenWidth argument
// @todo could make these 2 closed polygons calls a single function and default
// the aPenWidth argument
/**
* Function GRClosedPoly
* draws a closed polygon onto the drawing context \a aDC and optionally fills and/or
* draws a border around it.
* @param ClipBox defines a rectangular boundary outside of which no drawing will occur.
* draws a closed polygon onto the drawing context \a aDC and optionally fills
* and/or draws a border around it.
* @param ClipBox defines a rectangular boundary outside of which no drawing
* will occur.
* @param aDC the device context into which drawing should occur.
* @param aPointCount the number of points in the array \a aPointArray.
* @param aPointArray an array holding the wxPoints in the polygon.
* @param doFill true if polygon is to be filled, else false and only the boundary is drawn.
* @param aPenWidth is the width of the pen to use on the perimeter, can be zero.
* @param doFill true if polygon is to be filled, else false and only the
* boundary is drawn.
* @param aPenWidth is the width of the pen to use on the perimeter, can be
* zero.
* @param aPenColor the color index of the border.
* @param aFillColor the fill color of the polygon's interior.
*/
void
GRClosedPoly
(
EDA_Rect
*
ClipBox
,
wxDC
*
aDC
,
int
aPointCount
,
wxPoint
aPoints
[],
bool
doFill
,
int
aPenWidth
,
int
aPenColor
,
int
aFillColor
);
void
GRClosedPoly
(
EDA_Rect
*
ClipBox
,
wxDC
*
aDC
,
int
aPointCount
,
wxPoint
aPoints
[],
bool
doFill
,
int
aPenWidth
,
int
aPenColor
,
int
aFillColor
);
/**
* Function GRCircle
* draws a circle onto the drawing context \a aDC centered at the user coordinates (x,y)
* draws a circle onto the drawing context \a aDC centered at the user
* coordinates (x,y)
*
* @param ClipBox defines a rectangular boundary outside of which no drawing will occur.
* @param ClipBox defines a rectangular boundary outside of which no drawing
* will occur.
* @param aDC the device context into which drawing should occur.
* @param x The x coordinate in user space of the center of the circle.
* @param x The y coordinate in user space of the center of the circle.
...
...
@@ -132,58 +163,66 @@ void GRClosedPoly(EDA_Rect * ClipBox, wxDC* aDC, int aPointCount, wxPoint aPoint
* @param aColor is an index into our color table of RGB colors.
* @see EDA_Colors and colors.h
*/
void
GRCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
aDC
,
int
x
,
int
y
,
int
aRadius
,
int
aColor
);
void
GRCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
r
,
int
width
,
int
Color
);
void
GRFilledCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
r
,
int
width
,
int
Color
,
int
BgColor
);
void
GRSCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
r
,
int
width
,
int
Color
);
void
GRSFilledCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
r
,
int
width
,
int
Color
,
int
BgColor
);
void
GRArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
Color
);
void
GRArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
width
,
int
Color
);
void
GRArc1
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
xc
,
int
yc
,
int
Color
);
void
GRArc1
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
xc
,
int
yc
,
int
width
,
int
Color
);
void
GRSArc1
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
xc
,
int
yc
,
int
width
,
int
Color
);
void
GRSArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
width
,
int
Color
);
void
GRFilledArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
Color
,
int
BgColor
);
void
GRFilledArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
width
,
int
Color
,
int
BgColor
);
void
GRSFilledArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
width
,
int
Color
,
int
BgColor
);
void
GRCSegm
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRFillCSegm
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSCSegm
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSFillCSegm
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSetColor
(
int
Color
);
void
GRCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
aDC
,
int
x
,
int
y
,
int
aRadius
,
int
aColor
);
void
GRCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
r
,
int
width
,
int
Color
);
void
GRFilledCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
r
,
int
width
,
int
Color
,
int
BgColor
);
void
GRSCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
r
,
int
width
,
int
Color
);
void
GRSFilledCircle
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
r
,
int
width
,
int
Color
,
int
BgColor
);
void
GRArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
Color
);
void
GRArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
width
,
int
Color
);
void
GRArc1
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
xc
,
int
yc
,
int
Color
);
void
GRArc1
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
xc
,
int
yc
,
int
width
,
int
Color
);
void
GRSArc1
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
xc
,
int
yc
,
int
width
,
int
Color
);
void
GRSArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
width
,
int
Color
);
void
GRFilledArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
Color
,
int
BgColor
);
void
GRFilledArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
width
,
int
Color
,
int
BgColor
);
void
GRSFilledArc
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
r
,
int
width
,
int
Color
,
int
BgColor
);
void
GRCSegm
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRFillCSegm
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSCSegm
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSFillCSegm
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSetColor
(
int
Color
);
void
GRSetDefaultPalette
();
int
GRGetColor
();
void
GRPutPixel
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
color
);
void
GRSPutPixel
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
color
);
int
GRGetPixel
(
wxDC
*
DC
,
int
x
,
int
y
);
void
GRFilledRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
Color
,
int
BgColor
);
void
GRFilledRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
,
int
BgColor
);
void
GRSFilledRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
Color
,
int
BgColor
);
void
GRSFilledRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
,
int
BgColor
);
void
GRRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
Color
);
void
GRRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
Color
);
void
GRSRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRPutPixel
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
color
);
void
GRSPutPixel
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
color
);
int
GRGetPixel
(
wxDC
*
DC
,
int
x
,
int
y
);
void
GRFilledRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
Color
,
int
BgColor
);
void
GRFilledRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
,
int
BgColor
);
void
GRSFilledRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
Color
,
int
BgColor
);
void
GRSFilledRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
,
int
BgColor
);
void
GRRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
Color
);
void
GRRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRSRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
Color
);
void
GRSRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
#endif
/* define GR_BASIC */
include/kicad_string.h
View file @
d2eac37d
/**
* This file is part of the common libary \n
* This file is part of the common lib
r
ary \n
* Custom string manipulation routines.
* @file kicad_string.h
* @see common.h, string.cpp
...
...
@@ -13,75 +13,71 @@
char
*
strupper
(
char
*
Text
);
char
*
strlower
(
char
*
Text
);
/* Read string delimited with (") character.
* Upload NbMaxChar max
* Returns the number of codes read in source
* dest is terminated by NULL
*/
int
ReadDelimitedText
(
char
*
dest
,
char
*
source
,
int
NbMaxChar
);
/* lit et place dans dest la chaine de caractere trouvee dans source,
* delimitee par " .
* transfere NbMaxChar max
* retourne le nombre de codes lus dans source
* dest est termine par NULL */
/* Read one line line from a file.
* Returns the first useful line read by eliminating blank lines and comments.
*/
char
*
GetLine
(
FILE
*
File
,
char
*
Line
,
int
*
LineNum
=
NULL
,
int
SizeLine
=
255
);
/* Routine de lecture de 1 ligne utile
* retourne la 1ere ligne utile lue.
* elimine lignes vides et commentaires */
/* Remove leading and trailing whitespace.
*/
char
*
StrPurge
(
char
*
text
);
/* Supprime les caracteres Space en debut de la ligne text
* retourne un pointeur sur le 1er caractere non Space de text */
/*Return a string giving the current date and time.
*/
char
*
DateAndTime
(
char
*
line
);
wxString
DateAndTime
();
/* Retourne la chaine de caractere donnant date+heure */
/*
* Routine (compatible with qsort ()) to sort by alphabetical order.
* Equivalent to strncmp () but the numbers are compared by their integer
* value not by their ASCII code.
*/
int
StrLenNumCmp
(
const
wxChar
*
str1
,
const
wxChar
*
str2
,
int
NbMax
);
/*
* routine (compatible qsort() ) de comparaision pour classement alphab�tique
* Analogue a strncmp() mais les nombres sont compar�s selon leur valeur num�rique
* et non pas par leur code ascii */
* Routine (compatible with qsort ()) to sort by case insensitive alphabetical
* order.
* Equivalent to strnicmp () but the numbers are compared by their integer
* value not by their ASCII code.
*/
int
StrNumICmp
(
const
wxChar
*
str1
,
const
wxChar
*
str2
);
/* routine (compatible qsort() ) de comparaison pour classement alphab�tique,
* avec lower case == upper case.
* Analogue a stricmp() mais les nombres sont compar�s selon leur valeur num�rique
* et non pas par leur code ascii */
int
StrLenNumICmp
(
const
wxChar
*
str1
,
const
wxChar
*
str2
,
int
NbMax
);
/* routine (compatible qsort() ) de comparaison pour classement alphab�tique,
* avec lower case == upper case.
* Analogue a stricmp() mais les nombres sont compar�s selon leur valeur num�rique
* et non pas par leur code ascii */
/* Compare string against wild card pattern using the usual rules.
* (Wildcards *,?).
* The reference string is "pattern"
* If case_sensitive == TRUE (default), exact comparison
* Returns TRUE if pattern matched otherwise FALSE.
*/
bool
WildCompareString
(
const
wxString
&
pattern
,
const
wxString
&
string_to_tst
,
bool
case_sensitive
=
TRUE
);
/* compare 2 noms de composants, selon regles usuelles
* ( Jokers * , ? , autorises).
* la chaine de reference est "pattern"
* si case_sensitive == TRUE (default), comparaison exacte
* retourne TRUE si match FALSE si differences */
/* Replaces decimal point with commas to generated international numbers.
*/
char
*
to_point
(
char
*
Text
);
/* convertit les , en . dans une chaine. utilise pour compenser la fct printf
* qui genere les flottants avec une virgule au lieu du point en mode international */
#endif
/* __INCLUDE__KICAD_STRING_H__ */
include/pcbcommon.h
View file @
d2eac37d
...
...
@@ -5,7 +5,7 @@
#include "pcbstruct.h"
#include "dlist.h"
#define L_MIN_DESSIN 1
/* Min width segments to allow draws with tickness */
#define L_MIN_DESSIN 1
/* Min width segments to allow draws with t
h
ickness */
class
DPAD
;
class
BOARD_ITEM
;
...
...
@@ -44,8 +44,6 @@ extern int g_PadCUColor;
extern
int
g_PadCMPColor
;
/* variables generales */
extern
int
g_TimeOut
;
// Timer for automatic saving
extern
int
g_SaveTime
;
// Time for next saving
...
...
@@ -59,7 +57,7 @@ extern DLIST<TRACK> g_CurrentTrackList;
#define g_FirstTrackSegment \
g_CurrentTrackList.GetFirst() ///< first segment created
extern
PCB_SCREEN
*
ScreenPcb
;
/* Ecran principal */
extern
PCB_SCREEN
*
ScreenPcb
;
extern
BOARD
*
g_ModuleEditor_Pcb
;
/* Pad editing */
...
...
include/pcbstruct.h
View file @
d2eac37d
...
...
@@ -9,50 +9,48 @@
#include "class_base_screen.h"
#include "class_board_item.h"
// Definitions relatives aux lib
ari
ries
// Definitions relatives aux lib
ra
ries
#define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1"
#define ENTETE_LIBDOC "PCBNEW-LibDoc----V1"
#define L_ENTETE_LIB 18
#define EXT_DOC wxT( "mdc" )
/* Bits indicateurs du membre .Status, pour pistes, modules... */
#define FLAG1 (1 << 13)
/* flag for free local computations */
#define FLAG0 (1 << 12)
/* flag for free local computations */
#define BEGIN_ONPAD (1 << 11)
/* flag indicating a start of segment pad */
#define END_ONPAD (1 << 10)
/* flag indicating an end of segment pad */
#define BUSY (1 << 9)
/* flag indicating that the structure has
* already been edited, in some routines */
#define DELETED (1 << 8)
/* flag indicating structures erased nd set
* string "DELETED" */
#define NO_TRACE (1 << 7)
/* The element must not be displayed */
#define FLAG1 (1 << 13)
/* flag libre pour calculs locaux */
#define FLAG0 (1 << 12)
/* flag libre pour calculs locaux */
#define BEGIN_ONPAD (1 << 11)
/* flag indiquant un debut de segment sur pad */
#define END_ONPAD (1 << 10)
/* flag indiquant une fin de segment sur pad */
#define BUSY (1 << 9)
/* flag indiquant que la structure a deja
* ete examinee, dans certaines routines */
#define DELETED (1 << 8)
/* Bit flag de Status pour structures effacee
* et mises en chaine "DELETED" */
#define NO_TRACE (1 << 7)
/* l'element ne doit pas etre affiche */
#define SURBRILL (1 << 5)
/* element en surbrillance */
#define DRAG (1 << 4)
/* segment en mode drag */
#define EDIT (1 << 3)
/* element en cours d'edition */
#define SEGM_FIXE (1 << 2)
/* segment FIXE ( pas d'effacement global ) */
#define SEGM_AR (1 << 1)
/* segment Auto_Route */
#define CHAIN (1 << 0)
/* segment marque */
#define SURBRILL (1 << 5)
/* element highlighted */
#define DRAG (1 << 4)
/* segment in drag mode */
#define EDIT (1 << 3)
/* element being edited */
#define SEGM_FIXE (1 << 2)
/* segment fixed (not erase global) */
#define SEGM_AR (1 << 1)
/* segment marked for auto routing */
#define CHAIN (1 << 0)
/* mark segment */
/* Layer identification (layer number) */
#define FIRST_COPPER_LAYER 0
#define COPPER_LAYER_N 0
#define LAYER_N_2 1
/* Numero layer 2 */
#define LAYER_N_3 2
/* Numero layer 3 */
#define LAYER_N_4 3
/* Numero layer 4 */
#define LAYER_N_5 4
/* Numero layer 5 */
#define LAYER_N_6 5
/* Numero layer 6 */
#define LAYER_N_7 6
/* Numero layer 7 */
#define LAYER_N_8 7
/* Numero layer 8 */
#define LAYER_N_9 8
/* Numero layer 9 */
#define LAYER_N_10 9
/* Numero layer 10 */
#define LAYER_N_11 10
/* Numero layer 11 */
#define LAYER_N_12 11
/* Numero layer 12 */
#define LAYER_N_13 12
/* Numero layer 13 */
#define LAYER_N_14 13
/* Numero layer 14 */
#define LAYER_N_15 14
/* Numero layer 15 */
#define LAYER_N_2 1
#define LAYER_N_3 2
#define LAYER_N_4 3
#define LAYER_N_5 4
#define LAYER_N_6 5
#define LAYER_N_7 6
#define LAYER_N_8 7
#define LAYER_N_9 8
#define LAYER_N_10 9
#define LAYER_N_11 10
#define LAYER_N_12 11
#define LAYER_N_13 12
#define LAYER_N_14 13
#define LAYER_N_15 14
#define LAYER_CMP_N 15
#define CMP_N 15
#define LAST_COPPER_LAYER 15
...
...
@@ -78,9 +76,6 @@
#define LAYER_COUNT 32
/*************************************/
/* constantes de gestion des couches */
/*************************************/
#define CUIVRE_LAYER (1 << COPPER_LAYER_N) ///< bit mask for copper layer
#define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2
#define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3
...
...
@@ -115,15 +110,14 @@
#define LAST_NON_COPPER_LAYER EDGE_N
// extra bits 0xE0000000
/* Helpful global layers ma
ks
: */
/* Helpful global layers ma
sk
: */
#define ALL_LAYERS 0x1FFFFFFF // Pcbnew used 29 layers
#define FULL_LAYERS 0xFFFFFFFF // Gerbview used 32 layers
#define ALL_NO_CU_LAYERS 0x1FFF0000
#define ALL_CU_LAYERS 0x0000FFFF
#define INTERNAL_LAYERS 0x00007FFE
/* Bits layers internes */
#define INTERNAL_LAYERS 0x00007FFE
#define EXTERNAL_LAYERS 0x00008001
/* Forward declaration */
class
NETINFO_ITEM
;
class
MARKER_PCB
;
class
RATSNEST_ITEM
;
...
...
@@ -155,7 +149,7 @@ enum ELEMENTS_NUMBERS
* tests whether a given integer is a valid layer index
* @param aLayerIndex = Layer index to test
* @return true if aLayerIndex is a valid layer index
*/
*/
inline
bool
IsValidLayerIndex
(
int
aLayerIndex
)
{
return
aLayerIndex
>=
0
&&
aLayerIndex
<
NB_LAYERS
;
...
...
@@ -166,10 +160,11 @@ inline bool IsValidLayerIndex( int aLayerIndex )
* tests whether an integer is a valid copper layer index
* @param aLayerIndex = Layer index to test
* @return true if aLayerIndex is a valid copper layer index
*/
*/
inline
bool
IsValidCopperLayerIndex
(
int
aLayerIndex
)
{
return
aLayerIndex
>=
FIRST_COPPER_LAYER
&&
aLayerIndex
<=
LAST_COPPER_LAYER
;
return
aLayerIndex
>=
FIRST_COPPER_LAYER
&&
aLayerIndex
<=
LAST_COPPER_LAYER
;
}
/**
...
...
@@ -177,10 +172,11 @@ inline bool IsValidCopperLayerIndex( int aLayerIndex )
* tests whether an integer is a valid non copper layer index
* @param aLayerIndex = Layer index to test
* @return true if aLayerIndex is a valid non copper layer index
*/
*/
inline
bool
IsValidNonCopperLayerIndex
(
int
aLayerIndex
)
{
return
aLayerIndex
>=
FIRST_NO_COPPER_LAYER
&&
aLayerIndex
<=
LAST_NO_COPPER_LAYER
;
return
aLayerIndex
>=
FIRST_NO_COPPER_LAYER
&&
aLayerIndex
<=
LAST_NO_COPPER_LAYER
;
}
...
...
@@ -205,11 +201,6 @@ enum DisplayViaMode {
#include "class_module.h" // Class for the footprint
#include "class_netinfo.h" // Class for nets
/***********************************/
/* Description des elements du PCB */
/***********************************/
#include "class_drawsegment.h"
#include "class_pcb_text.h"
#include "class_cotation.h"
...
...
@@ -219,15 +210,23 @@ enum DisplayViaMode {
#include "class_zone.h"
/* Values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option
* This parameter controls how to show tracks and vias clerance area
* This parameter controls how to show tracks and vias cle
a
rance area
*/
enum
ShowTrackClearanceModeList
{
DO_NOT_SHOW_CLEARANCE
=
0
,
// Do not show clearance areas
SHOW_CLEARANCE_NEW_TRACKS
,
// Show clearance areas only for new track during track creation
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS
,
/* Show clrearance areas only for new track during track creation,
* and shows a via clearnce area at end of current new segment (guide to place a nev via
SHOW_CLEARANCE_NEW_TRACKS
,
/* Show clearance areas only
* for new track during track
* creation */
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS
,
/* Show clearance areas only
* for new track during track
* creation, and shows a via
* clearance area at end of
* current new segment (guide
* to place a new via
*/
SHOW_CLEARANCE_ALWAYS
/* Show Always clearance areas
* for track and vias
*/
SHOW_CLEARANCE_ALWAYS
// Show Always clearance areas for track and vias
};
class
DISPLAY_OPTIONS
...
...
@@ -246,7 +245,9 @@ public:
* 0 = do not show clearance
* 1 = show track clearance
* 2 = show clearance + via area
* (useful to know what clearance area is neede if we want to put a via on terminal track point)
* (useful to know what clearance area is
* needed if we want to put a via on
* terminal track point)
*/
int
m_DisplayViaMode
;
/* 0 do not show via hole,
...
...
include/pyhandler.h
View file @
d2eac37d
...
...
@@ -64,7 +64,7 @@ protected:
public
:
// Singlet
t
on handling:
// Singleton handling:
static
PyHandler
*
GetInstance
();
~
PyHandler
();
...
...
include/trigo.h
View file @
d2eac37d
/****************************************************/
/* TRIGO.H : Tables de fonctions trigonometriques */
/* utilisees dans les rotations d'axes */
/****************************************************/
/*************/
/* trigo.h */
/*************/
#ifndef TRIGO_H
#define TRIGO_H
/* Prototype des fonctions de trigo.cpp */
void
RotatePoint
(
int
*
pX
,
int
*
pY
,
int
angle
);
void
RotatePoint
(
int
*
pX
,
int
*
pY
,
int
cx
,
int
cy
,
int
angle
);
void
RotatePoint
(
wxPoint
*
point
,
int
angle
);
...
...
@@ -15,11 +13,11 @@ void RotatePoint( wxPoint *point, const wxPoint & centre, int angle );
void
RotatePoint
(
double
*
pX
,
double
*
pY
,
int
angle
);
void
RotatePoint
(
double
*
pX
,
double
*
pY
,
double
cx
,
double
cy
,
int
angle
);
/*
* function ArcTangente
Retourne l'arc tangente en 0.1 degres du vecteur de coord dx, dy
entre -1800 et 1800
Analogue a atan2 ( mais plus rapide pour les caculs si
l'angle est souvent 0, -1800, ou +- 900
*/
/*
Return the arc tangent of 0.1 degrees coord vector dx, dy
* between -1800 and 1800
* Equivalent to atan2 (but faster for calculations if
* the angle is 0 to -1800, or + - 900
*/
int
ArcTangente
(
int
dy
,
int
dx
);
bool
DistanceTest
(
int
seuil
,
int
dx
,
int
dy
,
int
spot_cX
,
int
spot_cY
);
...
...
@@ -33,20 +31,21 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY );
* @param aEnd is the second end-point of the line segment
* @param aDist = maximum distance for hit
*/
bool
TestSegmentHit
(
wxPoint
aRefPoint
,
wxPoint
aStart
,
wxPoint
aEnd
,
int
aDist
);
bool
TestSegmentHit
(
wxPoint
aRefPoint
,
wxPoint
aStart
,
wxPoint
aEnd
,
int
aDist
);
/*******************/
/* Macro NEW_COORD */
/*******************/
/*
Macro de calcul de novelles coordonnees par rotation d'axe
coord : xrot = y*sin + x*
cos
yrot = y*cos - x*sin
soit : xrot = (y*tg + x)*
cos
yrot = (y - x*tg)*
cos
les coeffs COS sont tabules en fct de tg sur 16 valeur
s.
*/
/*
Calculate coordinates to rotate around an axis
* coord: xrot = y + x * sin *
cos
* yrot = y * cos - sin * x
* either: xrot = (y + x * tg) *
cos
* yrot = (y - x * tg) *
cos
*
* Cosine coefficients are loaded from a trigometric table by 16 bit value
s.
*/
#define NEW_COORD( x0, y0 ) \
do { \
int itmp; \
...
...
include/worksheet.h
View file @
d2eac37d
/***************************************************/
/* WORKSHEET.H: constantes pour trace du cartouche */
/***************************************************/
/****************************/
/* Description du cartouche */
/****************************/
/***************/
/* worksheet.h */
/***************/
/* Values are in 1/1000 inch */
#ifndef __WORKSHEET_H__
#define __WORKSHEET_H__
#define GRID_REF_W 70
/* h
auteur de la bande de reference grille
*/
#define SIZETEXT 60
/*
Dimension des textes du cartouch
e */
#define SIZETEXT_REF 50
/*
Dimension des lettres du marquage des reperes
*/
#define PAS_REF 2000
/*
pas des marquages de reference des reperes
*/
#define GRID_REF_W 70
/* h
eight of the band reference grid
*/
#define SIZETEXT 60
/*
worksheet text siz
e */
#define SIZETEXT_REF 50
/*
worksheet frame reference text size
*/
#define PAS_REF 2000
/*
no reference markings on worksheet frame
*/
#define TEXT_VTAB_HEIGHT SIZETEXT * 2
#if defined(KICAD_GOST)
/* Shtamp */
#define STAMP_OX 185 * 10000 / 254
#define STAMP_OY 55 * 10000 / 254
...
...
@@ -69,8 +64,8 @@
#define STAMP_25 25 * 10000 / 254
#endif
/*
Les coord ci dessous sont relatives au coin bas - droit de la feuille, et
*
seront soustraires de cette origine
/*
The coordinates below are relative to the bottom right corner of page and
*
will be subtracted from this origin.
*/
#define BLOCK_OX 4200
#define BLOCK_KICAD_VERSION_X BLOCK_OX - SIZETEXT
...
...
@@ -100,15 +95,15 @@
struct
Ki_WorkSheetData
{
public
:
int
m_Type
;
/* nombre permettant de reconnaitre la description */
int
m_Type
;
Ki_WorkSheetData
*
Pnext
;
int
m_Posx
,
m_Posy
;
/* position de l'element ou point de depart du segment */
int
m_Endx
,
m_Endy
;
/* extremite d'un element type segment ou cadre */
const
wxChar
*
m_Legende
;
/* Pour m_Textes: texte a afficher avant le texte lui meme */
const
wxChar
*
m_Text
;
/* Pour m_Textes:pointeur sur le texte a afficher */
int
m_Posx
,
m_Posy
;
int
m_Endx
,
m_Endy
;
const
wxChar
*
m_Legende
;
const
wxChar
*
m_Text
;
};
/*
Type des descriptions Ki_WorkSheetData
*/
/*
Work sheet structure type definitions.
*/
enum
TypeKi_WorkSheetData
{
WS_DATE
,
WS_REV
,
...
...
include/wxBasePcbFrame.h
View file @
d2eac37d
...
...
@@ -56,7 +56,8 @@ public:
int
m_DisplayModEdge
;
// How show module drawings
int
m_DisplayModText
;
// How show module texts
bool
m_DisplayPcbTrackFill
;
/* FALSE : tracks are show in sketch mode, TRUE = filled */
bool
m_DisplayPcbTrackFill
;
/* FALSE : tracks are show in sketch mode,
* TRUE = filled */
int
m_UserGridUnits
;
wxRealPoint
m_UserGridSize
;
...
...
@@ -96,15 +97,21 @@ public:
virtual
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
)
{
}
virtual
void
ReCreateHToolbar
()
=
0
;
virtual
void
ReCreateVToolbar
()
=
0
;
virtual
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
void
ReCreateMenuBar
();
virtual
void
SetToolID
(
int
id
,
int
new_cursor_id
,
const
wxString
&
title
);
virtual
void
UpdateStatusBar
();
PCB_SCREEN
*
GetScreen
()
const
{
return
(
PCB_SCREEN
*
)
WinEDA_DrawFrame
::
GetBaseScreen
();
}
PCB_SCREEN
*
GetScreen
()
const
{
return
(
PCB_SCREEN
*
)
WinEDA_DrawFrame
::
GetBaseScreen
();
}
BASE_SCREEN
*
GetBaseScreen
()
const
;
...
...
@@ -114,11 +121,13 @@ public:
public
:
// Read/write f
o
nctions:
// Read/write f
u
nctions:
EDA_BaseStruct
*
ReadDrawSegmentDescr
(
FILE
*
File
,
int
*
LineNum
);
int
ReadListeSegmentDescr
(
FILE
*
File
,
TRACK
*
PtSegm
,
int
StructType
,
int
*
LineNum
,
int
NumSegm
);
TRACK
*
PtSegm
,
int
StructType
,
int
*
LineNum
,
int
NumSegm
);
int
ReadSetup
(
FILE
*
File
,
int
*
LineNum
);
int
ReadGeneralDescrPcb
(
FILE
*
File
,
int
*
LineNum
);
...
...
@@ -128,15 +137,16 @@ public:
* Function PcbGeneralLocateAndDisplay
* searches for an item under the mouse cursor.
* Items are searched first on the current working layer.
* If nothing found, an item will be searched without layer restriction. If
* more than one item is found meeting the current working layer criterion, then
* a popup menu is shown which allows the user to pick which item he/she is
* interested in. Once an item is chosen, then it is make the "current item"
* and the status window is updated to reflect this.
* If nothing found, an item will be searched without layer restriction.
* If more than one item is found meeting the current working layer
* criterion, then a popup menu is shown which allows the user to pick
* which item he/she is interested in. Once an item is chosen, then it
* is make the "current item" and the status window is updated to reflect
* this.
*
* @param aHotKeyCode The hotkey which relates to the caller and determines
the
*
type of search to be performed. If zero, then the mouse tools will be
* tested instead.
* @param aHotKeyCode The hotkey which relates to the caller and determines
*
the type of search to be performed. If zero, then
*
the mouse tools will be
tested instead.
*/
BOARD_ITEM
*
PcbGeneralLocateAndDisplay
(
int
aHotKeyCode
=
0
);
...
...
@@ -150,53 +160,65 @@ public:
* of "selecting" an item more formal, and to indivisibly tie the operation
* of selecting an item to displaying it using BOARD_ITEM::Display_Infos().
* @param aItem The BOARD_ITEM to make the selected item or NULL if none.
* @param aDisplayInfo = true to display item info, false if not (default = true)
* @param aDisplayInfo = true to display item info, false if not (default =
*true)
*/
void
SetCurItem
(
BOARD_ITEM
*
aItem
,
bool
aDisplayInfo
=
true
);
void
SetCurItem
(
BOARD_ITEM
*
aItem
,
bool
aDisplayInfo
=
true
);
BOARD_ITEM
*
GetCurItem
();
/**
* Function GetCollectorsGuide
* @return GENERAL_COLLECTORS_GUIDE - that considers the global configuration options.
* @return GENERAL_COLLECTORS_GUIDE - that considers the global
*configuration options.
*/
GENERAL_COLLECTORS_GUIDE
GetCollectorsGuide
();
/**
* Function CursorGoto
* positions the cursor at a given coordinate and reframes the drawing if the
* positions the cursor at a given coordinate and reframes the drawing if
*the
* requested point is out of view.
* @param aPos The point to go to.
*/
void
CursorGoto
(
const
wxPoint
&
aPos
);
/* Place un repere sur l'ecran au point de coordonnees PCB pos */
void
place_marqueur
(
wxDC
*
DC
,
const
wxPoint
&
pos
,
char
*
pt_bitmap
,
int
DrawMode
,
int
color
,
int
type
);
void
place_marqueur
(
wxDC
*
DC
,
const
wxPoint
&
pos
,
char
*
pt_bitmap
,
int
DrawMode
,
int
color
,
int
type
);
// Gestion des modules
MODULE
*
Copie_Module
(
MODULE
*
module
);
/** Function Save_Module_In_Library
* Save in an existing library a given footprint
* @param aLibName = name of the library to use
* @param aModule = the given footprint
* @param aOverwrite = true to overwrite an existing footprint, false to abort an existing footprint is found
* @param aDisplayDialog = true to display a dialog to enter or confirm the footprint name
* @param aOverwrite = true to overwrite an existing footprint, false to
* abort an existing footprint is found
* @param aDisplayDialog = true to display a dialog to enter or confirm the
* footprint name
* @param aCreateDocFile = true to creates the associated doc file
* @return : 1 if OK,0 if abort
*/
int
Save_Module_In_Library
(
const
wxString
&
aLibName
,
MODULE
*
aModule
,
bool
aOverwrite
,
bool
aDisplayDialog
,
bool
aCreateDocFile
);
MODULE
*
aModule
,
bool
aOverwrite
,
bool
aDisplayDialog
,
bool
aCreateDocFile
);
void
Archive_Modules
(
const
wxString
&
LibName
,
bool
NewModulesOnly
);
void
Archive_Modules
(
const
wxString
&
LibName
,
bool
NewModulesOnly
);
MODULE
*
Select_1_Module_From_BOARD
(
BOARD
*
Pcb
);
MODULE
*
GetModuleByName
();
// Modules (footprints)
MODULE
*
Create_1_Module
(
wxDC
*
DC
,
const
wxString
&
module_name
);
MODULE
*
Create_1_Module
(
wxDC
*
DC
,
const
wxString
&
module_name
);
void
Edit_Module
(
MODULE
*
module
,
wxDC
*
DC
);
void
Rotate_Module
(
wxDC
*
DC
,
MODULE
*
module
,
...
...
@@ -210,13 +232,16 @@ public:
void
RotateTextModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
DeleteTextModule
(
TEXTE_MODULE
*
Text
);
void
PlaceTexteModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
StartMoveTexteModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
void
StartMoveTexteModule
(
TEXTE_MODULE
*
Text
,
wxDC
*
DC
);
TEXTE_MODULE
*
CreateTextModule
(
MODULE
*
Module
,
wxDC
*
DC
);
void
InstallPadOptionsFrame
(
D_PAD
*
pad
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
InstallTextModOptionsFrame
(
TEXTE_MODULE
*
TextMod
,
wxDC
*
DC
);
void
InstallPadOptionsFrame
(
D_PAD
*
pad
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
InstallTextModOptionsFrame
(
TEXTE_MODULE
*
TextMod
,
wxDC
*
DC
);
// Pads sur modules
void
AddPad
(
MODULE
*
Module
,
bool
draw
);
void
DeletePad
(
D_PAD
*
Pad
);
void
StartMovePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
...
...
@@ -224,7 +249,8 @@ public:
void
PlacePad
(
D_PAD
*
Pad
,
wxDC
*
DC
);
void
Export_Pad_Settings
(
D_PAD
*
aPad
);
void
Import_Pad_Settings
(
D_PAD
*
aPad
,
bool
aDraw
);
void
Global_Import_Pad_Settings
(
D_PAD
*
aPad
,
bool
aDraw
);
void
Global_Import_Pad_Settings
(
D_PAD
*
aPad
,
bool
aDraw
);
// loading footprints
...
...
@@ -232,8 +258,9 @@ public:
/** function Get_Librairie_Module
*
* Read active libraries or one library to find and load a given module
* If found the lodule is linked to the tail of linked list of modules
* @param aLibrary: the full filename of the library to read. If empty, all active libraries are read
* If found the module is linked to the tail of linked list of modules
* @param aLibrary: the full filename of the library to read. If empty,
* all active libraries are read
* @param aModuleName = module name to load
* @param aDisplayMessageError = true to display an error message if any.
* @return a MODULE * pointer to the new module, or NULL
...
...
@@ -245,12 +272,16 @@ public:
/** Function Select_1_Module_From_List
* Display a list of modules found in active libraries or a given library
* @param aLibraryFullFilename = library to list (if aLibraryFullFilename == void, list all modules)
* @param aMask = Display filter (wildcart)( Mask = wxEmptyString if not used )
* @param aKeyWord = keyword list, to display a filtered list of module having one (or more) of these keyworks in their keywork list
* ( aKeyWord = wxEmptyString if not used )
* @param aLibraryFullFilename = library to list (if aLibraryFullFilename
* == void, list all modules)
* @param aMask = Display filter (wildcart)( Mask = wxEmptyString if not
* used )
* @param aKeyWord = keyword list, to display a filtered list of module
* having one (or more) of these keywords in their
* keyword list ( aKeyWord = wxEmptyString if not used )
*
* @return wxEmptyString if abort or fails, or the selected module name if Ok
* @return wxEmptyString if abort or fails, or the selected module name if
* Ok
*/
wxString
Select_1_Module_From_List
(
WinEDA_DrawFrame
*
active_window
,
const
wxString
&
aLibraryFullFilename
,
...
...
@@ -259,7 +290,7 @@ public:
MODULE
*
Load_Module_From_Library
(
const
wxString
&
library
,
wxDC
*
DC
);
// ratsnest functions
void
Compile_Ratsnest
(
wxDC
*
DC
,
bool
affiche
);
/* Recalcul complet du chevelu */
void
Compile_Ratsnest
(
wxDC
*
DC
,
bool
affiche
);
int
Test_1_Net_Ratsnest
(
wxDC
*
DC
,
int
net_code
);
void
build_ratsnest_module
(
wxDC
*
DC
,
MODULE
*
Module
);
void
trace_ratsnest_module
(
wxDC
*
DC
);
...
...
@@ -278,28 +309,42 @@ public:
/* Plotting functions:
*/
void
ToPlotter
(
wxCommandEvent
&
event
);
void
Genere_GERBER
(
const
wxString
&
FullFileName
,
int
Layer
,
bool
PlotOriginIsAuxAxis
,
GRTraceMode
trace_mode
);
void
Genere_HPGL
(
const
wxString
&
FullFileName
,
int
Layer
,
GRTraceMode
trace_mode
);
void
Genere_GERBER
(
const
wxString
&
FullFileName
,
int
Layer
,
bool
PlotOriginIsAuxAxis
,
GRTraceMode
trace_mode
);
void
Genere_HPGL
(
const
wxString
&
FullFileName
,
int
Layer
,
GRTraceMode
trace_mode
);
void
Genere_PS
(
const
wxString
&
FullFileName
,
int
Layer
,
bool
useA4
,
GRTraceMode
trace_mode
);
void
Genere_DXF
(
const
wxString
&
FullFileName
,
int
Layer
,
GRTraceMode
trace_mode
);
void
Plot_Layer
(
PLOTTER
*
plotter
,
int
Layer
,
GRTraceMode
trace_mode
);
void
Genere_DXF
(
const
wxString
&
FullFileName
,
int
Layer
,
GRTraceMode
trace_mode
);
void
Plot_Layer
(
PLOTTER
*
plotter
,
int
Layer
,
GRTraceMode
trace_mode
);
void
Plot_Standard_Layer
(
PLOTTER
*
aPlotter
,
int
aLayerMask
,
bool
aPlotVia
,
GRTraceMode
aPlotMode
);
void
Plot_Serigraphie
(
PLOTTER
*
plotter
,
int
masque_layer
,
GRTraceMode
trace_mode
);
void
Plot_Serigraphie
(
PLOTTER
*
plotter
,
int
masque_layer
,
GRTraceMode
trace_mode
);
/** function PlotDrillMark
* Draw a drill mark for pads and vias.
* Must be called after all drawings, because it
* redraw the drill mark on a pad or via, as a negative (i.e. white) shape in FILLED plot mode
* redraw the drill mark on a pad or via, as a negative (i.e. white) shape
* in FILLED plot mode
* @param aPlotter = the PLOTTER
* @param aTraceMode = the mode of plot (FILLED, SKETCH)
* @param aSmallDrillShape = true to plot a small drill shape, false to plot the actual drill shape
* @param aSmallDrillShape = true to plot a small drill shape, false to
* plot the actual drill shape
*/
void
PlotDrillMark
(
PLOTTER
*
aPlotter
,
GRTraceMode
aTraceMode
,
bool
aSmallDrillShape
);
void
PlotDrillMark
(
PLOTTER
*
aPlotter
,
GRTraceMode
aTraceMode
,
bool
aSmallDrillShape
);
/* Functions relative to Undo/redo commands:
*/
...
...
@@ -314,7 +359,8 @@ public:
*/
virtual
void
SaveCopyInUndoList
(
BOARD_ITEM
*
aItemToCopy
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
)
=
0
;
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
)
=
0
;
/** Function SaveCopyInUndoList (virtual pure, overloaded).
* Creates a new entry in undo list of commands.
...
...
@@ -326,7 +372,8 @@ public:
*/
virtual
void
SaveCopyInUndoList
(
PICKED_ITEMS_LIST
&
aItemsList
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
)
=
0
;
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
)
=
0
;
// layerhandling:
...
...
@@ -337,7 +384,6 @@ public:
void
SelectLayerPair
();
virtual
void
SwitchLayer
(
wxDC
*
DC
,
int
layer
);
// divers
void
InstallGridFrame
(
const
wxPoint
&
pos
);
/**
...
...
include/wxPcbStruct.h
View file @
d2eac37d
...
...
@@ -40,22 +40,28 @@ class GENERAL_COLLECTORS_GUIDE;
/**
* @info see also class WinEDA_BasePcbFrame: Basic class for pcbnew and
gerbview
*/
* @info see also class WinEDA_BasePcbFrame: Basic class for pcbnew and
*gerbview
*/
/*****************************************************/
/* class WinEDA_PcbFrame: the main frame for Pcbnew */
/*****************************************************/
class
WinEDA_PcbFrame
:
public
WinEDA_BasePcbFrame
class
WinEDA_PcbFrame
:
public
WinEDA_BasePcbFrame
{
public
:
WinEDAChoiceBox
*
m_SelLayerBox
;
// a combo box to display and select active layer
WinEDAChoiceBox
*
m_SelTrackWidthBox
;
// a combo box to display and select current track width
WinEDAChoiceBox
*
m_SelViaSizeBox
;
// a combo box to display and select current via diameter
wxTextCtrl
*
m_ClearanceBox
;
// a text ctrl to display the current tracks and vias clearance
wxTextCtrl
*
m_NetClassSelectedBox
;
// a text ctrl to display the current NetClass
WinEDAChoiceBox
*
m_SelLayerBox
;
// a combo box to display and
// select active layer
WinEDAChoiceBox
*
m_SelTrackWidthBox
;
// a combo box to display and
// select current track width
WinEDAChoiceBox
*
m_SelViaSizeBox
;
// a combo box to display and
// select current via diameter
wxTextCtrl
*
m_ClearanceBox
;
// a text ctrl to display the
// current tracks and vias
// clearance
wxTextCtrl
*
m_NetClassSelectedBox
;
// a text ctrl to display the
// current NetClass
bool
m_TrackAndViasSizesList_Changed
;
bool
m_show_microwave_tools
;
...
...
@@ -87,6 +93,7 @@ public:
void
InstallConfigFrame
(
const
wxPoint
&
pos
);
void
Process_Config
(
wxCommandEvent
&
event
);
void
Update_config
(
wxWindow
*
displayframe
);
/** Function Read_Config
* Read the project configuration file
* @param projectFileName = the config filename
...
...
@@ -96,7 +103,9 @@ public:
*/
bool
Read_Config
(
const
wxString
&
projectFileName
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
bool
OnHotkeyDeleteItem
(
wxDC
*
DC
,
EDA_BaseStruct
*
DrawStruct
);
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
...
...
@@ -124,6 +133,7 @@ public:
void
ShowDesignRulesEditor
(
wxCommandEvent
&
event
);
/* toolbars update UI functions: */
/**
* Function UpdateToolbarLayerInfo
* updates the currently selected layer in the layer listbox and
...
...
@@ -138,14 +148,14 @@ public:
* update the displayed values on auxiliary horizontal toolbar
* (track width, via sizes, clearance ...
*/
void
AuxiliaryToolBar_Update_UI
(
);
void
AuxiliaryToolBar_Update_UI
(
);
/**
* Function AuxiliaryToolBar_DesignRules_Update_UI
* update the displayed values: track width, via sizes, clearance
* used when a ne netclass is selected
* used when a ne
w
netclass is selected
*/
void
AuxiliaryToolBar_DesignRules_Update_UI
(
);
void
AuxiliaryToolBar_DesignRules_Update_UI
(
);
/* mouse functions events: */
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
...
...
@@ -153,7 +163,8 @@ public:
/**
* Function OnRightClick
* populates a popup menu with the choices appropriate for the current context.
* populates a popup menu with the choices appropriate for the current
*context.
* The caller will add the ZOOM menu choices afterwards.
* @param aMousePos The current mouse position
* @param aPopMenu The menu to add to.
...
...
@@ -168,51 +179,65 @@ public:
* add a picker to handle aItemToCopy
* @param aItemToCopy = the board item modified by the command to undo
* @param aTypeCommand = command type (see enum UndoRedoOpType)
* @param aTransformPoint = the reference point of the transformation, for commands like move
* @param aTransformPoint = the reference point of the transformation, for
*commands like move
*/
virtual
void
SaveCopyInUndoList
(
BOARD_ITEM
*
aItemToCopy
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
virtual
void
SaveCopyInUndoList
(
BOARD_ITEM
*
aItemToCopy
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
/** Function SaveCopyInUndoList (overloaded).
* Creates a new entry in undo list of commands.
* add a list of pickers to handle a list of items
* @param aItemsList = the list of items modified by the command to undo
* @param aTypeCommand = command type (see enum UndoRedoOpType)
* @param aTransformPoint = the reference point of the transformation, for commands like move
* @param aTransformPoint = the reference point of the transformation, for
*commands like move
*/
virtual
void
SaveCopyInUndoList
(
PICKED_ITEMS_LIST
&
aItemsList
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
virtual
void
SaveCopyInUndoList
(
PICKED_ITEMS_LIST
&
aItemsList
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
/** Function PutDataInPreviousState()
* Used in undo or redo command.
* Put data pointed by List in the previous state, i.e. the state memorised by List
* @param aList = a PICKED_ITEMS_LIST pointer to the list of items to undo/redo
* Put data pointed by List in the previous state, i.e. the state memorized
* by List
* @param aList = a PICKED_ITEMS_LIST pointer to the list of items to
* undo/redo
* @param aRedoCommand = a bool: true for redo, false for undo
* @param aRebuildRatsnet = a bool: true to rebuid ratsnet (normal use), false
* to just retrieve las state (used in abort commands that do not need to rebuild ratsnest)
* @param aRebuildRatsnet = a bool: true to rebuild ratsnet (normal use),
* false
* to just retrieve las state (used in abort commands that do not need to
* rebuild ratsnest)
*/
void
PutDataInPreviousState
(
PICKED_ITEMS_LIST
*
aList
,
bool
aRedoCommand
,
bool
aRebuildRatsnet
=
true
);
void
PutDataInPreviousState
(
PICKED_ITEMS_LIST
*
aList
,
bool
aRedoCommand
,
bool
aRebuildRatsnet
=
true
);
/** Function GetBoardFromRedoList
* Redo the last edition:
* - Save the current board in Undo list
* - Get an old version of the board from Redo list
* @return none
*/
void
GetBoardFromRedoList
(
wxCommandEvent
&
event
);
void
GetBoardFromRedoList
(
wxCommandEvent
&
event
);
/** Function GetBoardFromUndoList
* Undo the last edition:
* - Save the current board in Redo list
* - Get an old version of the board from Undo list
* @return none
*/
void
GetBoardFromUndoList
(
wxCommandEvent
&
event
);
void
GetBoardFromUndoList
(
wxCommandEvent
&
event
);
/* Block operations: */
/* Gestion generale des operations sur block */
int
ReturnBlockCommand
(
int
key
);
void
HandleBlockPlace
(
wxDC
*
DC
);
int
HandleBlockEnd
(
wxDC
*
DC
);
/* Block operations: */
/**
* Function Block_SelectItems
* Uses GetScreen()->m_BlockLocate
...
...
@@ -220,53 +245,62 @@ public:
* selected items are put in the pick list
* @param none
*/
void
Block_SelectItems
(
);
void
Block_SelectItems
(
);
/**
* Function Block_Delete
* deletes all items within the selected block.
* @param none
*/
void
Block_Delete
(
);
void
Block_Delete
();
/**
* Function Block_Rotate
* Rotate all items within the selected block.
* The rotation cent
re is the centre
of the block
* The rotation cent
er is the center
of the block
* @param none
*/
void
Block_Rotate
(
);
void
Block_Rotate
();
/**
* Function Block_Flip
* Flip items within the selected block.
* The flip cent
re is the centre
of the block
* The flip cent
er is the center
of the block
* @param none
*/
void
Block_Flip
(
);
void
Block_Flip
();
/**
* Function Block_Move
* move all items within the selected block.
* New location is determined by the current offset from the selected block's original location.
* New location is determined by the current offset from the selected
*block's original location.
* @param none
*/
void
Block_Move
(
);
void
Block_Move
();
/**
* Function Block_Mirror_X
* mirrors all items within the currently selected block in the X axis.
* @param none
*/
void
Block_Mirror_X
(
);
void
Block_Mirror_X
();
/**
* Function Block_Duplicate
* Duplicate all items within the selected block.
* New location is determined by the current offset from the selected block's original location.
* New location is determined by the current offset from the selected
* block's original location.
* @param none
*/
void
Block_Duplicate
(
);
void
Block_Duplicate
(
);
void
SetToolbars
();
void
Process_Settings
(
wxCommandEvent
&
event
);
void
InstallPcbOptionsFrame
(
const
wxPoint
&
pos
,
wxDC
*
DC
,
int
id
);
void
InstallPcbOptionsFrame
(
const
wxPoint
&
pos
,
wxDC
*
DC
,
int
id
);
void
InstallDisplayOptionsDialog
(
wxCommandEvent
&
aEvent
);
void
InstallPcbGlobalDeleteFrame
(
const
wxPoint
&
pos
);
...
...
@@ -284,17 +318,20 @@ public:
bool
WriteGeneralDescrPcb
(
FILE
*
File
);
// BOARD handling
/** function Clear_Pcb()
* delete all and reinitialize the current board
* @param aQuery = true to prompt user for confirmation, false to initialize silently
* @param aQuery = true to prompt user for confirmation, false to
* initialize silently
*/
bool
Clear_Pcb
(
bool
aQuery
);
// Drc control
/* function GetDrcController
* @return the DRC controller
*/
DRC
*
GetDrcController
()
{
return
m_drc
;}
///< return the DRC controller, see drc.cpp
DRC
*
GetDrcController
()
{
return
m_drc
;
}
/**
* Function RecreateBOMFileFromBoard
...
...
@@ -302,13 +339,13 @@ public:
* this is the same as created by cvpcb.
* can be used if this file is lost
*/
void
RecreateCmpFileFromBoard
(
wxCommandEvent
&
aEvent
);
void
RecreateCmpFileFromBoard
(
wxCommandEvent
&
aEvent
);
/**
* Function RecreateBOMFileFromBoard
* Creates a BOM file from the current loaded board
*/
void
RecreateBOMFileFromBoard
(
wxCommandEvent
&
aEvent
);
void
RecreateBOMFileFromBoard
(
wxCommandEvent
&
aEvent
);
void
ExportToGenCAD
(
wxCommandEvent
&
event
);
...
...
@@ -332,7 +369,8 @@ public:
/**
* Function ImportSpecctraDesign
* will import a specctra *.dsn file and use it to replace an entire BOARD.
* The new board will not have any graphics, only components, tracks and vias.
* The new board will not have any graphics, only components, tracks and
* vias.
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* specification.
*/
...
...
@@ -344,13 +382,12 @@ public:
*/
void
Access_to_External_Tool
(
wxCommandEvent
&
event
);
/* Fonctions specifiques */
MODULE
*
ListAndSelectModuleName
();
/** Function ListNetsAndSelect
* called by a command event
* displays the sorted list of nets in a dialog frame
* If a net is selected, it is high
t
lighted
* If a net is selected, it is highlighted
*/
void
ListNetsAndSelect
(
wxCommandEvent
&
event
);
...
...
@@ -368,33 +405,38 @@ public:
// Graphic Segments type DRAWSEGMENT
void
Start_Move_DrawItem
(
DRAWSEGMENT
*
drawitem
,
wxDC
*
DC
);
void
Place_DrawItem
(
DRAWSEGMENT
*
drawitem
,
wxDC
*
DC
);
void
InstallGraphicItemPropertiesDialog
(
DRAWSEGMENT
*
aItem
,
wxDC
*
aDC
);
// Graphic items edition
void
InstallGraphicItemPropertiesDialog
(
DRAWSEGMENT
*
aItem
,
wxDC
*
aDC
);
// Footprint edition (see also WinEDA_BasePcbFrame)
void
InstallModuleOptionsFrame
(
MODULE
*
Module
,
wxDC
*
DC
);
void
InstallModuleOptionsFrame
(
MODULE
*
Module
,
wxDC
*
DC
);
void
StartMove_Module
(
MODULE
*
module
,
wxDC
*
DC
);
bool
Delete_Module
(
MODULE
*
module
,
wxDC
*
DC
,
bool
aAskBeforeDeleting
);
bool
Delete_Module
(
MODULE
*
module
,
wxDC
*
DC
,
bool
aAskBeforeDeleting
);
void
Change_Side_Module
(
MODULE
*
Module
,
wxDC
*
DC
);
void
InstallExchangeModuleFrame
(
MODULE
*
ExchangeModuleModule
);
/** function Exchange_Module
* Replaces OldModule by NewModule, using OldModule settings:
* position, orientation, pad netnames ...)
* OldModule is deleted or put in undo list.
* @param aOldModule = footprint to replace
* @param aNewModule = footprint to put
* @param aUndoPickList = the undo list used to save OldModule. If null, OldModule is deleted
* @param aUndoPickList = the undo list used to save OldModule. If null,
* OldModule is deleted
*/
void
Exchange_Module
(
MODULE
*
aOldModule
,
MODULE
*
aNewModule
,
PICKED_ITEMS_LIST
*
aUndoPickList
);
PICKED_ITEMS_LIST
*
aUndoPickList
);
// loading modules: see WinEDA_BasePcbFrame
// Board handling
void
RemoveStruct
(
BOARD_ITEM
*
Item
,
wxDC
*
DC
);
// High
t
light functions:
// Highlight functions:
int
Select_High_Light
(
wxDC
*
DC
);
void
Hight_Light
(
wxDC
*
DC
);
...
...
@@ -403,11 +445,11 @@ public:
/**
* Function Other_Layer_Route
* operates in one of two ways. If argument track is NULL, then swap the
active
*
layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a track is
*
in progress (track is not NULL), and if DRC allows it, place a via on the end
*
of the current track, and then swap the current active layer and start a new
* segment on the new layer.
* operates in one of two ways. If argument track is NULL, then swap the
*
active layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a
*
track is in progress (track is not NULL), and if DRC allows it, place
*
a via on the end of the current track, and then swap the current active
*
layer and start a new
segment on the new layer.
* @param track A TRACK* to append the via to or NULL.
* @param DC A device context to draw on.
* @return bool - true if the operation was successful, else false such as
...
...
@@ -427,19 +469,23 @@ public:
* @param aTrack : bool true to modify tracks
* @param aVia : bool true to modify vias
*/
bool
Reset_All_Tracks_And_Vias_To_Netclass_Values
(
bool
aTrack
,
bool
aVia
);
bool
Reset_All_Tracks_And_Vias_To_Netclass_Values
(
bool
aTrack
,
bool
aVia
);
/** function Change_Net_Tracks_And_Vias_Sizes
* Reset all tracks width and vias diameters and drill
* to their default Netclass value o
u
current values
* to their default Netclass value o
r
current values
* @param aNetcode : the netcode of the net to edit
* @param aUseNetclassValue : bool. True to use netclass values, false to use current values
* @param aUseNetclassValue : bool. True to use netclass values, false to
* use current values
*/
bool
Change_Net_Tracks_And_Vias_Sizes
(
int
aNetcode
,
bool
aUseNetclassValue
);
bool
Change_Net_Tracks_And_Vias_Sizes
(
int
aNetcode
,
bool
aUseNetclassValue
);
/** Function Edit_Track_Width
* Modify a full track width (using DRC control).
* a full track is the set of track segments between 2 ends: pads or a point that has more than 2 segments ends connected
* a full track is the set of track segments between 2 ends: pads or a
* point that has more than 2 segments ends connected
* @param DC = the curred device context (can be NULL)
* @param aTrackSegment = a segment or via on the track to change
*/
...
...
@@ -467,34 +513,45 @@ public:
/** function EraseRedundantTrack
* Called after creating a track
* Remove (if exists) the old track that have the same starting and the same ending point as the new created track
* Remove (if exists) the old track that have the same starting and the
* same ending point as the new created track
* (this is the redunding track)
* @param aDC = the current device context (can be NULL)
* @param aNewTrack = the new created track (a pointer to a segment of the track list)
* @param aNewTrack = the new created track (a pointer to a segment of the
* track list)
* @param aNewTrackSegmentsCount = number of segments in this new track
* @param aItemsListPicker = the list picker to use for an undo command (can be NULL)
* @param aItemsListPicker = the list picker to use for an undo command
* (can be NULL)
*/
int
EraseRedundantTrack
(
wxDC
*
aDC
,
TRACK
*
aNewTrack
,
int
aNewTrackSegmentsCount
,
int
EraseRedundantTrack
(
wxDC
*
aDC
,
TRACK
*
aNewTrack
,
int
aNewTrackSegmentsCount
,
PICKED_ITEMS_LIST
*
aItemsListPicker
);
/** Function SetTrackSegmentWidth
* Modify one track segment width or one via diameter (using DRC control).
* Basic routine used by other routines when editing tracks or vias
* @param aTrackItem = the track segment or via to modify
* @param aItemsListPicker = the list picker to use for an undo command (can be NULL)
* @param aUseNetclassValue = true to use NetClass value, false to use g_DesignSettings value
* @param aItemsListPicker = the list picker to use for an undo command
* (can be NULL)
* @param aUseNetclassValue = true to use NetClass value, false to use
* g_DesignSettings value
* @return true if done, false if no not change (because DRC error)
*/
bool
SetTrackSegmentWidth
(
TRACK
*
aTrackItem
,
PICKED_ITEMS_LIST
*
aItemsListPicker
,
bool
aUseNetclassValue
);
bool
SetTrackSegmentWidth
(
TRACK
*
aTrackItem
,
PICKED_ITEMS_LIST
*
aItemsListPicker
,
bool
aUseNetclassValue
);
// zone handling
/** Function Delete_Zone_Fill
* Remove the zone filling which include the segment aZone, or the zone which have the given time stamp.
* A zone is a group of segments which have the same TimeStamp
* Remove the zone filling which include the segment aZone, or the zone
* which have the given time stamp. A zone is a group of segments which
* have the same TimeStamp
* @param aZone = zone segment within the zone to delete. Can be NULL
* @param aTimestamp = Timestamp for the zone to delete, used if aZone == NULL
* @param aTimestamp = Timestamp for the zone to delete, used if aZone ==
* NULL
*/
void
Delete_Zone_Fill
(
SEGZONE
*
Track
,
long
aTimestamp
=
0
);
...
...
@@ -552,7 +609,7 @@ public:
/**
* Function Add_Similar_Zone
* Add a zone to a given zone outline.
* if the zones are overlapp
e
ing they will be merged
* if the zones are overlapping they will be merged
* @param DC = current Device Context
* @param zone_container = parent zone outline
*/
...
...
@@ -579,8 +636,10 @@ public:
* Function Start_Move_Zone_Corner
* Prepares a drag edge in an existing zone outline,
*/
void
Start_Move_Zone_Drag_Outline_Edge
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
,
void
Start_Move_Zone_Drag_Outline_Edge
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
,
int
corner_id
);
/**
...
...
@@ -589,7 +648,10 @@ public:
* @param DC = current Device Context (can be NULL)
* @param zone_container: the given zone
*/
void
End_Move_Zone_Corner_Or_Outlines
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
void
End_Move_Zone_Corner_Or_Outlines
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
/**
* Function End_Move_Zone_Corner_Or_Outlines
...
...
@@ -599,8 +661,9 @@ public:
void
Remove_Zone_Corner
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
/** Function Delete_Zone
* Remove the zone which include the segment aZone, or the zone which have the given time stamp.
* A zone is a group of segments which have the same TimeStamp
* Remove the zone which include the segment aZone, or the zone which have
* the given time stamp. A zone is a group of segments which have the
* same TimeStamp
* @param DC = current Device Context (can be NULL)
* @param zone_container = zone to modify
* the member .m_CornerSelection is used to find the outline to remove.
...
...
@@ -611,18 +674,21 @@ public:
/**
* Function Start_Move_Zone_Outlines
* Initiali
se parametre
s to move an existing zone outlines.
* Initiali
ze parameter
s to move an existing zone outlines.
* @param DC = current Device Context (can be NULL)
* @param zone_container: the given zone to move
*/
void
Start_Move_Zone_Outlines
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
void
Start_Move_Zone_Outlines
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
// Target handling
MIREPCB
*
Create_Mire
(
wxDC
*
DC
);
void
Delete_Mire
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
);
void
StartMove_Mire
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
);
void
Place_Mire
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
);
void
InstallMireOptionsFrame
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
InstallMireOptionsFrame
(
MIREPCB
*
MirePcb
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
// Graphic segments type DRAWSEGMENT handling:
DRAWSEGMENT
*
Begin_DrawSegment
(
DRAWSEGMENT
*
Segment
,
int
shape
,
wxDC
*
DC
);
...
...
@@ -631,7 +697,9 @@ public:
void
Delete_Drawings_All_Layer
(
int
aLayer
);
// Dimension handling:
void
Install_Edit_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
void
Install_Edit_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
,
const
wxPoint
&
pos
);
COTATION
*
Begin_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
);
void
Delete_Cotation
(
COTATION
*
Cotation
,
wxDC
*
DC
);
...
...
@@ -643,7 +711,7 @@ public:
void
AutoPlace
(
wxCommandEvent
&
event
);
/** function OnOrientFootprints
* install the dialog box for the comm
a
n Orient Footprints
* install the dialog box for the comm
o
n Orient Footprints
*/
void
OnOrientFootprints
(
void
);
...
...
@@ -672,7 +740,6 @@ public:
void
ReadAutoroutedTracks
(
wxDC
*
DC
);
void
GlobalRoute
(
wxDC
*
DC
);
// divers
void
Show_1_Ratsnest
(
EDA_BaseStruct
*
item
,
wxDC
*
DC
);
void
Ratsnest_On_Off
(
wxDC
*
DC
);
void
Clean_Pcb
(
wxDC
*
DC
);
...
...
@@ -683,7 +750,8 @@ public:
* Function SendMessageToEESCHEMA
* sends a message to the schematic editor so that it may move its cursor
* to a part with the same reference as the objectToSync
* @param objectToSync The object whose reference is used to syncronize eeschema.
* @param objectToSync The object whose reference is used to synchronize
* eeschema.
*/
void
SendMessageToEESCHEMA
(
BOARD_ITEM
*
objectToSync
);
...
...
@@ -767,9 +835,11 @@ public:
void
ToPrinter
(
wxCommandEvent
&
event
);
// BOARD handling
/** function Clear_Pcb()
* delete all and reinitialize the current board
* @param aQuery = true to prompt user for confirmation, false to initialize silently
* @param aQuery = true to prompt user for confirmation, false to
* initialize silently
*/
bool
Clear_Pcb
(
bool
aQuery
);
...
...
@@ -782,29 +852,36 @@ public:
/* Undo and redo functions */
public
:
/** Function SaveCopyInUndoList.
* Creates a new entry in undo list of commands.
* add a picker to handle aItemToCopy
* @param aItem = the board item modified by the command to undo
* @param aTypeCommand = command type (see enum UndoRedoOpType)
* @param aTransformPoint = the reference point of the transformation, for commands like move
* @param aTransformPoint = the reference point of the transformation, for
* commands like move
*/
virtual
void
SaveCopyInUndoList
(
BOARD_ITEM
*
aItem
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
virtual
void
SaveCopyInUndoList
(
BOARD_ITEM
*
aItem
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
/** Function SaveCopyInUndoList (overloaded).
* Creates a new entry in undo list of commands.
* add a list of pickers to handle a list of items
* @param aItemsList = the list of items modified by the command to undo
* @param aTypeCommand = command type (see enum UndoRedoOpType)
* @param aTransformPoint = the reference point of the transformation, for commands like move
* @param aTransformPoint = the reference point of the transformation, for
* commands like move
*/
virtual
void
SaveCopyInUndoList
(
PICKED_ITEMS_LIST
&
aItemsList
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
virtual
void
SaveCopyInUndoList
(
PICKED_ITEMS_LIST
&
aItemsList
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
private
:
void
GetComponentFromUndoList
(
wxCommandEvent
&
event
);
void
GetComponentFromRedoList
(
wxCommandEvent
&
event
);
void
GetComponentFromUndoList
(
wxCommandEvent
&
event
);
void
GetComponentFromRedoList
(
wxCommandEvent
&
event
);
public
:
...
...
@@ -820,7 +897,6 @@ public:
// functions to edit footprint edges
/**
* Function Edit_Edge_Width
* changes the width of module perimeter lines, EDGE_MODULEs.
...
...
include/wxstruct.h
View file @
d2eac37d
/***********************************************************/
/* wxstruct.h: */
/* descriptions des principales classes derivees utilisees */
/***********************************************************/
/****************/
/* wxstruct.h */
/****************/
#ifndef WXSTRUCT_H
#define WXSTRUCT_H
...
...
@@ -32,13 +31,11 @@
#endif
// Option for dialog boxes
// #define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT|wxSTAY_ON_TOP
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | \
MAYBE_RESIZE_BORDER
#define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS
/* Forward declarations of classes. */
class
EDA_BaseStruct
;
class
EDA_Rect
;
class
WinEDA_DrawPanel
;
...
...
@@ -110,8 +107,6 @@ public:
#endif
public
:
// Constructor and destructor
WinEDA_BasicFrame
(
wxWindow
*
father
,
int
idtype
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
...
...
@@ -152,22 +147,31 @@ class WinEDA_DrawFrame : public WinEDA_BasicFrame
{
public
:
WinEDA_DrawPanel
*
DrawPanel
;
// Draw area
WinEDA_MsgPanel
*
MsgPanel
;
// Panel used to display some info (bottom of the screen)
WinEDA_MsgPanel
*
MsgPanel
;
// Panel used to display some
// info (bottom of the screen)
WinEDA_Toolbar
*
m_VToolBar
;
// Vertical (right side) Toolbar
WinEDA_Toolbar
*
m_AuxVToolBar
;
// Auxiliary Vertical (right side) Toolbar
WinEDA_Toolbar
*
m_AuxVToolBar
;
// Auxiliary Vertical (right side)
// Toolbar
WinEDA_Toolbar
*
m_OptionsToolBar
;
// Options Toolbar (left side)
WinEDA_Toolbar
*
m_AuxiliaryToolBar
;
// Toolbar auxiliaire (utilis� dans pcbnew)
WinEDAChoiceBox
*
m_SelGridBox
;
// Dialog box to choose the grid size
WinEDAChoiceBox
*
m_SelZoomBox
;
// Dialog box to choose the Zoom value
int
m_CursorShape
;
// shape for cursor (0 = default cursor)
int
m_ID_current_state
;
// Id of active button on the vertical toolbar
int
m_ID_last_state
;
// Id of previous active button on the vertical toolbar
int
m_HTOOL_current_state
;
// Id of active button on horizontal toolbar
WinEDA_Toolbar
*
m_AuxiliaryToolBar
;
// Auxiliay Toolbar used in pcbnew
WinEDAChoiceBox
*
m_SelGridBox
;
// Choice box to choose the grid
// size
WinEDAChoiceBox
*
m_SelZoomBox
;
// Choice box to choose the zoom
// value
int
m_CursorShape
;
// shape for cursor (0 = default
// cursor)
int
m_ID_current_state
;
// Id of active button on the
// vertical toolbar
int
m_ID_last_state
;
// Id of previous active button
// on the vertical toolbar
int
m_HTOOL_current_state
;
// Id of active button on
// horizontal toolbar
int
m_InternalUnits
;
// Internal units count in 1 inch
// = 1000 for eeschema, = 10000 for PCBnew and Gerbview
// = 1000 for eeschema, = 10000
// for PCBnew and Gerbview
int
m_UnitType
;
// Internal Unit type (0 = inch)
bool
m_Draw_Axis
;
// TRUE to show X and Y axis
...
...
@@ -175,8 +179,11 @@ public:
bool
m_Draw_Sheet_Ref
;
// TRUE to show frame references
bool
m_Print_Sheet_Ref
;
// TRUE to print frame references
bool
m_Draw_Auxiliary_Axis
;
/* TRUE to show auxiliary axis. Used in pcbnew:
* the auxiliary axis is the origin of coordinates for drill, gerber and component position files
bool
m_Draw_Auxiliary_Axis
;
/* TRUE to show auxiliary axis.
* Used in pcbnew: the auxiliary
* axis is the origin of
* coordinates for drill, gerber
* and component position files
*/
wxPoint
m_Auxiliary_Axis_Position
;
/* position of the auxiliary axis */
...
...
@@ -187,11 +194,12 @@ private:
BASE_SCREEN
*
m_CurrentScreen
;
///< current used SCREEN
protected
:
void
SetBaseScreen
(
BASE_SCREEN
*
aScreen
)
{
m_CurrentScreen
=
aScreen
;
}
void
SetBaseScreen
(
BASE_SCREEN
*
aScreen
)
{
m_CurrentScreen
=
aScreen
;
}
public
:
// Constructor and destructor
WinEDA_DrawFrame
(
wxWindow
*
father
,
int
idtype
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
...
...
@@ -247,7 +255,9 @@ public:
virtual
void
OnZoom
(
wxCommandEvent
&
event
);
void
OnGrid
(
int
grid_type
);
void
Recadre_Trace
(
bool
ToMouse
);
void
PutOnGrid
(
wxPoint
*
coord
);
/* set the coordiante "coord" to the nearest grid coordinate */
void
PutOnGrid
(
wxPoint
*
coord
);
/* set the coordinate to
* the nearest grid
* coordinate */
void
Zoom_Automatique
(
bool
move_mouse_cursor
);
/* Set the zoom level to show the area Rect */
...
...
@@ -271,9 +281,11 @@ public:
* Return the X,Y sheet references where the point position is located
* @param aScreen = screen to use
* @param aPosition = position to identify by YX ref
* @return a wxString containing the message locator like A3 or B6 (or ?? if out of page limits)
* @return a wxString containing the message locator like A3 or B6
* (or ?? if out of page limits)
*/
wxString
GetXYSheetReferences
(
BASE_SCREEN
*
aScreen
,
const
wxPoint
&
aPosition
);
wxString
GetXYSheetReferences
(
BASE_SCREEN
*
aScreen
,
const
wxPoint
&
aPosition
);
void
DisplayToolMsg
(
const
wxString
&
msg
);
void
Process_Zoom
(
wxCommandEvent
&
event
);
...
...
@@ -281,7 +293,8 @@ public:
virtual
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
)
=
0
;
virtual
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
virtual
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
void
AdjustScrollBars
();
...
...
@@ -295,8 +308,8 @@ public:
* a drawing function per se, but rather updates lines of text held by
* the components within the status bar which is owned by the wxFrame.
* <p>
* On a MAC, be careful about calling this function when there is an
existing
* wxDC in existence on a sibling window.
* On a MAC, be careful about calling this function when there is an
*
existing
wxDC in existence on a sibling window.
*/
virtual
void
UpdateStatusBar
();
...
...
@@ -305,7 +318,8 @@ public:
/* Handlers for block commands */
virtual
int
ReturnBlockCommand
(
int
key
);
virtual
void
InitBlockPasteInfos
();
virtual
bool
HandleBlockBegin
(
wxDC
*
DC
,
int
cmd_type
,
const
wxPoint
&
startpos
);
virtual
bool
HandleBlockBegin
(
wxDC
*
DC
,
int
cmd_type
,
const
wxPoint
&
startpos
);
virtual
void
HandleBlockPlace
(
wxDC
*
DC
);
virtual
int
HandleBlockEnd
(
wxDC
*
DC
);
...
...
@@ -342,10 +356,6 @@ public:
};
/****************************************************/
/* classe representant un ecran graphique de dessin */
/****************************************************/
/*********************************************************
* class WinEDA_MsgPanel : this is a panel to display various infos
* and messages on items in eeschema an pcbnew
...
...
@@ -410,12 +420,11 @@ protected:
public
:
WinEDA_DrawFrame
*
m_Parent
;
int
m_BgColor
;
// couleur de fond
int
m_BgColor
;
public
:
// Constructor and destructor
WinEDA_MsgPanel
(
WinEDA_DrawFrame
*
parent
,
int
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
WinEDA_MsgPanel
(
WinEDA_DrawFrame
*
parent
,
int
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_MsgPanel
();
...
...
@@ -465,8 +474,6 @@ private:
wxStaticText
*
m_Title
;
public
:
// Constructor and destructor
WinEDA_EnterText
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
wxBoxSizer
*
BoxSizer
,
const
wxSize
&
Size
,
bool
Multiline
=
false
);
...
...
@@ -489,6 +496,7 @@ public:
}
};
/************************************************************************/
/* Class to edit/enter a graphic text and its dimension ( INCHES or MM )*/
/************************************************************************/
...
...
@@ -503,8 +511,6 @@ private:
wxStaticText
*
m_Title
;
public
:
// Constructor and destructor
WinEDA_GraphicTextCtrl
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
int
textsize
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
framelen
=
200
,
...
...
@@ -527,13 +533,15 @@ public:
*/
static
wxString
FormatSize
(
int
internalUnit
,
int
units
,
int
textSize
);
static
int
ParseSize
(
const
wxString
&
sizeText
,
int
internalUnit
,
int
units
);
static
int
ParseSize
(
const
wxString
&
sizeText
,
int
internalUnit
,
int
units
);
};
/*************************************************************************************/
/*Class to edit/enter a coordinate (pair of values) ( INCHES or MM ) in dialog boxes */
/*************************************************************************************/
/**************************************************************************/
/* Class to edit/enter a coordinate (pair of values) ( INCHES or MM ) in */
/* dialog boxes, */
/**************************************************************************/
class
WinEDA_PositionCtrl
{
public
:
...
...
@@ -546,8 +554,6 @@ private:
wxStaticText
*
m_TextX
,
*
m_TextY
;
public
:
// Constructor and destructor
WinEDA_PositionCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
const
wxPoint
&
pos_to_edit
,
int
units
,
wxBoxSizer
*
BoxSizer
,
...
...
@@ -560,6 +566,7 @@ public:
wxPoint
GetValue
();
};
/*************************************************************
* Class to edit/enter a size (pair of values for X and Y size)
* ( INCHES or MM ) in dialog boxes
...
...
@@ -567,8 +574,6 @@ public:
class
WinEDA_SizeCtrl
:
public
WinEDA_PositionCtrl
{
public
:
// Constructor and destructor
WinEDA_SizeCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
const
wxSize
&
size_to_edit
,
int
units
,
wxBoxSizer
*
BoxSizer
,
...
...
@@ -582,11 +587,6 @@ public:
/****************************************************************/
/* Class to edit/enter a value ( INCHES or MM ) in dialog boxes */
/****************************************************************/
/* internal_unit est le nombre d'unites internes par inch
* - 1000 sur EESchema
* - 10000 sur PcbNew
*/
class
WinEDA_ValueCtrl
{
public
:
...
...
@@ -598,8 +598,6 @@ private:
wxStaticText
*
m_Text
;
public
:
// Constructor and destructor
WinEDA_ValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
int
value
,
int
units
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
...
...
@@ -616,6 +614,7 @@ public:
}
};
/************************************************************************/
/* Class to edit/enter a pair of float (double) values in dialog boxes */
/************************************************************************/
...
...
@@ -628,8 +627,6 @@ private:
wxStaticText
*
m_Text
;
public
:
// Constructor and destructor
WinEDA_DFloatValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
double
value
,
wxBoxSizer
*
BoxSizer
);
...
...
@@ -671,13 +668,16 @@ public:
#if defined(KICAD_AUITOOLBAR)
bool
GetToolState
(
int
toolId
)
{
return
GetToolToggled
(
toolId
);
};
void
AddRadioTool
(
int
toolid
,
const
wxString
&
label
,
const
wxBitmap
&
bitmap
,
void
AddRadioTool
(
int
toolid
,
const
wxString
&
label
,
const
wxBitmap
&
bitmap
,
const
wxBitmap
&
bmpDisabled
=
wxNullBitmap
,
const
wxString
&
shortHelp
=
wxEmptyString
,
const
wxString
&
longHelp
=
wxEmptyString
,
wxObject
*
data
=
NULL
)
wxObject
*
data
=
NULL
)
{
AddTool
(
toolid
,
label
,
bitmap
,
bmpDisabled
,
wxITEM_CHECK
,
shortHelp
,
longHelp
,
data
);
AddTool
(
toolid
,
label
,
bitmap
,
bmpDisabled
,
wxITEM_CHECK
,
shortHelp
,
longHelp
,
data
);
};
void
SetToolNormalBitmap
(
int
id
,
const
wxBitmap
&
bitmap
)
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment