synfig-core  1.0.3
definitions.h
Go to the documentation of this file.
1 /* === S Y N F I G ========================================================= */
23 /* ========================================================================= */
24 
25 #ifndef __SYNFIG_DEFINITIONS_H
26 #define __SYNFIG_DEFINITIONS_H
27 
28 /* === M A C R O S ========================================================= */
29 
30 #ifdef ENABLE_NLS
31 #undef _
32 #define _(x) gettext(x)
33 #else
34 #undef _
35 #define _(x) (x)
36 #endif
37 
38 #ifndef VERSION
39 #define VERSION "unknown"
40 #define PACKAGE "synfig-tool"
41 #endif
42 
43 #ifdef DEFAULT_QUALITY
44 #undef DEFAULT_QUALITY
45 #endif
46 
47 #define DEFAULT_QUALITY 2
48 #define VERBOSE_OUT(x) if (SynfigToolGeneralOptions::instance()->get_verbosity() >= (x)) std::cerr
49 
50 #define SYNFIG_LICENSE "\
51 ** This package is free software; you can redistribute it and/or\n\
52 ** modify it under the terms of the GNU General Public License as\n\
53 ** published by the Free Software Foundation; either version 2 of\n\
54 ** the License, or (at your option) any later version.\n\
55 **\n\
56 ** "
57 
59 {
73 };
74 
75 #include <string>
76 #include <boost/smart_ptr.hpp>
77 #include <boost/filesystem.hpp>
78 
80 {
81 public:
83  static void create_singleton_instance(const char* argv0);
84 
86 
87  boost::filesystem::path get_binary_path() const;
88 
89  size_t get_threads() const;
90 
91  void set_threads(size_t threads);
92 
93  int get_verbosity() const;
94 
95  void set_verbosity(int verbosity);
96 
97  bool should_be_quiet() const;
98 
99  void set_should_be_quiet(bool be_quiet);
100 
101  bool should_print_benchmarks() const;
102 
103  void set_should_print_benchmarks(bool print_benchmarks);
104 
105 private:
106  SynfigToolGeneralOptions(const char* argv0);
107 
108  boost::filesystem::path _binary_path;
109  int _verbosity;
110  size_t _threads;
111  bool _should_be_quiet,
112  _should_print_benchmarks;
113 
114  static boost::shared_ptr<SynfigToolGeneralOptions> _instance;
115 };
116 
117 #endif