# main.cpp File Reference

SYNFIG Tool. More...

`#include <iostream>`
`#include <ETL/stringf>`
`#include <list>`
`#include <ETL/clock>`
`#include <algorithm>`
`#include <cstring>`
`#include <synfig/loadcanvas.h>`
`#include <synfig/savecanvas.h>`
`#include <synfig/target_scanline.h>`
`#include <synfig/module.h>`
`#include <synfig/importer.h>`
`#include <synfig/layer.h>`
`#include <synfig/canvas.h>`
`#include <synfig/target.h>`
`#include <synfig/time.h>`
`#include <synfig/string.h>`
`#include <synfig/paramdesc.h>`
`#include <synfig/main.h>`
`#include <synfig/guid.h>`

## Defines

#define | _(x) (x)
#define | VERSION "unknown"
#define | PACKAGE "synfig-tool"
#define | DEFAULT_QUALITY 2
#define | VERBOSE_OUT(x) if(verbosity>=(x))std::cerr

## Typedefs

typedef list< String > | arg_list_t
typedef list< Job > | job_list_t

## Enumerations

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 }

## Functions

void | guid_test ()
void | signal_test_func ()
void | signal_test ()
void | display_help_option (const char *flag, const char *arg, string description)
void | display_help (bool full)
int | process_global_flags (arg_list_t &arg_list)
bool | flag_requires_value (String flag)
int | extract_arg_cluster (arg_list_t &arg_list, arg_list_t &cluster)
int | extract_RendDesc (arg_list_t &arg_list, RendDesc &desc)
int | extract_quality (arg_list_t &arg_list, int &quality)
int | extract_threads (arg_list_t &arg_list, int &threads)
int | extract_target (arg_list_t &arg_list, string &type)
int | extract_append (arg_list_t &arg_list, string &filename)
int | extract_outfile (arg_list_t &arg_list, string &outfile)
int | extract_canvasid (arg_list_t &arg_list, string &canvasid)
int | extract_list_canvases (arg_list_t &arg_list, bool &list_canvases)
void | extract_canvas_info (arg_list_t &arg_list, Job &job)
void | list_child_canvases (string prefix, Canvas::Handle canvas)
void | list_canvas_info (Job job)
int | main (int argc, char *argv[])

## Variables

const char * | progname
int | verbosity = 0
bool | be_quiet = false
bool | print_benchmarks = false

## Detailed Description

SYNFIG Tool.

$Id$

## Define Documentation

#define _ | ( | x |  | ) | (x)

#define VERSION "unknown"

Referenced by synfig::get_version(), and process_global_flags().

#define PACKAGE "synfig-tool"

Referenced by process_global_flags().

#define DEFAULT_QUALITY 2

Referenced by display_help(), and main().

#define VERBOSE_OUT | ( | x |  | ) | if(verbosity>=(x))std::cerr

Referenced by extract_quality(), extract_RendDesc(), extract_threads(), and main().

## Typedef Documentation

typedef list<String> arg_list_t

typedef list<Job> job_list_t

## Enumeration Type Documentation

enum exit_code

Enumerator:

  SYNFIGTOOL_OK |
  SYNFIGTOOL_FILENOTFOUND |
  SYNFIGTOOL_BORED |
  SYNFIGTOOL_HELP |
  SYNFIGTOOL_UNKNOWNARGUMENT |
  SYNFIGTOOL_UNKNOWNERROR |
  SYNFIGTOOL_INVALIDTARGET |
  SYNFIGTOOL_RENDERFAILURE |
  SYNFIGTOOL_BLANK |
  SYNFIGTOOL_BADVERSION |
  SYNFIGTOOL_MISSINGARGUMENT |

## Function Documentation

void guid_test | ( |  | ) |

Referenced by process_global_flags().

void signal_test_func | ( |  | ) |

Referenced by signal_test().

void signal_test | ( |  | ) |

References signal_test_func().

Referenced by process_global_flags().

void display_help_option | ( | const char * | flag,
|  | const char * | arg,
|  | string | description |
| ) |  |  |

Referenced by display_help().

void display_help | ( | bool | full | ) |

References _, DEFAULT_QUALITY, display_help_option(), and progname.

Referenced by main(), and process_global_flags().

int process_global_flags | ( | arg_list_t & | arg_list | ) |

References be_quiet, synfig::Importer::book(), synfig::LinkableValueNode::book(), synfig::Target::book(), synfig::Module::book(), synfig::Layer::book(), CATEGORY_DO_NOT_USE, synfig::Layer::create(), display_help(), synfig::error(), guid_test(), PACKAGE, print_benchmarks, progname, signal_test(), SYNFIG_COPYRIGHT, SYNFIGTOOL_HELP, SYNFIGTOOL_MISSINGARGUMENT, SYNFIGTOOL_OK, verbosity, and VERSION.

Referenced by main().

bool flag_requires_value | ( | String | flag | ) |

Referenced by extract_append(), extract_arg_cluster(), extract_canvasid(), extract_outfile(), extract_quality(), extract_RendDesc(), extract_target(), and extract_threads().

int extract_arg_cluster | ( | arg_list_t & | arg_list,
|  | arg_list_t & | cluster |
| ) |  |  |

References synfig::error(), flag_requires_value(), SYNFIGTOOL_MISSINGARGUMENT, and SYNFIGTOOL_OK.

Referenced by main().

int extract_RendDesc | ( | arg_list_t & | arg_list,
|  | RendDesc & | desc |
| ) |  |  |

References _, flag_requires_value(), synfig::RendDesc::get_frame_rate(), synfig::RendDesc::get_h(), synfig::Time::get_string(), synfig::RendDesc::get_time_start(), synfig::RendDesc::get_w(), synfig::RendDesc::set_antialias(), synfig::RendDesc::set_frame_rate(), synfig::RendDesc::set_span(), synfig::RendDesc::set_time(), synfig::RendDesc::set_time_end(), synfig::RendDesc::set_time_start(), synfig::RendDesc::set_wh(), synfig::RendDesc::set_x_res(), synfig::RendDesc::set_y_res(), SYNFIGTOOL_OK, VERBOSE_OUT, and synfig::warning().

Referenced by main().

int extract_quality | ( | arg_list_t & | arg_list,
|  | int & | quality |
| ) |  |  |

References _, flag_requires_value(), SYNFIGTOOL_OK, and VERBOSE_OUT.

Referenced by main().

int extract_threads | ( | arg_list_t & | arg_list,
|  | int & | threads |
| ) |  |  |

References _, flag_requires_value(), SYNFIGTOOL_OK, and VERBOSE_OUT.

Referenced by main().

int extract_target | ( | arg_list_t & | arg_list,
|  | string & | type |
| ) |  |  |

References flag_requires_value(), and SYNFIGTOOL_OK.

Referenced by main().

int extract_append | ( | arg_list_t & | arg_list,
|  | string & | filename |
| ) |  |  |

References flag_requires_value(), and SYNFIGTOOL_OK.

Referenced by main().

int extract_outfile | ( | arg_list_t & | arg_list,
|  | string & | outfile |
| ) |  |  |

References flag_requires_value(), SYNFIGTOOL_FILENOTFOUND, and SYNFIGTOOL_OK.

Referenced by main().

int extract_canvasid | ( | arg_list_t & | arg_list,
|  | string & | canvasid |
| ) |  |  |

References flag_requires_value(), and SYNFIGTOOL_OK.

Referenced by main().

int extract_list_canvases | ( | arg_list_t & | arg_list,
|  | bool & | list_canvases |
| ) |  |  |

References SYNFIGTOOL_OK.

Referenced by main().

void extract_canvas_info | ( | arg_list_t & | arg_list,
|  | Job & | job |
| ) |  |  |

References _.

Referenced by main().

void list_child_canvases | ( | string | prefix,
|  | Canvas::Handle | canvas |
| ) |  |  |

Referenced by main().

void list_canvas_info | ( | Job | job | ) |

References _.

Referenced by main().

int main | ( | int | argc,
|  | char * | argv[] |
| ) |  |  |

References _, synfig::Target::create(), DEFAULT_QUALITY, display_help(), extract_append(), extract_arg_cluster(), extract_canvas_info(), extract_canvasid(), extract_list_canvases(), extract_outfile(), extract_quality(), extract_RendDesc(), extract_target(), extract_threads(), synfig::info(), list_canvas_info(), list_child_canvases(), synfig::open_canvas(), print_benchmarks, process_global_flags(), progname, synfig::save_canvas(), SYNFIG_CHECK_VERSION, SYNFIGTOOL_BADVERSION, SYNFIGTOOL_BLANK, SYNFIGTOOL_BORED, SYNFIGTOOL_OK, SYNFIGTOOL_RENDERFAILURE, SYNFIGTOOL_UNKNOWNARGUMENT, tolower, VERBOSE_OUT, and verbosity.

## Variable Documentation

const char* progname

Referenced by display_help(), main(), and process_global_flags().

int verbosity = 0

Referenced by main(), and process_global_flags().

bool be_quiet = false

Referenced by process_global_flags().

bool print_benchmarks = false

Referenced by main(), and process_global_flags().