]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/xform_macros.h
The forms resize patch, and small updates
[lyx.git] / src / frontends / xforms / xform_macros.h
1 #ifndef XFORM_MACROS_H
2 #define XFORM_MACROS_H
3
4 /** Collection of useful macros to assist in correctly wrapping and
5     mapping C callbacks to the C++ member functions.
6  */
7
8 #define C_GENERICCB(FN, METHOD)                         \
9 extern "C" void C_##FN##METHOD(FL_OBJECT * ob, long d)  \
10 {                                                       \
11         FN::METHOD(ob, d);                              \
12 }
13
14 // Return CB's all seem to take a void* as the 2nd argument and return an int.
15 #define C_RETURNCB(FN, METHOD)                                  \
16 extern "C" int C_##FN##METHOD(FL_FORM * ob, void * d)           \
17 {                                                               \
18         return FN::METHOD(ob, d);                               \
19 }
20
21 #endif