From 8522b0deb7b532ffef8f14c88d4ec24bf5ff726b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 28 Feb 2016 19:16:59 +0100 Subject: [PATCH] Rename enum TypeSheetLabel to PINSHEETLABEL_SHAPE (Better name, and in accordance with our coding style policy) --- eeschema/dialogs/dialog_edit_label.cpp | 2 +- eeschema/dialogs/dialog_sch_edit_sheet_pin.h | 8 +++----- eeschema/edit_label.cpp | 8 ++++---- eeschema/lib_pin.cpp | 4 ++-- eeschema/sch_sheet_pin.cpp | 2 +- eeschema/sch_text.h | 15 +++++++-------- eeschema/schframe.h | 8 ++++---- eeschema/sheetlab.cpp | 2 +- 8 files changed, 23 insertions(+), 26 deletions(-) diff --git a/eeschema/dialogs/dialog_edit_label.cpp b/eeschema/dialogs/dialog_edit_label.cpp index 2bdb1676c8..08e3683a4c 100644 --- a/eeschema/dialogs/dialog_edit_label.cpp +++ b/eeschema/dialogs/dialog_edit_label.cpp @@ -302,7 +302,7 @@ void DIALOG_LABEL_EDITOR::TextPropertiesAccept( wxCommandEvent& aEvent ) if( m_TextShape ) /// @todo move cast to widget - m_CurrentText->SetShape( static_cast( m_TextShape->GetSelection() ) ); + m_CurrentText->SetShape( static_cast( m_TextShape->GetSelection() ) ); int style = m_TextStyle->GetSelection(); diff --git a/eeschema/dialogs/dialog_sch_edit_sheet_pin.h b/eeschema/dialogs/dialog_sch_edit_sheet_pin.h index 4d02b0145b..bad3fc8275 100644 --- a/eeschema/dialogs/dialog_sch_edit_sheet_pin.h +++ b/eeschema/dialogs/dialog_sch_edit_sheet_pin.h @@ -33,9 +33,7 @@ #include - -// enum TypeSheetLabel -#include +#include // enum PINSHEETLABEL_SHAPE definition class DIALOG_SCH_EDIT_SHEET_PIN : public DIALOG_SCH_EDIT_SHEET_PIN_BASE @@ -52,9 +50,9 @@ public: void SetTextWidth( const wxString& aWidth ) { m_textWidth->SetValue( aWidth ); } wxString GetTextWidth() const { return m_textWidth->GetValue(); } - void SetConnectionType( TypeSheetLabel aType ) { m_choiceConnectionType->SetSelection( aType ); } + void SetConnectionType( PINSHEETLABEL_SHAPE aType ) { m_choiceConnectionType->SetSelection( aType ); } /// @todo move cast to widget - TypeSheetLabel GetConnectionType() const { return static_cast( m_choiceConnectionType->GetCurrentSelection() ); } + PINSHEETLABEL_SHAPE GetConnectionType() const { return static_cast( m_choiceConnectionType->GetCurrentSelection() ); } void SetTextHeightUnits( const wxString& aUnit ) { m_staticHeightUnits->SetLabel( aUnit ); } void SetTextWidthUnits( const wxString& aUnit ) { m_staticWidthUnits->SetLabel( aUnit ); } diff --git a/eeschema/edit_label.cpp b/eeschema/edit_label.cpp index 2d8b2434f2..e343262b11 100644 --- a/eeschema/edit_label.cpp +++ b/eeschema/edit_label.cpp @@ -41,10 +41,10 @@ #include -static TypeSheetLabel lastGlobalLabelShape = NET_INPUT; -static int lastTextOrientation = 0; -static bool lastTextBold = false; -static bool lastTextItalic = false; +static PINSHEETLABEL_SHAPE lastGlobalLabelShape = NET_INPUT; +static int lastTextOrientation = 0; +static bool lastTextBold = false; +static bool lastTextItalic = false; void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* aTextItem, wxDC* aDC ) diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 0ca0d878d6..96fff9fea5 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -311,12 +311,12 @@ void LIB_PIN::SetShape( GRAPHIC_PINSHAPE aShape ) void LIB_PIN::SetType( ELECTRICAL_PINTYPE aType ) { - assert( aType >= 0 && aType < (int) PINTYPE_COUNT ); + assert( aType >= 0 && aType < (int)PINTYPE_COUNT ); if( aType < PIN_INPUT ) aType = PIN_INPUT; - if( aType >= PINTYPE_COUNT ) + if( aType >= (int)PINTYPE_COUNT ) aType = PIN_NC; if( m_type != aType ) diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp index 52cdd5db86..43b549d0d8 100644 --- a/eeschema/sch_sheet_pin.cpp +++ b/eeschema/sch_sheet_pin.cpp @@ -466,7 +466,7 @@ void SCH_SHEET_PIN::CreateGraphicShape( std::vector & aPoints, const wx * for INPUT type the icon is the OUTPUT shape of SCH_HIERLABEL * for OUTPUT type the icon is the INPUT shape of SCH_HIERLABEL */ - TypeSheetLabel tmp = m_shape; + PINSHEETLABEL_SHAPE tmp = m_shape; switch( m_shape ) { diff --git a/eeschema/sch_text.h b/eeschema/sch_text.h index e80448d664..da09f771ae 100644 --- a/eeschema/sch_text.h +++ b/eeschema/sch_text.h @@ -40,17 +40,16 @@ class LINE_READER; class NETLIST_OBJECT_LIST; -/* Type of SCH_HIERLABEL and SCH_GLOBALLABEL +/* Shape/Type of SCH_HIERLABEL and SCH_GLOBALLABEL * mainly used to handle the graphic associated shape */ -typedef enum { +enum PINSHEETLABEL_SHAPE { NET_INPUT, NET_OUTPUT, NET_BIDI, NET_TRISTATE, - NET_UNSPECIFIED, - NET_TMAX /* Last value */ -} TypeSheetLabel; + NET_UNSPECIFIED +}; extern const char* SheetLabelType[]; /* names of types of labels */ @@ -58,7 +57,7 @@ extern const char* SheetLabelType[]; /* names of types of labels */ class SCH_TEXT : public SCH_ITEM, public EDA_TEXT { protected: - TypeSheetLabel m_shape; + PINSHEETLABEL_SHAPE m_shape; /// True if not connected to another object if the object derive from SCH_TEXT /// supports connections. @@ -120,9 +119,9 @@ public: int GetOrientation() { return m_schematicOrientation; } - TypeSheetLabel GetShape() const { return m_shape; } + PINSHEETLABEL_SHAPE GetShape() const { return m_shape; } - void SetShape( TypeSheetLabel aShape ) { m_shape = aShape; } + void SetShape( PINSHEETLABEL_SHAPE aShape ) { m_shape = aShape; } /** * Function GetSchematicTextOffset (virtual) diff --git a/eeschema/schframe.h b/eeschema/schframe.h index 743eb29dd0..59f65cfa85 100644 --- a/eeschema/schframe.h +++ b/eeschema/schframe.h @@ -38,7 +38,7 @@ #include #include -// enum TypeSheetLabel +// enum PINSHEETLABEL_SHAPE #include class LIB_EDIT_FRAME; @@ -175,9 +175,9 @@ private: wxArrayString m_componentLibFiles; */ - static TypeSheetLabel m_lastSheetPinType; ///< Last sheet pin type. - static wxSize m_lastSheetPinTextSize; ///< Last sheet pin text size. - static wxPoint m_lastSheetPinPosition; ///< Last sheet pin position. + static PINSHEETLABEL_SHAPE m_lastSheetPinType; ///< Last sheet pin type. + static wxSize m_lastSheetPinTextSize; ///< Last sheet pin text size. + static wxPoint m_lastSheetPinPosition; ///< Last sheet pin position. protected: TEMPLATES m_TemplateFieldNames; diff --git a/eeschema/sheetlab.cpp b/eeschema/sheetlab.cpp index a2f4faa2f1..c5e58ef8bf 100644 --- a/eeschema/sheetlab.cpp +++ b/eeschema/sheetlab.cpp @@ -43,7 +43,7 @@ #include -TypeSheetLabel SCH_EDIT_FRAME::m_lastSheetPinType = NET_INPUT; +PINSHEETLABEL_SHAPE SCH_EDIT_FRAME::m_lastSheetPinType = NET_INPUT; wxSize SCH_EDIT_FRAME::m_lastSheetPinTextSize( -1, -1 ); wxPoint SCH_EDIT_FRAME::m_lastSheetPinPosition;