X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Ftool%2Fmain.cpp;h=fbf64b05caa3b4b9d660fb49bf87e3b5ddc6cbfb;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=14f6b74dea1370234ff3a5443e0e6510551ddb06;hpb=c3ad95144d148602f672e95ddda1f18fc35502f8;p=synfig.git diff --git a/synfig-core/trunk/src/tool/main.cpp b/synfig-core/trunk/src/tool/main.cpp index 14f6b74..fbf64b0 100644 --- a/synfig-core/trunk/src/tool/main.cpp +++ b/synfig-core/trunk/src/tool/main.cpp @@ -6,6 +6,7 @@ ** ** \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 @@ -48,6 +50,7 @@ #include #include #include +#include #endif using namespace std; @@ -56,18 +59,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 }; @@ -248,6 +259,19 @@ struct Job int quality; bool sifout; + bool list_canvases; + + bool canvas_info, canvas_info_all, canvas_info_time_start, canvas_info_time_end, canvas_info_frame_rate, + canvas_info_frame_start, canvas_info_frame_end, canvas_info_w, canvas_info_h, canvas_info_image_aspect, + canvas_info_pw, canvas_info_ph, canvas_info_pixel_aspect, canvas_info_tl, canvas_info_br, + canvas_info_physical_w, canvas_info_physical_h, canvas_info_x_res, canvas_info_y_res, canvas_info_span, + canvas_info_interlaced, canvas_info_antialias, canvas_info_clamp, canvas_info_flags, canvas_info_focus, + canvas_info_bg_color, canvas_info_metadata; + + Job() + { + canvas_info = canvas_info_all = canvas_info_time_start = canvas_info_time_end = canvas_info_frame_rate = canvas_info_frame_start = canvas_info_frame_end = canvas_info_w = canvas_info_h = canvas_info_image_aspect = canvas_info_pw = canvas_info_ph = canvas_info_pixel_aspect = canvas_info_tl = canvas_info_br = canvas_info_physical_w = canvas_info_physical_h = canvas_info_x_res = canvas_info_y_res = canvas_info_span = canvas_info_interlaced = canvas_info_antialias = canvas_info_clamp = canvas_info_flags = canvas_info_focus = canvas_info_bg_color = canvas_info_metadata = false; + }; }; typedef list arg_list_t; @@ -257,9 +281,7 @@ void guid_test() { cout<<"GUID Test"<=1) +void display_help(bool full) +{ + cerr << endl << _("syntax: ") << progname << " [DEFAULT OPTIONS] ([SIF FILE] [SPECIFIC OPTIONS])..." << endl << endl; + + if(full) { - 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","