/* === S Y N F I G ========================================================= */ /*! \file tool/main.cpp ** \brief SYNFIG Tool ** ** $Id: main.cpp 444 2007-04-08 03:42:41Z dooglus $ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as ** published by the Free Software Foundation; either version 2 of ** the License, or (at your option) any later version. ** ** This package is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** General Public License for more details. ** \endlegal */ /* ========================================================================= */ /* === H E A D E R S ======================================================= */ #ifdef USING_PCH # include "pch.h" #else #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif using namespace std; using namespace etl; using namespace synfig; /* === M A C R O S ========================================================= */ enum exit_code { SYNFIGTOOL_OK =0, SYNFIGTOOL_FILENOTFOUND =1, SYNFIGTOOL_BORRED =2, SYNFIGTOOL_HELP =3, SYNFIGTOOL_UNKNOWNARGUMENT =4, SYNFIGTOOL_UNKNOWNERROR =5, SYNFIGTOOL_INVALIDTARGET =6, SYNFIGTOOL_RENDERFAILURE =7, SYNFIGTOOL_BLANK =8, SYNFIGTOOL_BADVERSION =9, SYNFIGTOOL_MISSINGARGUMENT =10 }; #ifndef VERSION #define VERSION "unknown" #define PACKAGE "synfig-tool" #endif #ifdef DEFAULT_QUALITY #undef DEFAULT_QUALITY #endif #define DEFAULT_QUALITY 2 #define VERBOSE_OUT(x) if(verbosity>=(x))std::cerr /* === G L O B A L S ======================================================= */ const char *progname; int verbosity=0; bool be_quiet=false; bool print_benchmarks=false; /* === M E T H O D S ======================================================= */ class Progress : public synfig::ProgressCallback { const char *program; public: Progress(const char *name):program(name) { } virtual bool task(const String &task) { VERBOSE_OUT(1)<=60) minutes++,seconds-=60; while(minutes>=60) hours++,minutes-=60; while(hours>=24) days++,hours-=24; while(days>=7) weeks++,days-=7; cerr<=-time/(h-clk_scanline) ) cerr<<">"; */ if(delta>=0 && clk()>4.0 && scanline>clk_scanline+200) { //cerr<<"reset"< arg_list_t; typedef list job_list_t; void guid_test() { cout<<"GUID Test"< sig; sigc::connection conn; cout<<"Signal Test"<=1) { Argument("-t","",_("Specify output target (Default:unknown)")); Argument("-w","",_("Set the image width (Use zero for file default)")); Argument("-h","",_("Set the image height (Use zero for file default)")); Argument("-s","",_("Set the diagonal size of image window (Span)")); Argument("-a","<1...30>",_("Set antialias amount for parametric renderer.")); Argument("-Q","<0...10>",strprintf(_("Specify image quality for accelerated renderer (default=%d)"),DEFAULT_QUALITY).c_str()); Argument("-g","",_("Gamma (default=2.2)")); Argument("-v",NULL,_("Verbose Output (add more for more verbosity)")); Argument("-q",NULL,_("Quiet mode (No progress/time-remaining display)")); Argument("-c","",_("Render the canvas with the given id instead of the root.")); Argument("-o","",_("Specify output filename")); Argument("-T","<# of threads>",_("Enable multithreaded renderer using specified # of threads")); Argument("-b",NULL,_("Print Benchmarks")); Argument("--fps","",_("Set the frame rate")); Argument("--time","