1 /* === S Y N F I G ========================================================= */
2 /*! \file gtkmm/main.cpp
3 ** \brief Synfig Studio Entrypoint
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2007 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === H E A D E R S ======================================================= */
42 /* === U S I N G =========================================================== */
46 using namespace synfig;
47 using namespace studio;
49 /* === M A C R O S ========================================================= */
51 /* === G L O B A L S ======================================================= */
53 /* === P R O C E D U R E S ================================================= */
55 /* === M E T H O D S ======================================================= */
57 /* === E N T R Y P O I N T ================================================= */
59 int main(int argc, char **argv)
63 setlocale(LC_ALL, "");
64 bindtextdomain("synfigstudio", LOCALEDIR);
65 textdomain("synfigstudio");
69 SmartFILE file(IPC::make_connection());
72 fprintf(file.get(),"F\n");
74 // Hey, another copy of us is open!
75 // don't bother opening us, just go ahead and
76 // tell the other copy to load it all up
79 for(;argc>=1;(argc)--)
80 if((argv)[argc] && (argv)[argc][0]!='-')
82 fprintf(file.get(),"O %s\n",etl::absolute_path((argv)[argc]).c_str());
86 fprintf(file.get(),"F\n");
94 studio::App app(&argc, &argv);
100 std::cerr<<"Application shutdown with errors ("<<ret<<')'<<std::endl;
105 std::cerr<<"Uncaught Exception:string: "<<str<<std::endl;
108 catch(std::exception x)
110 std::cerr<<"Standard Exception: "<<x.what()<<std::endl;
113 catch(Glib::Exception& x)
115 std::cerr<<"GLib Exception: "<<x.what()<<std::endl;
120 std::cerr<<"Uncaught Exception"<<std::endl;
124 std::cerr<<"Application appears to have terminated successfully"<<std::endl;