27#include <wx/filename.h>
30#define ARG_DPI "--dpi"
31#define ARG_WIDTH "--width"
32#define ARG_HEIGHT "--height"
33#define ARG_NO_ANTIALIAS "--no-antialias"
34#define ARG_TRANSPARENT "--transparent"
35#define ARG_STRICT "--strict"
36#define ARG_UNITS "--units"
37#define ARG_ORIGIN_X "--origin-x"
38#define ARG_ORIGIN_Y "--origin-y"
39#define ARG_WINDOW_WIDTH "--window-width"
40#define ARG_WINDOW_HEIGHT "--window-height"
41#define ARG_FOREGROUND "--foreground"
42#define ARG_BACKGROUND "--background"
73 .help(
UTF8STDSTR(
_(
"Use transparent background (default)" ) ) )
79 .default_value( std::string(
"mm" ) )
80 .help(
UTF8STDSTR(
_(
"Units for viewport parameters, options: mm, inch, mils (default: mm)" ) ) )
102 .default_value( 0.0 )
108 .default_value( std::string() )
109 .help(
UTF8STDSTR(
_(
"Foreground color as hex (e.g., '#FFFFFF')" ) ) )
113 .default_value( std::string() )
114 .help(
UTF8STDSTR(
_(
"Background color as hex (e.g., '#000000')" ) ) )
121 std::unique_ptr<JOB_GERBER_EXPORT_PNG> pngJob = std::make_unique<JOB_GERBER_EXPORT_PNG>();
133 if( units == wxS(
"mm" ) )
137 else if( units == wxS(
"inch" ) )
141 else if( units == wxS(
"mils" ) )
147 wxFprintf( stderr,
_(
"Invalid units: %s\n" ), units );
156 if( ( pngJob->m_windowWidth > 0.0 ) != ( pngJob->m_windowHeight > 0.0 ) )
158 wxFprintf( stderr,
_(
"Error: both --window-width and --window-height must be specified together\n" ) );
169 pngJob->SetConfiguredOutputPath( inputFn.GetPath() + wxFileName::GetPathSeparator() + inputFn.GetName()
argparse::ArgumentParser m_argParser
COMMAND(const std::string &aName)
Define a new COMMAND instance.
void addCommonArgs(bool aInput, bool aOutput, IO_TYPE aInputType, IO_TYPE aOutputType)
Set up the most common of args used across cli.
wxString m_argOutput
Value of the output arg if configured.
wxString m_argInput
Value of the common input arg if configured.
GERBER_CONVERT_PNG_COMMAND()
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
int ProcessJob(KIWAY::FACE_T aFace, JOB *aJob, REPORTER *aReporter=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
#define ARG_WINDOW_HEIGHT
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
wxString From_UTF8(const char *cstring)