Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / glibmm2 / tools / m4 / property.m4
1 dnl $Id: property.m4 291 2006-05-12 08:08:45Z murrayc $
2
3 dnl
4 dnl
5 dnl  Code generation sections for properties
6 dnl
7 dnl
8
9 dnl
10 dnl _PROPERTY_PROXY(name, name_underscored, cpp_type, proxy_suffix, docs)
11 dnl proxy_suffix could be "_WriteOnly" or "_ReadOnly"
12 dnl The method will be const if the propertyproxy is _ReadOnly.
13 dnl
14 define(`_PROPERTY_PROXY',`dnl
15 dnl
16 dnl Put spaces around the template parameter if necessary.
17 pushdef(`__PROXY_TYPE__',`dnl
18 Glib::PropertyProxy$4<'ifelse(regexp(_QUOTE($3),`>$'),`-1',_QUOTE($3),` '_QUOTE($3)` ')`>'dnl
19 )dnl
20 #ifdef GLIBMM_PROPERTIES_ENABLED
21 /** $5
22    *
23    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
24    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
25    * the value of the property changes.
26    */
27   __PROXY_TYPE__ property_$2`'() ifelse($4,_ReadOnly, const,);
28 #endif //#GLIBMM_PROPERTIES_ENABLED
29 _PUSH(SECTION_CC_PROPERTYPROXIES)
30 #ifdef GLIBMM_PROPERTIES_ENABLED
31 __PROXY_TYPE__ __CPPNAME__::property_$2`'() ifelse($4,_ReadOnly, const,)
32 {
33   return __PROXY_TYPE__`'(this, "$1");
34 }
35 #endif //GLIBMM_PROPERTIES_ENABLED
36
37 _POP()
38 popdef(`__PROXY_TYPE__')dnl
39 ')dnl
40