1 #include <../../nrnconf.h>
4 #include <InterViews/window.h>
38 s_ = std::make_unique<std::string>(cmd);
48 s_ = std::make_unique<std::string>(
"");
72 const char*
ccc =
"PythonObject";
163 HocCommandAction::HocCommandAction(
HocCommand* hc) {
167 HocCommandAction::~HocCommandAction() {
171 void HocCommandAction::execute() {
175 HocCommandTool::HocCommandTool(
HocCommand* hc)
180 HocCommandTool::~HocCommandTool() {
184 bool HocCommandTool::event(
Event& e) {
189 if (e.type() != Event::down && e.type() != Event::up && e.window()->canvas()->any_damage()) {
193 if (e.type() == Event::down) {
198 e.window()->grab_pointer();
201 kd = e.control_is_down() + e.shift_is_down() * 2 + e.meta_is_down() * 4;
205 t.transform(e.pointer_x(), e.pointer_y(), x, y);
207 if (e.type() == Event::up) {
210 e.window()->ungrab_pointer();
213 if (hc_->pyobject()) {
218 Sprintf(
buf,
"%s(%d, %g, %g, %d)", hc_->name(), e.type(), x, y, kd);
219 hc_->execute(
buf,
true);
221 if (e.type() == Event::up) {
std::unique_ptr< std::string > s_
double func_call(int narg, int *perr=NULL)
int exec_strret(char *buf, int size, bool notify=true)
virtual void update(Observable *)
int execute(bool notify=true)
void init(const char *, Object *)
static void help(const char *)
virtual void unref() const
static XYView * current_pick_view()
const Transformer & s2o() const
Symbol * hoc_table_lookup(const char *, Symlist *)
void hoc_audit_command(const char *buf)
double hoc_call_objfunc(Symbol *s, int narg, Object *ob)
void hoc_obj_ref(Object *obj)
char * hoc_object_name(Object *ob)
Symbol * hoc_lookup(const char *)
void hoc_obj_unref(Object *obj)
void nrn_notify_when_void_freed(void *p, Observer *ob)
void nrn_notify_pointer_disconnect(Observer *ob)
int hoc_obj_run(const char *, Object *)
void hoc_execerror(const char *s1, const char *s2)
impl_ptrs methods
Collection of pointers to functions with python-version-specific implementations.
int Sprintf(char(&buf)[N], const char *fmt, Args &&... args)
Redirect sprintf to snprintf if the buffer size can be deduced.
static int hoccommand_exec(Object *ho)
void(* cmdtool)(Object *, int type, double x, double y, int kd)
int(* hoccommand_exec_strret)(Object *, char *, int)
double(* call_func)(Object *, int, int *)
int(* hoccommand_exec)(Object *)