34#include <drawing_sheet/drawing_sheet_lexer.h>
42using namespace DRAWINGSHEET_T;
47 return DRAWING_SHEET_LEXER::TokenName( aTok );
94 wxMessageBox( ioe.
What(),
_(
"Error writing drawing sheet file" ) );
123 wxMessageBox( ioe.
What(),
_(
"Error writing drawing sheet file" ) );
156 writer.
Format(
this, aItemsList );
164 m_out->
Print( 0,
"(kicad_wks (version %d) (generator \"pl_editor\") (generator_version \"%s\")\n",
168 Format( aModel, item, 1 );
184 format( aModel, aItem, aNestLevel );
196 wxFAIL_MSG( wxT(
"Cannot format item" ) );
205 m_out->
Print( 0,
"(kicad_wks (version %d) (generator \"pl_editor\") (generator_version \"%s\")\n",
227 for(
unsigned ii = 0; ii < aSheet->
GetCount(); ii++ )
230 Format( aSheet, item, nestLevel );
254 if( write_thickness || write_size || aItem->
m_Bold || aItem->
m_Italic
255 || write_face || aItem->
m_TextColor != COLOR4D::UNSPECIFIED )
262 if( write_thickness )
319 if( !aItem->
m_Info.IsEmpty() )
344 if( !aItem->
m_Info.IsEmpty() )
366 if( !aItem->
m_Info.IsEmpty() )
386 nestLevel = aNestLevel+2;
418 if( !aItem->
m_Info.IsEmpty() )
428#define MIME_BASE64_LENGTH 76
432 while( first < out.Length() )
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
wxString GetMajorMinorVersion()
Get only the major and minor version in a string major.minor.
const wxImage * GetOriginalImageData() const
const wxMemoryBuffer & GetImageDataBuffer() const
BITMAP_BASE * m_ImageBitmap
unsigned GetPolyIndexStart(unsigned aContour) const
unsigned GetPolyIndexEnd(unsigned aContour) const
std::vector< VECTOR2D > m_Corners
GR_TEXT_H_ALIGN_T m_Hjustify
KIGFX::COLOR4D m_TextColor
VECTOR2D m_BoundingBoxSize
GR_TEXT_V_ALIGN_T m_Vjustify
Drawing sheet structure type definitions.
PAGE_OPTION GetPage1Option() const
DS_ITEM_TYPE GetType() const
VECTOR2D m_IncrementVector
DS_DATA_MODEL_FILEIO(const wxString &aFilename)
PRETTIFIED_FILE_OUTPUTFORMATTER * m_fileout
void Format(DS_DATA_MODEL *aSheet) const
virtual ~DS_DATA_MODEL_IO()
void formatRepeatParameters(DS_DATA_ITEM *aItem) const
void format(DS_DATA_ITEM_TEXT *aItem, int aNestLevel) const
void formatOptions(DS_DATA_ITEM *aItem) const
void formatCoordinate(const char *aToken, POINT_COORD &aCoord) const
~DS_DATA_MODEL_STRINGIO()
STRING_FORMATTER * m_writer
DS_DATA_MODEL_STRINGIO(wxString *aOutputString)
Handle the graphic items list to draw/plot the frame and title block.
VECTOR2D m_DefaultTextSize
unsigned GetCount() const
double m_DefaultLineWidth
DS_DATA_ITEM * GetItem(unsigned aIdx) const
double m_DefaultTextThickness
void SaveInString(wxString *aOutputString)
Save the description in a buffer.
void Save(const wxString &aFullFileName)
Save the description in a file.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
const char * NameAsToken() const
const wxString & GetName() const
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
static const char * getTokenName(T aTok)
#define MIME_BASE64_LENGTH
#define SEXPR_WORKSHEET_FILE_VERSION
This file contains the file format version information for the s-expression drawing sheet file format...
wxString From_UTF8(const char *cstring)
std::string FormatDouble2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 This function is intended in...
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.