**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-** Copyright (c) 2007 Chris Moore
+** 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
cerr<<strprintf(" %s %s %s",flag, arg, spaces+strlen(arg)+strlen(flag)+1)+description<<endl;
else
cerr<<strprintf(" %s %s",flag,spaces+strlen(flag))+description<<endl;
-
}
};
Argument("-c","<canvas id>",_("Render the canvas with the given id instead of the root."));
Argument("-o","<output file>",_("Specify output filename"));
Argument("-T","<# of threads>",_("Enable multithreaded renderer using specified # of threads"));
-
Argument("-b",NULL,_("Print Benchmarks"));
-
Argument("--fps","<framerate>",_("Set the frame rate"));
Argument("--time","<time>",_("Render a single frame at <seconds>"));
Argument("--begin-time","<time>",_("Set the starting time"));
Argument("--end-time","<time>",_("Set the ending time"));
Argument("--dpi","<res>",_("Set the dots-per-inch"));
Argument("--append","<filename>",_("Append layers in <filename> to composition"));
-
Argument("--layer-info","<layer>",_("Print out layer's description, parameter info, etc."));
Argument("--layers",NULL,_("Print out the list of available layers"));
Argument("--targets",NULL,_("Print out the list of available targets"));
return SYNFIGTOOL_HELP;
}
-
if(*iter == "--help")
{
display_help(1);
-
return SYNFIGTOOL_HELP;
}
synfig::Main synfig_main(dirname(progname),&p);
synfig::Layer::Book::iterator iter=synfig::Layer::book().begin();
for(;iter!=synfig::Layer::book().end();iter++)
- cout<<iter->first<<endl;
+ if (iter->second.category != CATEGORY_DO_NOT_USE)
+ cout<<iter->first<<endl;
return SYNFIGTOOL_HELP;
}
synfig::Target::Book::iterator iter=synfig::Target::book().begin();
for(;iter!=synfig::Target::book().end();iter++)
cout<<iter->first<<endl;
-
return SYNFIGTOOL_HELP;
}
synfig::LinkableValueNode::Book::iterator iter=synfig::LinkableValueNode::book().begin();
for(;iter!=synfig::LinkableValueNode::book().end();iter++)
cout<<iter->first<<endl;
-
return SYNFIGTOOL_HELP;
}
synfig::Importer::Book::iterator iter=synfig::Importer::book().begin();
for(;iter!=synfig::Importer::book().end();iter++)
cout<<iter->first<<endl;
-
return SYNFIGTOOL_HELP;
}
if(*iter == "--version")
{
cerr<<PACKAGE<<" "<<VERSION<<endl;
-
arg_list.erase(iter);
-
return SYNFIGTOOL_HELP;
}
**\n\
** " << endl << endl;
arg_list.erase(iter);
-
return SYNFIGTOOL_HELP;
}
if(*iter == "-v")
{
verbosity++;
-
arg_list.erase(iter);
-
continue;
}
if(*iter == "-q")
{
be_quiet=true;
-
arg_list.erase(iter);
-
continue;
}
if(*iter == "-b")
{
print_benchmarks=true;
-
arg_list.erase(iter);
-
continue;
}
}
return SYNFIGTOOL_OK;
}
+/* true if the given flag takes an extra parameter */
+bool flag_requires_value(String flag) {
+ return (flag=="-a" || flag=="-c" || flag=="-g" || flag=="-h" || flag=="-o" ||
+ flag=="-Q" || flag=="-s" || flag=="-t" || flag=="-T" || flag=="-w" ||
+ flag=="--append" || flag=="--begin-time" || flag=="--dpi" || flag=="--dpi-x" ||
+ flag=="--dpi-y" || flag=="--end-frame" || flag=="--end-time" || flag=="--fps" ||
+ flag=="--frame" || flag=="--start-frame" || flag=="--start-time" || flag=="--time" );
+}
+
int extract_arg_cluster(arg_list_t &arg_list,arg_list_t &cluster)
{
arg_list_t::iterator iter, next;
return SYNFIGTOOL_OK;
}
- if(
- *iter=="-t" ||
- *iter=="-w" ||
- *iter=="-h" ||
- *iter=="-a" ||
- *iter=="-g" ||
- *iter=="-o" ||
- *iter=="-s" ||
- *iter=="-Q" ||
- *iter=="-c" ||
- *iter=="--fps" ||
- *iter=="--start-time" ||
- *iter=="--begin-time" ||
- *iter=="--end-time" ||
- *iter=="--start-frame" ||
- *iter=="--end-frame" ||
- *iter=="--time" ||
- *iter=="--frame" ||
- *iter=="--dpi" ||
- *iter=="--dpi-x" ||
- *iter=="--dpi-y" ||
- *iter=="--append" ||
- *iter=="-T" )
+ if (flag_requires_value(*iter))
{
cluster.push_back(*iter);
arg_list.erase(iter);
//desc.set_gamma(Gamma(atof(iter->c_str())));
arg_list.erase(iter);
}
+ else if (flag_requires_value(*iter))
+ iter=next++;
}
if(w&&h)
{
VERBOSE_OUT(1)<<strprintf(_("Quality set to %d"),quality)<<endl;
arg_list.erase(iter);
}
+ else if (flag_requires_value(*iter))
+ iter=next++;
}
return SYNFIGTOOL_OK;
VERBOSE_OUT(1)<<strprintf(_("Threads set to %d"),threads)<<endl;
arg_list.erase(iter);
}
+ else if (flag_requires_value(*iter))
+ iter=next++;
}
return SYNFIGTOOL_OK;
type=*iter;
arg_list.erase(iter);
}
+ else if (flag_requires_value(*iter))
+ iter=next++;
}
return SYNFIGTOOL_OK;
filename=*iter;
arg_list.erase(iter);
}
+ else if (flag_requires_value(*iter))
+ iter=next++;
}
return SYNFIGTOOL_OK;
arg_list.erase(iter);
ret=SYNFIGTOOL_OK;
}
+ else if (flag_requires_value(*iter))
+ iter=next++;
}
return ret;
canvasid=*iter;
arg_list.erase(iter);
}
+ else if (flag_requires_value(*iter))
+ iter=next++;
}
return SYNFIGTOOL_OK;
return ret;
// Open the composition
- {
- job_list.front().root=open_canvas(job_list.front().filename);
- }
+ job_list.front().root=open_canvas(job_list.front().filename);
+
if(!job_list.front().root)
{
cerr<<_("Unable to open ")<<job_list.front().filename<<"."<<endl;
}
VERBOSE_OUT(2)<<_("Appended contents of ")<<composite_file<<endl;
}
- }while(false);
+ } while(false);
VERBOSE_OUT(4)<<_("Attempting to determine target/outfile...")<<endl;
string ext = filename_extension(job_list.front().outfilename);
if (ext.length()) ext = ext.substr(1);
if(Target::ext_book().count(ext))
+ {
target_name=Target::ext_book()[ext];
+ info("target name not specified - using %s", target_name.c_str());
+ }
else
- target_name=ext;
+ {
+ string lower_ext(ext);
+
+ for(unsigned int i=0;i<ext.length();i++)
+ lower_ext[i] = tolower(ext[i]);
+
+ if(Target::ext_book().count(lower_ext))
+ {
+ target_name=Target::ext_book()[lower_ext];
+ info("target name not specified - using %s", target_name.c_str());
+ }
+ else
+ target_name=ext;
+ }
}
// If the target type is STILL not yet defined, then
job_list.pop_front();
continue;
}
- //string bleh;
- //getline(cin,bleh);
}
}