X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fgeneral.h;h=7136afa2ac1ad59667690de104691a12242143a3;hb=243072522bb877911a25499eacb20dcae016c2a9;hp=7e8f0e35344dc9c192f1b4b3215cb843e6389010;hpb=e8a065f2385c219c511b57dac52786120bfa097d;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/general.h b/synfig-core/trunk/src/synfig/general.h index 7e8f0e3..7136afa 100644 --- a/synfig-core/trunk/src/synfig/general.h +++ b/synfig-core/trunk/src/synfig/general.h @@ -30,6 +30,7 @@ #include #include "string.h" #include "version.h" +#include /* === M A C R O S ========================================================= */ @@ -40,7 +41,7 @@ //#define gettext(x) (x) #endif -#define SYNFIG_COPYRIGHT "Copyright (c) 2001-2004 Voria Software, LLC" +#define SYNFIG_COPYRIGHT "Copyright (c) 2001-2005 Robert B. Quattlebaum Jr., Adrian Bentley" #ifdef _DEBUG @@ -61,6 +62,19 @@ namespace synfig { +class ChangeLocale { + const String previous; + const int category; +public: + ChangeLocale(int category, const char *locale): + previous(setlocale(category,locale)),category(category) + { + } + ~ChangeLocale() { + setlocale(category,previous.c_str()); + } +}; + /*! \class ProgressCallback ** \todo writeme */ @@ -73,7 +87,7 @@ public: virtual bool error(const String &task) { return true; } virtual bool warning(const String &task) { return true; } virtual bool amount_complete(int current, int total) { return true; } - + virtual bool valid() const { return true; } }; @@ -101,7 +115,7 @@ public: virtual bool error(const String &task) { if(cb)return cb->error(task); return true; } virtual bool warning(const String &task) { if(cb)return cb->warning(task); return true; } virtual bool amount_complete(int cur, int total) { if(cb)return cb->amount_complete(start+cur*w/total,tot); return true; } - + virtual bool valid() const { return cb != 0; } };