NEURON
oclist.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 #if defined(__GO32__)
3 #define HAVE_IV 0
4 #endif
5 
6 #include <stdio.h>
7 #include <OS/string.h>
8 #include "classreg.h"
9 #include "oclist.h"
10 #include "oc2iv.h"
11 #include "hoclist.h"
12 #include "ocobserv.h"
13 #include "oc_ansi.h"
14 #if HAVE_IV
15 #include <InterViews/adjust.h>
16 #include <InterViews/hit.h>
17 #include "ocglyph.h"
18 #if !MAC
19 #include "checkpnt.h"
20 #endif
21 #include "apwindow.h"
22 #include "ocbrowsr.h"
23 #include "objcmd.h"
24 #endif
25 
26 #include "gui-redirect.h"
27 
28 #include "parse.hpp"
29 extern Object** hoc_temp_objptr(Object*);
32 
33 
34 extern Object** (*nrnpy_gui_helper_)(const char* name, Object* obj);
35 extern double (*nrnpy_object_to_double_)(Object*);
36 
37 extern int hoc_return_type_code;
38 
40 
41 #if HAVE_IV
42 /*static*/ class OcListBrowser: public OcBrowser {
43  public:
44  OcListBrowser(OcList*, const char* = NULL, Object* pystract = NULL);
45  OcListBrowser(OcList*, char**, const char*);
46  virtual ~OcListBrowser();
47  virtual void drag(const Event& e);
48  virtual void select(GlyphIndex);
49  virtual void dragselect(GlyphIndex);
50  virtual void reload();
51  virtual void reload(GlyphIndex);
52  virtual void set_select_action(const char*, bool on_rel = false, Object* pyact = NULL);
53  virtual void set_accept_action(const char*, Object* pyact = NULL);
54  virtual void accept();
55  virtual void release(const Event&);
56  virtual InputHandler* focus_in();
57  void load_item(GlyphIndex i);
58  void ocglyph(Window* w);
59  void ocglyph_unmap();
60 
61  private:
62  void change_name(GlyphIndex);
63 
64  private:
65  OcList* ocl_;
66  HocCommand* select_action_;
67  HocCommand* accept_action_;
68  HocCommand* label_action_;
69  HocCommand* label_pystract_;
70  bool on_release_;
71  char** plabel_;
72  CopyString* items_;
73  OcGlyph* ocg_;
74  bool ignore_;
75 };
76 #else
77 class OcListBrowser {};
78 #endif
79 
81 static void chk_list(Object* o) {
82  if (!o || o->ctemplate != list_class_sym_->u.ctemplate) {
83  check_obj_type(o, "List");
84  }
85 }
86 
87 static double l_append(void* v) {
88  OcList* o = (OcList*) v;
89  Object* ob = *hoc_objgetarg(1);
90  o->append(ob);
91  return o->count();
92 }
94  if (!ob)
95  return;
96  oref(ob);
97  oli_.push_back(ob);
98 #if HAVE_IV
99  if (b_) {
100  b_->load_item(count() - 1);
101  b_->select_and_adjust(count() - 1);
102  }
103 #endif
104 }
105 
106 void OcList::oref(Object* ob) {
107  if (!ct_) {
108  ++ob->refcount;
109  }
110 }
111 
113  if (!ct_) {
114  hoc_dec_refcount(&ob);
115  }
116 }
117 
120  Object* ob = co->object();
121  // printf("notify %d %s\n", co->message(), hoc_object_name(ob));
122  switch (co->message()) {
124  long i = index(ob);
125  if (i >= 0) {
126  remove(i);
127  }
128  } break;
130  append(ob);
131  break;
132  default:
133 #if HAVE_IV
134  if (b_) {
135  long i = index(ob);
136  if (i >= 0) {
137  b_->reload(i);
138  }
139  }
140 #endif
141  break;
142  }
143 }
144 
145 static double l_prepend(void* v) {
146  OcList* o = (OcList*) v;
147  Object* ob = *hoc_objgetarg(1);
148  o->prepend(ob);
149  return o->count();
150 }
152  if (!ob)
153  return;
154  oref(ob);
155  oli_.insert(oli_.begin(), ob);
156 #if HAVE_IV
157  if (b_) {
158  b_->reload();
159  }
160 #endif
161 }
162 
163 static double l_insert(void* v) {
164  OcList* o = (OcList*) v;
165  long i = long(chkarg(1, 0, o->count()));
166  Object* ob = *hoc_objgetarg(2);
167  o->insert(i, ob);
168  return o->count();
169 }
170 void OcList::insert(long i, Object* ob) {
171  if (!ob)
172  return;
173  oref(ob);
174  oli_.insert(oli_.begin() + i, ob);
175 #if HAVE_IV
176  if (b_) {
177  b_->reload();
178  }
179 #endif
180 }
181 
182 static double l_count(void* v) {
183  OcList* o = (OcList*) v;
185  return o->count();
186 }
188  return oli_.size();
189 }
190 
191 static double l_remove(void* v) {
192  OcList* o = (OcList*) v;
193  long i = long(chkarg(1, 0, o->count() - 1));
194  o->remove(i);
195  return o->count();
196 }
197 void OcList::remove(long i) {
198  Object* ob = oli_[i];
199  oli_.erase(oli_.begin() + i);
200 #if HAVE_IV
201  if (b_) {
202  b_->select(-1);
203  b_->remove_selectable(i);
204  b_->remove(i);
205  b_->refresh();
206  }
207 #endif
208  ounref(ob);
209 }
210 
211 static double l_index(void* v) {
212  OcList* o = (OcList*) v;
213  Object* ob = *hoc_objgetarg(1);
214  hoc_return_type_code = 1; // integer
215  return o->index(ob);
216 }
218  for (long i = 0; i < oli_.size(); ++i) {
219  if (oli_[i] == ob) {
220  return i;
221  }
222  }
223  return -1;
224 }
225 
226 static Object** l_object(void* v) {
227  OcList* o = (OcList*) v;
228  long i = long(chkarg(1, 0, o->count() - 1));
229  return hoc_temp_objptr(o->object(i));
230 }
232  return oli_[i];
233 }
234 
235 static double l_remove_all(void* v) {
236  OcList* o = (OcList*) v;
237  o->remove_all();
238  return o->count();
239 }
241  for (auto& ob: oli_) {
242  ounref(ob);
243  }
244  oli_.clear();
245 #if HAVE_IV
246  if (b_) {
247  b_->select(-1);
248  b_->reload();
249  }
250 #endif
251 }
252 
253 static double l_browser(void* v) {
255 #if HAVE_IV
256  IFGUI
257  char* s = 0;
258  char* i = 0;
259  char** p = 0;
260  OcList* o = (OcList*) v;
261  if (ifarg(1)) {
262  s = gargstr(1);
263  }
264  if (ifarg(3)) {
265  i = gargstr(3);
266  p = hoc_pgargstr(2);
267  o->create_browser(s, p, i);
268  return 1.;
269  }
270  if (ifarg(2)) {
271  if (hoc_is_object_arg(2)) {
272  o->create_browser(s, NULL, *hoc_objgetarg(2));
273  return 1.;
274  }
275  i = gargstr(2);
276  }
277  o->create_browser(s, i);
278  ENDGUI
279 #endif
280  return 1.;
281 }
282 
283 static double l_select(void* v) {
285 #if HAVE_IV
286  IFGUI
287  OcListBrowser* b = ((OcList*) v)->browser();
288  long i = (long) (*getarg(1));
289  if (b) {
290  b->select_and_adjust(i);
291  }
292  ENDGUI
293 #endif
294  return 1.;
295 }
296 static double l_select_action(void* v) {
298 #if HAVE_IV
299  IFGUI
300  OcListBrowser* b = ((OcList*) v)->browser();
301  if (b) {
302  bool on_rel = false;
303  if (ifarg(2)) {
304  on_rel = (bool) chkarg(2, 0, 1);
305  }
306  if (hoc_is_object_arg(1)) {
307  b->set_select_action(NULL, on_rel, *hoc_objgetarg(1));
308  } else {
309  b->set_select_action(gargstr(1), on_rel);
310  }
311  }
312  ENDGUI
313 #endif
314  return 1.;
315 }
316 static double l_selected(void* v) {
317  hoc_return_type_code = 1; // integer
319 #if HAVE_IV
320  long i = -1;
321  IFGUI
322  OcListBrowser* b = ((OcList*) v)->browser();
323  if (b) {
324  i = b->selected();
325  } else {
326  i = -1;
327  }
328  ENDGUI
329  return (double) i;
330 #else
331  return 0.;
332 #endif
333 }
334 static double l_accept_action(void* v) {
336 #if HAVE_IV
337  IFGUI
338  OcListBrowser* b = ((OcList*) v)->browser();
339  if (b) {
340  if (hoc_is_object_arg(1)) {
341  b->set_accept_action(NULL, *hoc_objgetarg(1));
342  } else {
343  b->set_accept_action(gargstr(1));
344  }
345  }
346  ENDGUI
347 #endif
348  return 1.;
349 }
350 
351 static double l_scroll_pos(void* v) {
353 #if HAVE_IV
354  IFGUI
355  OcList* o = (OcList*) v;
356  OcListBrowser* b = o->browser();
357  if (b) {
358  Adjustable* a = b->adjustable();
359  if (ifarg(1)) {
360  Coord c = (Coord) chkarg(1, 0, 1e9);
361  c = (double) o->count() - a->cur_length(Dimension_Y) - c;
362  a->scroll_to(Dimension_Y, c);
363  }
364  // printf("%g %g %g %g\n", (double)o->count(), a->cur_lower(Dimension_Y),
365  // a->cur_upper(Dimension_Y), a->cur_length(Dimension_Y));
366  return (double) (o->count() - 1) - (double) a->cur_upper(Dimension_Y);
367  }
368  ENDGUI
369 #endif
370  return -1.;
371 }
372 
373 
374 static Member_func l_members[] = {{"append", l_append},
375  {"prepend", l_prepend},
376  {"insrt", l_insert},
377  {"remove", l_remove},
378  {"remove_all", l_remove_all},
379  {"index", l_index},
380  {"count", l_count},
381  {"browser", l_browser},
382  {"selected", l_selected},
383  {"select", l_select},
384  {"select_action", l_select_action},
385  {"accept_action", l_accept_action},
386  {"scroll_pos", l_scroll_pos},
387  {nullptr, nullptr}};
388 
390  {"o", l_object},
391  {nullptr, nullptr}};
392 
393 static void* l_cons(Object*) {
394  OcList* o;
395  if (ifarg(1)) {
396  if (hoc_is_str_arg(1)) {
397  o = new OcList(gargstr(1));
398  } else {
399  o = new OcList(long(chkarg(1, 0, 1e8)));
400  }
401  } else {
402  o = new OcList();
403  }
404  o->ref();
405  return (void*) o;
406 }
407 
408 int ivoc_list_count(Object* olist) {
409  chk_list(olist);
410  OcList* list = (OcList*) olist->u.this_pointer;
411  return list->count();
412 }
413 
414 Object* ivoc_list_item(Object* olist, int i) {
415  chk_list(olist);
416  OcList* list = (OcList*) olist->u.this_pointer;
417  if (i >= 0 && i < list->count()) {
418  return list->object(i);
419  } else {
420  return 0;
421  }
422 }
423 
425  b_ = nullptr;
426  ct_ = nullptr;
427 }
428 
429 OcList::OcList(const char* name) {
430  Symbol* s = hoc_lookup(name);
431  if (!s) {
433  }
434  if (!s || s->type != TEMPLATE) {
435  hoc_execerror(name, "is not a template name");
436  }
437  ct_ = s->u.ctemplate;
438  int cnt = ct_->count;
439  cnt = (cnt) ? cnt : 5;
440  b_ = nullptr;
441  hoc_Item* q;
442  ITERATE(q, ct_->olist) {
443  append(OBJ(q));
444  }
446 }
447 
448 static void l_destruct(void* v) {
449  OcList* o = (OcList*) v;
450  o->unref();
451 }
453  if (ct_) {
455  }
456 #if HAVE_IV
457  if (b_) {
458  b_->ocglyph_unmap();
459  }
461 #endif
462  b_ = NULL;
463  remove_all();
464 }
465 
466 static int l_chkpt(void** vp) {
467 #if HAVE_IV && !MAC
468  OcList* o;
470  if (chk.out()) {
471  long cnt;
472  o = (OcList*) (*vp);
473  cnt = o->count();
474  CKPT(chk, cnt);
475  for (long i = 0; i < cnt; ++i) {
476  Object* item = o->object(i);
477  CKPT(chk, item);
478  }
479  } else {
480  long cnt;
481  CKPT(chk, cnt);
482  o = new OcList(cnt);
483  o->ref();
484  for (long i = 0; i < cnt; ++i) {
485  Object* item;
486  CKPT(chk, item);
487  o->append(item);
488  }
489  *vp = (void*) o;
490  }
491 #endif
492  return 1;
493 }
494 
495 void OcList_reg() {
496  // printf("Oclist_reg\n");
498  list_class_sym_ = hoc_lookup("List");
499 }
500 
501 extern bool hoc_objectpath_impl(Object* ob, Object* oblook, char* path, int depth);
502 extern void hoc_path_prepend(char*, const char*, const char*);
503 int ivoc_list_look(Object* ob, Object* oblook, char* path, int) {
504  if (oblook->ctemplate->constructor == l_cons) {
505  OcList* o = (OcList*) oblook->u.this_pointer;
506  long i, cnt = o->count();
507  Object* obj;
508  for (i = 0; i < cnt; ++i) {
509  obj = o->object(i);
510 #if 0
511  if (obj && obj != oblook &&
512  hoc_objectpath_impl(ob, obj, path, depth) ) {
513 #else
514  if (obj == ob) {
515 #endif
516  char buf[200];
517  sprintf(buf, "object(%ld)", i);
518  hoc_path_prepend(path, buf, "");
519  return 1;
520  }
521  }
522 }
523 return 0;
524 }
525 
526 void OcList::create_browser(const char* name, const char* items, Object* pystract) {
527 #if HAVE_IV
528  if (b_) {
529  b_->ocglyph_unmap();
530  }
532  b_ = new OcListBrowser(this, items, pystract);
533  b_->ref();
534  PrintableWindow* w = new StandardWindow(b_->standard_glyph());
535  b_->ocglyph(w);
536  if (name) {
537  w->name(name);
538  }
539  w->map();
540 #endif
541 }
542 
543 void OcList::create_browser(const char* name, char** pstr, const char* action) {
544 #if HAVE_IV
545  if (b_) {
546  b_->ocglyph_unmap();
547  }
549  b_ = new OcListBrowser(this, pstr, action);
550  b_->ref();
551  PrintableWindow* w = new StandardWindow(b_->standard_glyph());
552  b_->ocglyph(w);
553  if (name) {
554  w->name(name);
555  }
556  w->map();
557 #endif
558 }
559 
561  return b_;
562 }
563 
564 //-----------------------------------------
565 #if HAVE_IV
566 
567 OcListBrowser::OcListBrowser(OcList* ocl, const char* items, Object* pystract)
568  : OcBrowser() {
569  ocl_ = ocl; // not reffed because this is reffed by ocl
570  ocg_ = NULL; // do not ref
571  select_action_ = NULL;
572  accept_action_ = NULL;
573  plabel_ = NULL;
574  label_action_ = NULL;
575  label_pystract_ = NULL;
576  if (pystract) {
577  label_pystract_ = new HocCommand(pystract);
578  }
579  on_release_ = false;
580  ignore_ = false;
581  if (items) {
582  items_ = new CopyString(items);
583  } else {
584  items_ = NULL;
585  }
586  reload();
587 }
588 
589 OcListBrowser::OcListBrowser(OcList* ocl, char** pstr, const char* action)
590  : OcBrowser() {
591  ocl_ = ocl;
592  ocg_ = NULL;
593  select_action_ = NULL;
594  accept_action_ = NULL;
595  on_release_ = false;
596  ignore_ = false;
597  plabel_ = pstr;
598  items_ = NULL;
599  label_action_ = new HocCommand(action);
600  label_pystract_ = NULL;
601  reload();
602 }
603 
604 OcListBrowser::~OcListBrowser() {
605  if (select_action_) {
606  delete select_action_;
607  }
608  if (accept_action_) {
609  delete accept_action_;
610  }
611  if (label_action_) {
612  delete label_action_;
613  }
614  if (label_pystract_) {
615  delete label_pystract_;
616  }
617  if (items_) {
618  delete items_;
619  }
620 }
621 
622 void OcListBrowser::release(const Event& e) {
624  if (select_action_ && on_release_) {
625  GlyphIndex i = selected();
627  hoc_ac_ = double(i);
628  select_action_->execute();
629  }
630 }
631 
632 InputHandler* OcListBrowser::focus_in() {
633  // works around the problem that the first time a list is used
634  // the InputHandler calls focus in on the press, which then
635  // selects item 0. Perhaps that is necessary for some kind of initialization
636  // but for us with select actions it causes problems. So we temporarily
637  // turn off the select actions during focus in handling.
638  ignore_ = true;
639  InputHandler* ih = OcBrowser::focus_in();
640  ignore_ = false;
641  return ih;
642 }
643 
644 void OcListBrowser::select(GlyphIndex i) {
645  OcBrowser::select(i);
646  // printf("select %d ignore=%d\n", i, ignore_);
647  if (select_action_ && !on_release_ && !ignore_) {
649  hoc_ac_ = (double) i;
650  select_action_->execute();
651  }
652 }
653 void OcListBrowser::dragselect(GlyphIndex i) {
654  GlyphIndex old = selected();
655  OcBrowser::select(i);
656  // printf("select %d old=%d ignore=%d\n", i, old, ignore_);
657  if (old != i && select_action_ && !on_release_ && !ignore_) {
659  hoc_ac_ = (double) i;
660  select_action_->execute();
661  }
662 }
663 // mostly copied from src/InterViews/browser.cpp
664 void OcListBrowser::drag(const Event& e) {
665  if (inside(e)) {
666  Hit h(&e);
667  repick(0, h);
668  if (h.any()) {
669  dragselect(h.index(0));
670  return;
671  }
672  }
673  dragselect(-1);
674 }
675 
676 void OcListBrowser::reload() {
677  GlyphIndex i, cnt;
678  cnt = count();
679  for (i = 0; i < cnt; ++i) {
680  remove_selectable(0);
681  remove(0);
682  }
683  cnt = ocl_->count();
684  for (i = 0; i < cnt; ++i) {
685  load_item(i);
686  }
687  refresh();
688 }
689 void OcListBrowser::reload(GlyphIndex i) {
690  change_name(i);
691 }
692 
693 void OcListBrowser::load_item(GlyphIndex i) {
694  append_item("");
695  change_name(i);
696 }
697 
698 void OcListBrowser::change_name(GlyphIndex i) {
699  if (label_pystract_) {
700  hoc_ac_ = i;
701  char buf[256];
702  if (label_pystract_->exec_strret(buf, 256, bool(false))) {
703  change_item(i, buf);
704  } else {
705  change_item(i, "label error");
706  }
707  } else if (plabel_) {
708  hoc_ac_ = i;
709  if (label_action_->execute(bool(false)) == 0) {
710  change_item(i, *plabel_);
711  } else {
712  change_item(i, "label error");
713  }
714  } else if (items_) {
715  char* pstr = Oc2IV::object_str(items_->string(), ocl_->object(i));
716  if (pstr) {
717  change_item(i, pstr);
718  } else {
719  change_item(i, hoc_object_name(ocl_->object(i)));
720  }
721  } else {
722  change_item(i, hoc_object_name(ocl_->object(i)));
723  }
724 }
725 
726 void OcListBrowser::set_select_action(const char* s, bool on_rel, Object* pyact) {
727  if (select_action_) {
728  delete select_action_;
729  }
730  if (pyact) {
731  select_action_ = new HocCommand(pyact);
732  } else {
733  select_action_ = new HocCommand(s);
734  }
735  on_release_ = on_rel;
736 }
737 void OcListBrowser::set_accept_action(const char* s, Object* pyact) {
738  if (accept_action_) {
739  delete accept_action_;
740  }
741  if (pyact) {
742  accept_action_ = new HocCommand(pyact);
743  } else {
744  accept_action_ = new HocCommand(s);
745  }
746 }
747 void OcListBrowser::accept() {
748  if (accept_action_) {
749  long i = selected();
750  if (i < 0) {
751  return;
752  }
754  hoc_ac_ = (double) i;
755  accept_action_->execute();
756  }
757 }
758 void OcListBrowser::ocglyph(Window* w) {
759  ocg_ = (OcGlyph*) (w->glyph());
760  Resource::ref(ocg_);
761 }
762 
763 void OcListBrowser::ocglyph_unmap() {
764  OcGlyph* o = ocg_;
765  ocg_ = NULL;
766  if (o) {
767  if (o->has_window()) {
768  delete o->window();
769  }
771  }
772 }
773 
774 #endif
#define InputHandler
Definition: _defines.h:151
#define Window
Definition: _defines.h:333
#define Coord
Definition: _defines.h:19
#define Adjustable
Definition: _defines.h:29
#define Hit
Definition: _defines.h:147
#define GlyphIndex
Definition: _defines.h:23
#define Event
Definition: _defines.h:107
#define CopyString
Definition: _defines.h:2
#define CKPT(arg1, arg2)
Definition: checkpnt.h:4
static Checkpoint * instance()
static void Detach(cTemplate *, Observer *)
Definition: ocobserv.cpp:58
static void Attach(cTemplate *, Observer *)
Definition: ocobserv.cpp:50
int message()
Definition: ocobserv.h:55
Object * object()
Definition: ocobserv.h:52
virtual const char * name() const
static char * object_str(const char *symname, Object *=NULL)
Definition: oc2iv.cpp:14
Definition: oclist.h:12
OcListBrowser * b_
Definition: oclist.h:41
void remove_all()
Definition: oclist.cpp:240
void create_browser(const char *name, const char *items=NULL, Object *pystract=NULL)
Definition: oclist.cpp:526
virtual void update(Observable *)
Definition: oclist.cpp:118
cTemplate * ct_
Definition: oclist.h:42
OcListBrowser * browser()
Definition: oclist.cpp:560
long count()
Definition: oclist.cpp:187
void prepend(Object *)
Definition: oclist.cpp:151
void ounref(Object *)
Definition: oclist.cpp:112
void append(Object *)
Definition: oclist.cpp:93
std::vector< Object * > oli_
Definition: oclist.h:40
long index(Object *)
Definition: oclist.cpp:217
void insert(long, Object *)
Definition: oclist.cpp:170
void oref(Object *)
Definition: oclist.cpp:106
void remove(long)
Definition: oclist.cpp:197
OcList(long=5)
Definition: oclist.cpp:424
virtual ~OcList()
Definition: oclist.cpp:452
Object * object(long)
Definition: oclist.cpp:231
virtual void map()
virtual void ref() const
Definition: resource.cpp:47
virtual void unref() const
Definition: resource.cpp:52
Symbol * hoc_table_lookup(const char *, Symlist *)
Definition: symbol.cpp:61
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)
double chkarg(int, double low, double high)
Definition: code2.cpp:638
#define c
#define chk(i)
Definition: fmenu.cpp:193
void hoc_execerror(const char *, const char *)
Definition: hoc.cpp:754
@ Dimension_Y
Definition: geometry.h:43
char buf[512]
Definition: init.cpp:13
int hoc_is_object_arg(int narg)
Definition: code.cpp:756
Object * ivoc_list_item(Object *olist, int i)
Definition: oclist.cpp:414
int ivoc_list_look(Object *ob, Object *oblook, char *path, int)
Definition: oclist.cpp:503
int ivoc_list_count(Object *)
Definition: oclist.cpp:408
int hoc_is_str_arg(int narg)
Definition: code.cpp:752
double hoc_ac_
Definition: hoc_init.cpp:397
char * hoc_object_name(Object *ob)
Definition: hoc_oop.cpp:72
void hoc_dec_refcount(Object **pobj)
Definition: hoc_oop.cpp:1816
Symbol * hoc_lookup(const char *)
char ** hoc_pgargstr(int narg)
Definition: code.cpp:1599
#define TRY_GUI_REDIRECT_METHOD_ACTUAL_DOUBLE(name, sym, v)
Definition: gui-redirect.h:23
#define IFGUI
Definition: hocdec.h:372
#define getarg
Definition: hocdec.h:15
#define gargstr
Definition: hocdec.h:14
#define ENDGUI
Definition: hocdec.h:373
#define OBJ(q)
Definition: hoclist.h:67
Object ** hoc_objgetarg(int)
Definition: code.cpp:1587
int ifarg(int)
Definition: code.cpp:1581
#define v
Definition: md1redef.h:4
#define i
Definition: md1redef.h:12
#define ITERATE(itm, lst)
Definition: model.h:25
char * name
Definition: init.cpp:16
static double inside(void *)
Definition: mymath.cpp:21
int const size_t const size_t n
Definition: nrngsl.h:11
size_t q
if(status)
size_t p
void class2oc(const char *, void *(*cons)(Object *), void(*destruct)(void *), Member_func *, int(*checkpoint)(void **), Member_ret_obj_func *, Member_ret_str_func *)
Definition: hoc_oop.cpp:1560
HOC interpreter function declarations (included by hocdec.h)
static double remove(void *v)
Definition: ocdeck.cpp:207
virtual void drag(const Event &e)
Definition: ocinput.h:32
virtual void release(const Event &e)
Definition: ocinput.h:35
static double l_append(void *v)
Definition: oclist.cpp:87
static double l_accept_action(void *v)
Definition: oclist.cpp:334
static double l_remove_all(void *v)
Definition: oclist.cpp:235
static double l_count(void *v)
Definition: oclist.cpp:182
static Member_ret_obj_func l_retobj_members[]
Definition: oclist.cpp:389
bool hoc_objectpath_impl(Object *ob, Object *oblook, char *path, int depth)
Symlist * hoc_top_level_symlist
Definition: symdir.cpp:23
static double l_insert(void *v)
Definition: oclist.cpp:163
double(* nrnpy_object_to_double_)(Object *)
Definition: xmenu.cpp:14
static void * l_cons(Object *)
Definition: oclist.cpp:393
static double l_select(void *v)
Definition: oclist.cpp:283
static double l_selected(void *v)
Definition: oclist.cpp:316
static double l_prepend(void *v)
Definition: oclist.cpp:145
void handle_old_focus()
Object ** hoc_temp_objptr(Object *)
Definition: code.cpp:216
static Symbol * list_class_sym_
Definition: oclist.cpp:80
int hoc_return_type_code
Definition: code.cpp:42
static double l_index(void *v)
Definition: oclist.cpp:211
static double l_select_action(void *v)
Definition: oclist.cpp:296
void hoc_path_prepend(char *, const char *, const char *)
static void chk_list(Object *o)
Definition: oclist.cpp:81
static void l_destruct(void *v)
Definition: oclist.cpp:448
static double l_remove(void *v)
Definition: oclist.cpp:191
static Object ** l_object(void *v)
Definition: oclist.cpp:226
static int l_chkpt(void **vp)
Definition: oclist.cpp:466
static double l_scroll_pos(void *v)
Definition: oclist.cpp:351
void OcList_reg()
Definition: oclist.cpp:495
static double l_browser(void *v)
Definition: oclist.cpp:253
static Member_func l_members[]
Definition: oclist.cpp:374
#define e
Definition: passive0.cpp:22
check_obj_type(o, "SectionList")
o
Definition: seclist.cpp:175
#define cnt
Definition: spt2queue.cpp:19
#define NULL
Definition: sptree.h:16
Definition: hocdec.h:227
void * this_pointer
Definition: hocdec.h:232
int refcount
Definition: hocdec.h:228
union Object::@39 u
Definition: model.h:57
short type
Definition: model.h:58
union Symbol::@18 u
HocStruct cTemplate * ctemplate
Definition: hocdec.h:152
Definition: hocdec.h:84
hoc_List * olist
Definition: hocdec.h:204
int count
Definition: hocdec.h:203