X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fgeneral.h;h=43e768d94664654915232fe72594f4187e5d5999;hb=eade3a78d78a6b9d5f39fe69b7fb76696e2a29ef;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..43e768d 100644 --- a/synfig-core/trunk/src/synfig/general.h +++ b/synfig-core/trunk/src/synfig/general.h @@ -2,7 +2,7 @@ /*! \file general.h ** \brief General macros, classes, and prodecure declarations ** -** $Id: general.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley @@ -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; } };