papyrus logo

utility.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the papyrus library.                             *
00006  *                                                                         *
00007  *   papyrus is free software; you can redistribute it and/or modify       *
00008  *   it under the terms of the GNU Lesser General Public License           *
00009  *   version 3.0 as published by the Free Software Foundation.             *
00010  *                                                                         *
00011  *   papyrus is distributed in the hope that it will be useful,            *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Lesser General Public License version 3.0 for more details.       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with the papyrus library. If not, see                   *
00018  *   <http://www.gnu.org/licenses/>.                                       *
00019  ***************************************************************************/
00020 #ifndef PAPYRUS_UTILITY_H
00021 #define PAPYRUS_UTILITY_H
00022 
00023 #include <papyrus/enums.h>
00024 #include <glibmm/ustring.h>
00025 #include <papyrus/pointer.h>
00026 
00027 #define PAPYRUS_CLASS_NAME( StrName )             \
00028   static const Glib::ustring& name_string()       \
00029   {                                               \
00030     static const Glib::ustring cn(StrName);       \
00031     return cn;                                    \
00032   }                                               \
00033                                                   \
00034   virtual const Glib::ustring& class_name() const \
00035   {                                               \
00036     static const Glib::ustring cn(StrName);       \
00037     return cn;                                    \
00038   }
00039 
00040 #define PAPYRUS_CLONE_METHOD( Type )          \
00041   virtual Drawable::pointer clone() const {   \
00042     Type::pointer other = Type::create();     \
00043     *other = *this;                           \
00044     return other;                             \
00045   }
00046 
00047 #define PAPYRUS_CREATE( BaseObjCall )     \
00048   pointer p = pointer( new BaseObjCall ); \
00049   p->m_self = p;                          \
00050   return p;
00051 
00052   namespace Papyrus {
00053 
00054   double rad2units(double value, DegRad units);
00055 
00056   double units2rad(double value, DegRad units);
00057 
00058   bool strcaseeq( const Glib::ustring& str1, const Glib::ustring& str2 );
00059 
00060   int strcasecmp( const Glib::ustring& str1, const Glib::ustring& str2 );
00061   
00062   class Drawable;
00063   
00064   struct wp_lt_compare {
00065     bool operator()( const PapyrusWeakPointer<Drawable>&, const PapyrusWeakPointer<Drawable>& );
00066   };
00067   
00068   }
00069 
00070 #endif

Generated on Wed Mar 18 12:34:04 2009 for papyrus by doxygen 1.5.7.1