Commit bf688ea1 authored by charras's avatar charras

eeschema: code cleaning

parent 2057c815
...@@ -15,6 +15,7 @@ set(EESCHEMA_SRCS ...@@ -15,6 +15,7 @@ set(EESCHEMA_SRCS
class_drawsheet.cpp class_drawsheet.cpp
class_hierarchical_PIN_sheet.cpp class_hierarchical_PIN_sheet.cpp
class_pin.cpp class_pin.cpp
class_library.cpp
class_schematic_items.cpp class_schematic_items.cpp
class_screen.cpp class_screen.cpp
class_text-label.cpp class_text-label.cpp
...@@ -56,7 +57,6 @@ set(EESCHEMA_SRCS ...@@ -56,7 +57,6 @@ set(EESCHEMA_SRCS
hotkeys.cpp hotkeys.cpp
libalias.cpp libalias.cpp
libarch.cpp libarch.cpp
libclass.cpp
libedit.cpp libedit.cpp
libedit_onleftclick.cpp libedit_onleftclick.cpp
libedit_onrightclick.cpp libedit_onrightclick.cpp
......
...@@ -45,8 +45,21 @@ public: ...@@ -45,8 +45,21 @@ public:
public: public:
LibraryStruct( int type, const wxString& name, const wxString& fullname ); LibraryStruct( int type, const wxString& name, const wxString& fullname );
~LibraryStruct(); ~LibraryStruct();
bool WriteHeader( FILE* file ); /**
* Function SaveLibrary
* writes the data structures for this object out to 2 file
* the library in "*.lib" format.
* the doc file in "*.dcm" format.
* creates a backup file for each file (.bak and .bck)
* @param aFullFileName The full lib filename.
* @return bool - true if success writing else false.
*/
bool SaveLibrary( const wxString& aFullFileName );
bool ReadHeader( FILE* file, int* LineNum ); bool ReadHeader( FILE* file, int* LineNum );
private:
bool WriteHeader( FILE* file );
}; };
...@@ -73,8 +86,15 @@ public: ...@@ -73,8 +86,15 @@ public:
return wxT( "LibCmpEntry" ); return wxT( "LibCmpEntry" );
} }
/**
bool WriteDescr( FILE* File ); * Function SaveLibrary
* writes the data structures for this object out to 2 FILE in "*.lib" and ".dcm" format.
* the main file (.lib) is the library content (set of components)
* the second file (.dcm)is the auxiliary file that contents the keywords and description for components)
* @param FullFileName the new full filename (*.lib).
* @return bool - true if success writing else false.
*/
bool SaveLibrary( const wxString& FullFileName );
}; };
......
...@@ -761,9 +761,9 @@ int LibDrawPin::ReturnPinDrawOrient( int TransMat[2][2] ) ...@@ -761,9 +761,9 @@ int LibDrawPin::ReturnPinDrawOrient( int TransMat[2][2] )
} }
/****************************************************/ /***********************************************************/
void LibDrawPin::ReturnPinStringNum( wxString& buffer ) void LibDrawPin::ReturnPinStringNum( wxString& buffer ) const
/****************************************************/ /***********************************************************/
/* fill the buffer with pin num as a wxString /* fill the buffer with pin num as a wxString
* Pin num is coded as a long * Pin num is coded as a long
...@@ -772,7 +772,7 @@ void LibDrawPin::ReturnPinStringNum( wxString& buffer ) ...@@ -772,7 +772,7 @@ void LibDrawPin::ReturnPinStringNum( wxString& buffer )
{ {
char ascii_buf[5]; char ascii_buf[5];
strncpy( ascii_buf, (char*) &m_PinNum, 4 ); memcpy(ascii_buf, &m_PinNum , 4);
ascii_buf[4] = 0; ascii_buf[4] = 0;
buffer = CONV_FROM_UTF8( ascii_buf ); buffer = CONV_FROM_UTF8( ascii_buf );
......
...@@ -151,7 +151,7 @@ public: ...@@ -151,7 +151,7 @@ public:
* @param aOffset = offset to draw * @param aOffset = offset to draw
* @param aColor = -1 to use the normal body item color, or use this color if >= 0 * @param aColor = -1 to use the normal body item color, or use this color if >= 0
* @param aDrawMode = GR_OR, GR_XOR, ... * @param aDrawMode = GR_OR, GR_XOR, ...
* @param aData = pointer used to pass others parametres, depending on body items. * @param aData = value or pointer used to pass others parametres, depending on body items.
* used for some items to force to force no fill mode * used for some items to force to force no fill mode
* ( has meaning only for items what can be filled ). used in printing or moving objects mode * ( has meaning only for items what can be filled ). used in printing or moving objects mode
* or to pass refernce to the lib component for pins * or to pass refernce to the lib component for pins
...@@ -160,6 +160,14 @@ public: ...@@ -160,6 +160,14 @@ public:
virtual void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, virtual void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void * aData, int aTransformMatrix[2][2] ) = 0; int aDrawMode, void * aData, int aTransformMatrix[2][2] ) = 0;
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual bool Save( FILE* aFile ) const = 0;
void Display_Infos_DrawEntry( WinEDA_DrawFrame* frame ); void Display_Infos_DrawEntry( WinEDA_DrawFrame* frame );
}; };
...@@ -189,15 +197,21 @@ public: ...@@ -189,15 +197,21 @@ public:
{ {
return wxT( "LibDrawPin" ); return wxT( "LibDrawPin" );
} }
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual bool Save( FILE* aFile ) const;
LibDrawPin* GenCopy(); LibDrawPin* GenCopy();
bool WriteDescr( FILE* File );
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
wxPoint ReturnPinEndPoint(); wxPoint ReturnPinEndPoint();
int ReturnPinDrawOrient( int TransMat[2][2] ); int ReturnPinDrawOrient( int TransMat[2][2] );
void ReturnPinStringNum( wxString& buffer ); void ReturnPinStringNum( wxString& buffer ) const;
void SetPinNumFromString( wxString& buffer ); void SetPinNumFromString( wxString& buffer );
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
...@@ -234,10 +248,16 @@ public: ...@@ -234,10 +248,16 @@ public:
{ {
return wxT( "LibDrawArc" ); return wxT( "LibDrawArc" );
} }
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual bool Save( FILE* aFile ) const;
LibDrawArc* GenCopy(); LibDrawArc* GenCopy();
bool WriteDescr( FILE* File );
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void * aData, int aTransformMatrix[2][2] ); int aDrawMode, void * aData, int aTransformMatrix[2][2] );
}; };
...@@ -257,10 +277,16 @@ public: ...@@ -257,10 +277,16 @@ public:
{ {
return wxT( "LibDrawCircle" ); return wxT( "LibDrawCircle" );
} }
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual bool Save( FILE* aFile ) const;
LibDrawCircle* GenCopy(); LibDrawCircle* GenCopy();
bool WriteDescr( FILE* File );
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void * aData, int aTransformMatrix[2][2] ); int aDrawMode, void * aData, int aTransformMatrix[2][2] );
}; };
...@@ -287,10 +313,16 @@ public: ...@@ -287,10 +313,16 @@ public:
{ {
return wxT( "LibDrawText" ); return wxT( "LibDrawText" );
} }
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual bool Save( FILE* aFile ) const;
LibDrawText* GenCopy(); LibDrawText* GenCopy();
bool WriteDescr( FILE* File );
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void * aData, int aTransformMatrix[2][2] ); int aDrawMode, void * aData, int aTransformMatrix[2][2] );
}; };
...@@ -311,10 +343,16 @@ public: ...@@ -311,10 +343,16 @@ public:
{ {
return wxT( "LibDrawSquare" ); return wxT( "LibDrawSquare" );
} }
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual bool Save( FILE* aFile ) const;
LibDrawSquare* GenCopy(); LibDrawSquare* GenCopy();
bool WriteDescr( FILE* File );
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void * aData, int aTransformMatrix[2][2] ); int aDrawMode, void * aData, int aTransformMatrix[2][2] );
}; };
...@@ -334,10 +372,16 @@ public: ...@@ -334,10 +372,16 @@ public:
{ {
return wxT( "LibDrawSegment" ); return wxT( "LibDrawSegment" );
} }
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual bool Save( FILE* aFile ) const;
LibDrawSegment* GenCopy(); LibDrawSegment* GenCopy();
bool WriteDescr( FILE* File );
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void * aData, int aTransformMatrix[2][2] ); int aDrawMode, void * aData, int aTransformMatrix[2][2] );
}; };
...@@ -365,10 +409,16 @@ public: ...@@ -365,10 +409,16 @@ public:
return wxT( "LibDrawPolyline" ); return wxT( "LibDrawPolyline" );
} }
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual bool Save( FILE* aFile ) const;
LibDrawPolyline* GenCopy(); LibDrawPolyline* GenCopy();
void AddPoint( const wxPoint& point ); void AddPoint( const wxPoint& point );
bool WriteDescr( FILE* File );
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void * aData, int aTransformMatrix[2][2] ); int aDrawMode, void * aData, int aTransformMatrix[2][2] );
}; };
...@@ -406,11 +456,17 @@ public: ...@@ -406,11 +456,17 @@ public:
{ {
return wxT( "LibDrawField" ); return wxT( "LibDrawField" );
} }
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual bool Save( FILE* aFile ) const;
LibDrawField* GenCopy(); LibDrawField* GenCopy();
void Copy( LibDrawField* Target ); void Copy( LibDrawField* Target );
bool WriteDescr( FILE* File );
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor, void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void * aData, int aTransformMatrix[2][2] ); int aDrawMode, void * aData, int aTransformMatrix[2][2] );
}; };
......
...@@ -18,12 +18,11 @@ ...@@ -18,12 +18,11 @@
//#define DRAW_ARC_WITH_ANGLE // Used to draw arcs //#define DRAW_ARC_WITH_ANGLE // Used to draw arcs
/* Fonctions locales */
/* Descr component <DUMMY> used when a component is not found in library,
* to draw a dummy shape*/
/* /* Local functions */
/* Descr component <DUMMY> used when a component is not found in library,
* to draw a dummy shape
* This component is a 400 mils square with the text ?? * This component is a 400 mils square with the text ??
* DEF DUMMY U 0 40 Y Y 1 0 N * DEF DUMMY U 0 40 Y Y 1 0 N
* F0 "U" 0 -350 60 H V * F0 "U" 0 -350 60 H V
...@@ -34,9 +33,7 @@ ...@@ -34,9 +33,7 @@
* ENDDRAW * ENDDRAW
* ENDDEF * ENDDEF
*/ */
static void CreateDummyCmp();
static EDA_LibComponentStruct* DummyCmp;
static void DrawLibPartAux( WinEDA_DrawPanel * panel, wxDC * DC, static void DrawLibPartAux( WinEDA_DrawPanel * panel, wxDC * DC,
SCH_COMPONENT * Component, SCH_COMPONENT * Component,
EDA_LibComponentStruct * Entry, EDA_LibComponentStruct * Entry,
...@@ -45,6 +42,8 @@ static void DrawLibPartAux( WinEDA_DrawPanel * panel, wxDC * DC, ...@@ -45,6 +42,8 @@ static void DrawLibPartAux( WinEDA_DrawPanel * panel, wxDC * DC,
int Multi, int convert, int Multi, int convert,
int DrawMode, int Color = -1, bool DrawPinText = TRUE ); int DrawMode, int Color = -1, bool DrawPinText = TRUE );
/* Local variables */
static EDA_LibComponentStruct* DummyCmp;
/***************************************************************************/ /***************************************************************************/
wxPoint TransformCoordinate( int aTransformMatrix[2][2], wxPoint& aPosition ) wxPoint TransformCoordinate( int aTransformMatrix[2][2], wxPoint& aPosition )
...@@ -66,7 +65,7 @@ wxPoint TransformCoordinate( int aTransformMatrix[2][2], wxPoint& aPosition ) ...@@ -66,7 +65,7 @@ wxPoint TransformCoordinate( int aTransformMatrix[2][2], wxPoint& aPosition )
/******************************/ /******************************/
static void CreateDummyCmp() void CreateDummyCmp()
/******************************/ /******************************/
{ {
DummyCmp = new EDA_LibComponentStruct( NULL ); DummyCmp = new EDA_LibComponentStruct( NULL );
......
...@@ -88,7 +88,6 @@ void WinEDA_LibeditFrame::ExportOnePart( bool create_lib ) ...@@ -88,7 +88,6 @@ void WinEDA_LibeditFrame::ExportOnePart( bool create_lib )
{ {
wxString Name, mask; wxString Name, mask;
LibraryStruct* NewLib, * LibTmp, * CurLibTmp; LibraryStruct* NewLib, * LibTmp, * CurLibTmp;
int err;
if( CurrentLibEntry == NULL ) if( CurrentLibEntry == NULL )
{ {
...@@ -131,7 +130,7 @@ void WinEDA_LibeditFrame::ExportOnePart( bool create_lib ) ...@@ -131,7 +130,7 @@ void WinEDA_LibeditFrame::ExportOnePart( bool create_lib )
/* Sauvegarde du composant: */ /* Sauvegarde du composant: */
CurrentLib = NewLib; CurrentLib = NewLib;
SaveOnePartInMemory(); SaveOnePartInMemory();
err = SaveOneLibrary( this, Name, NewLib ); bool success = NewLib->SaveLibrary( Name );
/* Suppression de la librarie temporaire */ /* Suppression de la librarie temporaire */
FreeCmpLibrary( this, NewLib->m_Name ); FreeCmpLibrary( this, NewLib->m_Name );
...@@ -139,7 +138,7 @@ void WinEDA_LibeditFrame::ExportOnePart( bool create_lib ) ...@@ -139,7 +138,7 @@ void WinEDA_LibeditFrame::ExportOnePart( bool create_lib )
CurrentLib = CurLibTmp; CurrentLib = CurLibTmp;
wxString msg; wxString msg;
if( create_lib && (err == 0) ) if( create_lib && success )
{ {
msg = Name + _( "0k" ); msg = Name + _( "0k" );
DisplayInfo( this, DisplayInfo( this,
......
...@@ -97,14 +97,9 @@ const wxChar * Text; ...@@ -97,14 +97,9 @@ const wxChar * Text;
{ {
continue; continue;
} }
if ( ii == 0 ) if ( (ii == 0) || ( ListEntry[ii-1] != ListEntry[ii] ) )
{ {
WriteOneLibEntry(frame, ArchiveFile, ListEntry[ii]); WriteOneLibEntry(ArchiveFile, ListEntry[ii]);
if( DocFile ) WriteOneDocLibEntry(DocFile, ListEntry[ii]);
}
else if ( ListEntry[ii-1] != ListEntry[ii] )
{
WriteOneLibEntry(frame, ArchiveFile, ListEntry[ii]);
if( DocFile ) WriteOneDocLibEntry(DocFile, ListEntry[ii]); if( DocFile ) WriteOneDocLibEntry(DocFile, ListEntry[ii]);
} }
} }
......
...@@ -222,7 +222,6 @@ void WinEDA_LibeditFrame::SaveActiveLibrary() ...@@ -222,7 +222,6 @@ void WinEDA_LibeditFrame::SaveActiveLibrary()
*/ */
{ {
wxString Name, msg; wxString Name, msg;
int err;
if(CurrentLib == NULL) if(CurrentLib == NULL)
{ {
...@@ -234,11 +233,11 @@ int err; ...@@ -234,11 +233,11 @@ int err;
msg = _("Modify Library File \"") + Name + _("\"?"); msg = _("Modify Library File \"") + Name + _("\"?");
if( ! IsOK(this, msg) ) return; if( ! IsOK(this, msg) ) return;
err = SaveOneLibrary(this, Name, CurrentLib); bool success = CurrentLib->SaveLibrary( Name );
MsgPanel->EraseMsgBox(); MsgPanel->EraseMsgBox();
if ( err ) if ( ! success )
{ {
msg = _("Error while saving Library File \"") + Name + _("\"."); msg = _("Error while saving Library File \"") + Name + _("\".");
Affiche_1_Parametre(this, 1, wxT(" *** ERROR : **"), msg,BLUE); Affiche_1_Parametre(this, 1, wxT(" *** ERROR : **"), msg,BLUE);
......
...@@ -26,7 +26,7 @@ OBJECTS = eeschema.o\ ...@@ -26,7 +26,7 @@ OBJECTS = eeschema.o\
class_hierarchical_PIN_sheet.o\ class_hierarchical_PIN_sheet.o\
class_text-label.o\ class_text-label.o\
component_class.o\ component_class.o\
libclass.o\ class_library.o\
dialog_options.o\ dialog_options.o\
tool_lib.o\ tool_lib.o\
tool_sch.o\ tool_sch.o\
......
...@@ -229,7 +229,7 @@ LibEDA_BaseStruct * CopyDrawEntryStruct( wxWindow * frame, LibEDA_BaseStruct * D ...@@ -229,7 +229,7 @@ LibEDA_BaseStruct * CopyDrawEntryStruct( wxWindow * frame, LibEDA_BaseStruct * D
Retourne: Retourne:
Pointeur sur la structure creee (ou NULL si impossible) */ Pointeur sur la structure creee (ou NULL si impossible) */
int WriteOneLibEntry(wxWindow * frame, FILE * ExportFile, EDA_LibComponentStruct * LibEntry); int WriteOneLibEntry( FILE * ExportFile, EDA_LibComponentStruct * LibEntry);
/* Routine d'ecriture du composant pointe par LibEntry /* Routine d'ecriture du composant pointe par LibEntry
dans le fichier ExportFile( qui doit etre deja ouvert) dans le fichier ExportFile( qui doit etre deja ouvert)
return: FALSE si Ok, TRUE si err write */ return: FALSE si Ok, TRUE si err write */
...@@ -246,21 +246,6 @@ int WriteOneDocLibEntry(FILE * ExportFile, EDA_LibComponentStruct * LibEntry); ...@@ -246,21 +246,6 @@ int WriteOneDocLibEntry(FILE * ExportFile, EDA_LibComponentStruct * LibEntry);
1 si err write */ 1 si err write */
int SaveOneLibrary(wxWindow * frame, const wxString & FullFileName, LibraryStruct * Library);
/* Sauvegarde en fichier la librairie pointee par Library, sous le nom
FullFileName.
2 fichiers sont crees
- La librarie
- le fichier de documentation
une sauvegarde .bak de l'ancien fichier librairie est cree
une sauvegarde .bck de l'ancien fichier documentation est cree
return:
0 si OK
1 si erreur */
/***************/ /***************/
/* SYMBEDIT.CPP */ /* SYMBEDIT.CPP */
/***************/ /***************/
......
This diff is collapsed.
...@@ -137,7 +137,6 @@ void WinEDA_LibeditFrame::SaveOneSymbol() ...@@ -137,7 +137,6 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
{ {
EDA_LibComponentStruct* LibEntry = CurrentLibEntry; EDA_LibComponentStruct* LibEntry = CurrentLibEntry;
int Unit = CurrentUnit, convert = CurrentConvert; int Unit = CurrentUnit, convert = CurrentConvert;
int SymbUnit, SymbConvert;
LibEDA_BaseStruct* DrawEntry; LibEDA_BaseStruct* DrawEntry;
wxString FullFileName, mask; wxString FullFileName, mask;
wxString msg; wxString msg;
...@@ -196,8 +195,8 @@ void WinEDA_LibeditFrame::SaveOneSymbol() ...@@ -196,8 +195,8 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
1, 0 /* unused */, 'N' ); 1, 0 /* unused */, 'N' );
/* Position / orientation / visibilite des champs */ /* Position / orientation / visibilite des champs */
LibEntry->m_Prefix.WriteDescr( ExportFile ); LibEntry->m_Prefix.Save( ExportFile );
LibEntry->m_Name.WriteDescr( ExportFile ); LibEntry->m_Name.Save( ExportFile );
DrawEntry = LibEntry->m_Drawings; DrawEntry = LibEntry->m_Drawings;
if( DrawEntry ) if( DrawEntry )
...@@ -211,55 +210,7 @@ void WinEDA_LibeditFrame::SaveOneSymbol() ...@@ -211,55 +210,7 @@ void WinEDA_LibeditFrame::SaveOneSymbol()
if( convert && DrawEntry->m_Convert && (DrawEntry->m_Convert != convert) ) if( convert && DrawEntry->m_Convert && (DrawEntry->m_Convert != convert) )
continue; continue;
/* .Unit , . Convert est laisse a 0 ou mis a 1 */ DrawEntry->Save( ExportFile );
SymbUnit = DrawEntry->m_Unit; if( SymbUnit > 1 )
SymbUnit = 1;
SymbConvert = DrawEntry->m_Convert;
if( SymbConvert > 1 )
SymbConvert = 1;
switch( DrawEntry->Type() )
{
case COMPONENT_ARC_DRAW_TYPE:
#define DRAWSTRUCT ( (LibDrawArc*) DrawEntry )
DRAWSTRUCT->WriteDescr( ExportFile );
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
#undef DRAWSTRUCT
#define DRAWSTRUCT ( (LibDrawCircle*) DrawEntry )
DRAWSTRUCT->WriteDescr( ExportFile );
break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
#undef DRAWSTRUCT
#define DRAWSTRUCT ( (LibDrawText*) DrawEntry )
DRAWSTRUCT->WriteDescr( ExportFile );
break;
case COMPONENT_RECT_DRAW_TYPE:
#undef DRAWSTRUCT
#define DRAWSTRUCT ( (LibDrawSquare*) DrawEntry )
DRAWSTRUCT->WriteDescr( ExportFile );
break;
case COMPONENT_PIN_DRAW_TYPE:
#undef DRAWSTRUCT
#define DRAWSTRUCT ( (LibDrawPin*) DrawEntry )
if( DRAWSTRUCT->m_Attributs & PINNOTDRAW )
break;
DRAWSTRUCT->WriteDescr( ExportFile );
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
#undef DRAWSTRUCT
#define DRAWSTRUCT ( (LibDrawPolyline*) DrawEntry )
DRAWSTRUCT->WriteDescr( ExportFile );
break;
default:
;
}
} }
fprintf( ExportFile, "ENDDRAW\n" ); fprintf( ExportFile, "ENDDRAW\n" );
} }
......
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