X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Ftool%2Fmain.cpp;h=64ac3824c840d18290f8b9aa3eda856094f6555c;hb=bbb1a360a86824945bb920021889ca228796d330;hp=ed9cac2f60bcb07f2c5a189b12ce4cac855348de;hpb=4c238d3647b83af8b18c0dc0dfe5eac5986cda2b;p=synfig.git diff --git a/synfig-core/trunk/src/tool/main.cpp b/synfig-core/trunk/src/tool/main.cpp index ed9cac2..64ac382 100644 --- a/synfig-core/trunk/src/tool/main.cpp +++ b/synfig-core/trunk/src/tool/main.cpp @@ -1,11 +1,12 @@ /* === S Y N F I G ========================================================= */ -/*! \file main.cpp +/*! \file tool/main.cpp ** \brief SYNFIG Tool ** -** $Id: main.cpp,v 1.9 2005/01/23 04:41:10 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007, 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -34,6 +35,7 @@ #include #include #include +#include #include #include @@ -56,18 +58,26 @@ 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_BORRED =2, - SYNFIGTOOL_HELP =3, - SYNFIGTOOL_UNKNOWNARGUMENT =4, - SYNFIGTOOL_UNKNOWNERROR =5, - SYNFIGTOOL_INVALIDTARGET =6, - SYNFIGTOOL_RENDERFAILURE =7, - SYNFIGTOOL_BLANK =8, - SYNFIGTOOL_BADVERSION =9, + 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 }; @@ -95,11 +105,11 @@ bool print_benchmarks=false; class Progress : public synfig::ProgressCallback { const char *program; - + public: - + Progress(const char *name):program(name) { } - + virtual bool task(const String &task) { @@ -122,7 +132,7 @@ public: } virtual bool - amount_complete(int current, int total) + amount_complete(int /*current*/, int /*total*/) { return true; } @@ -131,16 +141,16 @@ public: class RenderProgress : public synfig::ProgressCallback { string taskname; - + etl::clock clk; int clk_scanline; // The scanline at which the clock was reset etl::clock clk2; - float last_time; + float last_time; public: - + RenderProgress():clk_scanline(0), last_time(0) { } - + virtual bool task(const String &thetask) { @@ -178,7 +188,7 @@ public: if(clk2()<0.2) return true; clk2.reset(); - + if(scanline) seconds=(int)time+1; else @@ -187,7 +197,7 @@ public: clk.reset(); clk_scanline=scanline; } - + if(seconds<0) { clk.reset(); @@ -202,7 +212,7 @@ public: days++,hours-=24; while(days>=7) weeks++,days-=7; - + cerr<=1) + + cerr << endl << _("syntax: ") << progname << " [DEFAULT OPTIONS] ([SIF FILE] [SPECIFIC OPTIONS])..." << endl << endl; + + if(amount == 0) + Argument("--help",NULL,_("Print out usage and syntax info")); + else { Argument("-t","",_("Specify output target (Default:unknown)")); Argument("-w","",_("Set the image width (Use zero for file default)")); @@ -314,16 +326,13 @@ void display_help(int amount) 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","