UniWidgets  1.0.0
global_macros.h
00001 #ifndef _GLOBAL_MACROS_H
00002 #define _GLOBAL_MACROS_H
00003 
00004 /* A macro to disallow the copy constructor and operator= functions.
00005  * This should be used in the private: declarations for a class.
00006  * For more info see http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml */
00007 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
00008 private: \
00009     TypeName(const TypeName&);               \
00010     TypeName& operator=(const TypeName&)
00011 
00012 
00013 /* Macro for Gtk properties definition in classes */
00014 #define ADD_PROPERTY(name, type) \
00015 protected: \
00016     Glib::Property<type> name; \
00017 public: \
00018     void set_ ## name(type value) {name.set_value(value);} \
00019     type get_ ## name() {return name.get_value();}
00020 
00021 #define ADD_TRANSPROPERTY(name, type) \
00022 protected: \
00023     TransProperty<type> name; \
00024 public: \
00025     void set_ ## name(type value) {name.set_value(value);} \
00026     type get_ ## name() {return name.get_value();}
00027 
00028 #endif