← Back to team overview

kicad-developers team mailing list archive

[PATCH 00/19] Pin shape and type refactoring

 

Hi,

this refactors the enums and widgets for pin shape and (electric) type.

As prerequisites, this needs the "Separate ElectricPinType and
TypeSheetLabel" and the "Regenerate eeschema dialogs" series patches.

1. The DrawPinShape bitmask is replaced with a simple enum covering only
   the supported values. 
2. A new widget type is gradually introduced, providing the selection for
   the pin shape:
   1. Create widget
   2. Move initialization code out of owner into widget
   3. Make Get/Set typesafe
3. The code dealing with the pin shape is moved from LIB_PIN to its own
   place:
   1. Create own header
   2. Move lookup for UI text
   3. Drop old interface from LIB_PIN
   4. Move lookup for UI bitmaps
4. Repeat 2 and 3 for electric pin type
5. Clean up ERC code typesafety

Each intermediate step compiles fine and should also run.

This is a prerequisite for having icons in the pin table, and reusing the
pin type combobox in other places, also I believe the code to be a bit
cleaner.

   Simon

Simon Richter (19):
  Replace DrawPinShape enum with PinShape
  PinShapeComboBox: Introduce widget
  PinShapeComboBox: Fully initialize in c'tor
  PinShapeComboBox: typesafe Get/Set
  PinShape: move enum to own header
  PinShape: move text lookup
  PinShape: drop list interfaces
  PinShape: move bitmap lookup
  ElectricPinType: move definition to pin_type.h
  ElectricPinType: Use enum rather than int where possible
  ElectricPinType: Rename PIN_NMAX to PINTYPE_COUNT
  ElectricPinType: Separate PINTYPE_COUNT from enum
  PinTypeComboBox: Introduce widget
  PinTypeComboBox: fully initialize in c'tor
  PinTypeComboBox: typesafe Get/Set
  ElectricPinType: move text lookup
  ElectricPinType: remove list interfaces
  ElectricPinType: move bitmap lookup
  TypeSheetLabel: use enum

 eeschema/CMakeLists.txt                       |   6 +
 eeschema/class_netlist_object.cpp             |   6 +-
 eeschema/class_netlist_object.h               |   8 +-
 eeschema/dialogs/dialog_edit_label.cpp        |   3 +-
 eeschema/dialogs/dialog_erc.cpp               |  18 +-
 eeschema/dialogs/dialog_erc.h                 |   4 +-
 eeschema/dialogs/dialog_lib_edit_pin.cpp      |  29 +--
 eeschema/dialogs/dialog_lib_edit_pin.h        |  12 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.cpp |   6 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.fbp |   4 +-
 eeschema/dialogs/dialog_lib_edit_pin_base.h   |   6 +-
 eeschema/dialogs/dialog_sch_edit_sheet_pin.h  |   8 +-
 eeschema/edit_label.cpp                       |   8 +-
 eeschema/erc.cpp                              |  24 +-
 eeschema/lib_pin.cpp                          | 347 ++++++++++----------------
 eeschema/lib_pin.h                            | 128 ++--------
 eeschema/pin_shape.cpp                        | 104 ++++++++
 eeschema/pin_shape.h                          |  57 +++++
 eeschema/pin_type.cpp                         | 116 +++++++++
 eeschema/pin_type.h                           |  59 +++++
 eeschema/pinedit.cpp                          |  23 +-
 eeschema/sch_component.cpp                    |   2 +-
 eeschema/sch_sheet.cpp                        |   2 +-
 eeschema/sch_sheet_pin.cpp                    |   2 +-
 eeschema/sch_text.cpp                         |   4 +-
 eeschema/sch_text.h                           |   6 +-
 eeschema/schframe.h                           |   4 +-
 eeschema/sheetlab.cpp                         |   2 +-
 eeschema/widgets/pin_shape_combobox.cpp       |  69 +++++
 eeschema/widgets/pin_shape_combobox.h         |  51 ++++
 eeschema/widgets/pin_type_combobox.cpp        |  69 +++++
 eeschema/widgets/pin_type_combobox.h          |  51 ++++
 32 files changed, 822 insertions(+), 416 deletions(-)
 create mode 100644 eeschema/pin_shape.cpp
 create mode 100644 eeschema/pin_shape.h
 create mode 100644 eeschema/pin_type.cpp
 create mode 100644 eeschema/pin_type.h
 create mode 100644 eeschema/widgets/pin_shape_combobox.cpp
 create mode 100644 eeschema/widgets/pin_shape_combobox.h
 create mode 100644 eeschema/widgets/pin_type_combobox.cpp
 create mode 100644 eeschema/widgets/pin_type_combobox.h

-- 
2.1.4


Follow ups