Commit 7a93d0b2 authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

more KICAD_PLUGIN work progress

parent 8f79b146
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -390,6 +390,8 @@ public:
     */
    KICAD_T Type()  const { return m_StructType; }

    void SetTimeStamp( unsigned long aNewTimeStamp ) { m_TimeStamp = aNewTimeStamp; }
    unsigned long GetTimeStamp() const { return m_TimeStamp; }

    EDA_ITEM* Next() const { return (EDA_ITEM*) Pnext; }
    EDA_ITEM* Back() const { return (EDA_ITEM*) Pback; }
@@ -728,7 +730,6 @@ enum FILL_T {
 */
class EDA_TEXT
{

public:
    int      m_Thickness;               /* pen size used to draw this text */
    int      m_Orient;                  /* Orient in 0.1 degrees */
@@ -770,6 +771,9 @@ public:
    void SetOrientation( int aOrientation ) { m_Orient = aOrientation; }
    int  GetOrientation() const { return m_Orient; }

    void SetItalic( bool isItalic ) { m_Italic = isItalic; }
    bool GetItalic() const { return m_Italic; }

    /**
     * Function SetSize
     * sets text size.
+2 −0
Original line number Diff line number Diff line
@@ -112,6 +112,8 @@ public:
        return m_Name;
    }

    void SetName( const wxString& aName ) { m_Name = aName; }

    /**
     * Function GetCount
     * returns the number of nets in this NETCLASS, i.e. using these rules.
+0 −3
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ public:
     */
    void DisplayInfo( EDA_DRAW_FRAME* frame );


    /**
     * Function HitTest
     * tests if the given wxPoint is within the bounds of this object.
@@ -94,7 +93,6 @@ public:
        return TextHitTest( refPos );
    }


    /**
     * Function HitTest (overloaded)
     * tests if the given EDA_RECT intersect this object.
@@ -149,7 +147,6 @@ public:
     */
    virtual void Show( int nestLevel, std::ostream& os );
#endif

};

#endif  // #define CLASS_PCB_TEXT_H
+6 −12
Original line number Diff line number Diff line
@@ -117,23 +117,18 @@ public:
     */
    virtual void Flip( const wxPoint& aCentre );

    /**
     * Function GetPosition
     * returns the position of this object.
     * @return const wxPoint& - The position of this object.
     */
    wxPoint& GetPosition()
    {
        return m_Start;  // it had to be start or end.
    }

    const wxPoint GetPosition() const       // overload
    {
        return m_Start;  // it had to be start or end.
    }

    int GetWidth() const { return m_Width; }
    void SetWidth( int aWidth ) { m_Width = aWidth; }

    void SetPosition( const wxPoint& aPos ) {  m_Start = aPos; }    // overload

    void SetEnd( const wxPoint& aEnd ) { m_Start = aEnd; }

    EDA_RECT GetBoundingBox() const;

    /**
@@ -177,13 +172,13 @@ public:
        return hypot( dx, dy );
    }


    /* Display on screen: */
    void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode,
               const wxPoint& aOffset = ZeroOffset );

    /* divers */
    int Shape() const { return m_Shape & 0xFF; }
    void SetShape( int aShape ) { m_Shape = aShape; }

    /**
     * Function TransformShapeWithClearanceToPolygon
@@ -489,7 +484,6 @@ public:
        return wxT( "VIA" );
    }


    virtual wxString GetSelectMenuText() const;

    virtual BITMAP_DEF GetMenuImage() const { return  via_sketch_xpm; }
+13 −9
Original line number Diff line number Diff line
@@ -27,22 +27,26 @@
#include <kicad_plugin.h>


// some day plugins could be in separate DLL/DSOs, until then, use the simplest method:
// Some day plugins might be in separate DLL/DSOs, simply because of numbers of them
// and code size.  Until then, use the simplest method:

// This implementation is one of two which could be done.
// the other one would cater to DLL/DSO's.  But since it would be nearly
// The other one would cater to DLL/DSO's.  But since it would be nearly
// impossible to link a KICAD type DLL/DSO right now without pulling in all
// ::Draw() functions, I forgo that option.
// ::Draw() functions, I forgo that option temporarily.

// Some day it may be possible to have some built in AND some DLL/DSO, but
// only when we can keep things clean enough to link a DLL/DSO without
// pulling in the world.
// Some day it may be possible to have some built in AND some DLL/DSO
// plugins coexisting.

static KICAD_PLUGIN kicad_plugin;

static KICAD_PLUGIN kicad_plugin;       // a secret
//static EAGLE_PLUGIN eagle_plugin;

PLUGIN* IO_MGR::PluginFind( PCB_FILE_T aFileType )
{
    // This implementation is subject to change, any magic is allowed here.
    // The public IO_MGR API is the only pertinent public information.

    switch( aFileType )
    {
    case KICAD:     return &kicad_plugin;
@@ -104,7 +108,7 @@ BOARD* PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, PROPERTIES*
    wxString msg;

    msg.Printf( _( "Plugin %s does not implement the BOARD Load() function.\n" ),
            Name().GetData() );
            PluginName().GetData() );

    THROW_IO_ERROR( msg );
}
@@ -118,7 +122,7 @@ void PLUGIN::Save( const wxString* aFileName, BOARD* aBoard, PROPERTIES* aProper
    wxString msg;

    msg.Printf( _( "Plugin %s does not implement the BOARD Save() function.\n" ),
            Name().GetData() );
            PluginName().GetData() );

    THROW_IO_ERROR( msg );
}
Loading