1 #include <../../nrnconf.h>
4 #include <InterViews/window.h>
32 if (strcmp(pobj->ctemplate->sym->name,
"PythonObject") != 0) {
80 const char*
ccc =
"PythonObject";
106 err = (*nrnpy_hoccommand_exec)(
po_);
170 HocCommandAction::HocCommandAction(
HocCommand* hc) {
174 HocCommandAction::~HocCommandAction() {
182 HocCommandTool::HocCommandTool(
HocCommand* hc)
187 HocCommandTool::~HocCommandTool() {
191 bool HocCommandTool::event(
Event&
e) {
196 if (
e.type() != Event::down &&
e.type() != Event::up &&
e.window()->canvas()->any_damage()) {
200 if (
e.type() == Event::down) {
205 e.window()->grab_pointer();
208 kd =
e.control_is_down() +
e.shift_is_down() * 2 +
e.meta_is_down() * 4;
212 t.transform(
e.pointer_x(),
e.pointer_y(), x, y);
214 if (
e.type() == Event::up) {
217 e.window()->ungrab_pointer();
220 if (hc_->pyobject()) {
221 (*nrnpy_cmdtool)(hc_->pyobject(),
e.type(), x, y, kd);
225 sprintf(
buf,
"%s(%d, %g, %g, %d)", hc_->name(),
e.type(), x, y, kd);
226 hc_->execute(
buf,
true);
228 if (
e.type() == Event::up) {
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
const char * string() const
static XYView * current_pick_view()
const Transformer & s2o() const
Symbol * hoc_table_lookup(const char *, Symlist *)
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
void hoc_execerror(const char *, const char *)
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(* nrnpy_cmdtool)(Object *, int type, double x, double y, int kd)
double(* nrnpy_func_call)(Object *, int, int *)
int(* nrnpy_hoccommand_exec_strret)(Object *, char *, int)
int(* nrnpy_hoccommand_exec)(Object *)