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