X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Ftool%2Fmain.cpp;h=064959a0efd73cf17f6063bf9945474e39de205c;hb=978ba874aac345ea8a46318589b21e5e8143f89a;hp=e3255153dce964ee4435e4044b1bf29340a5fdd7;hpb=96ecf115bd5db526fa2d5fe4757fd6ef60afd7cd;p=synfig.git diff --git a/synfig-core/src/tool/main.cpp b/synfig-core/src/tool/main.cpp index e325515..064959a 100644 --- a/synfig-core/src/tool/main.cpp +++ b/synfig-core/src/tool/main.cpp @@ -51,49 +51,16 @@ #include #include #include +#include "definitions.h" +#include "progress.h" +#include "renderprogress.h" +#include "job.h" #endif using namespace std; using namespace etl; using namespace synfig; -/* === M A C R O S ========================================================= */ - -#ifdef ENABLE_NLS -#undef _ -#define _(x) gettext(x) -#else -#undef _ -#define _(x) (x) -#endif - -enum exit_code -{ - SYNFIGTOOL_OK = 0, - SYNFIGTOOL_FILENOTFOUND = 1, - SYNFIGTOOL_BORED = 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; @@ -101,182 +68,13 @@ 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; +/* === M E T H O D S ======================================================= */ + void guid_test() { cout<<"GUID Test"<