X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fgeneral.h;h=38b4565486a206bb030cb73cba0824c084836747;hb=c99d377aa4707033745107db74afdb83adea9a59;hp=1fe5851befceb182d51f0d0bfcd1df1ab791079d;hpb=28f28705612902c15cd0702cc891fba35bf2d2df;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/general.h b/synfig-core/trunk/src/synfig/general.h index 1fe5851..38b4565 100644 --- a/synfig-core/trunk/src/synfig/general.h +++ b/synfig-core/trunk/src/synfig/general.h @@ -1,20 +1,21 @@ /* === S Y N F I G ========================================================= */ /*! \file general.h -** \brief General macros, classes, and prodecure declarations +** \brief General macros, classes, and procedure declarations ** -** $Id: general.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -29,6 +30,7 @@ #include #include "string.h" #include "version.h" +#include /* === M A C R O S ========================================================= */ @@ -39,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 @@ -60,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 */ @@ -68,11 +83,11 @@ class ProgressCallback public: virtual ~ProgressCallback() { } - virtual bool task(const String &task) { return true; } - 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 task(const String &/*task*/) { return true; } + 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; } }; @@ -100,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; } };