10 #define TRY_GUI_REDIRECT_OBJ(name, obj) \
11 if (auto* const ngh_result = \
12 neuron::python::methods.try_gui_helper(name, static_cast<Object*>(obj))) { \
13 return static_cast<void*>(*ngh_result); \
16 #define TRY_GUI_REDIRECT_METHOD_ACTUAL_DOUBLE(name, sym, v) \
18 Object** guiredirect_result = NULL; \
19 if (neuron::python::methods.gui_helper) { \
20 Object* obj = nrn_get_gui_redirect_obj(); \
21 guiredirect_result = neuron::python::methods.gui_helper(name, obj); \
22 if (guiredirect_result) { \
23 return neuron::python::methods.object_to_double(*guiredirect_result); \
28 #define TRY_GUI_REDIRECT_METHOD_ACTUAL_OBJ(name, sym, v) \
30 Object** guiredirect_result = NULL; \
31 if (neuron::python::methods.gui_helper) { \
32 Object* obj = nrn_get_gui_redirect_obj(); \
33 guiredirect_result = neuron::python::methods.gui_helper(name, obj); \
34 if (guiredirect_result) { \
35 return (guiredirect_result); \
40 #define TRY_GUI_REDIRECT_NO_RETURN(name, obj) \
41 if (auto* const ngh_result = \
42 neuron::python::methods.try_gui_helper(name, static_cast<Object*>(obj)); \
47 #define TRY_GUI_REDIRECT_DOUBLE(name, obj) \
48 if (auto* const ngh_result = \
49 neuron::python::methods.try_gui_helper(name, static_cast<Object*>(obj))) { \
51 hoc_pushx(neuron::python::methods.object_to_double(*ngh_result)); \
55 #define TRY_GUI_REDIRECT_ACTUAL_DOUBLE(name, obj) \
56 if (auto* const ngh_result = \
57 neuron::python::methods.try_gui_helper(name, static_cast<Object*>(obj))) { \
58 return neuron::python::methods.object_to_double(*ngh_result); \
61 #define TRY_GUI_REDIRECT_ACTUAL_STR(name, obj) \
64 if (neuron::python::methods.gui_helper3_str) { \
66 neuron::python::methods.gui_helper3_str(name, static_cast<Object*>(obj), 0); \
68 return ((const char**) ngh_result); \
73 #define TRY_GUI_REDIRECT_ACTUAL_OBJ(name, obj) \
74 if (auto* const ngh_result = \
75 neuron::python::methods.try_gui_helper(name, static_cast<Object*>(obj))) { \
79 #define TRY_GUI_REDIRECT_DOUBLE_SEND_STRREF(name, obj) \
81 Object** ngh_result; \
82 if (neuron::python::methods.gui_helper3) { \
83 ngh_result = neuron::python::methods.gui_helper3(name, static_cast<Object*>(obj), 1); \
86 hoc_pushx(neuron::python::methods.object_to_double(*ngh_result)); \
Object * nrn_get_gui_redirect_obj()