Commit c406eed1 authored by dickelbeck's avatar dickelbeck

class name changes, XOR artifacts

parent bd77c9f2
...@@ -5,6 +5,27 @@ Started 2007-June-11 ...@@ -5,6 +5,27 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-Mar-19 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+eeschema
Renamed some classes and their corresponding KICAD_T types so they are both
simpler, shorter and more closely match each other: the type and the classname.
Wedged a class SCH_ITEM underneath most eeschema drawable items, and this
class came from DrawPartStruct which was largely disfunctional. Eeschema
now more closely matches what we have in pcbnew with the BOARD_ITEM base class.
The corresponding class in eeschema is now SCH_ITEM. Put in some of Jonas'
patch for the dragging of a block. Needs testing, especially dragging
text since there is no GetBoundingBox() for that yet. As an interrim solution
we could make SCH_ITEM::GetBoundingBox() return a HUGE rectangle so that any class
not implementing GetBoundingBox() in eeschema will get properly re-drawn,
in theory.
We are currently using XORing for dragging a single object and using full
redraws for dragging a block. I suppose this can be an experiment for a
week or so. I would not expect that dragging a block of labels with no
other object to work currently.
2008-Mar-19 UPDATE Igor Plyatov <plyatov@mail.ru> 2008-Mar-19 UPDATE Igor Plyatov <plyatov@mail.ru>
================================================================================ ================================================================================
* Support for Gnome/KDE menu added. * Support for Gnome/KDE menu added.
......
...@@ -805,8 +805,9 @@ EDA_Rect& EDA_Rect::Inflate( wxCoord dx, wxCoord dy ) ...@@ -805,8 +805,9 @@ EDA_Rect& EDA_Rect::Inflate( wxCoord dx, wxCoord dy )
} }
/** Function Merge /**
* Modify Position and Size of this in order to contain the given rect * Function Merge
* modifies Position and Size of this in order to contain the given rect
* mainly used to calculate bounding boxes * mainly used to calculate bounding boxes
* @param aRect = given rect to merge with this * @param aRect = given rect to merge with this
*/ */
...@@ -840,7 +841,7 @@ void EDA_Rect::Merge( const EDA_Rect& aRect ) ...@@ -840,7 +841,7 @@ void EDA_Rect::Merge( const EDA_Rect& aRect )
/*******************************************************************/ /*******************************************************************/
DrawPickedStruct::DrawPickedStruct( EDA_BaseStruct* pickedstruct ) : DrawPickedStruct::DrawPickedStruct( EDA_BaseStruct* pickedstruct ) :
EDA_BaseStruct( DRAW_PICK_ITEM_STRUCT_TYPE ) SCH_ITEM( NULL, DRAW_PICK_ITEM_STRUCT_TYPE )
/*******************************************************************/ /*******************************************************************/
{ {
m_PickedStruct = pickedstruct; m_PickedStruct = pickedstruct;
...@@ -851,6 +852,41 @@ DrawPickedStruct::~DrawPickedStruct() ...@@ -851,6 +852,41 @@ DrawPickedStruct::~DrawPickedStruct()
{ {
} }
#if defined(DEBUG)
void DrawPickedStruct::Show( int nestLevel, std::ostream& os )
{
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << "/>\n";
}
#endif
EDA_Rect DrawPickedStruct::GetBoundingBox()
{
if( m_PickedStruct )
return m_PickedStruct->GetBoundingBox();
else
{
return EDA_Rect(); // empty rectangle
}
}
EDA_Rect DrawPickedStruct::GetBoundingBoxUnion()
{
EDA_Rect ret;
DrawPickedStruct* cur = this;
EDA_BaseStruct* item;
while( cur && (item = cur->m_PickedStruct) != NULL )
{
ret.Merge( item->GetBoundingBox() );
cur = cur->Next();
}
return ret;
}
/*********************************************/ /*********************************************/
void DrawPickedStruct::DeleteWrapperList() void DrawPickedStruct::DeleteWrapperList()
......
...@@ -27,7 +27,7 @@ void DrawSheetStruct::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -27,7 +27,7 @@ void DrawSheetStruct::Display_Infos( WinEDA_DrawFrame* frame )
/***************************************************************/ /***************************************************************/
void EDA_SchComponentStruct::Display_Infos( WinEDA_DrawFrame* frame ) void SCH_COMPONENT::Display_Infos( WinEDA_DrawFrame* frame )
/***************************************************************/ /***************************************************************/
{ {
EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );; EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );;
......
...@@ -90,10 +90,10 @@ void ReAnnotatePowerSymbolsOnly( void ) ...@@ -90,10 +90,10 @@ void ReAnnotatePowerSymbolsOnly( void )
EDA_BaseStruct* DrawList = sheet->LastDrawList(); EDA_BaseStruct* DrawList = sheet->LastDrawList();
for( ; DrawList != NULL; DrawList = DrawList->Pnext ) for( ; DrawList != NULL; DrawList = DrawList->Pnext )
{ {
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue; continue;
EDA_SchComponentStruct* DrawLibItem = SCH_COMPONENT* DrawLibItem =
(EDA_SchComponentStruct*) DrawList; (SCH_COMPONENT*) DrawList;
EDA_LibComponentStruct* Entry = EDA_LibComponentStruct* Entry =
FindLibPart( FindLibPart(
DrawLibItem->m_ChipName.GetData(), wxEmptyString, DrawLibItem->m_ChipName.GetData(), wxEmptyString,
...@@ -303,14 +303,14 @@ int ListeComposants( CmpListStruct* BaseListeCmp, DrawSheetPath* sheet ) ...@@ -303,14 +303,14 @@ int ListeComposants( CmpListStruct* BaseListeCmp, DrawSheetPath* sheet )
{ {
int NbrCmp = 0; int NbrCmp = 0;
EDA_BaseStruct* DrawList = sheet->LastDrawList(); EDA_BaseStruct* DrawList = sheet->LastDrawList();
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
for( ; DrawList; DrawList = DrawList->Pnext ) for( ; DrawList; DrawList = DrawList->Pnext )
{ {
if( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() == TYPE_SCH_COMPONENT )
{ {
DrawLibItem = (EDA_SchComponentStruct*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
Entry = FindLibPart( DrawLibItem->m_ChipName.GetData(), Entry = FindLibPart( DrawLibItem->m_ChipName.GetData(),
wxEmptyString, wxEmptyString,
FIND_ROOT ); FIND_ROOT );
...@@ -361,7 +361,7 @@ static void ReAnnotateComponents( CmpListStruct* BaseListeCmp, int NbOfCmp ) ...@@ -361,7 +361,7 @@ static void ReAnnotateComponents( CmpListStruct* BaseListeCmp, int NbOfCmp )
{ {
int ii; int ii;
char* Text; char* Text;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
/* Reattribution des numeros */ /* Reattribution des numeros */
for( ii = 0; ii < NbOfCmp; ii++ ) for( ii = 0; ii < NbOfCmp; ii++ )
......
...@@ -24,7 +24,7 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_ ...@@ -24,7 +24,7 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_
EDA_BaseStruct* DrawStruct ); EDA_BaseStruct* DrawStruct );
static void CollectStructsToDrag( SCH_SCREEN* screen ); static void CollectStructsToDrag( SCH_SCREEN* screen );
static void AddPickedItem( SCH_SCREEN* screen, wxPoint position ); static void AddPickedItem( SCH_SCREEN* screen, wxPoint position );
static LibEDA_BaseStruct* GetNextPinPosition( EDA_SchComponentStruct* DrawLibItem, static LibEDA_BaseStruct* GetNextPinPosition( SCH_COMPONENT* DrawLibItem,
wxPoint& position ); wxPoint& position );
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
static EDA_BaseStruct* SaveStructListForPaste( EDA_BaseStruct* DrawStruct ); static EDA_BaseStruct* SaveStructListForPaste( EDA_BaseStruct* DrawStruct );
...@@ -555,27 +555,28 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -555,27 +555,28 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
*****************************************************************************/ *****************************************************************************/
bool MoveStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct ) bool MoveStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct )
{ {
DrawPickedStruct* PickedList = NULL;
if( !DrawStruct ) if( !DrawStruct )
return FALSE; return FALSE;
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE ) if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{ {
DrawPickedStruct* pickedList = (DrawPickedStruct*) DrawStruct;
if( DC ) if( DC )
RedrawStructList( panel, DC, DrawStruct, g_XorMode ); panel->PostDirtyRect( pickedList->GetBoundingBoxUnion() );
PlaceStruct( panel->GetScreen(), DrawStruct ); /* Place it in its new position. */
PlaceStruct( panel->GetScreen(), pickedList); // Place it in its new position.
if( DC ) if( DC )
RedrawStructList( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE ); RedrawStructList( panel, DC, pickedList, GR_DEFAULT_DRAWMODE );
/* Free the wrapper DrawPickedStruct chain: */ // Free the wrapper DrawPickedStruct chain
PickedList = (DrawPickedStruct*) DrawStruct; pickedList->DeleteWrapperList();
PickedList->DeleteWrapperList();
} }
else else
{ {
if( DC ) if( DC )
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode ); panel->PostDirtyRect( DrawStruct->GetBoundingBox());
PlaceStruct( panel->GetScreen(), DrawStruct ); /* Place it in its new position. */ PlaceStruct( panel->GetScreen(), DrawStruct ); /* Place it in its new position. */
if( DC ) if( DC )
RedrawOneStruct( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE ); RedrawOneStruct( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
...@@ -604,12 +605,12 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center ) ...@@ -604,12 +605,12 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
DrawJunctionStruct* DrawConnect; DrawJunctionStruct* DrawConnect;
EDA_DrawLineStruct* DrawSegment; EDA_DrawLineStruct* DrawSegment;
DrawBusEntryStruct* DrawRaccord; DrawBusEntryStruct* DrawRaccord;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
DrawSheetStruct* DrawSheet; DrawSheetStruct* DrawSheet;
DrawSheetLabelStruct* DrawSheetLabel; DrawSheetLabelStruct* DrawSheetLabel;
DrawMarkerStruct* DrawMarker; DrawMarkerStruct* DrawMarker;
DrawNoConnectStruct* DrawNoConnect; DrawNoConnectStruct* DrawNoConnect;
DrawTextStruct* DrawText; SCH_TEXT* DrawText;
wxPoint px; wxPoint px;
if( !DrawStruct ) if( !DrawStruct )
...@@ -665,13 +666,13 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center ) ...@@ -665,13 +666,13 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
MirrorYPoint( DrawNoConnect->m_Pos, Center ); MirrorYPoint( DrawNoConnect->m_Pos, Center );
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
// Text is not really mirrored; it is moved to a suitable position // Text is not really mirrored; it is moved to a suitable position
// which is the closest position for a true mirrored text // which is the closest position for a true mirrored text
// The center position is mirrored and the text is moved for half horizontal len // The center position is mirrored and the text is moved for half horizontal len
DrawText = (DrawTextStruct*) DrawStruct; DrawText = (SCH_TEXT*) DrawStruct;
px = DrawText->m_Pos; px = DrawText->m_Pos;
if( DrawText->m_Orient == 0 ) /* horizontal text */ if( DrawText->m_Orient == 0 ) /* horizontal text */
dx = DrawText->Len_Size() / 2; dx = DrawText->Len_Size() / 2;
...@@ -687,11 +688,11 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center ) ...@@ -687,11 +688,11 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
DrawText->m_Pos.x = px.x; DrawText->m_Pos.x = px.x;
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
// Text is not really mirrored: Orientation is changed // Text is not really mirrored: Orientation is changed
DrawText = (DrawLabelStruct*) DrawStruct; DrawText = (SCH_LABEL*) DrawStruct;
if( DrawText->m_Orient == 0 ) /* horizontal text */ if( DrawText->m_Orient == 0 ) /* horizontal text */
DrawText->m_Orient = 2; DrawText->m_Orient = 2;
else if( DrawText->m_Orient == 2 ) /* invert horizontal text*/ else if( DrawText->m_Orient == 2 ) /* invert horizontal text*/
...@@ -703,8 +704,8 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center ) ...@@ -703,8 +704,8 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
DrawText->m_Pos.x = px.x; DrawText->m_Pos.x = px.x;
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
DrawLibItem = (EDA_SchComponentStruct*) DrawStruct; DrawLibItem = (SCH_COMPONENT*) DrawStruct;
dx = DrawLibItem->m_Pos.x; dx = DrawLibItem->m_Pos.x;
g_EDA_Appl->m_SchematicFrame->CmpRotationMiroir( DrawLibItem, g_EDA_Appl->m_SchematicFrame->CmpRotationMiroir( DrawLibItem,
NULL, CMP_MIROIR_Y ); NULL, CMP_MIROIR_Y );
...@@ -753,43 +754,42 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center ) ...@@ -753,43 +754,42 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
*****************************************************************************/ *****************************************************************************/
bool MirrorStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct, wxPoint& Center ) bool MirrorStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct, wxPoint& Center )
{ {
DrawPickedStruct* PickedList = NULL;
DrawPickedStruct* DrawStructs;
if( !DrawStruct ) if( !DrawStruct )
return FALSE; return FALSE;
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE ) if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{ {
DrawPickedStruct* pickedList = (DrawPickedStruct*) DrawStruct;
if( DC ) if( DC )
RedrawStructList( panel, DC, DrawStruct, g_XorMode ); panel->PostDirtyRect( pickedList->GetBoundingBoxUnion() );
DrawStructs = (DrawPickedStruct*) DrawStruct;
while( DrawStructs ) for( DrawPickedStruct* cur = pickedList; cur; cur=cur->Next() )
{ {
MirrorOneStruct( DrawStructs->m_PickedStruct, Center ); MirrorOneStruct( cur->m_PickedStruct, Center );
DrawStructs->m_PickedStruct->m_Flags = 0; cur->m_PickedStruct->m_Flags = 0;
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
} }
if( DC ) if( DC )
RedrawStructList( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE ); RedrawStructList( panel, DC, pickedList, GR_DEFAULT_DRAWMODE );
/* Free the wrapper DrawPickedStruct chain: */ // Free the wrapper DrawPickedStruct chain
PickedList = (DrawPickedStruct*) DrawStruct; pickedList->DeleteWrapperList();
PickedList->DeleteWrapperList();
} }
else else
{ {
if( DC ) if( DC )
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode ); panel->PostDirtyRect( DrawStruct->GetBoundingBox() );
MirrorOneStruct( DrawStruct, Center ); /* Place it in its new position. */
MirrorOneStruct( DrawStruct, Center ); // Place it in its new position.
if( DC ) if( DC )
RedrawOneStruct( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE ); RedrawOneStruct( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
DrawStruct->m_Flags = 0; DrawStruct->m_Flags = 0;
} }
return true;
return TRUE;
} }
...@@ -825,10 +825,10 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE ...@@ -825,10 +825,10 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
switch( Struct->Type() ) switch( Struct->Type() )
{ {
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
{ {
( (EDA_SchComponentStruct*) Struct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) Struct )->ClearAnnotation(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation();
} }
break; break;
...@@ -872,10 +872,10 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE ...@@ -872,10 +872,10 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
case DRAW_JUNCTION_STRUCT_TYPE: case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_SHEETLABEL_STRUCT_TYPE: case DRAW_SHEETLABEL_STRUCT_TYPE:
case DRAW_PICK_ITEM_STRUCT_TYPE: case DRAW_PICK_ITEM_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE: case DRAW_MARKER_STRUCT_TYPE:
...@@ -891,9 +891,9 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE ...@@ -891,9 +891,9 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
break; break;
} }
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
( (EDA_SchComponentStruct*) NewDrawStruct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) NewDrawStruct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) NewDrawStruct )->ClearAnnotation(); ( (SCH_COMPONENT*) NewDrawStruct )->ClearAnnotation();
break; break;
} }
...@@ -924,13 +924,11 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct ...@@ -924,13 +924,11 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
*/ */
{ {
SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen(); SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen();
DrawPickedStruct* PickedList = NULL;
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->m_Parent; WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->m_Parent;
if( !DrawStruct ) if( !DrawStruct )
return; return;
if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE ) if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE )
{ {
/* Cette stucture est rattachee a une feuille, et n'est pas /* Cette stucture est rattachee a une feuille, et n'est pas
...@@ -942,34 +940,34 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct ...@@ -942,34 +940,34 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE ) if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{ {
/* Unlink all picked structs from current EEDrawList */ // Unlink all picked structs from current EEDrawList
PickedList = (DrawPickedStruct*) DrawStruct;
while( PickedList ) for( DrawPickedStruct* cur = (DrawPickedStruct*) DrawStruct; cur; cur=cur->Next() )
{ {
screen->RemoveFromDrawList( PickedList->m_PickedStruct ); EDA_BaseStruct* item = cur->m_PickedStruct;
PickedList->m_PickedStruct->Pnext = screen->RemoveFromDrawList( item );
PickedList->m_PickedStruct->Pback = NULL; panel->PostDirtyRect( item->GetBoundingBox() );
PickedList->m_PickedStruct->m_Flags = IS_DELETED; item->Pnext = item->Pback = NULL;
PickedList = PickedList->Next(); item->m_Flags = IS_DELETED;
} }
RedrawStructList( panel, DC, DrawStruct, g_XorMode ); // Removed items are put onto the Undo list
/* Removed items are put to the Undo list */
frame->SaveCopyInUndoList( DrawStruct, IS_DELETED ); frame->SaveCopyInUndoList( DrawStruct, IS_DELETED );
} }
else /* structure classique */ else /* structure classique */
{ {
screen->RemoveFromDrawList( DrawStruct ); screen->RemoveFromDrawList( DrawStruct );
if( (DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE) || switch( DrawStruct->Type() )
(DrawStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE) ||
(DrawStruct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE) )
{ {
case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
panel->PostDirtyRect( DrawStruct->GetBoundingBox() ); panel->PostDirtyRect( DrawStruct->GetBoundingBox() );
} break;
else
{ // other classes do not yet have GetBoundingBox() implementations
default:
D( DrawStruct->Show( 0, std::cout ); ) // tell me which classes still need GetBoundingBox support D( DrawStruct->Show( 0, std::cout ); ) // tell me which classes still need GetBoundingBox support
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode ); RedrawOneStruct( panel, DC, DrawStruct, g_XorMode );
} }
...@@ -1062,10 +1060,10 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) ...@@ -1062,10 +1060,10 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
for( PickedList = (DrawPickedStruct*) DrawStruct; PickedList != NULL; ) // Clear annotation for new components for( PickedList = (DrawPickedStruct*) DrawStruct; PickedList != NULL; ) // Clear annotation for new components
{ {
EDA_BaseStruct* Struct = PickedList->m_PickedStruct; EDA_BaseStruct* Struct = PickedList->m_PickedStruct;
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_COMPONENT )
{ {
( (EDA_SchComponentStruct*) Struct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) Struct )->ClearAnnotation(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation();
SetStructFather( Struct, GetScreen() ); SetStructFather( Struct, GetScreen() );
} }
PickedList = (DrawPickedStruct*) PickedList->Pnext; PickedList = (DrawPickedStruct*) PickedList->Pnext;
...@@ -1086,10 +1084,10 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) ...@@ -1086,10 +1084,10 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
} }
else else
{ {
if( DrawStruct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
{ {
( (EDA_SchComponentStruct*) DrawStruct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) DrawStruct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) DrawStruct )->ClearAnnotation(); ( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation();
} }
SetStructFather( DrawStruct, GetScreen() ); SetStructFather( DrawStruct, GetScreen() );
RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE ); RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
...@@ -1135,11 +1133,11 @@ bool PlaceStruct( BASE_SCREEN* screen, EDA_BaseStruct* DrawStruct ) ...@@ -1135,11 +1133,11 @@ bool PlaceStruct( BASE_SCREEN* screen, EDA_BaseStruct* DrawStruct )
case DRAW_JUNCTION_STRUCT_TYPE: case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
case DRAW_SHEETLABEL_STRUCT_TYPE: case DRAW_SHEETLABEL_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE: case DRAW_MARKER_STRUCT_TYPE:
...@@ -1174,7 +1172,7 @@ void MoveOneStruct( EDA_BaseStruct* DrawStruct, const wxPoint& move_vector ) ...@@ -1174,7 +1172,7 @@ void MoveOneStruct( EDA_BaseStruct* DrawStruct, const wxPoint& move_vector )
DrawJunctionStruct* DrawConnect; DrawJunctionStruct* DrawConnect;
EDA_DrawLineStruct* DrawSegment; EDA_DrawLineStruct* DrawSegment;
DrawBusEntryStruct* DrawRaccord; DrawBusEntryStruct* DrawRaccord;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
DrawSheetStruct* DrawSheet; DrawSheetStruct* DrawSheet;
DrawSheetLabelStruct* DrawSheetLabel; DrawSheetLabelStruct* DrawSheetLabel;
DrawMarkerStruct* DrawMarker; DrawMarkerStruct* DrawMarker;
...@@ -1231,24 +1229,24 @@ void MoveOneStruct( EDA_BaseStruct* DrawStruct, const wxPoint& move_vector ) ...@@ -1231,24 +1229,24 @@ void MoveOneStruct( EDA_BaseStruct* DrawStruct, const wxPoint& move_vector )
DrawNoConnect->m_Pos += move_vector; DrawNoConnect->m_Pos += move_vector;
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
#define DrawText ( (DrawTextStruct*) DrawStruct ) #define DrawText ( (SCH_TEXT*) DrawStruct )
DrawText->m_Pos += move_vector; DrawText->m_Pos += move_vector;
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
#define DrawLabel ( (DrawLabelStruct*) DrawStruct ) #define DrawLabel ( (SCH_LABEL*) DrawStruct )
DrawLabel->m_Pos += move_vector; DrawLabel->m_Pos += move_vector;
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
#define DrawGHLabel ( (DrawLabelStruct*) DrawStruct ) #define DrawGHLabel ( (SCH_LABEL*) DrawStruct )
DrawGHLabel->m_Pos += move_vector; DrawGHLabel->m_Pos += move_vector;
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
DrawLibItem = (EDA_SchComponentStruct*) DrawStruct; DrawLibItem = (SCH_COMPONENT*) DrawStruct;
DrawLibItem->m_Pos += move_vector; DrawLibItem->m_Pos += move_vector;
for( ii = 0; ii < NUMBER_OF_FIELDS; ii++ ) for( ii = 0; ii < NUMBER_OF_FIELDS; ii++ )
{ {
...@@ -1325,24 +1323,24 @@ EDA_BaseStruct* DuplicateStruct( EDA_BaseStruct* DrawStruct ) ...@@ -1325,24 +1323,24 @@ EDA_BaseStruct* DuplicateStruct( EDA_BaseStruct* DrawStruct )
NewDrawStruct = ( (DrawNoConnectStruct*) DrawStruct )->GenCopy(); NewDrawStruct = ( (DrawNoConnectStruct*) DrawStruct )->GenCopy();
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
NewDrawStruct = ( (DrawTextStruct*) DrawStruct )->GenCopy(); NewDrawStruct = ( (SCH_TEXT*) DrawStruct )->GenCopy();
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
NewDrawStruct = ( (DrawLabelStruct*) DrawStruct )->GenCopy(); NewDrawStruct = ( (SCH_LABEL*) DrawStruct )->GenCopy();
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
NewDrawStruct = ( (DrawHierLabelStruct*) DrawStruct )->GenCopy(); NewDrawStruct = ( (SCH_HIERLABEL*) DrawStruct )->GenCopy();
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
NewDrawStruct = ( (DrawGlobalLabelStruct*) DrawStruct )->GenCopy(); NewDrawStruct = ( (SCH_GLOBALLABEL*) DrawStruct )->GenCopy();
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
NewDrawStruct = ( (EDA_SchComponentStruct*) DrawStruct )->GenCopy(); NewDrawStruct = ( (SCH_COMPONENT*) DrawStruct )->GenCopy();
break; break;
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
...@@ -1465,11 +1463,11 @@ static void CollectStructsToDrag( SCH_SCREEN* screen ) ...@@ -1465,11 +1463,11 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
{ {
Struct = DrawStructs->m_PickedStruct; Struct = DrawStructs->m_PickedStruct;
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext; DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_COMPONENT )
{ {
LibEDA_BaseStruct* DrawItem; LibEDA_BaseStruct* DrawItem;
wxPoint pos; wxPoint pos;
DrawItem = GetNextPinPosition( (EDA_SchComponentStruct*) Struct, pos ); DrawItem = GetNextPinPosition( (SCH_COMPONENT*) Struct, pos );
while( DrawItem ) while( DrawItem )
{ {
if( (pos.x < ox) || (pos.x > fx) || (pos.y < oy) || (pos.y > fy) ) if( (pos.x < ox) || (pos.x > fx) || (pos.y < oy) || (pos.y > fy) )
...@@ -1587,12 +1585,12 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position ) ...@@ -1587,12 +1585,12 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) Struct ) #define STRUCT ( (SCH_LABEL*) Struct )
if( Struct->m_Flags & SELECTED ) if( Struct->m_Flags & SELECTED )
break; /* Already in list */ break; /* Already in list */
if( STRUCT->m_Pos != position ) if( STRUCT->m_Pos != position )
...@@ -1604,10 +1602,10 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position ) ...@@ -1604,10 +1602,10 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
Struct->m_Flags |= SELECTED; Struct->m_Flags |= SELECTED;
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) Struct ) #define STRUCT ( (SCH_LABEL*) Struct )
if( Struct->m_Flags & SELECTED ) if( Struct->m_Flags & SELECTED )
break; /* Already in list */ break; /* Already in list */
if( STRUCT->m_Pos != position ) if( STRUCT->m_Pos != position )
...@@ -1619,7 +1617,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position ) ...@@ -1619,7 +1617,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
Struct->m_Flags |= SELECTED; Struct->m_Flags |= SELECTED;
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
break; break;
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
...@@ -1668,7 +1666,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position ) ...@@ -1668,7 +1666,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
/*********************************************************************************/ /*********************************************************************************/
static LibEDA_BaseStruct* GetNextPinPosition( EDA_SchComponentStruct* DrawLibItem, static LibEDA_BaseStruct* GetNextPinPosition( SCH_COMPONENT* DrawLibItem,
wxPoint& position ) wxPoint& position )
/*********************************************************************************/ /*********************************************************************************/
{ {
......
...@@ -642,9 +642,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -642,9 +642,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawTextStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_TEXT*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep; STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
...@@ -653,9 +653,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -653,9 +653,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_LABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep; STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
...@@ -664,9 +664,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -664,9 +664,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawHierLabelStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_HIERLABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep; STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
...@@ -674,9 +674,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -674,9 +674,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
IncrementLabelMember( STRUCT->m_Text ); IncrementLabelMember( STRUCT->m_Text );
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawGlobalLabelStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_GLOBALLABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep; STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
...@@ -701,9 +701,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -701,9 +701,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: // In repeat command the new component is put in move mode case TYPE_SCH_COMPONENT: // In repeat command the new component is put in move mode
#undef STRUCT #undef STRUCT
#define STRUCT ( (EDA_SchComponentStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_COMPONENT*) g_ItemToRepeat )
// Create the duplicate component, position = mouse cursor // Create the duplicate component, position = mouse cursor
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
...@@ -790,7 +790,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -790,7 +790,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
{ {
EDA_BaseStruct* item; EDA_BaseStruct* item;
LibDrawPin* pin; LibDrawPin* pin;
EDA_SchComponentStruct* LibItem = NULL; SCH_COMPONENT* LibItem = NULL;
DrawSheetLabelStruct* pinsheet; DrawSheetLabelStruct* pinsheet;
wxPoint itempos; wxPoint itempos;
...@@ -837,9 +837,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -837,9 +837,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
return TRUE; return TRUE;
item = PickStruct( pos, screen, LABELITEM ); item = PickStruct( pos, screen, LABELITEM );
if( item && (item->Type() != DRAW_TEXT_STRUCT_TYPE) if( item && (item->Type() != TYPE_SCH_TEXT)
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.x == pos.x ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.x == pos.x )
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.y == pos.y ) ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
return TRUE; return TRUE;
pinsheet = LocateAnyPinSheet( pos, screen ); pinsheet = LocateAnyPinSheet( pos, screen );
......
...@@ -184,12 +184,12 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC ) ...@@ -184,12 +184,12 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
/* Search Hlabel corresponding to this Pinsheet */ /* Search Hlabel corresponding to this Pinsheet */
EDA_BaseStruct* DrawStruct = m_AssociatedScreen->EEDrawList; EDA_BaseStruct* DrawStruct = m_AssociatedScreen->EEDrawList;
DrawHierLabelStruct* HLabel = NULL; SCH_HIERLABEL* HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext ) for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
{ {
if( DrawStruct->Type() != DRAW_HIER_LABEL_STRUCT_TYPE ) if( DrawStruct->Type() != TYPE_SCH_HIERLABEL )
continue; continue;
HLabel = (DrawHierLabelStruct*) DrawStruct; HLabel = (SCH_HIERLABEL*) DrawStruct;
if( Pinsheet->m_Text.CmpNoCase( HLabel->m_Text ) == 0 ) if( Pinsheet->m_Text.CmpNoCase( HLabel->m_Text ) == 0 )
break; // Found! break; // Found!
HLabel = NULL; HLabel = NULL;
...@@ -282,9 +282,9 @@ void DrawSheetStruct::DeleteAnnotation( bool recurse ) ...@@ -282,9 +282,9 @@ void DrawSheetStruct::DeleteAnnotation( bool recurse )
EDA_BaseStruct* comp = m_AssociatedScreen->EEDrawList; EDA_BaseStruct* comp = m_AssociatedScreen->EEDrawList;
for( ; comp; comp = comp->Pnext ) for( ; comp; comp = comp->Pnext )
{ {
if( comp->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( comp->Type() == TYPE_SCH_COMPONENT )
{ {
( (EDA_SchComponentStruct*) comp )->ClearAnnotation(); ( (SCH_COMPONENT*) comp )->ClearAnnotation();
} }
} }
} }
...@@ -305,9 +305,9 @@ int DrawSheetStruct::ComponentCount() ...@@ -305,9 +305,9 @@ int DrawSheetStruct::ComponentCount()
EDA_BaseStruct* bs; EDA_BaseStruct* bs;
for( bs = m_AssociatedScreen->EEDrawList; bs != NULL; bs = bs->Pnext ) for( bs = m_AssociatedScreen->EEDrawList; bs != NULL; bs = bs->Pnext )
{ {
if( bs->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( bs->Type() == TYPE_SCH_COMPONENT )
{ {
DrawPartStruct* Cmp = (DrawPartStruct*) bs; SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs;
if( Cmp->m_Field[VALUE].m_Text.GetChar( 0 ) != '#' ) if( Cmp->m_Field[VALUE].m_Text.GetChar( 0 ) != '#' )
n++; n++;
} }
...@@ -803,9 +803,9 @@ void DrawSheetPath::UpdateAllScreenReferences() ...@@ -803,9 +803,9 @@ void DrawSheetPath::UpdateAllScreenReferences()
while( t ) while( t )
{ {
if( t->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( t->Type() == TYPE_SCH_COMPONENT )
{ {
EDA_SchComponentStruct* d = (EDA_SchComponentStruct*) t; SCH_COMPONENT* d = (SCH_COMPONENT*) t;
d->m_Field[REFERENCE].m_Text = d->GetRef( this ); d->m_Field[REFERENCE].m_Text = d->GetRef( this );
} }
t = t->Pnext; t = t->Pnext;
......
...@@ -19,11 +19,11 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen ) ...@@ -19,11 +19,11 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
{ {
case DRAW_POLYLINE_STRUCT_TYPE: case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE: case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
......
...@@ -18,15 +18,15 @@ ...@@ -18,15 +18,15 @@
/************************/ /************************/
/* class DrawTextStruct */ /* class SCH_TEXT */
/* class DrawLabelStruct */ /* class SCH_LABEL */
/* class DrawGlobalLabelStruct */ /* class SCH_GLOBALLABEL */
/* class DrawHierLabelStruct */ /* class SCH_HIERLABEL */
/************************/ /************************/
/**************************************************************************/ /**************************************************************************/
DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_T aType ) : SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
EDA_BaseStruct( aType ) SCH_ITEM( NULL, aType )
, EDA_TextStruct( text ) , EDA_TextStruct( text )
/**************************************************************************/ /**************************************************************************/
{ {
...@@ -38,28 +38,28 @@ DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_ ...@@ -38,28 +38,28 @@ DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_
/*********************************************/ /*********************************************/
DrawTextStruct* DrawTextStruct::GenCopy() SCH_TEXT* SCH_TEXT::GenCopy()
/*********************************************/ /*********************************************/
{ {
DrawTextStruct* newitem; SCH_TEXT* newitem;
switch( Type() ) switch( Type() )
{ {
default: default:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
newitem = new DrawTextStruct( m_Pos, m_Text ); newitem = new SCH_TEXT( m_Pos, m_Text );
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
newitem = new DrawGlobalLabelStruct( m_Pos, m_Text ); newitem = new SCH_GLOBALLABEL( m_Pos, m_Text );
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
newitem = new DrawHierLabelStruct( m_Pos, m_Text ); newitem = new SCH_HIERLABEL( m_Pos, m_Text );
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
newitem = new DrawLabelStruct( m_Pos, m_Text ); newitem = new SCH_LABEL( m_Pos, m_Text );
break; break;
} }
...@@ -77,7 +77,7 @@ DrawTextStruct* DrawTextStruct::GenCopy() ...@@ -77,7 +77,7 @@ DrawTextStruct* DrawTextStruct::GenCopy()
/********************************************************/ /********************************************************/
void DrawTextStruct::SwapData( DrawTextStruct* copyitem ) void SCH_TEXT::SwapData( SCH_TEXT* copyitem )
/********************************************************/ /********************************************************/
{ {
EXCHG( m_Text, copyitem->m_Text ); EXCHG( m_Text, copyitem->m_Text );
...@@ -95,20 +95,20 @@ void DrawTextStruct::SwapData( DrawTextStruct* copyitem ) ...@@ -95,20 +95,20 @@ void DrawTextStruct::SwapData( DrawTextStruct* copyitem )
/***************************************************************/ /***************************************************************/
void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/***************************************************************/ /***************************************************************/
{ {
/* save old text in undo list */ /* save old text in undo list */
if( g_ItemToUndoCopy && ( (m_Flags & IS_NEW) == 0 ) ) if( g_ItemToUndoCopy && ( (m_Flags & IS_NEW) == 0 ) )
{ {
/* restore old values and save new ones */ /* restore old values and save new ones */
SwapData( (DrawTextStruct*) g_ItemToUndoCopy ); SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
/* save in undo list */ /* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED ); ( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */ /* restore new values */
SwapData( (DrawTextStruct*) g_ItemToUndoCopy ); SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
SAFE_DELETE( g_ItemToUndoCopy ); SAFE_DELETE( g_ItemToUndoCopy );
} }
...@@ -118,8 +118,8 @@ void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -118,8 +118,8 @@ void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/****************************************************************************/ /****************************************************************************/
DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) : SCH_LABEL::SCH_LABEL( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_LABEL_STRUCT_TYPE ) SCH_TEXT( pos, text, TYPE_SCH_LABEL )
/****************************************************************************/ /****************************************************************************/
{ {
m_Layer = LAYER_LOCLABEL; m_Layer = LAYER_LOCLABEL;
...@@ -129,8 +129,8 @@ DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) : ...@@ -129,8 +129,8 @@ DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) :
/***********************************************************************************/ /***********************************************************************************/
DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString& text ) : SCH_GLOBALLABEL::SCH_GLOBALLABEL( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_GLOBAL_LABEL_STRUCT_TYPE ) SCH_TEXT( pos, text, TYPE_SCH_GLOBALLABEL )
/***********************************************************************************/ /***********************************************************************************/
{ {
m_Layer = LAYER_GLOBLABEL; m_Layer = LAYER_GLOBLABEL;
...@@ -140,8 +140,8 @@ DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString ...@@ -140,8 +140,8 @@ DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString
/***********************************************************************************/ /***********************************************************************************/
DrawHierLabelStruct::DrawHierLabelStruct( const wxPoint& pos, const wxString& text ) : SCH_HIERLABEL::SCH_HIERLABEL( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_HIER_LABEL_STRUCT_TYPE ) SCH_TEXT( pos, text, TYPE_SCH_HIERLABEL )
/***********************************************************************************/ /***********************************************************************************/
{ {
m_Layer = LAYER_HIERLABEL; m_Layer = LAYER_HIERLABEL;
...@@ -151,7 +151,7 @@ DrawHierLabelStruct::DrawHierLabelStruct( const wxPoint& pos, const wxString& te ...@@ -151,7 +151,7 @@ DrawHierLabelStruct::DrawHierLabelStruct( const wxPoint& pos, const wxString& te
/*******************************************************************************************/ /*******************************************************************************************/
void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color ) int DrawMode, int Color )
/*******************************************************************************************/ /*******************************************************************************************/
...@@ -211,16 +211,16 @@ void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& off ...@@ -211,16 +211,16 @@ void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& off
/*********************************************************************************************/ /*********************************************************************************************/
void DrawLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void SCH_LABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color ) int DrawMode, int Color )
/*********************************************************************************************/ /*********************************************************************************************/
{ {
DrawTextStruct::Draw( panel, DC, offset, DrawMode, Color ); SCH_TEXT::Draw( panel, DC, offset, DrawMode, Color );
} }
/*******************************************************************************************/ /*******************************************************************************************/
void DrawHierLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color ) int DrawMode, int Color )
/******************************************************************************************/ /******************************************************************************************/
...@@ -288,7 +288,7 @@ void DrawHierLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint ...@@ -288,7 +288,7 @@ void DrawHierLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint
* format list is * format list is
* corner_count, x0, y0, ... xn, yn * corner_count, x0, y0, ... xn, yn
*/ */
void DrawHierLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& Pos ) void SCH_HIERLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
{ {
int* Template = TemplateShape[m_Shape][m_Orient]; int* Template = TemplateShape[m_Shape][m_Orient];
int HalfSize = m_Size.x / 2; int HalfSize = m_Size.x / 2;
...@@ -307,7 +307,7 @@ void DrawHierLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& P ...@@ -307,7 +307,7 @@ void DrawHierLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& P
/*******************************************************************************************/ /*******************************************************************************************/
void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& draw_offset, void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& draw_offset,
int DrawMode, int Color ) int DrawMode, int Color )
/******************************************************************************************/ /******************************************************************************************/
...@@ -392,7 +392,7 @@ void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoi ...@@ -392,7 +392,7 @@ void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoi
* format list is * format list is
* <corner_count>, x0, y0, ... xn, yn * <corner_count>, x0, y0, ... xn, yn
*/ */
void DrawGlobalLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& Pos ) void SCH_GLOBALLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
{ {
int HalfSize = m_Size.x / 2; int HalfSize = m_Size.x / 2;
int width = MAX( m_Width, g_DrawMinimunLineWidth ); int width = MAX( m_Width, g_DrawMinimunLineWidth );
......
...@@ -76,7 +76,7 @@ int* TemplateShape[5][4] = ...@@ -76,7 +76,7 @@ int* TemplateShape[5][4] =
extern int* TemplateShape[5][4]; extern int* TemplateShape[5][4];
#endif #endif
class DrawTextStruct : public EDA_BaseStruct class SCH_TEXT : public SCH_ITEM
, public EDA_TextStruct , public EDA_TextStruct
{ {
public: public:
...@@ -85,31 +85,31 @@ public: ...@@ -85,31 +85,31 @@ public:
bool m_IsDangling; // TRUE si non connect� bool m_IsDangling; // TRUE si non connect�
public: public:
DrawTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString, SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString,
KICAD_T aType = DRAW_TEXT_STRUCT_TYPE ); KICAD_T aType = TYPE_SCH_TEXT );
~DrawTextStruct() { } ~SCH_TEXT() { }
virtual wxString GetClass() const virtual wxString GetClass() const
{ {
return wxT( "DrawText" ); return wxT( "SCH_TEXT" );
} }
DrawTextStruct* GenCopy(); SCH_TEXT* GenCopy();
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
void SwapData( DrawTextStruct* copyitem ); void SwapData( SCH_TEXT* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC ); virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
}; };
class DrawLabelStruct : public DrawTextStruct class SCH_LABEL : public SCH_TEXT
{ {
public: public:
DrawLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString ); SCH_LABEL( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~DrawLabelStruct() { } ~SCH_LABEL() { }
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
...@@ -120,12 +120,12 @@ public: ...@@ -120,12 +120,12 @@ public:
}; };
class DrawGlobalLabelStruct : public DrawTextStruct class SCH_GLOBALLABEL : public SCH_TEXT
{ {
public: public:
DrawGlobalLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), SCH_GLOBALLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
const wxString& text = wxEmptyString ); const wxString& text = wxEmptyString );
~DrawGlobalLabelStruct() { } ~SCH_GLOBALLABEL() { }
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
...@@ -147,12 +147,12 @@ public: ...@@ -147,12 +147,12 @@ public:
class DrawHierLabelStruct : public DrawTextStruct class SCH_HIERLABEL : public SCH_TEXT
{ {
public: public:
DrawHierLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), SCH_HIERLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
const wxString& text = wxEmptyString ); const wxString& text = wxEmptyString );
~DrawHierLabelStruct() { } ~SCH_HIERLABEL() { }
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
......
...@@ -105,14 +105,14 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen ) ...@@ -105,14 +105,14 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_NOCONNECT_STRUCT_TYPE: case DRAW_NOCONNECT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
case DRAW_PICK_ITEM_STRUCT_TYPE: case DRAW_PICK_ITEM_STRUCT_TYPE:
case DRAW_POLYLINE_STRUCT_TYPE: case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE: case DRAW_MARKER_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
case DRAW_SHEETLABEL_STRUCT_TYPE: case DRAW_SHEETLABEL_STRUCT_TYPE:
break; break;
......
...@@ -269,7 +269,7 @@ EDA_Rect DrawJunctionStruct::GetBoundingBox() ...@@ -269,7 +269,7 @@ EDA_Rect DrawJunctionStruct::GetBoundingBox()
}; };
EDA_Rect EDA_SchComponentStruct::GetBoundingBox() EDA_Rect SCH_COMPONENT::GetBoundingBox()
{ {
const int PADDING = 40; const int PADDING = 40;
......
...@@ -22,28 +22,9 @@ ...@@ -22,28 +22,9 @@
WX_DEFINE_OBJARRAY( ArrayOfSheetLists ); WX_DEFINE_OBJARRAY( ArrayOfSheetLists );
/***************************/ /***************************/
/* class DrawPartStruct */ /* class SCH_COMPONENT */
/* class EDA_SchComponentStruct */
/***************************/ /***************************/
/***********************************************************************************/
DrawPartStruct::DrawPartStruct( KICAD_T struct_type, const wxPoint& pos ) :
EDA_BaseStruct( struct_type )
/***********************************************************************************/
{
m_Layer = 0;
m_Pos = pos;
m_TimeStamp = 0;
}
/************************************/
DrawPartStruct::~DrawPartStruct()
/************************************/
{
}
/****************************************************************/ /****************************************************************/
const wxString& ReturnDefaultFieldName( int aFieldNdx ) const wxString& ReturnDefaultFieldName( int aFieldNdx )
/****************************************************************/ /****************************************************************/
...@@ -78,7 +59,7 @@ const wxString& ReturnDefaultFieldName( int aFieldNdx ) ...@@ -78,7 +59,7 @@ const wxString& ReturnDefaultFieldName( int aFieldNdx )
/****************************************************************/ /****************************************************************/
const wxString& EDA_SchComponentStruct::ReturnFieldName( int aFieldNdx ) const const wxString& SCH_COMPONENT::ReturnFieldName( int aFieldNdx ) const
/****************************************************************/ /****************************************************************/
/* Return the Field name from its index (REFERENCE, VALUE ..) /* Return the Field name from its index (REFERENCE, VALUE ..)
...@@ -94,7 +75,7 @@ const wxString& EDA_SchComponentStruct::ReturnFieldName( int aFieldNdx ) const ...@@ -94,7 +75,7 @@ const wxString& EDA_SchComponentStruct::ReturnFieldName( int aFieldNdx ) const
/****************************************************************/ /****************************************************************/
wxString EDA_SchComponentStruct::GetPath( DrawSheetPath* sheet ) wxString SCH_COMPONENT::GetPath( DrawSheetPath* sheet )
/****************************************************************/ /****************************************************************/
{ {
wxString str; wxString str;
...@@ -105,7 +86,7 @@ wxString EDA_SchComponentStruct::GetPath( DrawSheetPath* sheet ) ...@@ -105,7 +86,7 @@ wxString EDA_SchComponentStruct::GetPath( DrawSheetPath* sheet )
/********************************************************************/ /********************************************************************/
const wxString EDA_SchComponentStruct::GetRef( DrawSheetPath* sheet ) const wxString SCH_COMPONENT::GetRef( DrawSheetPath* sheet )
/********************************************************************/ /********************************************************************/
{ {
wxString path = GetPath( sheet ); wxString path = GetPath( sheet );
...@@ -137,7 +118,7 @@ const wxString EDA_SchComponentStruct::GetRef( DrawSheetPath* sheet ) ...@@ -137,7 +118,7 @@ const wxString EDA_SchComponentStruct::GetRef( DrawSheetPath* sheet )
/***********************************************************************/ /***********************************************************************/
void EDA_SchComponentStruct::SetRef( DrawSheetPath* sheet, wxString ref ) void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, wxString ref )
/***********************************************************************/ /***********************************************************************/
{ {
//check to see if it is already there before inserting it //check to see if it is already there before inserting it
...@@ -176,7 +157,7 @@ void EDA_SchComponentStruct::SetRef( DrawSheetPath* sheet, wxString ref ) ...@@ -176,7 +157,7 @@ void EDA_SchComponentStruct::SetRef( DrawSheetPath* sheet, wxString ref )
/**************************************/ /**************************************/
void EDA_SchComponentStruct::ClearRefs() void SCH_COMPONENT::ClearRefs()
/**************************************/ /**************************************/
{ {
m_Paths.Empty(); m_Paths.Empty();
...@@ -184,7 +165,7 @@ void EDA_SchComponentStruct::ClearRefs() ...@@ -184,7 +165,7 @@ void EDA_SchComponentStruct::ClearRefs()
} }
const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const const wxString& SCH_COMPONENT::GetFieldValue( int aFieldNdx ) const
{ {
// avoid unnecessarily copying wxStrings. // avoid unnecessarily copying wxStrings.
static const wxString myEmpty = wxEmptyString; static const wxString myEmpty = wxEmptyString;
...@@ -197,14 +178,16 @@ const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const ...@@ -197,14 +178,16 @@ const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const
/*******************************************************************/ /*******************************************************************/
EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) : SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos ) :
DrawPartStruct( DRAW_LIB_ITEM_STRUCT_TYPE, pos ) SCH_ITEM( NULL, TYPE_SCH_COMPONENT )
/*******************************************************************/ /*******************************************************************/
{ {
int ii; int ii;
m_Multi = 0; /* In multi unit chip - which unit to draw. */ m_Multi = 0; /* In multi unit chip - which unit to draw. */
m_Pos = aPos;
//m_FlagControlMulti = 0; //m_FlagControlMulti = 0;
m_UsedOnSheets.Clear(); m_UsedOnSheets.Clear();
m_Convert = 0; /* Gestion des mutiples representations (conversion De Morgan) */ m_Convert = 0; /* Gestion des mutiples representations (conversion De Morgan) */
...@@ -234,7 +217,7 @@ EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) : ...@@ -234,7 +217,7 @@ EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) :
/************************************************/ /************************************************/
EDA_Rect EDA_SchComponentStruct::GetBoundaryBox() const EDA_Rect SCH_COMPONENT::GetBoundaryBox() const
/************************************************/ /************************************************/
{ {
EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT ); EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
...@@ -309,7 +292,7 @@ void PartTextStruct::SwapData( PartTextStruct* copyitem ) ...@@ -309,7 +292,7 @@ void PartTextStruct::SwapData( PartTextStruct* copyitem )
/**************************************************************************/ /**************************************************************************/
void EDA_SchComponentStruct::SwapData( EDA_SchComponentStruct* copyitem ) void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem )
/**************************************************************************/ /**************************************************************************/
/* Used if undo / redo command: /* Used if undo / redo command:
...@@ -332,7 +315,7 @@ void EDA_SchComponentStruct::SwapData( EDA_SchComponentStruct* copyitem ) ...@@ -332,7 +315,7 @@ void EDA_SchComponentStruct::SwapData( EDA_SchComponentStruct* copyitem )
/***********************************************************************/ /***********************************************************************/
void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) void SCH_COMPONENT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/***********************************************************************/ /***********************************************************************/
{ {
/* save old text in undo list */ /* save old text in undo list */
...@@ -341,13 +324,13 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -341,13 +324,13 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
&& ( (m_Flags & IS_NEW) == 0 ) ) && ( (m_Flags & IS_NEW) == 0 ) )
{ {
/* restore old values and save new ones */ /* restore old values and save new ones */
SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy ); SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
/* save in undo list */ /* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED ); ( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */ /* restore new values */
SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy ); SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
SAFE_DELETE( g_ItemToUndoCopy ); SAFE_DELETE( g_ItemToUndoCopy );
} }
...@@ -357,7 +340,7 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -357,7 +340,7 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/***************************************************/ /***************************************************/
void EDA_SchComponentStruct::ClearAnnotation() void SCH_COMPONENT::ClearAnnotation()
/***************************************************/ /***************************************************/
/* Suppress annotation ( i.i IC23 changed to IC? and part reset to 1) /* Suppress annotation ( i.i IC23 changed to IC? and part reset to 1)
...@@ -386,10 +369,10 @@ void EDA_SchComponentStruct::ClearAnnotation() ...@@ -386,10 +369,10 @@ void EDA_SchComponentStruct::ClearAnnotation()
/**************************************************************/ /**************************************************************/
EDA_SchComponentStruct* EDA_SchComponentStruct::GenCopy() SCH_COMPONENT* SCH_COMPONENT::GenCopy()
/**************************************************************/ /**************************************************************/
{ {
EDA_SchComponentStruct* new_item = new EDA_SchComponentStruct( m_Pos ); SCH_COMPONENT* new_item = new SCH_COMPONENT( m_Pos );
int ii; int ii;
...@@ -418,7 +401,7 @@ EDA_SchComponentStruct* EDA_SchComponentStruct::GenCopy() ...@@ -418,7 +401,7 @@ EDA_SchComponentStruct* EDA_SchComponentStruct::GenCopy()
/*****************************************************************/ /*****************************************************************/
void EDA_SchComponentStruct::SetRotationMiroir( int type_rotate ) void SCH_COMPONENT::SetRotationMiroir( int type_rotate )
/******************************************************************/ /******************************************************************/
/* Compute the new matrix transform for a schematic component /* Compute the new matrix transform for a schematic component
...@@ -561,7 +544,7 @@ void EDA_SchComponentStruct::SetRotationMiroir( int type_rotate ) ...@@ -561,7 +544,7 @@ void EDA_SchComponentStruct::SetRotationMiroir( int type_rotate )
/****************************************************/ /****************************************************/
int EDA_SchComponentStruct::GetRotationMiroir() int SCH_COMPONENT::GetRotationMiroir()
/****************************************************/ /****************************************************/
{ {
int type_rotate = CMP_ORIENT_0; int type_rotate = CMP_ORIENT_0;
...@@ -626,7 +609,7 @@ int EDA_SchComponentStruct::GetRotationMiroir() ...@@ -626,7 +609,7 @@ int EDA_SchComponentStruct::GetRotationMiroir()
/***********************************************************************/ /***********************************************************************/
wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord ) wxPoint SCH_COMPONENT::GetScreenCoord( const wxPoint& coord )
/***********************************************************************/ /***********************************************************************/
/* Renvoie la coordonn�e du point coord, en fonction de l'orientation /* Renvoie la coordonn�e du point coord, en fonction de l'orientation
...@@ -651,7 +634,7 @@ wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord ) ...@@ -651,7 +634,7 @@ wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord )
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void EDA_SchComponentStruct::Show( int nestLevel, std::ostream& os ) void SCH_COMPONENT::Show( int nestLevel, std::ostream& os )
{ {
// for now, make it look like XML: // for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
...@@ -748,7 +731,7 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const ...@@ -748,7 +731,7 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const
int orient; int orient;
int dx, dy, x1, y1, x2, y2; int dx, dy, x1, y1, x2, y2;
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) m_Parent; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent;
orient = m_Orient; orient = m_Orient;
wxPoint pos = DrawLibItem->m_Pos; wxPoint pos = DrawLibItem->m_Pos;
......
...@@ -65,35 +65,21 @@ public: ...@@ -65,35 +65,21 @@ public:
}; };
/* the class DrawPartStruct describes a basic virtual component WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists );
* Not used directly:
* used classes are EDA_SchComponentStruct (the "classic" schematic component, below) /**
* and the Pseudo component DrawSheetStruct * Class SCH_COMPONENT
* describes a real schematic component
*/ */
class DrawPartStruct : public EDA_BaseStruct class SCH_COMPONENT : public SCH_ITEM
{ {
public: public:
int m_Layer; int m_Multi; /* In multi unit chip - which unit to draw. */
wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */
PartTextStruct m_Field[NUMBER_OF_FIELDS];
wxPoint m_Pos; /* Exact position of part. */
public:
DrawPartStruct( KICAD_T struct_type, const wxPoint& pos );
~DrawPartStruct();
virtual wxString GetClass() const wxPoint m_Pos;
{
return wxT( "DrawPart" );
}
};
WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists ); wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */
/* the class EDA_SchComponentStruct describes a real component */ PartTextStruct m_Field[NUMBER_OF_FIELDS];
class EDA_SchComponentStruct : public DrawPartStruct
{
public:
int m_Multi; /* In multi unit chip - which unit to draw. */
//int m_FlagControlMulti; //int m_FlagControlMulti;
ArrayOfSheetLists m_UsedOnSheets; ArrayOfSheetLists m_UsedOnSheets;
...@@ -108,16 +94,16 @@ public: ...@@ -108,16 +94,16 @@ public:
* determined, upon file load, by the first non-digits in the reference fields. */ * determined, upon file load, by the first non-digits in the reference fields. */
public: public:
EDA_SchComponentStruct( const wxPoint& pos = wxPoint( 0, 0 ) ); SCH_COMPONENT( const wxPoint& pos = wxPoint( 0, 0 ) );
~EDA_SchComponentStruct( void ) { } ~SCH_COMPONENT() { }
virtual wxString GetClass() const virtual wxString GetClass() const
{ {
return wxT( "EDA_SchComponent" ); return wxT( "SCH_COMPONENT" );
} }
EDA_SchComponentStruct* GenCopy(); SCH_COMPONENT* GenCopy();
void SetRotationMiroir( int type ); void SetRotationMiroir( int type );
int GetRotationMiroir(); int GetRotationMiroir();
wxPoint GetScreenCoord( const wxPoint& coord ); wxPoint GetScreenCoord( const wxPoint& coord );
...@@ -143,7 +129,7 @@ public: ...@@ -143,7 +129,7 @@ public:
const wxPoint& offset, const wxPoint& offset,
int draw_mode, int draw_mode,
int Color = -1 ); int Color = -1 );
void SwapData( EDA_SchComponentStruct* copyitem ); void SwapData( SCH_COMPONENT* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC ); virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
......
...@@ -42,7 +42,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin ) ...@@ -42,7 +42,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
wxString msg; wxString msg;
wxPoint mouse_position = GetScreen()->m_MousePosition; wxPoint mouse_position = GetScreen()->m_MousePosition;
LibDrawPin* Pin = NULL; LibDrawPin* Pin = NULL;
EDA_SchComponentStruct* LibItem = NULL; SCH_COMPONENT* LibItem = NULL;
DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin ); DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin );
if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) ) if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
...@@ -57,15 +57,15 @@ SchematicGeneralLocateAndDisplay( bool IncludePin ) ...@@ -57,15 +57,15 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
{ {
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
case COMPONENT_FIELD_DRAW_TYPE: case COMPONENT_FIELD_DRAW_TYPE:
LibItem = (EDA_SchComponentStruct*) DrawStruct->m_Parent; LibItem = (SCH_COMPONENT*) DrawStruct->m_Parent;
SendMessageToPCBNEW( DrawStruct,LibItem ); SendMessageToPCBNEW( DrawStruct,LibItem );
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
Pin = LocateAnyPin( GetScreen()->EEDrawList, GetScreen()->m_Curseur, &LibItem ); Pin = LocateAnyPin( GetScreen()->EEDrawList, GetScreen()->m_Curseur, &LibItem );
if( Pin ) if( Pin )
break; // Priority is probing a pin first break; // Priority is probing a pin first
LibItem = (EDA_SchComponentStruct*) DrawStruct; LibItem = (SCH_COMPONENT*) DrawStruct;
SendMessageToPCBNEW( DrawStruct, LibItem ); SendMessageToPCBNEW( DrawStruct, LibItem );
break; break;
...@@ -118,7 +118,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin ) ...@@ -118,7 +118,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
{ {
EDA_BaseStruct* DrawStruct; EDA_BaseStruct* DrawStruct;
LibDrawPin* Pin; LibDrawPin* Pin;
EDA_SchComponentStruct* LibItem; SCH_COMPONENT* LibItem;
wxString Text; wxString Text;
wxString msg; wxString msg;
int ii; int ii;
...@@ -175,7 +175,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin ) ...@@ -175,7 +175,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
if( DrawStruct ) if( DrawStruct )
{ {
PartTextStruct* Field = (PartTextStruct*) DrawStruct; PartTextStruct* Field = (PartTextStruct*) DrawStruct;
LibItem = (EDA_SchComponentStruct*) Field->m_Parent; LibItem = (SCH_COMPONENT*) Field->m_Parent;
LibItem->Display_Infos( this ); LibItem->Display_Infos( this );
return DrawStruct; return DrawStruct;
...@@ -199,7 +199,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin ) ...@@ -199,7 +199,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
if( DrawStruct ) if( DrawStruct )
{ {
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
LibItem = (EDA_SchComponentStruct*) DrawStruct; LibItem = (SCH_COMPONENT*) DrawStruct;
LibItem->Display_Infos( this ); LibItem->Display_Infos( this );
return DrawStruct; return DrawStruct;
} }
......
...@@ -86,7 +86,7 @@ void RemoteCommand( const char* cmdline ) ...@@ -86,7 +86,7 @@ void RemoteCommand( const char* cmdline )
/*****************************************************************************/ /*****************************************************************************/
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
EDA_SchComponentStruct* LibItem ) SCH_COMPONENT* LibItem )
/*****************************************************************************/ /*****************************************************************************/
/** Send a remote command to eeschema via a socket, /** Send a remote command to eeschema via a socket,
...@@ -116,8 +116,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT ...@@ -116,8 +116,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
} }
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
LibItem = (EDA_SchComponentStruct*) objectToSync; LibItem = (SCH_COMPONENT*) objectToSync;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) ); sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line ); SendCommand( MSG_TO_PCB, Line );
break; break;
......
...@@ -47,7 +47,7 @@ DanglingEndHandle* ItemList; ...@@ -47,7 +47,7 @@ DanglingEndHandle* ItemList;
static void TestWireForDangling( EDA_DrawLineStruct* DrawRef, static void TestWireForDangling( EDA_DrawLineStruct* DrawRef,
WinEDA_SchematicFrame* frame, wxDC* DC ); WinEDA_SchematicFrame* frame, wxDC* DC );
void TestLabelForDangling( DrawTextStruct* label, void TestLabelForDangling( SCH_TEXT* label,
WinEDA_SchematicFrame* frame, wxDC* DC ); WinEDA_SchematicFrame* frame, wxDC* DC );
DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList ); DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList );
...@@ -111,11 +111,11 @@ void WinEDA_SchematicFrame::TestDanglingEnds( EDA_BaseStruct* DrawList, wxDC* DC ...@@ -111,11 +111,11 @@ void WinEDA_SchematicFrame::TestDanglingEnds( EDA_BaseStruct* DrawList, wxDC* DC
{ {
switch( DrawItem->Type() ) switch( DrawItem->Type() )
{ {
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawItem ) #define STRUCT ( (SCH_LABEL*) DrawItem )
TestLabelForDangling( STRUCT, this, DC ); TestLabelForDangling( STRUCT, this, DC );
break; break;
break; break;
...@@ -155,7 +155,7 @@ LibDrawPin* WinEDA_SchematicFrame::LocatePinEnd( EDA_BaseStruct* DrawList, ...@@ -155,7 +155,7 @@ LibDrawPin* WinEDA_SchematicFrame::LocatePinEnd( EDA_BaseStruct* DrawList,
* NULL sinon * NULL sinon
*/ */
{ {
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
LibDrawPin* Pin; LibDrawPin* Pin;
wxPoint pinpos; wxPoint pinpos;
...@@ -223,7 +223,7 @@ void TestWireForDangling( EDA_DrawLineStruct* DrawRef, ...@@ -223,7 +223,7 @@ void TestWireForDangling( EDA_DrawLineStruct* DrawRef,
/********************************************************/ /********************************************************/
void TestLabelForDangling( DrawTextStruct* label, void TestLabelForDangling( SCH_TEXT* label,
WinEDA_SchematicFrame* frame, wxDC* DC ) WinEDA_SchematicFrame* frame, wxDC* DC )
/********************************************************/ /********************************************************/
{ {
...@@ -281,7 +281,7 @@ void TestLabelForDangling( DrawTextStruct* label, ...@@ -281,7 +281,7 @@ void TestLabelForDangling( DrawTextStruct* label,
/****************************************************/ /****************************************************/
wxPoint ReturnPinPhysicalPosition( LibDrawPin* Pin, wxPoint ReturnPinPhysicalPosition( LibDrawPin* Pin,
EDA_SchComponentStruct* DrawLibItem ) SCH_COMPONENT* DrawLibItem )
/****************************************************/ /****************************************************/
/* Retourne la position physique de la pin, qui d�pend de l'orientation /* Retourne la position physique de la pin, qui d�pend de l'orientation
...@@ -316,13 +316,13 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList ) ...@@ -316,13 +316,13 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
{ {
switch( DrawItem->Type() ) switch( DrawItem->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawItem ) #define STRUCT ( (SCH_LABEL*) DrawItem )
item = new DanglingEndHandle( LABEL_END ); item = new DanglingEndHandle( LABEL_END );
item->m_Item = DrawItem; item->m_Item = DrawItem;
...@@ -395,10 +395,10 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList ) ...@@ -395,10 +395,10 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
lastitem = item; lastitem = item;
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
{ {
#undef STRUCT #undef STRUCT
#define STRUCT ( (EDA_SchComponentStruct*) DrawItem ) #define STRUCT ( (SCH_COMPONENT*) DrawItem )
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
Entry = FindLibPart( STRUCT->m_ChipName, wxEmptyString, FIND_ROOT ); Entry = FindLibPart( STRUCT->m_ChipName, wxEmptyString, FIND_ROOT );
if( Entry == NULL ) if( Entry == NULL )
......
...@@ -280,10 +280,10 @@ void WinEDA_SchematicFrame::DeleteConnection( wxDC* DC, bool DeleteFullConnectio ...@@ -280,10 +280,10 @@ void WinEDA_SchematicFrame::DeleteConnection( wxDC* DC, bool DeleteFullConnectio
if( DelStruct->m_Flags & STRUCT_DELETED ) if( DelStruct->m_Flags & STRUCT_DELETED )
continue; continue;
if( DelStruct->Type() != DRAW_LABEL_STRUCT_TYPE ) if( DelStruct->Type() != TYPE_SCH_LABEL )
continue; continue;
GetScreen()->m_Curseur = ( (DrawTextStruct*) DelStruct )->m_Pos; GetScreen()->m_Curseur = ( (SCH_TEXT*) DelStruct )->m_Pos;
EDA_BaseStruct* TstStruct = EDA_BaseStruct* TstStruct =
PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM | BUSITEM ); PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM | BUSITEM );
......
...@@ -845,7 +845,7 @@ int GenListeCmp( ListComponent* List ) ...@@ -845,7 +845,7 @@ int GenListeCmp( ListComponent* List )
{ {
int ItemCount = 0; int ItemCount = 0;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
DrawSheetPath* sheet; DrawSheetPath* sheet;
/* Build the sheet (not screen) list */ /* Build the sheet (not screen) list */
...@@ -858,9 +858,9 @@ int GenListeCmp( ListComponent* List ) ...@@ -858,9 +858,9 @@ int GenListeCmp( ListComponent* List )
{ {
switch( DrawList->Type() ) switch( DrawList->Type() )
{ {
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
ItemCount++; ItemCount++;
DrawLibItem = (EDA_SchComponentStruct*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
DrawLibItem->m_Parent = sheet->LastScreen(); DrawLibItem->m_Parent = sheet->LastScreen();
if( List ) if( List )
{ {
...@@ -910,8 +910,8 @@ static int GenListeGLabels( ListLabel* List ) ...@@ -910,8 +910,8 @@ static int GenListeGLabels( ListLabel* List )
{ {
switch( DrawList->Type() ) switch( DrawList->Type() )
{ {
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
ItemCount++; ItemCount++;
if( List ) if( List )
{ {
...@@ -1063,12 +1063,12 @@ static int ListTriGLabelByVal( ListLabel* Objet1, ListLabel* Objet2 ) ...@@ -1063,12 +1063,12 @@ static int ListTriGLabelByVal( ListLabel* Objet1, ListLabel* Objet2 )
if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text; Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text;
else else
Text1 = &( (DrawTextStruct*) Objet1->m_Label )->m_Text; Text1 = &( (SCH_TEXT*) Objet1->m_Label )->m_Text;
if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text; Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text;
else else
Text2 = &( (DrawTextStruct*) Objet2->m_Label )->m_Text; Text2 = &( (SCH_TEXT*) Objet2->m_Label )->m_Text;
ii = Text1->CmpNoCase( *Text2 ); ii = Text1->CmpNoCase( *Text2 );
...@@ -1102,12 +1102,12 @@ static int ListTriGLabelBySheet( ListLabel* Objet1, ListLabel* Objet2 ) ...@@ -1102,12 +1102,12 @@ static int ListTriGLabelBySheet( ListLabel* Objet1, ListLabel* Objet2 )
if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text; Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text;
else else
Text1 = &( (DrawTextStruct*) Objet1->m_Label )->m_Text; Text1 = &( (SCH_TEXT*) Objet1->m_Label )->m_Text;
if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text; Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text;
else else
Text2 = &( (DrawTextStruct*) Objet2->m_Label )->m_Text; Text2 = &( (SCH_TEXT*) Objet2->m_Label )->m_Text;
ii = Text1->CmpNoCase( *Text2 ); ii = Text1->CmpNoCase( *Text2 );
} }
...@@ -1125,7 +1125,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems ) ...@@ -1125,7 +1125,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems )
*/ */
{ {
int ii; int ii;
EDA_SchComponentStruct* LibItem; SCH_COMPONENT* LibItem;
wxString OldName, CurrName; wxString OldName, CurrName;
for( ii = 0; ii < NbItems; ii++ ) for( ii = 0; ii < NbItems; ii++ )
...@@ -1149,7 +1149,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems ) ...@@ -1149,7 +1149,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems )
/*******************************************************************************************/ /*******************************************************************************************/
void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, EDA_SchComponentStruct* DrawLibItem, void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem,
bool CompactForm ) bool CompactForm )
/*******************************************************************************************/ /*******************************************************************************************/
{ {
...@@ -1198,7 +1198,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in ...@@ -1198,7 +1198,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
{ {
int ii, Multi, Unit; int ii, Multi, Unit;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
char NameCmp[80]; char NameCmp[80];
wxString msg; wxString msg;
...@@ -1254,10 +1254,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in ...@@ -1254,10 +1254,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
if( DrawList == NULL ) if( DrawList == NULL )
continue; continue;
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue; continue;
DrawLibItem = (EDA_SchComponentStruct*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
if( List[ii].m_Ref[0] == '#' ) if( List[ii].m_Ref[0] == '#' )
continue; continue;
...@@ -1313,7 +1313,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in ...@@ -1313,7 +1313,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
int ii, Multi; int ii, Multi;
wxChar Unit; wxChar Unit;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
wxString msg; wxString msg;
...@@ -1331,10 +1331,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in ...@@ -1331,10 +1331,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
if( DrawList == NULL ) if( DrawList == NULL )
continue; continue;
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue; continue;
DrawLibItem = (EDA_SchComponentStruct*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
if( List[ii].m_Ref[0] == '#' ) if( List[ii].m_Ref[0] == '#' )
continue; continue;
...@@ -1377,7 +1377,7 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems ) ...@@ -1377,7 +1377,7 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
/******************************************************************/ /******************************************************************/
{ {
int ii, jj; int ii, jj;
DrawLabelStruct* DrawTextItem; SCH_LABEL* DrawTextItem;
DrawSheetLabelStruct* DrawSheetLabel; DrawSheetLabelStruct* DrawSheetLabel;
ListLabel* LabelItem; ListLabel* LabelItem;
wxString msg, sheetpath; wxString msg, sheetpath;
...@@ -1389,10 +1389,10 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems ) ...@@ -1389,10 +1389,10 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
switch( LabelItem->m_LabelType ) switch( LabelItem->m_LabelType )
{ {
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
DrawTextItem = (DrawLabelStruct*) (LabelItem->m_Label); DrawTextItem = (SCH_LABEL*) (LabelItem->m_Label);
if( LabelItem->m_LabelType == DRAW_HIER_LABEL_STRUCT_TYPE ) if( LabelItem->m_LabelType == TYPE_SCH_HIERLABEL )
labeltype = wxT("Hierarchical"); labeltype = wxT("Hierarchical");
else else
labeltype = wxT("Global "); labeltype = wxT("Global ");
......
...@@ -133,7 +133,7 @@ public: ...@@ -133,7 +133,7 @@ public:
void CreateExportList(const wxString & FullFileName); void CreateExportList(const wxString & FullFileName);
int PrintListeCmpByRef( FILE * f, ListComponent * List, int NbItems, bool CompactForm = FALSE ); int PrintListeCmpByRef( FILE * f, ListComponent * List, int NbItems, bool CompactForm = FALSE );
int PrintListeCmpByVal( FILE *f, ListComponent * List, int NbItems); int PrintListeCmpByVal( FILE *f, ListComponent * List, int NbItems);
void PrintFieldData(FILE * f, EDA_SchComponentStruct * DrawLibItem, bool CompactForm = FALSE); void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE);
void SavePreferences(); void SavePreferences();
......
...@@ -54,7 +54,7 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( ) ...@@ -54,7 +54,7 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( )
} }
WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent, WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent,
EDA_SchComponentStruct * cmp, SCH_COMPONENT * cmp,
wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{ {
m_Parent = parent; m_Parent = parent;
......
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
/// Constructors /// Constructors
WinEDA_ComponentPropertiesFrame( ); WinEDA_ComponentPropertiesFrame( );
WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent, WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent,
EDA_SchComponentStruct * cmp, SCH_COMPONENT * cmp,
wxWindowID id = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_STYLE ); wxWindowID id = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_STYLE );
/// Creation /// Creation
...@@ -137,7 +137,7 @@ public: ...@@ -137,7 +137,7 @@ public:
////@end WinEDA_ComponentPropertiesFrame member variables ////@end WinEDA_ComponentPropertiesFrame member variables
WinEDA_SchematicFrame * m_Parent; WinEDA_SchematicFrame * m_Parent;
EDA_SchComponentStruct * m_Cmp; SCH_COMPONENT * m_Cmp;
EDA_LibComponentStruct * m_LibEntry; EDA_LibComponentStruct * m_LibEntry;
int m_CurrentFieldId; int m_CurrentFieldId;
......
...@@ -51,7 +51,7 @@ WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( ) ...@@ -51,7 +51,7 @@ WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( )
} }
WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent, WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent,
DrawTextStruct * CurrentText, SCH_TEXT * CurrentText,
const wxPoint& pos, const wxPoint& pos,
wxWindowID id, const wxString& caption, const wxSize& size, long style ) wxWindowID id, const wxString& caption, const wxSize& size, long style )
{ {
...@@ -64,15 +64,15 @@ wxString msg; ...@@ -64,15 +64,15 @@ wxString msg;
m_TextLabel->SetFocus(); m_TextLabel->SetFocus();
switch( m_CurrentText->Type() ) switch( m_CurrentText->Type() )
{ {
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
SetTitle(_("Global Label properties")); SetTitle(_("Global Label properties"));
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
SetTitle(_("Hierarchal Label properties")); SetTitle(_("Hierarchal Label properties"));
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
SetTitle(_("Label properties")); SetTitle(_("Label properties"));
break; break;
...@@ -189,8 +189,8 @@ void WinEDA_LabelPropertiesFrame::CreateControls() ...@@ -189,8 +189,8 @@ void WinEDA_LabelPropertiesFrame::CreateControls()
m_TextShape->SetValidator( wxGenericValidator(& m_CurrentText->m_Shape) ); m_TextShape->SetValidator( wxGenericValidator(& m_CurrentText->m_Shape) );
////@end WinEDA_LabelPropertiesFrame content construction ////@end WinEDA_LabelPropertiesFrame content construction
if (m_CurrentText->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || if (m_CurrentText->Type() == TYPE_SCH_GLOBALLABEL ||
m_CurrentText->Type() == DRAW_HIER_LABEL_STRUCT_TYPE) m_CurrentText->Type() == TYPE_SCH_HIERLABEL)
m_TextShape->Show(true); m_TextShape->Show(true);
} }
......
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
/// Constructors /// Constructors
WinEDA_LabelPropertiesFrame( ); WinEDA_LabelPropertiesFrame( );
WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent, WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent,
DrawTextStruct * CurrentText, SCH_TEXT * CurrentText,
const wxPoint& pos = SYMBOL_WINEDA_LABELPROPERTIESFRAME_POSITION, const wxPoint& pos = SYMBOL_WINEDA_LABELPROPERTIESFRAME_POSITION,
wxWindowID id = SYMBOL_WINEDA_LABELPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_LABELPROPERTIESFRAME_TITLE, const wxSize& size = SYMBOL_WINEDA_LABELPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_LABELPROPERTIESFRAME_STYLE ); wxWindowID id = SYMBOL_WINEDA_LABELPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_LABELPROPERTIESFRAME_TITLE, const wxSize& size = SYMBOL_WINEDA_LABELPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_LABELPROPERTIESFRAME_STYLE );
...@@ -110,7 +110,7 @@ public: ...@@ -110,7 +110,7 @@ public:
////@end WinEDA_LabelPropertiesFrame member variables ////@end WinEDA_LabelPropertiesFrame member variables
WinEDA_SchematicFrame * m_Parent; WinEDA_SchematicFrame * m_Parent;
DrawTextStruct * m_CurrentText; SCH_TEXT * m_CurrentText;
}; };
......
...@@ -39,14 +39,14 @@ static wxPoint OldPos; ...@@ -39,14 +39,14 @@ static wxPoint OldPos;
/**********************************************************************/ /**********************************************************************/
void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos, void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
EDA_SchComponentStruct* cmp ) SCH_COMPONENT* cmp )
/*********************************************************************/ /*********************************************************************/
/* Create the dialog box for the current component edition /* Create the dialog box for the current component edition
*/ */
{ {
parent->DrawPanel->m_IgnoreMouseEvents = TRUE; parent->DrawPanel->m_IgnoreMouseEvents = TRUE;
if( cmp->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( cmp->Type() != TYPE_SCH_COMPONENT )
{ {
DisplayError( parent, DisplayError( parent,
wxT( "InstallCmpeditFrame() error: This struct is not a component" ) ); wxT( "InstallCmpeditFrame() error: This struct is not a component" ) );
...@@ -458,7 +458,7 @@ void WinEDA_SchematicFrame::StartMoveCmpField( PartTextStruct* Field, wxDC* DC ) ...@@ -458,7 +458,7 @@ void WinEDA_SchematicFrame::StartMoveCmpField( PartTextStruct* Field, wxDC* DC )
wxPoint pos, newpos; wxPoint pos, newpos;
int x1, y1; int x1, y1;
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) CurrentField->m_Parent; SCH_COMPONENT* Cmp = (SCH_COMPONENT*) CurrentField->m_Parent;
SAFE_DELETE( g_ItemToUndoCopy ); SAFE_DELETE( g_ItemToUndoCopy );
g_ItemToUndoCopy = Cmp->GenCopy(); g_ItemToUndoCopy = Cmp->GenCopy();
...@@ -519,7 +519,7 @@ void WinEDA_SchematicFrame::EditCmpFieldText( PartTextStruct* Field, wxDC* DC ) ...@@ -519,7 +519,7 @@ void WinEDA_SchematicFrame::EditCmpFieldText( PartTextStruct* Field, wxDC* DC )
return; return;
} }
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) Field->m_Parent; SCH_COMPONENT* Cmp = (SCH_COMPONENT*) Field->m_Parent;
FieldNumber = Field->m_FieldId; FieldNumber = Field->m_FieldId;
if( FieldNumber == VALUE ) if( FieldNumber == VALUE )
...@@ -608,14 +608,14 @@ static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -608,14 +608,14 @@ static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( CurrentField == NULL ) if( CurrentField == NULL )
return; return;
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) CurrentField->m_Parent; SCH_COMPONENT* Cmp = (SCH_COMPONENT*) CurrentField->m_Parent;
FieldNumber = CurrentField->m_FieldId; FieldNumber = CurrentField->m_FieldId;
/* Effacement: */ /* Effacement: */
if( erase ) if( erase )
DrawTextField( panel, DC, CurrentField, Multiflag, g_XorMode ); DrawTextField( panel, DC, CurrentField, Multiflag, g_XorMode );
pos = ( (EDA_SchComponentStruct*) CurrentField->m_Parent )->m_Pos; pos = ( (SCH_COMPONENT*) CurrentField->m_Parent )->m_Pos;
/* Les positions sont caculees par la matrice TRANSPOSEE de la matrice /* Les positions sont caculees par la matrice TRANSPOSEE de la matrice
* de rotation-miroir */ * de rotation-miroir */
...@@ -658,13 +658,13 @@ void WinEDA_SchematicFrame::RotateCmpField( PartTextStruct* Field, wxDC* DC ) ...@@ -658,13 +658,13 @@ void WinEDA_SchematicFrame::RotateCmpField( PartTextStruct* Field, wxDC* DC )
if( Field->m_Text == wxEmptyString ) if( Field->m_Text == wxEmptyString )
return; return;
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) Field->m_Parent; SCH_COMPONENT* Cmp = (SCH_COMPONENT*) Field->m_Parent;
FieldNumber = Field->m_FieldId; FieldNumber = Field->m_FieldId;
flag = 0; flag = 0;
if( FieldNumber == REFERENCE ) if( FieldNumber == REFERENCE )
{ {
Entry = FindLibPart( ( (EDA_SchComponentStruct*) Field->m_Parent )->m_ChipName.GetData(), Entry = FindLibPart( ( (SCH_COMPONENT*) Field->m_Parent )->m_ChipName.GetData(),
wxEmptyString, FIND_ROOT ); wxEmptyString, FIND_ROOT );
if( Entry != NULL ) if( Entry != NULL )
{ {
...@@ -699,13 +699,13 @@ void PartTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -699,13 +699,13 @@ void PartTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
frame->DrawPanel->ManageCurseur = NULL; frame->DrawPanel->ManageCurseur = NULL;
frame->DrawPanel->ForceCloseManageCurseur = NULL; frame->DrawPanel->ForceCloseManageCurseur = NULL;
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) m_Parent; SCH_COMPONENT* Cmp = (SCH_COMPONENT*) m_Parent;
/* save old cmp in undo list */ /* save old cmp in undo list */
if( g_ItemToUndoCopy && ( g_ItemToUndoCopy->Type() == Cmp->Type()) ) if( g_ItemToUndoCopy && ( g_ItemToUndoCopy->Type() == Cmp->Type()) )
{ {
Cmp->SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy ); Cmp->SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( Cmp, IS_CHANGED ); ( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( Cmp, IS_CHANGED );
Cmp->SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy ); Cmp->SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
} }
FieldNumber = m_FieldId; FieldNumber = m_FieldId;
...@@ -730,7 +730,7 @@ void PartTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -730,7 +730,7 @@ void PartTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/**************************************************************************************************/ /**************************************************************************************************/
void WinEDA_SchematicFrame::EditComponentReference( EDA_SchComponentStruct* Cmp, wxDC* DC ) void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC )
/**************************************************************************************************/ /**************************************************************************************************/
/* Edit the component text reference*/ /* Edit the component text reference*/
{ {
...@@ -768,7 +768,7 @@ void WinEDA_SchematicFrame::EditComponentReference( EDA_SchComponentStruct* Cmp, ...@@ -768,7 +768,7 @@ void WinEDA_SchematicFrame::EditComponentReference( EDA_SchComponentStruct* Cmp,
/*****************************************************************************************/ /*****************************************************************************************/
void WinEDA_SchematicFrame::EditComponentValue( EDA_SchComponentStruct* Cmp, wxDC* DC ) void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
/*****************************************************************************************/ /*****************************************************************************************/
/* Routine de changement du texte selectionne */ /* Routine de changement du texte selectionne */
{ {
...@@ -808,7 +808,7 @@ void WinEDA_SchematicFrame::EditComponentValue( EDA_SchComponentStruct* Cmp, wxD ...@@ -808,7 +808,7 @@ void WinEDA_SchematicFrame::EditComponentValue( EDA_SchComponentStruct* Cmp, wxD
} }
/*****************************************************************************************/ /*****************************************************************************************/
void WinEDA_SchematicFrame::EditComponentFootprint( EDA_SchComponentStruct* Cmp, wxDC* DC ) void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC )
/*****************************************************************************************/ /*****************************************************************************************/
{ {
wxString msg; wxString msg;
......
...@@ -69,7 +69,7 @@ void WinEDA_LabelPropertiesFrame::TextPropertiesAccept( wxCommandEvent& event ) ...@@ -69,7 +69,7 @@ void WinEDA_LabelPropertiesFrame::TextPropertiesAccept( wxCommandEvent& event )
/********************************************************************************/ /********************************************************************************/
void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC ) void WinEDA_SchematicFrame::StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC )
/********************************************************************************/ /********************************************************************************/
{ {
if( TextStruct == NULL ) if( TextStruct == NULL )
...@@ -87,10 +87,10 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC ...@@ -87,10 +87,10 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
switch( TextStruct->Type() ) switch( TextStruct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
ItemInitialPosition = TextStruct->m_Pos; ItemInitialPosition = TextStruct->m_Pos;
OldSize = TextStruct->m_Size; OldSize = TextStruct->m_Size;
OldOrient = TextStruct->m_Orient; OldOrient = TextStruct->m_Orient;
...@@ -115,7 +115,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC ...@@ -115,7 +115,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
/*************************************************************************/ /*************************************************************************/
void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct, void WinEDA_SchematicFrame::EditSchematicText( SCH_TEXT* TextStruct,
wxDC* DC ) wxDC* DC )
/*************************************************************************/ /*************************************************************************/
...@@ -140,11 +140,11 @@ void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct, ...@@ -140,11 +140,11 @@ void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct,
/***********************************************************************************/ /***********************************************************************************/
void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* DC ) void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC )
/***********************************************************************************/ /***********************************************************************************/
{ {
if( TextStruct == NULL ) if( TextStruct == NULL )
TextStruct = (DrawTextStruct*) PickStruct( GetScreen()->m_Curseur, TextStruct = (SCH_TEXT*) PickStruct( GetScreen()->m_Curseur,
GetScreen(), TEXTITEM | LABELITEM ); GetScreen(), TEXTITEM | LABELITEM );
if( TextStruct == NULL ) if( TextStruct == NULL )
return; return;
...@@ -160,10 +160,10 @@ void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* ...@@ -160,10 +160,10 @@ void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC*
/* Rotation du texte */ /* Rotation du texte */
switch( TextStruct->Type() ) switch( TextStruct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
TextStruct->m_Orient++; TextStruct->m_Orient++;
TextStruct->m_Orient &= 3; TextStruct->m_Orient &= 3;
break; break;
...@@ -187,28 +187,28 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type ) ...@@ -187,28 +187,28 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
/* Routine to create new text struct (GraphicText, label or Glabel). /* Routine to create new text struct (GraphicText, label or Glabel).
*/ */
{ {
DrawTextStruct* NewText = NULL; SCH_TEXT* NewText = NULL;
g_ItemToRepeat = NULL; g_ItemToRepeat = NULL;
switch( type ) switch( type )
{ {
case LAYER_NOTES: case LAYER_NOTES:
NewText = new DrawTextStruct( GetScreen()->m_Curseur ); NewText = new SCH_TEXT( GetScreen()->m_Curseur );
break; break;
case LAYER_LOCLABEL: case LAYER_LOCLABEL:
NewText = new DrawLabelStruct( GetScreen()->m_Curseur ); NewText = new SCH_LABEL( GetScreen()->m_Curseur );
break; break;
case LAYER_HIERLABEL: case LAYER_HIERLABEL:
NewText = new DrawHierLabelStruct(GetScreen()->m_Curseur ); NewText = new SCH_HIERLABEL(GetScreen()->m_Curseur );
NewText->m_Shape = s_DefaultShapeGLabel; NewText->m_Shape = s_DefaultShapeGLabel;
NewText->m_Orient = s_DefaultOrientGLabel; NewText->m_Orient = s_DefaultOrientGLabel;
break; break;
case LAYER_GLOBLABEL: case LAYER_GLOBLABEL:
NewText = new DrawGlobalLabelStruct(GetScreen()->m_Curseur ); NewText = new SCH_GLOBALLABEL(GetScreen()->m_Curseur );
NewText->m_Shape = s_DefaultShapeGLabel; NewText->m_Shape = s_DefaultShapeGLabel;
NewText->m_Orient = s_DefaultOrientGLabel; NewText->m_Orient = s_DefaultOrientGLabel;
break; break;
...@@ -260,11 +260,11 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -260,11 +260,11 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* redraw the text */ /* redraw the text */
switch( TextStruct->Type() ) switch( TextStruct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
( (DrawTextStruct*) TextStruct )->m_Pos = panel->GetScreen()->m_Curseur; ( (SCH_TEXT*) TextStruct )->m_Pos = panel->GetScreen()->m_Curseur;
break; break;
default: default:
...@@ -304,12 +304,12 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -304,12 +304,12 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
switch( Struct->Type() ) switch( Struct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
{ {
DrawTextStruct* Text = (DrawTextStruct*) Struct; SCH_TEXT* Text = (SCH_TEXT*) Struct;
Text->m_Pos = ItemInitialPosition; Text->m_Pos = ItemInitialPosition;
Text->m_Size = OldSize; Text->m_Size = OldSize;
Text->m_Orient = OldOrient; Text->m_Orient = OldOrient;
...@@ -327,7 +327,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -327,7 +327,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
/*****************************************************************************/ /*****************************************************************************/
void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text, void WinEDA_SchematicFrame::ConvertTextType( SCH_TEXT* Text,
wxDC* DC, int newtype ) wxDC* DC, int newtype )
/*****************************************************************************/ /*****************************************************************************/
...@@ -339,22 +339,22 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text, ...@@ -339,22 +339,22 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
if( Text == NULL ) if( Text == NULL )
return; return;
DrawTextStruct* newtext; SCH_TEXT* newtext;
switch( newtype ) switch( newtype )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
newtext = new DrawLabelStruct( Text->m_Pos, Text->m_Text ); newtext = new SCH_LABEL( Text->m_Pos, Text->m_Text );
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
newtext = new DrawGlobalLabelStruct(Text->m_Pos, Text->m_Text ); newtext = new SCH_GLOBALLABEL(Text->m_Pos, Text->m_Text );
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
newtext = new DrawHierLabelStruct(Text->m_Pos, Text->m_Text ); newtext = new SCH_HIERLABEL(Text->m_Pos, Text->m_Text );
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
newtext = new DrawTextStruct( Text->m_Pos, Text->m_Text ); newtext = new SCH_TEXT( Text->m_Pos, Text->m_Text );
break; break;
default: default:
......
...@@ -376,9 +376,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -376,9 +376,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y; STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawTextStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_TEXT*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x; STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x;
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y; STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
...@@ -389,11 +389,11 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -389,11 +389,11 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_LABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x; STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x;
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y; STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
...@@ -528,9 +528,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -528,9 +528,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
return TRUE; return TRUE;
item = PickStruct( screen, LABELITEM ); item = PickStruct( screen, LABELITEM );
if( item && (item->Type() != DRAW_TEXT_STRUCT_TYPE) if( item && (item->Type() != TYPE_SCH_TEXT)
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.x == pos.x ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.x == pos.x )
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.y == pos.y ) ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
return TRUE; return TRUE;
pinsheet = LocateAnyPinSheet( pos, screen->EEDrawList ); pinsheet = LocateAnyPinSheet( pos, screen->EEDrawList );
......
...@@ -40,7 +40,7 @@ static int s_ItemSelectColor = BROWN; ...@@ -40,7 +40,7 @@ static int s_ItemSelectColor = BROWN;
static EDA_LibComponentStruct* DummyCmp; static EDA_LibComponentStruct* DummyCmp;
static int* Buf_Poly_Drawings, Buf_Poly_Size; // Used fo polyline drawings static int* Buf_Poly_Drawings, Buf_Poly_Size; // Used fo polyline drawings
static void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, static void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_SchComponentStruct* Component, SCH_COMPONENT* Component,
EDA_LibComponentStruct* Entry, EDA_LibComponentStruct* Entry,
const wxPoint& Pos, const wxPoint& Pos,
int TransMat[2][2], int TransMat[2][2],
...@@ -204,7 +204,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -204,7 +204,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
* Routine to draw the given part at given position, transformed/mirror as * * Routine to draw the given part at given position, transformed/mirror as *
* specified, and in the given drawing mode. Only this one is visible... * * specified, and in the given drawing mode. Only this one is visible... *
*****************************************************************************/ *****************************************************************************/
void EDA_SchComponentStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color ) const wxPoint& offset, int DrawMode, int Color )
{ {
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
...@@ -262,7 +262,7 @@ void DrawTextField( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -262,7 +262,7 @@ void DrawTextField( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
int orient, color; int orient, color;
wxPoint pos; /* Position des textes */ wxPoint pos; /* Position des textes */
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) Field->m_Parent; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) Field->m_Parent;
int hjustify, vjustify; int hjustify, vjustify;
int LineWidth = MAX( Field->m_Width, g_DrawMinimunLineWidth ); int LineWidth = MAX( Field->m_Width, g_DrawMinimunLineWidth );
...@@ -404,7 +404,7 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName ...@@ -404,7 +404,7 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName
*****************************************************************************/ *****************************************************************************/
/* DrawMode = GrXOR, GrOR ..*/ /* DrawMode = GrXOR, GrOR ..*/
void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_SchComponentStruct* Component, SCH_COMPONENT* Component,
EDA_LibComponentStruct* Entry, EDA_LibComponentStruct* Entry,
const wxPoint& Pos, const wxPoint& Pos,
int TransMat[2][2], int TransMat[2][2],
...@@ -896,7 +896,7 @@ bool MapAngles( int* Angle1, int* Angle2, int TransMat[2][2] ) ...@@ -896,7 +896,7 @@ bool MapAngles( int* Angle1, int* Angle2, int TransMat[2][2] )
*****************************************************************************/ *****************************************************************************/
void DrawingLibInGhost( WinEDA_DrawPanel* panel, wxDC* DC, void DrawingLibInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_LibComponentStruct* LibEntry, EDA_LibComponentStruct* LibEntry,
EDA_SchComponentStruct* DrawLibItem, int PartX, int PartY, SCH_COMPONENT* DrawLibItem, int PartX, int PartY,
int multi, int convert, int Color, bool DrawPinText ) int multi, int convert, int Color, bool DrawPinText )
{ {
int DrawMode = g_XorMode; int DrawMode = g_XorMode;
......
...@@ -459,22 +459,22 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -459,22 +459,22 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
break; break;
} }
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
{ {
DrawTextStruct* Struct; SCH_TEXT* Struct;
Struct = (DrawTextStruct*) DrawStruct; Struct = (SCH_TEXT*) DrawStruct;
Struct->m_Pos.x += dx; Struct->m_Pos.y += dy; Struct->m_Pos.x += dx; Struct->m_Pos.y += dy;
Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor ); Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor );
Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy; Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy;
break; break;
} }
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
{ {
DrawLabelStruct* Struct; SCH_LABEL* Struct;
Struct = (DrawLabelStruct*) DrawStruct; Struct = (SCH_LABEL*) DrawStruct;
Struct->m_Pos.x += dx; Struct->m_Pos.y += dy; Struct->m_Pos.x += dx; Struct->m_Pos.y += dy;
Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor ); Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor );
Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy; Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy;
...@@ -491,11 +491,11 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -491,11 +491,11 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
break; break;
} }
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
{ {
EDA_LibComponentStruct* LibEntry; EDA_LibComponentStruct* LibEntry;
EDA_SchComponentStruct* Struct; SCH_COMPONENT* Struct;
Struct = (EDA_SchComponentStruct*) DrawStruct; Struct = (SCH_COMPONENT*) DrawStruct;
LibEntry = FindLibPart( Struct->m_ChipName.GetData(), wxEmptyString, FIND_ROOT ); LibEntry = FindLibPart( Struct->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
if( LibEntry == NULL ) if( LibEntry == NULL )
break; break;
......
...@@ -303,7 +303,7 @@ int CountCmpNumber() ...@@ -303,7 +303,7 @@ int CountCmpNumber()
{ {
for( Phead = Window->EEDrawList; Phead != NULL; Phead = Phead->Pnext ) for( Phead = Window->EEDrawList; Phead != NULL; Phead = Phead->Pnext )
{ {
if( Phead->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( Phead->Type() == TYPE_SCH_COMPONENT )
{ {
DrawPartStruct* Cmp = (DrawPartStruct*) Phead; DrawPartStruct* Cmp = (DrawPartStruct*) Phead;
if( Cmp->m_Field[VALUE].m_Text.GetChar( 0 ) != '#' ) if( Cmp->m_Field[VALUE].m_Text.GetChar( 0 ) != '#' )
......
...@@ -72,7 +72,7 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem( ...@@ -72,7 +72,7 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem(
{ {
DrawSheetPath* sheet, * SheetWithComponentFound = NULL; DrawSheetPath* sheet, * SheetWithComponentFound = NULL;
EDA_BaseStruct* DrawList = NULL; EDA_BaseStruct* DrawList = NULL;
EDA_SchComponentStruct* Component = NULL; SCH_COMPONENT* Component = NULL;
wxSize DrawAreaSize = DrawPanel->GetClientSize(); wxSize DrawAreaSize = DrawPanel->GetClientSize();
wxPoint pos, curpos; wxPoint pos, curpos;
bool DoCenterAndRedraw = FALSE; bool DoCenterAndRedraw = FALSE;
...@@ -91,10 +91,10 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem( ...@@ -91,10 +91,10 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem(
DrawList = sheet->LastDrawList(); DrawList = sheet->LastDrawList();
for( ; (DrawList != NULL) && (NotFound == true); DrawList = DrawList->Pnext ) for( ; (DrawList != NULL) && (NotFound == true); DrawList = DrawList->Pnext )
{ {
if( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() == TYPE_SCH_COMPONENT )
{ {
EDA_SchComponentStruct* pSch; SCH_COMPONENT* pSch;
pSch = (EDA_SchComponentStruct*) DrawList; pSch = (SCH_COMPONENT*) DrawList;
if( component_reference.CmpNoCase( pSch->GetRef(sheet) ) == 0 ) if( component_reference.CmpNoCase( pSch->GetRef(sheet) ) == 0 )
{ {
Component = pSch; Component = pSch;
...@@ -465,9 +465,9 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem( ...@@ -465,9 +465,9 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
{ {
switch( DrawList->Type() ) switch( DrawList->Type() )
{ {
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
EDA_SchComponentStruct * pSch; SCH_COMPONENT * pSch;
pSch = (EDA_SchComponentStruct*) DrawList; pSch = (SCH_COMPONENT*) DrawList;
if( WildCompareString( WildText, pSch->GetRef(Sheet), FALSE ) ) if( WildCompareString( WildText, pSch->GetRef(Sheet), FALSE ) )
{ {
NotFound = FALSE; NotFound = FALSE;
...@@ -481,12 +481,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem( ...@@ -481,12 +481,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
} }
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
DrawTextStruct * pDraw; SCH_TEXT * pDraw;
pDraw = (DrawTextStruct*) DrawList; pDraw = (SCH_TEXT*) DrawList;
if( WildCompareString( WildText, pDraw->m_Text, FALSE ) ) if( WildCompareString( WildText, pDraw->m_Text, FALSE ) )
{ {
NotFound = FALSE; NotFound = FALSE;
...@@ -551,12 +551,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem( ...@@ -551,12 +551,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
DoCenterAndRedraw = TRUE; DoCenterAndRedraw = TRUE;
} }
/* the struct is a DRAW_LIB_ITEM_STRUCT_TYPE type, /* the struct is a TYPE_SCH_COMPONENT type,
* coordinates must be computed according to its orientation matrix * coordinates must be computed according to its orientation matrix
*/ */
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_COMPONENT )
{ {
EDA_SchComponentStruct* pSch = (EDA_SchComponentStruct*) Struct; SCH_COMPONENT* pSch = (SCH_COMPONENT*) Struct;
pos.x -= pSch->m_Pos.x; pos.x -= pSch->m_Pos.x;
pos.y -= pSch->m_Pos.y; pos.y -= pSch->m_Pos.y;
......
...@@ -59,7 +59,7 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent ) ...@@ -59,7 +59,7 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent )
/**************************************************************************/ /**************************************************************************/
EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC, SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
const wxString& libname, const wxString& libname,
wxArrayString& HistoryList, wxArrayString& HistoryList,
bool UseLibBrowser ) bool UseLibBrowser )
...@@ -73,7 +73,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -73,7 +73,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
int ii, CmpCount = 0; int ii, CmpCount = 0;
LibDrawField* Field; LibDrawField* Field;
EDA_LibComponentStruct* Entry = NULL; EDA_LibComponentStruct* Entry = NULL;
EDA_SchComponentStruct* DrawLibItem = NULL; SCH_COMPONENT* DrawLibItem = NULL;
LibraryStruct* Library = NULL; LibraryStruct* Library = NULL;
wxString Name, keys, msg; wxString Name, keys, msg;
bool AllowWildSeach = TRUE; bool AllowWildSeach = TRUE;
...@@ -180,7 +180,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -180,7 +180,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
DrawPanel->ManageCurseur = ShowWhileMoving; DrawPanel->ManageCurseur = ShowWhileMoving;
DrawPanel->ForceCloseManageCurseur = ExitPlaceCmp; DrawPanel->ForceCloseManageCurseur = ExitPlaceCmp;
DrawLibItem = new EDA_SchComponentStruct( GetScreen()->m_Curseur ); DrawLibItem = new SCH_COMPONENT( GetScreen()->m_Curseur );
DrawLibItem->m_Multi = 1;/* Selection de l'unite 1 dans le boitier */ DrawLibItem->m_Multi = 1;/* Selection de l'unite 1 dans le boitier */
DrawLibItem->m_Convert = 1; DrawLibItem->m_Convert = 1;
DrawLibItem->m_ChipName = Name; DrawLibItem->m_ChipName = Name;
...@@ -257,7 +257,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -257,7 +257,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
wxPoint move_vector; wxPoint move_vector;
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
panel->m_Parent->GetScreen()->GetCurItem(); panel->m_Parent->GetScreen()->GetCurItem();
/* Effacement du composant */ /* Effacement du composant */
...@@ -276,7 +276,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -276,7 +276,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/**************************************************************************/ /**************************************************************************/
void WinEDA_SchematicFrame::CmpRotationMiroir( void WinEDA_SchematicFrame::CmpRotationMiroir(
EDA_SchComponentStruct* DrawComponent, wxDC* DC, int type_rotate ) SCH_COMPONENT* DrawComponent, wxDC* DC, int type_rotate )
/**************************************************************************/ /**************************************************************************/
/* Routine permettant les rotations et les miroirs d'un composant /* Routine permettant les rotations et les miroirs d'un composant
...@@ -293,7 +293,9 @@ void WinEDA_SchematicFrame::CmpRotationMiroir( ...@@ -293,7 +293,9 @@ void WinEDA_SchematicFrame::CmpRotationMiroir(
if( DrawComponent->m_Flags ) if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); {
DrawPanel->PostDirtyRect( DrawComponent->GetBoundingBox());
}
} }
DrawComponent->SetRotationMiroir( type_rotate ); DrawComponent->SetRotationMiroir( type_rotate );
...@@ -320,7 +322,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -320,7 +322,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/* Routine de sortie de la fonction de placement de composant /* Routine de sortie de la fonction de placement de composant
*/ */
{ {
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
Panel->m_Parent->GetScreen()->GetCurItem(); Panel->m_Parent->GetScreen()->GetCurItem();
if( DrawLibItem->m_Flags & IS_NEW ) /* Nouveau Placement en cours, on l'efface */ if( DrawLibItem->m_Flags & IS_NEW ) /* Nouveau Placement en cours, on l'efface */
...@@ -352,7 +354,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -352,7 +354,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/************************************************************************/ /************************************************************************/
void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent, void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
int unit, wxDC* DC ) int unit, wxDC* DC )
/************************************************************************/ /************************************************************************/
/* Selection de l'unite dans les boitiers a multiples Parts */ /* Selection de l'unite dans les boitiers a multiples Parts */
...@@ -400,7 +402,7 @@ void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent, ...@@ -400,7 +402,7 @@ void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent,
/************************************************************************/ /************************************************************************/
void WinEDA_SchematicFrame::ConvertPart( EDA_SchComponentStruct* DrawComponent, void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
wxDC* DC ) wxDC* DC )
/************************************************************************/ /************************************************************************/
{ {
...@@ -469,13 +471,13 @@ int LookForConvertPart( EDA_LibComponentStruct* LibEntry ) ...@@ -469,13 +471,13 @@ int LookForConvertPart( EDA_LibComponentStruct* LibEntry )
/***********************************************************************************/ /***********************************************************************************/
void WinEDA_SchematicFrame::StartMovePart( EDA_SchComponentStruct* Component, void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component,
wxDC* DC ) wxDC* DC )
/***********************************************************************************/ /***********************************************************************************/
{ {
if( Component == NULL ) if( Component == NULL )
return; return;
if( Component->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( Component->Type() != TYPE_SCH_COMPONENT )
return; return;
if( Component->m_Flags == 0 ) if( Component->m_Flags == 0 )
......
...@@ -281,7 +281,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -281,7 +281,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
GetScreen(), LIBITEM | TEXTITEM | LABELITEM ); GetScreen(), LIBITEM | TEXTITEM | LABELITEM );
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
if( DrawStruct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
...@@ -289,7 +289,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -289,7 +289,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
switch( DrawStruct->Type() ) switch( DrawStruct->Type() )
{ {
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
if( DrawStruct->m_Flags == 0 ) if( DrawStruct->m_Flags == 0 )
{ {
SaveCopyInUndoList( DrawStruct, IS_CHANGED ); SaveCopyInUndoList( DrawStruct, IS_CHANGED );
...@@ -297,19 +297,19 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -297,19 +297,19 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
} }
CmpRotationMiroir( CmpRotationMiroir(
(EDA_SchComponentStruct*) DrawStruct, DC, CMP_ROTATE_COUNTERCLOCKWISE ); (SCH_COMPONENT*) DrawStruct, DC, CMP_ROTATE_COUNTERCLOCKWISE );
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
if( DrawStruct->m_Flags == 0 ) if( DrawStruct->m_Flags == 0 )
{ {
SaveCopyInUndoList( DrawStruct, IS_CHANGED ); SaveCopyInUndoList( DrawStruct, IS_CHANGED );
RefreshToolBar = TRUE; RefreshToolBar = TRUE;
} }
ChangeTextOrient( (DrawTextStruct*) DrawStruct, DC ); ChangeTextOrient( (SCH_TEXT*) DrawStruct, DC );
break; break;
default: default:
...@@ -329,7 +329,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -329,7 +329,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
RefreshToolBar = TRUE; RefreshToolBar = TRUE;
} }
CmpRotationMiroir( CmpRotationMiroir(
(EDA_SchComponentStruct*) DrawStruct, DC, CMP_MIROIR_Y ); (SCH_COMPONENT*) DrawStruct, DC, CMP_MIROIR_Y );
} }
break; break;
...@@ -344,7 +344,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -344,7 +344,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
RefreshToolBar = TRUE; RefreshToolBar = TRUE;
} }
CmpRotationMiroir( CmpRotationMiroir(
(EDA_SchComponentStruct*) DrawStruct, DC, CMP_MIROIR_X ); (SCH_COMPONENT*) DrawStruct, DC, CMP_MIROIR_X );
} }
break; break;
...@@ -359,7 +359,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -359,7 +359,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
RefreshToolBar = TRUE; RefreshToolBar = TRUE;
} }
CmpRotationMiroir( CmpRotationMiroir(
(EDA_SchComponentStruct*) DrawStruct, DC, CMP_NORMAL ); (SCH_COMPONENT*) DrawStruct, DC, CMP_NORMAL );
TestDanglingEnds( (SCH_SCREEN*)GetScreen()->EEDrawList, DC ); TestDanglingEnds( (SCH_SCREEN*)GetScreen()->EEDrawList, DC );
} }
break; break;
...@@ -386,7 +386,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -386,7 +386,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if(DrawStruct) if(DrawStruct)
{ {
EditComponentValue( EditComponentValue(
(EDA_SchComponentStruct*) DrawStruct, DC ); (SCH_COMPONENT*) DrawStruct, DC );
} }
break; break;
...@@ -398,7 +398,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -398,7 +398,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
if(DrawStruct) if(DrawStruct)
{ {
EditComponentFootprint( EditComponentFootprint(
(EDA_SchComponentStruct*) DrawStruct, DC ); (SCH_COMPONENT*) DrawStruct, DC );
} }
break; break;
} }
......
...@@ -378,16 +378,16 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F ...@@ -378,16 +378,16 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
if( Name1[0] == 'L' ) if( Name1[0] == 'L' )
{ {
DrawLabelStruct* TextStruct = SCH_LABEL* TextStruct =
new DrawLabelStruct( pos, CONV_FROM_UTF8( text ) ); new SCH_LABEL( pos, CONV_FROM_UTF8( text ) );
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->m_Orient = orient; TextStruct->m_Orient = orient;
Struct = (EDA_BaseStruct*) TextStruct; Struct = (EDA_BaseStruct*) TextStruct;
} }
else if( Name1[0] == 'G' && version > '1') else if( Name1[0] == 'G' && version > '1')
{ {
DrawGlobalLabelStruct* TextStruct = SCH_GLOBALLABEL* TextStruct =
new DrawGlobalLabelStruct(pos, CONV_FROM_UTF8( text ) ); new SCH_GLOBALLABEL(pos, CONV_FROM_UTF8( text ) );
Struct = (EDA_BaseStruct*) TextStruct; Struct = (EDA_BaseStruct*) TextStruct;
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->m_Orient = orient; TextStruct->m_Orient = orient;
...@@ -403,8 +403,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F ...@@ -403,8 +403,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
} }
else if( (Name1[0] == 'H') || (Name1[0] == 'G' && version == '1')) else if( (Name1[0] == 'H') || (Name1[0] == 'G' && version == '1'))
{ //in schematic file version 1, glabels were actually hierarchal labels. { //in schematic file version 1, glabels were actually hierarchal labels.
DrawHierLabelStruct* TextStruct = SCH_HIERLABEL* TextStruct =
new DrawHierLabelStruct(pos, CONV_FROM_UTF8( text ) ); new SCH_HIERLABEL(pos, CONV_FROM_UTF8( text ) );
Struct = (EDA_BaseStruct*) TextStruct; Struct = (EDA_BaseStruct*) TextStruct;
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->m_Orient = orient; TextStruct->m_Orient = orient;
...@@ -420,8 +420,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F ...@@ -420,8 +420,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
} }
else else
{ {
DrawTextStruct* TextStruct = SCH_TEXT* TextStruct =
new DrawTextStruct( pos, CONV_FROM_UTF8( text ) ); new SCH_TEXT( pos, CONV_FROM_UTF8( text ) );
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->m_Orient = orient; TextStruct->m_Orient = orient;
Struct = (EDA_BaseStruct*) TextStruct; Struct = (EDA_BaseStruct*) TextStruct;
...@@ -489,11 +489,11 @@ static int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, ...@@ -489,11 +489,11 @@ static int ReadPartDescr( wxWindow* frame, char* Line, FILE* f,
int ii, fieldref; int ii, fieldref;
char Name1[256], Name2[256], char Name1[256], Name2[256],
Char1[256], Char2[256], Char3[256]; Char1[256], Char2[256], Char3[256];
EDA_SchComponentStruct* LibItemStruct; SCH_COMPONENT* LibItemStruct;
int Failed = 0, newfmt = 0; int Failed = 0, newfmt = 0;
char* ptcar; char* ptcar;
LibItemStruct = new EDA_SchComponentStruct(); LibItemStruct = new SCH_COMPONENT();
LibItemStruct->m_Convert = 1; LibItemStruct->m_Convert = 1;
if( Line[0] == '$' ) if( Line[0] == '$' )
......
...@@ -31,14 +31,14 @@ static bool SnapPoint2( const wxPoint& PosRef, int SearchMask, ...@@ -31,14 +31,14 @@ static bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
/*********************************************************************/ /*********************************************************************/
EDA_SchComponentStruct* LocateSmallestComponent( SCH_SCREEN* Screen ) SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen )
/*********************************************************************/ /*********************************************************************/
/* Search the smaller (considering its area) component under the mouse cursor or the pcb cursor /* Search the smaller (considering its area) component under the mouse cursor or the pcb cursor
* If more than 1 component is found, a pointer to the smaller component is returned * If more than 1 component is found, a pointer to the smaller component is returned
*/ */
{ {
EDA_SchComponentStruct* DrawLibItem = NULL, * LastDrawLibItem = NULL; SCH_COMPONENT* DrawLibItem = NULL, * LastDrawLibItem = NULL;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_Rect BoundaryBox; EDA_Rect BoundaryBox;
float sizeref = 0, sizecurr; float sizeref = 0, sizecurr;
...@@ -54,7 +54,7 @@ EDA_SchComponentStruct* LocateSmallestComponent( SCH_SCREEN* Screen ) ...@@ -54,7 +54,7 @@ EDA_SchComponentStruct* LocateSmallestComponent( SCH_SCREEN* Screen )
DrawList, NULL, Screen->GetZoom() ) ) == FALSE ) DrawList, NULL, Screen->GetZoom() ) ) == FALSE )
break; break;
} }
DrawLibItem = (EDA_SchComponentStruct*) LastSnappedStruct; DrawLibItem = (SCH_COMPONENT*) LastSnappedStruct;
DrawList = DrawLibItem->Pnext; DrawList = DrawLibItem->Pnext;
if( LastDrawLibItem == NULL ) // First time a component is located if( LastDrawLibItem == NULL ) // First time a component is located
{ {
...@@ -341,10 +341,10 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask, ...@@ -341,10 +341,10 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
} }
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawTextStruct*) DrawList ) #define STRUCT ( (SCH_TEXT*) DrawList )
if( !( SearchMask & (TEXTITEM | LABELITEM) ) ) if( !( SearchMask & (TEXTITEM | LABELITEM) ) )
break; break;
dx = STRUCT->m_Size.x * STRUCT->GetLength(); dx = STRUCT->m_Size.x * STRUCT->GetLength();
...@@ -379,10 +379,10 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask, ...@@ -379,10 +379,10 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawList ) #define STRUCT ( (SCH_LABEL*) DrawList )
if( !(SearchMask & LABELITEM) ) if( !(SearchMask & LABELITEM) )
break; break;
dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1 ); /* longueur */ dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1 ); /* longueur */
...@@ -416,14 +416,14 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask, ...@@ -416,14 +416,14 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
} }
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
if( !( SearchMask & (LIBITEM | FIELDCMPITEM) ) ) if( !( SearchMask & (LIBITEM | FIELDCMPITEM) ) )
break; break;
if( SearchMask & FIELDCMPITEM ) if( SearchMask & FIELDCMPITEM )
{ {
PartTextStruct* Field; PartTextStruct* Field;
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) DrawList; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
for( i = REFERENCE; i < NUMBER_OF_FIELDS; i++ ) for( i = REFERENCE; i < NUMBER_OF_FIELDS; i++ )
{ {
Field = &DrawLibItem->m_Field[i]; Field = &DrawLibItem->m_Field[i];
...@@ -442,7 +442,7 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask, ...@@ -442,7 +442,7 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
else else
{ {
#undef STRUCT #undef STRUCT
#define STRUCT ( (EDA_SchComponentStruct*) DrawList ) #define STRUCT ( (SCH_COMPONENT*) DrawList )
EDA_Rect BoundaryBox = STRUCT->GetBoundaryBox(); EDA_Rect BoundaryBox = STRUCT->GetBoundaryBox();
if( BoundaryBox.Inside( x, y ) ) if( BoundaryBox.Inside( x, y ) )
{ {
...@@ -564,10 +564,10 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, ...@@ -564,10 +564,10 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2,
return TRUE; return TRUE;
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawTextStruct*) DrawStruct ) #define STRUCT ( (SCH_TEXT*) DrawStruct )
dx = STRUCT->m_Size.x * STRUCT->GetLength(); dx = STRUCT->m_Size.x * STRUCT->GetLength();
dy = STRUCT->m_Size.y; dy = STRUCT->m_Size.y;
xt1 = xt2 = STRUCT->m_Pos.x; xt1 = xt2 = STRUCT->m_Pos.x;
...@@ -596,10 +596,10 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, ...@@ -596,10 +596,10 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2,
return TRUE; return TRUE;
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawStruct ) #define STRUCT ( (SCH_LABEL*) DrawStruct )
dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1); /* longueur totale */ dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1); /* longueur totale */
dy = STRUCT->m_Size.y / 2; /* Demi hauteur */ dy = STRUCT->m_Size.y / 2; /* Demi hauteur */
xt1 = xt2 = STRUCT->m_Pos.x; xt1 = xt2 = STRUCT->m_Pos.x;
...@@ -628,10 +628,10 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, ...@@ -628,10 +628,10 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2,
return TRUE; return TRUE;
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
{ {
#undef STRUCT #undef STRUCT
#define STRUCT ( (EDA_SchComponentStruct*) DrawStruct ) #define STRUCT ( (SCH_COMPONENT*) DrawStruct )
EDA_Rect BoundaryBox = STRUCT->GetBoundaryBox(); EDA_Rect BoundaryBox = STRUCT->GetBoundaryBox();
xt1 = BoundaryBox.GetX(); xt1 = BoundaryBox.GetX();
yt1 = BoundaryBox.GetY(); yt1 = BoundaryBox.GetY();
...@@ -1043,7 +1043,7 @@ int distance( int dx, int dy, int spot_cX, int spot_cY, int seuil ) ...@@ -1043,7 +1043,7 @@ int distance( int dx, int dy, int spot_cX, int spot_cY, int seuil )
/*******************************************************************/ /*******************************************************************/
LibDrawPin* LocatePinByNumber( const wxString & ePin_Number, LibDrawPin* LocatePinByNumber( const wxString & ePin_Number,
EDA_SchComponentStruct* eComponent ) SCH_COMPONENT* eComponent )
/*******************************************************************/ /*******************************************************************/
/** Find a PIN in a component /** Find a PIN in a component
...@@ -1096,7 +1096,7 @@ LibDrawPin* LocatePinByNumber( const wxString & ePin_Number, ...@@ -1096,7 +1096,7 @@ LibDrawPin* LocatePinByNumber( const wxString & ePin_Number,
/*******************************************************************/ /*******************************************************************/
LibEDA_BaseStruct* LocatePin( const wxPoint& RefPos, LibEDA_BaseStruct* LocatePin( const wxPoint& RefPos,
EDA_LibComponentStruct* Entry, EDA_LibComponentStruct* Entry,
int Unit, int convert, EDA_SchComponentStruct* DrawLibItem ) int Unit, int convert, SCH_COMPONENT* DrawLibItem )
/*******************************************************************/ /*******************************************************************/
/* Routine de localisation d'une PIN de la PartLib pointee par Entry /* Routine de localisation d'une PIN de la PartLib pointee par Entry
...@@ -1198,19 +1198,19 @@ DrawSheetLabelStruct* LocateSheetLabel( DrawSheetStruct* Sheet, const wxPoint& p ...@@ -1198,19 +1198,19 @@ DrawSheetLabelStruct* LocateSheetLabel( DrawSheetStruct* Sheet, const wxPoint& p
/**************************************************************************/ /**************************************************************************/
LibDrawPin* LocateAnyPin( EDA_BaseStruct* DrawList, const wxPoint& RefPos, LibDrawPin* LocateAnyPin( EDA_BaseStruct* DrawList, const wxPoint& RefPos,
EDA_SchComponentStruct** libpart ) SCH_COMPONENT** libpart )
/**************************************************************************/ /**************************************************************************/
{ {
EDA_BaseStruct* DrawStruct; EDA_BaseStruct* DrawStruct;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
EDA_SchComponentStruct* LibItem = NULL; SCH_COMPONENT* LibItem = NULL;
LibDrawPin* Pin = NULL; LibDrawPin* Pin = NULL;
for( DrawStruct = DrawList; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext ) for( DrawStruct = DrawList; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
{ {
if( DrawStruct->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawStruct->Type() != TYPE_SCH_COMPONENT )
continue; continue;
LibItem = (EDA_SchComponentStruct*) DrawStruct; LibItem = (SCH_COMPONENT*) DrawStruct;
Entry = FindLibPart( LibItem->m_ChipName.GetData(), wxEmptyString, FIND_ROOT ); Entry = FindLibPart( LibItem->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
if( Entry == NULL ) if( Entry == NULL )
continue; continue;
......
...@@ -24,10 +24,10 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet ); ...@@ -24,10 +24,10 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet );
static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool use_netnames ); static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool use_netnames );
static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet ); static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet );
static void AddPinToComponentPinList( EDA_SchComponentStruct* Component, static void AddPinToComponentPinList( SCH_COMPONENT* Component,
DrawSheetPath* sheet, DrawSheetPath* sheet,
LibDrawPin* PinEntry ); LibDrawPin* PinEntry );
static void FindOthersUnits( EDA_SchComponentStruct* Component, DrawSheetPath* Sheet_in); static void FindOthersUnits( SCH_COMPONENT* Component, DrawSheetPath* Sheet_in);
static int SortPinsByNum( ObjetNetListStruct** Pin1, ObjetNetListStruct** Pin2 ); static int SortPinsByNum( ObjetNetListStruct** Pin1, ObjetNetListStruct** Pin2 );
static void EraseDuplicatePins( ObjetNetListStruct** TabPin, int NbrPin ); static void EraseDuplicatePins( ObjetNetListStruct** TabPin, int NbrPin );
...@@ -92,7 +92,7 @@ void WriteNetList( WinEDA_SchematicFrame* frame, const wxString& FileNameNL, ...@@ -92,7 +92,7 @@ void WriteNetList( WinEDA_SchematicFrame* frame, const wxString& FileNameNL,
/****************************************************************************/ /****************************************************************************/
static EDA_SchComponentStruct* FindNextComponentAndCreatPinList( static SCH_COMPONENT* FindNextComponentAndCreatPinList(
EDA_BaseStruct* DrawList, DrawSheetPath* sheet) EDA_BaseStruct* DrawList, DrawSheetPath* sheet)
/****************************************************************************/ /****************************************************************************/
...@@ -105,7 +105,7 @@ static EDA_SchComponentStruct* FindNextComponentAndCreatPinList( ...@@ -105,7 +105,7 @@ static EDA_SchComponentStruct* FindNextComponentAndCreatPinList(
* Must be deallocated by the user * Must be deallocated by the user
*/ */
{ {
EDA_SchComponentStruct* Component = NULL; SCH_COMPONENT* Component = NULL;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
LibEDA_BaseStruct* DEntry; LibEDA_BaseStruct* DEntry;
...@@ -113,9 +113,9 @@ static EDA_SchComponentStruct* FindNextComponentAndCreatPinList( ...@@ -113,9 +113,9 @@ static EDA_SchComponentStruct* FindNextComponentAndCreatPinList(
for( ; DrawList != NULL; DrawList = DrawList->Next() ) for( ; DrawList != NULL; DrawList = DrawList->Next() )
{ {
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue; continue;
Component = (EDA_SchComponentStruct*) DrawList; Component = (SCH_COMPONENT*) DrawList;
/* already tested ? : */ /* already tested ? : */
bool found = false; bool found = false;
...@@ -247,7 +247,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame, ...@@ -247,7 +247,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame,
wxString Line, FootprintName; wxString Line, FootprintName;
DrawSheetPath* sheet; DrawSheetPath* sheet;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* Component; SCH_COMPONENT* Component;
wxString netname; wxString netname;
int ii; int ii;
FILE* tmpfile; FILE* tmpfile;
...@@ -363,9 +363,9 @@ static void ClearUsedFlags( WinEDA_SchematicFrame* frame ) ...@@ -363,9 +363,9 @@ static void ClearUsedFlags( WinEDA_SchematicFrame* frame )
DrawList = screen->EEDrawList; DrawList = screen->EEDrawList;
while( DrawList ) while( DrawList )
{ {
if( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() == TYPE_SCH_COMPONENT )
{ {
EDA_SchComponentStruct* Component = (EDA_SchComponentStruct*) DrawList; SCH_COMPONENT* Component = (SCH_COMPONENT*) DrawList;
//Component->m_FlagControlMulti = 0; //Component->m_FlagControlMulti = 0;
Component->m_UsedOnSheets.Clear(); Component->m_UsedOnSheets.Clear();
} }
...@@ -394,7 +394,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, ...@@ -394,7 +394,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f,
char Line[1024]; char Line[1024];
DrawSheetPath* sheet; DrawSheetPath* sheet;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* Component; SCH_COMPONENT* Component;
int ii, nbitems; int ii, nbitems;
wxString text; wxString text;
wxArrayString SpiceCommandAtBeginFile, SpiceCommandAtEndFile; wxArrayString SpiceCommandAtBeginFile, SpiceCommandAtEndFile;
...@@ -416,9 +416,9 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, ...@@ -416,9 +416,9 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f,
for( DrawList = sheet->LastDrawList(); DrawList != NULL; DrawList = DrawList->Pnext ) for( DrawList = sheet->LastDrawList(); DrawList != NULL; DrawList = DrawList->Pnext )
{ {
wxChar ident; wxChar ident;
if( DrawList->Type() != DRAW_TEXT_STRUCT_TYPE ) if( DrawList->Type() != TYPE_SCH_TEXT )
continue; continue;
#define DRAWTEXT ( (DrawTextStruct*) DrawList ) #define DRAWTEXT ( (SCH_TEXT*) DrawList )
text = DRAWTEXT->m_Text; if( text.IsEmpty() ) text = DRAWTEXT->m_Text; if( text.IsEmpty() )
continue; continue;
ident = text.GetChar( 0 ); ident = text.GetChar( 0 );
...@@ -536,7 +536,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with ...@@ -536,7 +536,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
char Buf[256]; char Buf[256];
DrawSheetPath* sheet; DrawSheetPath* sheet;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* Component; SCH_COMPONENT* Component;
int ii; int ii;
ListComponent* CmpList = NULL; ListComponent* CmpList = NULL;
int CmpListCount = 0, CmpListSize = 1000; int CmpListCount = 0, CmpListSize = 1000;
...@@ -675,7 +675,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with ...@@ -675,7 +675,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
/*************************************************************************************/ /*************************************************************************************/
static void AddPinToComponentPinList( EDA_SchComponentStruct* Component, static void AddPinToComponentPinList( SCH_COMPONENT* Component,
DrawSheetPath* sheetlist, LibDrawPin* Pin ) DrawSheetPath* sheetlist, LibDrawPin* Pin )
/*************************************************************************************/ /*************************************************************************************/
...@@ -742,7 +742,7 @@ static void EraseDuplicatePins( ObjetNetListStruct** TabPin, int NbrPin ) ...@@ -742,7 +742,7 @@ static void EraseDuplicatePins( ObjetNetListStruct** TabPin, int NbrPin )
/**********************************************************************/ /**********************************************************************/
static void FindOthersUnits( EDA_SchComponentStruct* Component_in, DrawSheetPath* Sheet_in) static void FindOthersUnits( SCH_COMPONENT* Component_in, DrawSheetPath* Sheet_in)
/**********************************************************************/ /**********************************************************************/
/* Recherche les autres parts du boitier auquel appartient la part Component, /* Recherche les autres parts du boitier auquel appartient la part Component,
...@@ -751,7 +751,7 @@ static void FindOthersUnits( EDA_SchComponentStruct* Component_in, DrawSheetPath ...@@ -751,7 +751,7 @@ static void FindOthersUnits( EDA_SchComponentStruct* Component_in, DrawSheetPath
*/ */
{ {
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* Component2; SCH_COMPONENT* Component2;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
LibEDA_BaseStruct* DEntry; LibEDA_BaseStruct* DEntry;
DrawSheetPath* sheet; DrawSheetPath* sheet;
...@@ -767,8 +767,8 @@ static void FindOthersUnits( EDA_SchComponentStruct* Component_in, DrawSheetPath ...@@ -767,8 +767,8 @@ static void FindOthersUnits( EDA_SchComponentStruct* Component_in, DrawSheetPath
{ {
switch( DrawList->Type() ) switch( DrawList->Type() )
{ {
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
Component2 = (EDA_SchComponentStruct*) DrawList; Component2 = (SCH_COMPONENT*) DrawList;
found = false; found = false;
for( i =0; i<Component2->m_UsedOnSheets.GetCount(); i++){ for( i =0; i<Component2->m_UsedOnSheets.GetCount(); i++){
...@@ -853,7 +853,7 @@ static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet ) ...@@ -853,7 +853,7 @@ static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet )
int ii, jj; int ii, jj;
int NetCode, LastNetCode = -1; int NetCode, LastNetCode = -1;
int SameNetcodeCount = 0; int SameNetcodeCount = 0;
EDA_SchComponentStruct* Cmp; SCH_COMPONENT* Cmp;
wxString NetName, CmpRef; wxString NetName, CmpRef;
wxString NetcodeName; wxString NetcodeName;
char FirstItemInNet[1024]; char FirstItemInNet[1024];
...@@ -896,7 +896,7 @@ static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet ) ...@@ -896,7 +896,7 @@ static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet )
if( ObjNet[ii].m_Type != NET_PIN ) if( ObjNet[ii].m_Type != NET_PIN )
continue; continue;
Cmp = (EDA_SchComponentStruct*) ObjNet[ii].m_Link; Cmp = (SCH_COMPONENT*) ObjNet[ii].m_Link;
CmpRef = Cmp->GetRef(&ObjNet[ii].m_SheetList); //is this correct? CmpRef = Cmp->GetRef(&ObjNet[ii].m_SheetList); //is this correct?
if( CmpRef.StartsWith( wxT( "#" ) ) ) if( CmpRef.StartsWith( wxT( "#" ) ) )
continue; // Pseudo component (Like Power symbol) continue; // Pseudo component (Like Power symbol)
...@@ -962,7 +962,7 @@ static void WriteNetListCADSTAR( WinEDA_SchematicFrame* frame, FILE* f ) ...@@ -962,7 +962,7 @@ static void WriteNetListCADSTAR( WinEDA_SchematicFrame* frame, FILE* f )
char Line[1024]; char Line[1024];
DrawSheetPath* sheet; DrawSheetPath* sheet;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* Component; SCH_COMPONENT* Component;
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion(); wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
fprintf( f, "%sHEA\n", CONV_TO_UTF8( StartLine ) ); fprintf( f, "%sHEA\n", CONV_TO_UTF8( StartLine ) );
...@@ -1031,7 +1031,7 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet ) ...@@ -1031,7 +1031,7 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
wxString NetcodeName, InitNetDescLine; wxString NetcodeName, InitNetDescLine;
int ii, jj, print_ter = 0; int ii, jj, print_ter = 0;
int NetCode, LastNetCode = -1; int NetCode, LastNetCode = -1;
EDA_SchComponentStruct* Cmp; SCH_COMPONENT* Cmp;
wxString NetName; wxString NetName;
for( ii = 0; ii < g_NbrObjNet; ii++ ) for( ii = 0; ii < g_NbrObjNet; ii++ )
...@@ -1080,7 +1080,7 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet ) ...@@ -1080,7 +1080,7 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
if( ObjNet[ii].m_Flag != 0 ) if( ObjNet[ii].m_Flag != 0 )
continue; continue;
Cmp = (EDA_SchComponentStruct*) ObjNet[ii].m_Link; Cmp = (SCH_COMPONENT*) ObjNet[ii].m_Link;
wxString refstr = Cmp->GetRef(&(ObjNet[ii].m_SheetList)); wxString refstr = Cmp->GetRef(&(ObjNet[ii].m_SheetList));
if( refstr[0] == '#' ) if( refstr[0] == '#' )
continue; // Pseudo composant (symboles d'alims) continue; // Pseudo composant (symboles d'alims)
...@@ -1127,8 +1127,8 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet ) ...@@ -1127,8 +1127,8 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
break; break;
if( ObjNet[jj].m_Type != NET_PIN ) if( ObjNet[jj].m_Type != NET_PIN )
continue; continue;
EDA_SchComponentStruct* tstcmp = SCH_COMPONENT* tstcmp =
(EDA_SchComponentStruct*) ObjNet[jj].m_Link; (SCH_COMPONENT*) ObjNet[jj].m_Link;
wxString p = Cmp->GetPath( &( ObjNet[ii].m_SheetList ) ); wxString p = Cmp->GetPath( &( ObjNet[ii].m_SheetList ) );
wxString tstp = tstcmp->GetPath( &( ObjNet[jj].m_SheetList ) ); wxString tstp = tstcmp->GetPath( &( ObjNet[jj].m_SheetList ) );
if( p.Cmp(tstp) != 0 ) if( p.Cmp(tstp) != 0 )
......
...@@ -449,7 +449,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh ...@@ -449,7 +449,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
{ {
int ii, NbrItem = 0; int ii, NbrItem = 0;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
int TransMat[2][2], PartX, PartY, x2, y2; int TransMat[2][2], PartX, PartY, x2, y2;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
LibEDA_BaseStruct* DEntry; LibEDA_BaseStruct* DEntry;
...@@ -517,9 +517,9 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh ...@@ -517,9 +517,9 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
NbrItem++; NbrItem++;
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawList ) #define STRUCT ( (SCH_LABEL*) DrawList )
ii = IsBusLabel( STRUCT->m_Text ); ii = IsBusLabel( STRUCT->m_Text );
if( ObjNet ) if( ObjNet )
{ {
...@@ -542,10 +542,10 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh ...@@ -542,10 +542,10 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
NbrItem += ii + 1; NbrItem += ii + 1;
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawList ) #define STRUCT ( (SCH_LABEL*) DrawList )
ii = IsBusLabel( STRUCT->m_Text ); ii = IsBusLabel( STRUCT->m_Text );
if( ObjNet ) if( ObjNet )
{ {
...@@ -568,8 +568,8 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh ...@@ -568,8 +568,8 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
NbrItem += ii + 1; NbrItem += ii + 1;
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
DrawLibItem = (EDA_SchComponentStruct*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
memcpy( TransMat, DrawLibItem->m_Transform, sizeof(TransMat) ); memcpy( TransMat, DrawLibItem->m_Transform, sizeof(TransMat) );
...@@ -645,7 +645,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh ...@@ -645,7 +645,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
case DRAW_POLYLINE_STRUCT_TYPE: case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE: case DRAW_MARKER_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
break; break;
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
......
...@@ -99,7 +99,7 @@ typedef struct ListLabel ...@@ -99,7 +99,7 @@ typedef struct ListLabel
} ListLabel; } ListLabel;
typedef struct ListComponent typedef struct ListComponent
{ {
EDA_SchComponentStruct * m_Comp; SCH_COMPONENT * m_Comp;
char m_Ref[32]; char m_Ref[32];
//have to store it here since the object refrerences will be duplicated. //have to store it here since the object refrerences will be duplicated.
DrawSheetPath m_SheetList; //composed of UIDs DrawSheetPath m_SheetList; //composed of UIDs
...@@ -109,7 +109,7 @@ typedef struct ListComponent ...@@ -109,7 +109,7 @@ typedef struct ListComponent
struct CmpListStruct struct CmpListStruct
{ {
public: public:
EDA_SchComponentStruct* m_Cmp; /* Pointeur sur le composant */ SCH_COMPONENT* m_Cmp; /* Pointeur sur le composant */
int m_NbParts; /* Nombre de parts par boitier */ int m_NbParts; /* Nombre de parts par boitier */
bool m_PartsLocked; // For multi part components: True if the part cannot be changed bool m_PartsLocked; // For multi part components: True if the part cannot be changed
int m_Unit; /* Numero de part */ int m_Unit; /* Numero de part */
......
...@@ -39,15 +39,15 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -39,15 +39,15 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
switch( DrawStruct->Type() ) switch( DrawStruct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_SHEETLABEL_STRUCT_TYPE: case DRAW_SHEETLABEL_STRUCT_TYPE:
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE: case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
...@@ -354,16 +354,16 @@ void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -354,16 +354,16 @@ void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
InstallNextScreen( (DrawSheetStruct*) DrawStruct ); InstallNextScreen( (DrawSheetStruct*) DrawStruct );
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
InstallCmpeditFrame( this, pos, (EDA_SchComponentStruct*) DrawStruct ); InstallCmpeditFrame( this, pos, (SCH_COMPONENT*) DrawStruct );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
EditSchematicText( (DrawTextStruct*) DrawStruct, DC ); EditSchematicText( (SCH_TEXT*) DrawStruct, DC );
break; break;
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
......
...@@ -55,11 +55,11 @@ static void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus, ...@@ -55,11 +55,11 @@ static void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus,
WinEDA_SchematicFrame* frame ); WinEDA_SchematicFrame* frame );
static void AddMenusForHierchicalSheet( wxMenu* PopMenu, DrawSheetStruct* Sheet ); static void AddMenusForHierchicalSheet( wxMenu* PopMenu, DrawSheetStruct* Sheet );
static void AddMenusForPinSheet( wxMenu* PopMenu, DrawSheetLabelStruct* PinSheet ); static void AddMenusForPinSheet( wxMenu* PopMenu, DrawSheetLabelStruct* PinSheet );
static void AddMenusForText( wxMenu* PopMenu, DrawTextStruct* Text ); static void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text );
static void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label ); static void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label );
static void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel ); static void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel );
static void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* GLabel ); static void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* GLabel );
static void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component ); static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component );
static void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field ); static void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field );
static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction, static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
WinEDA_SchematicFrame* frame ); WinEDA_SchematicFrame* frame );
...@@ -182,20 +182,20 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -182,20 +182,20 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete Marker" ), delete_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete Marker" ), delete_xpm );
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
AddMenusForText( PopMenu, (DrawTextStruct*) DrawStruct ); AddMenusForText( PopMenu, (SCH_TEXT*) DrawStruct );
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
AddMenusForLabel( PopMenu, (DrawLabelStruct*) DrawStruct ); AddMenusForLabel( PopMenu, (SCH_LABEL*) DrawStruct );
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
AddMenusForGLabel( PopMenu, (DrawGlobalLabelStruct*) DrawStruct ); AddMenusForGLabel( PopMenu, (SCH_GLOBALLABEL*) DrawStruct );
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
AddMenusForHLabel( PopMenu, (DrawHierLabelStruct*) DrawStruct ); AddMenusForHLabel( PopMenu, (SCH_HIERLABEL*) DrawStruct );
break; break;
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
...@@ -205,17 +205,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -205,17 +205,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
break; break;
// Many fields are inside a component. If this is the case, add the component menu // Many fields are inside a component. If this is the case, add the component menu
EDA_SchComponentStruct* Component = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); SCH_COMPONENT* Component = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
if( Component ) if( Component )
{ {
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
AddMenusForComponent( PopMenu, (EDA_SchComponentStruct*) DrawStruct ); AddMenusForComponent( PopMenu, (SCH_COMPONENT*) DrawStruct );
} }
} }
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
AddMenusForComponent( PopMenu, (EDA_SchComponentStruct*) DrawStruct ); AddMenusForComponent( PopMenu, (SCH_COMPONENT*) DrawStruct );
break; break;
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
...@@ -278,7 +278,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field ) ...@@ -278,7 +278,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field )
/**************************************************************************/ /**************************************************************************/
void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component ) void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
/**************************************************************************/ /**************************************************************************/
/* Add menu commands for a component /* Add menu commands for a component
...@@ -363,7 +363,7 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component ) ...@@ -363,7 +363,7 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
/*******************************************************************/ /*******************************************************************/
void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel ) void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
/*******************************************************************/ /*******************************************************************/
/* Add menu commands for a Global Label /* Add menu commands for a Global Label
...@@ -388,7 +388,7 @@ void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel ) ...@@ -388,7 +388,7 @@ void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel )
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm ); ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
} }
/*******************************************************************/ /*******************************************************************/
void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel ) void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
/*******************************************************************/ /*******************************************************************/
/* Add menu commands for a hierarchal Label /* Add menu commands for a hierarchal Label
*/ */
...@@ -414,7 +414,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel ) ...@@ -414,7 +414,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel )
/*****************************************************************/ /*****************************************************************/
void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label ) void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
/*****************************************************************/ /*****************************************************************/
/* Add menu commands for a Label /* Add menu commands for a Label
...@@ -441,7 +441,7 @@ void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label ) ...@@ -441,7 +441,7 @@ void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label )
/*****************************************************************/ /*****************************************************************/
void AddMenusForText( wxMenu* PopMenu, DrawTextStruct* Text ) void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
/*****************************************************************/ /*****************************************************************/
/* Add menu commands for a Text (a comment) /* Add menu commands for a Text (a comment)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/* Variables locales : */ /* Variables locales : */
static void PlotSheetLabelStruct( DrawSheetLabelStruct* Struct ); static void PlotSheetLabelStruct( DrawSheetLabelStruct* Struct );
static void PlotTextField( EDA_SchComponentStruct* DrawLibItem, static void PlotTextField( SCH_COMPONENT* DrawLibItem,
int FieldNumber, int IsMulti, int DrawMode ); int FieldNumber, int IsMulti, int DrawMode );
static void PlotPinSymbol( int posX, int posY, int len, int orient, int Shape ); static void PlotPinSymbol( int posX, int posY, int len, int orient, int Shape );
...@@ -164,7 +164,7 @@ void PlotNoConnectStruct( DrawNoConnectStruct* Struct ) ...@@ -164,7 +164,7 @@ void PlotNoConnectStruct( DrawNoConnectStruct* Struct )
/*************************************************/ /*************************************************/
void PlotLibPart( EDA_SchComponentStruct* DrawLibItem ) void PlotLibPart( SCH_COMPONENT* DrawLibItem )
/*************************************************/ /*************************************************/
/* Genere le trace d'un composant */ /* Genere le trace d'un composant */
{ {
...@@ -342,7 +342,7 @@ void PlotLibPart( EDA_SchComponentStruct* DrawLibItem ) ...@@ -342,7 +342,7 @@ void PlotLibPart( EDA_SchComponentStruct* DrawLibItem )
/*************************************************************/ /*************************************************************/
static void PlotTextField( EDA_SchComponentStruct* DrawLibItem, static void PlotTextField( SCH_COMPONENT* DrawLibItem,
int FieldNumber, int IsMulti, int DrawMode ) int FieldNumber, int IsMulti, int DrawMode )
/**************************************************************/ /**************************************************************/
...@@ -553,22 +553,22 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -553,22 +553,22 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
switch( Struct->Type() ) switch( Struct->Type() )
{ {
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
Text = ( (DrawTextStruct*) Struct )->m_Text; Text = ( (SCH_TEXT*) Struct )->m_Text;
Size = ( (DrawTextStruct*) Struct )->m_Size; Size = ( (SCH_TEXT*) Struct )->m_Size;
Orient = ( (DrawTextStruct*) Struct )->m_Orient; Orient = ( (SCH_TEXT*) Struct )->m_Orient;
Shape = ( (DrawTextStruct*) Struct )->m_Shape; Shape = ( (SCH_TEXT*) Struct )->m_Shape;
pX = ( (DrawTextStruct*) Struct )->m_Pos.x; pX = ( (SCH_TEXT*) Struct )->m_Pos.x;
pY = ( (DrawTextStruct*) Struct )->m_Pos.y; pY = ( (SCH_TEXT*) Struct )->m_Pos.y;
offset = TXTMARGE; offset = TXTMARGE;
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE if( Struct->Type() == TYPE_SCH_GLOBALLABEL
|| Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE ) || Struct->Type() == TYPE_SCH_HIERLABEL )
offset += Size.x; // We must draw the Glabel graphic symbol offset += Size.x; // We must draw the Glabel graphic symbol
if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt ) if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt )
color = ReturnLayerColor( ( (DrawTextStruct*) Struct )->m_Layer ); color = ReturnLayerColor( ( (SCH_TEXT*) Struct )->m_Layer );
break; break;
default: default:
...@@ -580,9 +580,9 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -580,9 +580,9 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
SetCurrentLineWidth( -1 ); SetCurrentLineWidth( -1 );
if ( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE ) if ( Struct->Type() == TYPE_SCH_GLOBALLABEL )
{ {
offset = ( (DrawGlobalLabelStruct*) Struct )->m_Width; offset = ( (SCH_GLOBALLABEL*) Struct )->m_Width;
switch( Shape ) switch( Shape )
{ {
case NET_INPUT: case NET_INPUT:
...@@ -604,7 +604,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -604,7 +604,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
switch( Orient ) switch( Orient )
{ {
case 0: /* Orientation horiz normale */ case 0: /* Orientation horiz normale */
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_GLOBALLABEL || Struct->Type() == TYPE_SCH_HIERLABEL )
PlotGraphicText( g_PlotFormat, wxPoint( pX - offset, pY ), PlotGraphicText( g_PlotFormat, wxPoint( pX - offset, pY ),
color, Text, TEXT_ORIENT_HORIZ, Size, color, Text, TEXT_ORIENT_HORIZ, Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER ); GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER );
...@@ -615,7 +615,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -615,7 +615,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
break; break;
case 1: /* Orientation vert UP */ case 1: /* Orientation vert UP */
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_GLOBALLABEL || Struct->Type() == TYPE_SCH_HIERLABEL )
PlotGraphicText( g_PlotFormat, wxPoint( pX, pY + offset ), PlotGraphicText( g_PlotFormat, wxPoint( pX, pY + offset ),
color, Text, TEXT_ORIENT_VERT, Size, color, Text, TEXT_ORIENT_VERT, Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP );
...@@ -626,7 +626,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -626,7 +626,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
break; break;
case 2: /* Horiz Orientation - Right justified */ case 2: /* Horiz Orientation - Right justified */
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_GLOBALLABEL || Struct->Type() == TYPE_SCH_HIERLABEL )
PlotGraphicText( g_PlotFormat, wxPoint( pX + offset, pY ), PlotGraphicText( g_PlotFormat, wxPoint( pX + offset, pY ),
color, Text, TEXT_ORIENT_HORIZ, Size, color, Text, TEXT_ORIENT_HORIZ, Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER ); GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER );
...@@ -637,7 +637,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -637,7 +637,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
break; break;
case 3: /* Orientation vert BOTTOM */ case 3: /* Orientation vert BOTTOM */
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_GLOBALLABEL || Struct->Type() == TYPE_SCH_HIERLABEL )
PlotGraphicText( g_PlotFormat, wxPoint( pX, pY - offset ), PlotGraphicText( g_PlotFormat, wxPoint( pX, pY - offset ),
color, Text, TEXT_ORIENT_VERT, Size, color, Text, TEXT_ORIENT_VERT, Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM );
...@@ -649,14 +649,14 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -649,14 +649,14 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
} }
/* Draw graphic symbol for global or hierachical labels */ /* Draw graphic symbol for global or hierachical labels */
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_GLOBALLABEL )
{ {
( (DrawGlobalLabelStruct*) Struct )->CreateGraphicShape( Poly, wxPoint(pX, pY) ); ( (SCH_GLOBALLABEL*) Struct )->CreateGraphicShape( Poly, wxPoint(pX, pY) );
PlotPoly( Poly[0], Poly + 1, NOFILL ); PlotPoly( Poly[0], Poly + 1, NOFILL );
} }
if( Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_HIERLABEL )
{ {
( (DrawHierLabelStruct*) Struct )->CreateGraphicShape( Poly, wxPoint(pX, pY) ); ( (SCH_HIERLABEL*) Struct )->CreateGraphicShape( Poly, wxPoint(pX, pY) );
PlotPoly( Poly[0], Poly + 1, NOFILL ); PlotPoly( Poly[0], Poly + 1, NOFILL );
} }
} }
......
...@@ -552,7 +552,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL(const wxString & FullFileName, ...@@ -552,7 +552,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL(const wxString & FullFileName,
*/ */
{ {
EDA_BaseStruct *DrawList; EDA_BaseStruct *DrawList;
EDA_SchComponentStruct *DrawLibItem; SCH_COMPONENT *DrawLibItem;
int x1=0, y1=0, x2=0, y2=0, layer; int x1=0, y1=0, x2=0, y2=0, layer;
wxString msg; wxString msg;
...@@ -635,15 +635,15 @@ wxString msg; ...@@ -635,15 +635,15 @@ wxString msg;
PlotCercle( wxPoint(x1,y1), DRAWJUNCTION_SIZE * 2); PlotCercle( wxPoint(x1,y1), DRAWJUNCTION_SIZE * 2);
break; break;
case DRAW_TEXT_STRUCT_TYPE : case TYPE_SCH_TEXT :
case DRAW_LABEL_STRUCT_TYPE : case TYPE_SCH_LABEL :
case DRAW_GLOBAL_LABEL_STRUCT_TYPE : case TYPE_SCH_GLOBALLABEL :
case DRAW_HIER_LABEL_STRUCT_TYPE : case TYPE_SCH_HIERLABEL :
PlotTextStruct(DrawList); PlotTextStruct(DrawList);
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE : case TYPE_SCH_COMPONENT :
DrawLibItem = (EDA_SchComponentStruct *) DrawList; DrawLibItem = (SCH_COMPONENT *) DrawList;
PlotLibPart( DrawLibItem ); PlotLibPart( DrawLibItem );
break; break;
......
...@@ -380,7 +380,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS(const wxString & FileName, ...@@ -380,7 +380,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS(const wxString & FileName,
{ {
wxString Line; wxString Line;
EDA_BaseStruct *DrawList; EDA_BaseStruct *DrawList;
EDA_SchComponentStruct *DrawLibItem; SCH_COMPONENT *DrawLibItem;
int layer; int layer;
wxPoint StartPos, EndPos; wxPoint StartPos, EndPos;
...@@ -471,15 +471,15 @@ wxPoint StartPos, EndPos; ...@@ -471,15 +471,15 @@ wxPoint StartPos, EndPos;
PlotCercle( STRUCT->m_Pos, DRAWJUNCTION_SIZE); PlotCercle( STRUCT->m_Pos, DRAWJUNCTION_SIZE);
break; break;
case DRAW_TEXT_STRUCT_TYPE : case TYPE_SCH_TEXT :
case DRAW_LABEL_STRUCT_TYPE : case TYPE_SCH_LABEL :
case DRAW_GLOBAL_LABEL_STRUCT_TYPE : case TYPE_SCH_GLOBALLABEL :
case DRAW_HIER_LABEL_STRUCT_TYPE : case TYPE_SCH_HIERLABEL :
PlotTextStruct(DrawList); PlotTextStruct(DrawList);
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE : case TYPE_SCH_COMPONENT :
DrawLibItem = (EDA_SchComponentStruct *) DrawList; DrawLibItem = (SCH_COMPONENT *) DrawList;
PlotLibPart( DrawLibItem ); PlotLibPart( DrawLibItem );
break; break;
......
...@@ -5,7 +5,7 @@ void FreeLibraryEntry(LibCmpEntry * Entry); ...@@ -5,7 +5,7 @@ void FreeLibraryEntry(LibCmpEntry * Entry);
LibEDA_BaseStruct * LocatePin(const wxPoint & RefPos, LibEDA_BaseStruct * LocatePin(const wxPoint & RefPos,
EDA_LibComponentStruct * Entry, EDA_LibComponentStruct * Entry,
int Unit, int Convert, EDA_SchComponentStruct * DrawItem = NULL); int Unit, int Convert, SCH_COMPONENT * DrawItem = NULL);
/* Routine de localisation d'une PIN de la PartLib pointee par Entry */ /* Routine de localisation d'une PIN de la PartLib pointee par Entry */
const wxString& ReturnDefaultFieldName( int aFieldNdx ); const wxString& ReturnDefaultFieldName( int aFieldNdx );
...@@ -36,7 +36,7 @@ void IncrementLabelMember(wxString & name); ...@@ -36,7 +36,7 @@ void IncrementLabelMember(wxString & name);
/* EDITPART.CPP */ /* EDITPART.CPP */
/****************/ /****************/
void InstallCmpeditFrame(WinEDA_SchematicFrame * parent, wxPoint & pos, void InstallCmpeditFrame(WinEDA_SchematicFrame * parent, wxPoint & pos,
EDA_SchComponentStruct * m_Cmp); SCH_COMPONENT * m_Cmp);
/**************/ /**************/
...@@ -49,7 +49,7 @@ int NumOfLibraries(); ...@@ -49,7 +49,7 @@ int NumOfLibraries();
EDA_LibComponentStruct *FindLibPart(const wxChar *Name, const wxString & LibName, int Alias); EDA_LibComponentStruct *FindLibPart(const wxChar *Name, const wxString & LibName, int Alias);
void DrawingLibInGhost(WinEDA_DrawPanel * panel, wxDC * DC, EDA_LibComponentStruct *LibEntry, void DrawingLibInGhost(WinEDA_DrawPanel * panel, wxDC * DC, EDA_LibComponentStruct *LibEntry,
EDA_SchComponentStruct * DrawLibItem, int PartX, int PartY, SCH_COMPONENT * DrawLibItem, int PartX, int PartY,
int Multi, int convert, int Multi, int convert,
int Color, bool DrawPinText); int Color, bool DrawPinText);
...@@ -84,9 +84,9 @@ void FreeCmpLibrary(wxWindow * frame, const wxString & LibName); ...@@ -84,9 +84,9 @@ void FreeCmpLibrary(wxWindow * frame, const wxString & LibName);
const wxChar **GetLibNames(); const wxChar **GetLibNames();
void SnapLibItemPoint(int OrigX, int OrigY, int *ClosestX, int *ClosestY, void SnapLibItemPoint(int OrigX, int OrigY, int *ClosestX, int *ClosestY,
EDA_SchComponentStruct *DrawLibItem); SCH_COMPONENT *DrawLibItem);
bool LibItemInBox(int x1, int y1, int x2, int y2, bool LibItemInBox(int x1, int y1, int x2, int y2,
EDA_SchComponentStruct *DrawLibItem); SCH_COMPONENT *DrawLibItem);
void DrawTextField(WinEDA_DrawPanel * panel, wxDC * DC, PartTextStruct * Field, int IsMulti, int DrawMode); void DrawTextField(WinEDA_DrawPanel * panel, wxDC * DC, PartTextStruct * Field, int IsMulti, int DrawMode);
/* Routine de trace des textes type Field du composant. /* Routine de trace des textes type Field du composant.
entree: entree:
...@@ -117,9 +117,9 @@ bool DrawStructInBox(int x1, int y1, int x2, int y2, ...@@ -117,9 +117,9 @@ bool DrawStructInBox(int x1, int y1, int x2, int y2,
/* LOCATE.CPP */ /* LOCATE.CPP */
/*************/ /*************/
LibDrawPin* LocatePinByNumber( const wxString & ePin_Number, LibDrawPin* LocatePinByNumber( const wxString & ePin_Number,
EDA_SchComponentStruct* eComponent ); SCH_COMPONENT* eComponent );
EDA_SchComponentStruct * LocateSmallestComponent( SCH_SCREEN * Screen ); SCH_COMPONENT * LocateSmallestComponent( SCH_SCREEN * Screen );
/* Recherche du plus petit (en surface) composant pointe par la souris */ /* Recherche du plus petit (en surface) composant pointe par la souris */
EDA_BaseStruct * PickStruct(EDA_Rect & block, EDA_BaseStruct * PickStruct(EDA_Rect & block,
...@@ -168,7 +168,7 @@ LibEDA_BaseStruct * LocateDrawItem(SCH_SCREEN * Screen, const wxPoint & refpoint ...@@ -168,7 +168,7 @@ LibEDA_BaseStruct * LocateDrawItem(SCH_SCREEN * Screen, const wxPoint & refpoint
DrawSheetLabelStruct * LocateSheetLabel(DrawSheetStruct *Sheet, const wxPoint & pos); DrawSheetLabelStruct * LocateSheetLabel(DrawSheetStruct *Sheet, const wxPoint & pos);
LibDrawPin * LocateAnyPin(EDA_BaseStruct *DrawList, const wxPoint & RefPos, LibDrawPin * LocateAnyPin(EDA_BaseStruct *DrawList, const wxPoint & RefPos,
EDA_SchComponentStruct ** libpart = NULL ); SCH_COMPONENT ** libpart = NULL );
DrawSheetLabelStruct * LocateAnyPinSheet(const wxPoint & RefPos, DrawSheetLabelStruct * LocateAnyPinSheet(const wxPoint & RefPos,
EDA_BaseStruct *DrawList); EDA_BaseStruct *DrawList);
...@@ -315,7 +315,7 @@ void PlotCercle(wxPoint centre, int diametre, int width = -1); ...@@ -315,7 +315,7 @@ void PlotCercle(wxPoint centre, int diametre, int width = -1);
void PlotPoly( int nb, int * coord, int fill, int width = -1); void PlotPoly( int nb, int * coord, int fill, int width = -1);
void PlotNoConnectStruct(DrawNoConnectStruct * Struct); void PlotNoConnectStruct(DrawNoConnectStruct * Struct);
void PlotLibPart( EDA_SchComponentStruct *DrawLibItem ); void PlotLibPart( SCH_COMPONENT *DrawLibItem );
/* Genere le trace d'un composant */ /* Genere le trace d'un composant */
void PlotSheetStruct(DrawSheetStruct *Struct); void PlotSheetStruct(DrawSheetStruct *Struct);
/* Routine de dessin du bloc type hierarchie */ /* Routine de dessin du bloc type hierarchie */
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/* Fonctions externes */ /* Fonctions externes */
/* Fonctions Locales */ /* Fonctions Locales */
static int SavePartDescr( FILE *f, EDA_SchComponentStruct * LibItemStruct); static int SavePartDescr( FILE *f, SCH_COMPONENT * LibItemStruct);
static int SaveSheetDescr( FILE *f, DrawSheetStruct * SheetStruct); static int SaveSheetDescr( FILE *f, DrawSheetStruct * SheetStruct);
static void SaveLayers(FILE *f); static void SaveLayers(FILE *f);
...@@ -145,8 +145,8 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave) ...@@ -145,8 +145,8 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
{ {
switch(Phead->Type()) switch(Phead->Type())
{ {
case DRAW_LIB_ITEM_STRUCT_TYPE: /* Its a library item. */ case TYPE_SCH_COMPONENT: /* Its a library item. */
SavePartDescr( f, (EDA_SchComponentStruct *) Phead); SavePartDescr( f, (SCH_COMPONENT *) Phead);
break; break;
case DRAW_SHEET_STRUCT_TYPE: /* Its a Sheet item. */ case DRAW_SHEET_STRUCT_TYPE: /* Its a Sheet item. */
...@@ -237,9 +237,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave) ...@@ -237,9 +237,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
} }
break; break;
case DRAW_TEXT_STRUCT_TYPE: /* Its a text item. */ case TYPE_SCH_TEXT: /* Its a text item. */
#undef STRUCT #undef STRUCT
#define STRUCT ((DrawTextStruct *) Phead) #define STRUCT ((SCH_TEXT *) Phead)
if (fprintf(f, "Text Notes %-4d %-4d %-4d %-4d ~\n%s\n", if (fprintf(f, "Text Notes %-4d %-4d %-4d %-4d ~\n%s\n",
STRUCT->m_Pos.x, STRUCT->m_Pos.y, STRUCT->m_Pos.x, STRUCT->m_Pos.y,
STRUCT->m_Orient, STRUCT->m_Size.x, STRUCT->m_Orient, STRUCT->m_Size.x,
...@@ -248,9 +248,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave) ...@@ -248,9 +248,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
break; break;
case DRAW_LABEL_STRUCT_TYPE: /* Its a label item. */ case TYPE_SCH_LABEL: /* Its a label item. */
#undef STRUCT #undef STRUCT
#define STRUCT ((DrawLabelStruct *) Phead) #define STRUCT ((SCH_LABEL *) Phead)
shape = '~'; shape = '~';
if (fprintf(f, "Text Label %-4d %-4d %-4d %-4d %c\n%s\n", if (fprintf(f, "Text Label %-4d %-4d %-4d %-4d %c\n%s\n",
STRUCT->m_Pos.x, STRUCT->m_Pos.y, STRUCT->m_Pos.x, STRUCT->m_Pos.y,
...@@ -259,9 +259,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave) ...@@ -259,9 +259,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
Failed = TRUE; Failed = TRUE;
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: /* Its a Global label item. */ case TYPE_SCH_GLOBALLABEL: /* Its a Global label item. */
#undef STRUCT #undef STRUCT
#define STRUCT ((DrawGlobalLabelStruct *) Phead) #define STRUCT ((SCH_GLOBALLABEL *) Phead)
shape = STRUCT->m_Shape; shape = STRUCT->m_Shape;
if (fprintf(f, "Text GLabel %-4d %-4d %-4d %-4d %s\n%s\n", if (fprintf(f, "Text GLabel %-4d %-4d %-4d %-4d %s\n%s\n",
STRUCT->m_Pos.x, STRUCT->m_Pos.y, STRUCT->m_Pos.x, STRUCT->m_Pos.y,
...@@ -271,9 +271,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave) ...@@ -271,9 +271,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
Failed = TRUE; Failed = TRUE;
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: /* Its a Hierarchical label item. */ case TYPE_SCH_HIERLABEL: /* Its a Hierarchical label item. */
#undef STRUCT #undef STRUCT
#define STRUCT ((DrawHierLabelStruct *) Phead) #define STRUCT ((SCH_HIERLABEL *) Phead)
shape = STRUCT->m_Shape; shape = STRUCT->m_Shape;
if (fprintf(f, "Text HLabel %-4d %-4d %-4d %-4d %s\n%s\n", if (fprintf(f, "Text HLabel %-4d %-4d %-4d %-4d %s\n%s\n",
STRUCT->m_Pos.x, STRUCT->m_Pos.y, STRUCT->m_Pos.x, STRUCT->m_Pos.y,
...@@ -324,7 +324,7 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave) ...@@ -324,7 +324,7 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
/*******************************************************************/ /*******************************************************************/
static int SavePartDescr( FILE *f, EDA_SchComponentStruct * LibItemStruct) static int SavePartDescr( FILE *f, SCH_COMPONENT * LibItemStruct)
/*******************************************************************/ /*******************************************************************/
/* Routine utilisee dans la routine precedente. /* Routine utilisee dans la routine precedente.
Assure la sauvegarde de la structure LibItemStruct Assure la sauvegarde de la structure LibItemStruct
......
...@@ -273,36 +273,36 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -273,36 +273,36 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_SCH_EDIT_TEXT: case ID_POPUP_SCH_EDIT_TEXT:
EditSchematicText( (DrawTextStruct*) GetScreen()->GetCurItem(), &dc ); EditSchematicText( (SCH_TEXT*) GetScreen()->GetCurItem(), &dc );
break; break;
case ID_POPUP_SCH_ROTATE_TEXT: case ID_POPUP_SCH_ROTATE_TEXT:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ChangeTextOrient( (DrawTextStruct*) GetScreen()->GetCurItem(), &dc ); ChangeTextOrient( (SCH_TEXT*) GetScreen()->GetCurItem(), &dc );
break; break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL: case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(), ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
&dc, DRAW_LABEL_STRUCT_TYPE ); &dc, TYPE_SCH_LABEL );
break; break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL: case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(), ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
&dc, DRAW_GLOBAL_LABEL_STRUCT_TYPE ); &dc, TYPE_SCH_GLOBALLABEL );
break; break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL: case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(), ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
&dc, DRAW_HIER_LABEL_STRUCT_TYPE ); &dc, TYPE_SCH_HIERLABEL );
break; break;
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT: case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(), ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
&dc, DRAW_TEXT_STRUCT_TYPE ); &dc, TYPE_SCH_TEXT );
break; break;
case ID_POPUP_SCH_SET_SHAPE_TEXT: case ID_POPUP_SCH_SET_SHAPE_TEXT:
...@@ -347,7 +347,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -347,7 +347,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a // Ensure the struct is a component (could be a struct of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
...@@ -403,7 +403,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -403,7 +403,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a // Ensure the struct is a component (could be a struct of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
...@@ -431,13 +431,13 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -431,13 +431,13 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a // Ensure the struct is a component (could be a struct of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
break; break;
InstallCmpeditFrame( this, pos, InstallCmpeditFrame( this, pos,
(EDA_SchComponentStruct*) GetScreen()->GetCurItem() ); (SCH_COMPONENT*) GetScreen()->GetCurItem() );
break; break;
case ID_POPUP_SCH_MIROR_X_CMP: case ID_POPUP_SCH_MIROR_X_CMP:
...@@ -448,7 +448,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -448,7 +448,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a // Ensure the struct is a component (could be a struct of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
...@@ -480,7 +480,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -480,7 +480,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
SaveCopyInUndoList( GetScreen()->GetCurItem(), IS_CHANGED ); SaveCopyInUndoList( GetScreen()->GetCurItem(), IS_CHANGED );
CmpRotationMiroir( CmpRotationMiroir(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), (SCH_COMPONENT*) GetScreen()->GetCurItem(),
&dc, option ); &dc, option );
break; break;
} }
...@@ -493,41 +493,41 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -493,41 +493,41 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a // Ensure the struct is a component (could be a struct of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
break; break;
EditComponentValue( EditComponentValue(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc ); (SCH_COMPONENT*) GetScreen()->GetCurItem(), &dc );
break; break;
case ID_POPUP_SCH_EDIT_REF_CMP: case ID_POPUP_SCH_EDIT_REF_CMP:
// Ensure the struct is a component (could be a struct of a // Ensure the struct is a component (could be a struct of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
break; break;
EditComponentReference( EditComponentReference(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc ); (SCH_COMPONENT*) GetScreen()->GetCurItem(), &dc );
break; break;
case ID_POPUP_SCH_EDIT_FOOTPRINT_CMP: case ID_POPUP_SCH_EDIT_FOOTPRINT_CMP:
// Ensure the struct is a component (could be a struct of a // Ensure the struct is a component (could be a struct of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
break; break;
EditComponentFootprint( EditComponentFootprint(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc ); (SCH_COMPONENT*) GetScreen()->GetCurItem(), &dc );
break; break;
...@@ -535,25 +535,25 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -535,25 +535,25 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a // Ensure the struct is a component (could be a struct of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
break; break;
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
ConvertPart( ConvertPart(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), (SCH_COMPONENT*) GetScreen()->GetCurItem(),
&dc ); &dc );
break; break;
case ID_POPUP_SCH_COPY_COMPONENT_CMP: case ID_POPUP_SCH_COPY_COMPONENT_CMP:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
{ {
EDA_SchComponentStruct* olditem, * newitem; SCH_COMPONENT* olditem, * newitem;
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
olditem = (EDA_SchComponentStruct*) GetScreen()->GetCurItem(); olditem = (SCH_COMPONENT*) GetScreen()->GetCurItem();
if( olditem == NULL ) if( olditem == NULL )
break; break;
newitem = olditem->GenCopy(); newitem = olditem->GenCopy();
...@@ -597,14 +597,14 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -597,14 +597,14 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a // Ensure the struct is a component (could be a struct of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
break; break;
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
SelPartUnit( SelPartUnit(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), (SCH_COMPONENT*) GetScreen()->GetCurItem(),
id + 1 - ID_POPUP_SCH_SELECT_UNIT1, id + 1 - ID_POPUP_SCH_SELECT_UNIT1,
&dc ); &dc );
break; break;
...@@ -613,7 +613,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -613,7 +613,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a piece of a // Ensure the struct is a component (could be a piece of a
// component, like Field, text..) // component, like Field, text..)
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*) GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
GetScreen() ) ); GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL ) if( GetScreen()->GetCurItem() == NULL )
...@@ -621,7 +621,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -621,7 +621,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
EDA_LibComponentStruct* LibEntry; EDA_LibComponentStruct* LibEntry;
LibEntry = FindLibPart( LibEntry = FindLibPart(
( (EDA_SchComponentStruct*) GetScreen()->GetCurItem() )->m_ChipName, ( (SCH_COMPONENT*) GetScreen()->GetCurItem() )->m_ChipName,
wxEmptyString, wxEmptyString,
FIND_ALIAS ); FIND_ALIAS );
if( LibEntry && LibEntry->m_DocFile != wxEmptyString ) if( LibEntry && LibEntry->m_DocFile != wxEmptyString )
...@@ -755,15 +755,15 @@ void WinEDA_SchematicFrame::Process_Move_Item( EDA_BaseStruct* DrawStruct, ...@@ -755,15 +755,15 @@ void WinEDA_SchematicFrame::Process_Move_Item( EDA_BaseStruct* DrawStruct,
StartMoveBusEntry( (DrawBusEntryStruct*) DrawStruct, DC ); StartMoveBusEntry( (DrawBusEntryStruct*) DrawStruct, DC );
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
StartMoveTexte( (DrawTextStruct*) DrawStruct, DC ); StartMoveTexte( (SCH_TEXT*) DrawStruct, DC );
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
StartMovePart( (EDA_SchComponentStruct*) DrawStruct, DC ); StartMovePart( (SCH_COMPONENT*) DrawStruct, DC );
break; break;
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
......
...@@ -90,22 +90,22 @@ void SwapData( EDA_BaseStruct* Item ) ...@@ -90,22 +90,22 @@ void SwapData( EDA_BaseStruct* Item )
EXCHG( SOURCE->m_Pos, DEST->m_Pos ); EXCHG( SOURCE->m_Pos, DEST->m_Pos );
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
#undef SOURCE #undef SOURCE
#undef DEST #undef DEST
#define SOURCE ( (DrawTextStruct*) Item ) #define SOURCE ( (SCH_TEXT*) Item )
#define DEST ( (DrawTextStruct*) image ) #define DEST ( (SCH_TEXT*) image )
DEST->SwapData( SOURCE ); DEST->SwapData( SOURCE );
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
#undef SOURCE #undef SOURCE
#undef DEST #undef DEST
#define SOURCE ( (EDA_SchComponentStruct*) Item ) #define SOURCE ( (SCH_COMPONENT*) Item )
#define DEST ( (EDA_SchComponentStruct*) image ) #define DEST ( (SCH_COMPONENT*) image )
DEST->SwapData( SOURCE ); DEST->SwapData( SOURCE );
break; break;
......
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
/* Cross probing with pcbnew */ /* Cross probing with pcbnew */
void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
EDA_SchComponentStruct* LibItem ); SCH_COMPONENT* LibItem );
/* netlist generation */ /* netlist generation */
void* BuildNetListBase(); void* BuildNetListBase();
...@@ -144,10 +144,10 @@ private: ...@@ -144,10 +144,10 @@ private:
// Text ,label, glabel // Text ,label, glabel
EDA_BaseStruct* CreateNewText( wxDC* DC, int type ); EDA_BaseStruct* CreateNewText( wxDC* DC, int type );
void EditSchematicText( DrawTextStruct* TextStruct, wxDC* DC ); void EditSchematicText( SCH_TEXT* TextStruct, wxDC* DC );
void ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* DC ); void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC );
void StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC ); void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC );
void ConvertTextType( DrawTextStruct* Text, wxDC* DC, int newtype ); void ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype );
// Wire, Bus // Wire, Bus
void BeginSegment( wxDC* DC, int type ); void BeginSegment( wxDC* DC, int type );
...@@ -188,25 +188,25 @@ public: ...@@ -188,25 +188,25 @@ public:
private: private:
// Component // Component
EDA_SchComponentStruct* Load_Component( wxDC* DC, SCH_COMPONENT* Load_Component( wxDC* DC,
const wxString& libname, const wxString& libname,
wxArrayString& List, wxArrayString& List,
bool UseLibBrowser ); bool UseLibBrowser );
void StartMovePart( EDA_SchComponentStruct* DrawLibItem, wxDC* DC ); void StartMovePart( SCH_COMPONENT* DrawLibItem, wxDC* DC );
public: public:
void CmpRotationMiroir( EDA_SchComponentStruct* DrawComponent, void CmpRotationMiroir( SCH_COMPONENT* DrawComponent,
wxDC* DC, int type_rotate ); wxDC* DC, int type_rotate );
private: private:
void SelPartUnit( EDA_SchComponentStruct* DrawComponent, void SelPartUnit( SCH_COMPONENT* DrawComponent,
int unit, wxDC* DC ); int unit, wxDC* DC );
void ConvertPart( EDA_SchComponentStruct* DrawComponent, wxDC* DC ); void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC );
void SetInitCmp( EDA_SchComponentStruct* DrawComponent, wxDC* DC ); void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC );
void EditComponentReference( EDA_SchComponentStruct* DrawLibItem, void EditComponentReference( SCH_COMPONENT* DrawLibItem,
wxDC* DC ); wxDC* DC );
void EditComponentValue( EDA_SchComponentStruct* DrawLibItem, wxDC* DC ); void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC );
void EditComponentFootprint( EDA_SchComponentStruct* DrawLibItem, void EditComponentFootprint( SCH_COMPONENT* DrawLibItem,
wxDC* DC ); wxDC* DC );
void StartMoveCmpField( PartTextStruct* Field, wxDC* DC ); void StartMoveCmpField( PartTextStruct* Field, wxDC* DC );
void EditCmpFieldText( PartTextStruct* Field, wxDC* DC ); void EditCmpFieldText( PartTextStruct* Field, wxDC* DC );
......
...@@ -359,16 +359,16 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S ...@@ -359,16 +359,16 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
{ {
EDA_BaseStruct* DrawStruct; EDA_BaseStruct* DrawStruct;
DrawSheetLabelStruct* NewSheetLabel, * SheetLabel = NULL; DrawSheetLabelStruct* NewSheetLabel, * SheetLabel = NULL;
DrawHierLabelStruct* HLabel = NULL; SCH_HIERLABEL* HLabel = NULL;
if(!Sheet->m_AssociatedScreen) return NULL; if(!Sheet->m_AssociatedScreen) return NULL;
DrawStruct = Sheet->m_AssociatedScreen->EEDrawList; DrawStruct = Sheet->m_AssociatedScreen->EEDrawList;
HLabel = NULL; HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext ) for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
{ {
if( DrawStruct->Type() != DRAW_HIER_LABEL_STRUCT_TYPE ) if( DrawStruct->Type() != TYPE_SCH_HIERLABEL )
continue; continue;
HLabel = (DrawHierLabelStruct*) DrawStruct; HLabel = (SCH_HIERLABEL*) DrawStruct;
/* Ici un G-Label a ete trouve: y a t-il un SheetLabel correspondant */ /* Ici un G-Label a ete trouve: y a t-il un SheetLabel correspondant */
SheetLabel = Sheet->m_Label; SheetLabel = Sheet->m_Label;
......
...@@ -47,11 +47,11 @@ enum KICAD_T { ...@@ -47,11 +47,11 @@ enum KICAD_T {
// Draw Items in schematic // Draw Items in schematic
DRAW_POLYLINE_STRUCT_TYPE, DRAW_POLYLINE_STRUCT_TYPE,
DRAW_JUNCTION_STRUCT_TYPE, DRAW_JUNCTION_STRUCT_TYPE,
DRAW_TEXT_STRUCT_TYPE, TYPE_SCH_TEXT,
DRAW_LABEL_STRUCT_TYPE, TYPE_SCH_LABEL,
DRAW_GLOBAL_LABEL_STRUCT_TYPE, TYPE_SCH_GLOBALLABEL,
DRAW_HIER_LABEL_STRUCT_TYPE, TYPE_SCH_HIERLABEL,
DRAW_LIB_ITEM_STRUCT_TYPE, TYPE_SCH_COMPONENT,
DRAW_PICK_ITEM_STRUCT_TYPE, DRAW_PICK_ITEM_STRUCT_TYPE,
DRAW_SEGMENT_STRUCT_TYPE, DRAW_SEGMENT_STRUCT_TYPE,
DRAW_BUSENTRY_STRUCT_TYPE, DRAW_BUSENTRY_STRUCT_TYPE,
...@@ -357,6 +357,10 @@ public: ...@@ -357,6 +357,10 @@ public:
*/ */
virtual EDA_Rect GetBoundingBox() virtual EDA_Rect GetBoundingBox()
{ {
#if defined (DEBUG)
printf("Missing GetBoundingBox() -> no good! :-)\n");
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
EDA_Rect ret( wxPoint( 0, 0 ), wxSize( 0, 0 ) ); EDA_Rect ret( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
return ret; return ret;
...@@ -668,18 +672,44 @@ public: ...@@ -668,18 +672,44 @@ public:
}; };
/**************************/ /**
/* class DrawPickedStruct */ * Class SCH_ITEM
/**************************/ * is a base class for any item which can be embedded within the SCHEMATIC
* container class, and therefore instances of derived classes should only be
* found in EESCHEMA or other programs that use class SCHEMATIC and its contents.
* The corresponding class in PCBNEW is BOARD_ITEM.
*/
class SCH_ITEM : public EDA_BaseStruct
{
protected:
int m_Layer;
public:
SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ) :
EDA_BaseStruct( aParent, aType ),
m_Layer( 0 )
{
}
~SCH_ITEM(){}
virtual wxString GetClass() const
{
return wxT( "SCH_ITEM" );
}
};
/* Class to hold structures picked by pick events (like block selection) /**
* Class DrawPickedStruct
* holds structures picked by pick events (like block selection).
* This class has only one useful member: .m_PickedStruct, used as a link. * This class has only one useful member: .m_PickedStruct, used as a link.
* It does not describe really an item.
* It is used to create a linked list of selected items (in block selection). * It is used to create a linked list of selected items (in block selection).
* Each DrawPickedStruct item has is member: .m_PickedStruct pointing the * Each DrawPickedStruct item has is member: .m_PickedStruct pointing the
* real selected item * real selected item.
*/ */
class DrawPickedStruct : public EDA_BaseStruct class DrawPickedStruct : public SCH_ITEM
{ {
public: public:
EDA_BaseStruct* m_PickedStruct; EDA_BaseStruct* m_PickedStruct;
...@@ -691,6 +721,22 @@ public: ...@@ -691,6 +721,22 @@ public:
void DeleteWrapperList(); void DeleteWrapperList();
DrawPickedStruct* Next() { return (DrawPickedStruct*) Pnext; } DrawPickedStruct* Next() { return (DrawPickedStruct*) Pnext; }
EDA_Rect GetBoundingBox();
/**
* Function GetBoundingBoxUnion
* returns the union of all the BoundingBox rectangles of all held items
* in the picklist whose list head is this DrawPickedStruct.
* @return EDA_Rect - The combined, composite, bounding box.
*/
EDA_Rect GetBoundingBoxUnion();
wxString GetClass() const { return wxT( "DrawPickedStruct" ); }
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os );
#endif
}; };
#endif /* BASE_STRUCT_H */ #endif /* BASE_STRUCT_H */
...@@ -71,13 +71,13 @@ class EDA_LibComponentStruct; ...@@ -71,13 +71,13 @@ class EDA_LibComponentStruct;
class LibEDA_BaseStruct; class LibEDA_BaseStruct;
class EDA_BaseStruct; class EDA_BaseStruct;
class DrawBusEntryStruct; class DrawBusEntryStruct;
class DrawGlobalLabelStruct; class SCH_GLOBALLABEL;
class DrawTextStruct; class SCH_TEXT;
class EDA_DrawLineStruct; class EDA_DrawLineStruct;
class DrawSheetStruct; class DrawSheetStruct;
class DrawSheetPath; class DrawSheetPath;
class DrawSheetLabelStruct; class DrawSheetLabelStruct;
class EDA_SchComponentStruct; class SCH_COMPONENT;
class LibDrawField; class LibDrawField;
class PartTextStruct; class PartTextStruct;
class LibDrawPin; class LibDrawPin;
......
...@@ -934,7 +934,7 @@ typedef boost::ptr_vector<WINDOW> WINDOWS; ...@@ -934,7 +934,7 @@ typedef boost::ptr_vector<WINDOW> WINDOWS;
/** /**
* Class KEEPOUT * Class KEEPOUT
* is used for <keepout_descriptor> and <plane_descriptor>. * is used for &lt;keepout_descriptor&gt; and &lt;plane_descriptor&gt;.
*/ */
class KEEPOUT : public ELEM class KEEPOUT : public ELEM
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment