utility.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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