Commit f72394cc authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

Make PLUGIN::Footprint*() API functions take 'const' PROPERTIES*.

Add const PROPERTIES* to FootprintDelete().
Add {Get,Set}Properties() to FP_LIB_TABLE::ROW.
Touch up fp table dialog.
parent 4afae651
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -73,4 +73,11 @@ Dialogs:
    within the dialog, but for testing purposes please do not exceed this dialog
    within the dialog, but for testing purposes please do not exceed this dialog
    size should the user have selected a font size of 13 points.
    size should the user have selected a font size of 13 points.


Quoting:
    Filenames and paths should be emphasized with <> angle brackets.  Anything
    else should be emphasized with single quotes ''.  e.g.:
    <filename.kicad_pcb>
    <longpath/subdir>
    'FOOTPRINTNAME'
    'anything else'
+16 −19
Original line number Original line Diff line number Diff line
@@ -140,25 +140,22 @@ PCBNew
    various zoom factors.  I believe that a fixed distance in pixels might make
    various zoom factors.  I believe that a fixed distance in pixels might make
    for a friendlier UI.
    for a friendlier UI.


*)  Check that the new load visibility BOARD settings is properly setting the toolbar
    buttons like show grid or ratsnest.  Add PCB_EDIT_FRAME::SetVisibleElements() so
    toolbar crap is not known to a BOARD.

*)  Finish removing global access requirements from PLUGINs, so that:
    *)  a BOARD is a fully self contained document description.
    *)  plugin developers do not have to access globals, since a plugin could
        very well be a dynamically loaded DLL/DSO in the future.
        One final problem remains is the BASE_SCREEN's grid origin.  An easy
        solution is to move just that one field into the BOARD.

*)  Add ::Footprint*() functions to EAGLE_PLUGIN, so that Eagle footprint libraries
    can be used in situ.

*)  Add a library table for Pcbnew like that in the sweet library and get rid of the
    damn search path strategy.  This will enable concurrent usage of various types
    of PLUGIN::Footprint*() functions.  At least LEGACY and KICAD are both needed
    concurrently.

*)  Add a hot key to toggle the 45 degree constraint on and off so that it can be
*)  Add a hot key to toggle the 45 degree constraint on and off so that it can be
    changed when drawing a trace.
    changed when drawing a trace.



Dick's Final TODO List:
======================
*) write options dialog for fp table dialog.
*) Apply Fabrizio and Alexander's linux desktop patches after unifying them.
*) Get licensing cleaned up.
*) Re-arrange the repo architecture.
*) Merge KiCad GAL/TOM/ORSON if nobody else does.
*) lib_convert.py (i.e. convert) all footprint libraries to pretty format and move copy them to
   github if nobody else does.
*) DLL-ization of pcbnew eeschema
*) Pass options, i.e. PROPERTIES to all PLUGIN::Footprint*() calls.  Current code needs
   to be based on NickNames, not Libpaths, so we have access to the FP_LIB_TABLE::ROWs.
   User should not be prompted for a libpath for reading from it, he/she must pick from the
   known list of nicknames. Possibly duplicate some of the PLUGIN:::Footprint*() api in ROW or
   FP_LIB_TABLE. Again, limited to PLUGIN::Footprint*() calls, not Load() and Save().
+1 −0
Original line number Original line Diff line number Diff line
@@ -133,6 +133,7 @@ set(PCB_COMMON_SRCS
    ../pcbnew/sel_layer.cpp
    ../pcbnew/sel_layer.cpp
    ../pcbnew/pcb_plot_params.cpp
    ../pcbnew/pcb_plot_params.cpp
    ../pcbnew/io_mgr.cpp
    ../pcbnew/io_mgr.cpp
    ../pcbnew/plugin.cpp
    ../pcbnew/eagle_plugin.cpp
    ../pcbnew/eagle_plugin.cpp
    ../pcbnew/legacy_plugin.cpp
    ../pcbnew/legacy_plugin.cpp
    ../pcbnew/kicad_plugin.cpp
    ../pcbnew/kicad_plugin.cpp
+2 −3
Original line number Original line Diff line number Diff line
@@ -235,7 +235,6 @@ PROPERTIES* FP_LIB_TABLE::ParseOptions( const std::string& aOptionsList )
                ++cp;           // skip the escape
                ++cp;           // skip the escape
                pair += *cp++;  // add the separator
                pair += *cp++;  // add the separator
            }
            }

            else if( *cp==OPT_SEP )
            else if( *cp==OPT_SEP )
            {
            {
                ++cp;           // skip the separator
                ++cp;           // skip the separator
@@ -248,7 +247,7 @@ PROPERTIES* FP_LIB_TABLE::ParseOptions( const std::string& aOptionsList )
        // stash the pair
        // stash the pair
        if( pair.size() )
        if( pair.size() )
        {
        {
            // the first equals size established the end of the name
            // first equals sign separates 'name' and 'value'.
            size_t  eqNdx = pair.find( '=' );
            size_t  eqNdx = pair.find( '=' );
            if( eqNdx != pair.npos )
            if( eqNdx != pair.npos )
            {
            {
@@ -257,7 +256,7 @@ PROPERTIES* FP_LIB_TABLE::ParseOptions( const std::string& aOptionsList )
                props[name] = value;
                props[name] = value;
            }
            }
            else
            else
                props[pair] = "";
                props[pair] = "";       // property is present, but with no value.
        }
        }
    }
    }


+19 −0
Original line number Original line Diff line number Diff line
@@ -216,6 +216,24 @@ public:
         */
         */
        void SetDescr( const wxString& aDescr )     { description = aDescr; }
        void SetDescr( const wxString& aDescr )     { description = aDescr; }


        /**
         * Function GetProperties
         * returns the constant PROPERTIES for this library (ROW).  These are
         * the "options" in a table.
         */
        const PROPERTIES* GetProperties() const     { return properties; }

        /**
         * Function SetProperties
         * sets this ROW's PROPERTIES by taking ownership of @a aProperties.
         * @param aProperties ownership is given over to this ROW.
         */
        void SetProperties( const PROPERTIES* aProperties )
        {
            delete properties;
            properties = aProperties;
        }

        //-----</accessors>-----------------------------------------------------
        //-----</accessors>-----------------------------------------------------


        /**
        /**
@@ -236,6 +254,7 @@ public:
        LIB_T           type;
        LIB_T           type;
        wxString        options;
        wxString        options;
        wxString        description;
        wxString        description;
        const
        PROPERTIES*     properties;
        PROPERTIES*     properties;
    };
    };


Loading