NEURON
ochelp.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 #if HAVE_IV // to end of file
3 
4 // nrnbbs has been removed. This is no longer working.
5 
6 #include <InterViews/cursor.h>
7 #include <InterViews/window.h>
8 #include <OS/list.h>
9 #include <OS/string.h>
10 #include <stdio.h>
11 #include <string.h>
12 #include <ctype.h>
13 
14 #include "ivoc.h"
15 
16 static FILE* help_pipe;
17 
18 #if defined(WIN32) && !defined(MINGW)
19 #include "nrnbbs.h"
20 #endif
21 
22 #ifndef WIN32
23 #define WIN32
24 #define UNIX 1
25 #endif
26 
27 extern const char* hoc_current_xopen();
28 
29 void ivoc_help(const char* s) {
30  // printf("online help not currently working\n");
31  return;
32 }
33 
34 static void readmore() {
35 #if !defined(WIN32)
36  char buf[1024];
37  char* cmd = "ls $NEURONHOME/doc/help/*.help";
38  FILE* p = popen(cmd, "r");
39  if (!p) {
40  printf("couldn't do: %s\n", cmd);
41  return;
42  }
43  while (fgets(buf, 1024, p)) {
44  fprintf(help_pipe, "?0 %s", buf);
45  }
46 #endif
47 }
48 
49 #if !defined(WIN32)
50 void Oc::help(const char* s) {
51  printf("online help not currently working\n");
52 }
53 #endif
54 
55 #if defined(WIN32)
56 void Oc::help(const char* s) {}
57 #endif // WIN32
58 
59 void Oc::helpmode(bool b) {
60  helpmode_ = b;
61 }
62 
63 void Oc::helpmode(Window* w) {
64  if (helpmode()) {
65  if (w->cursor() != Oc::help_cursor()) {
66  w->push_cursor();
67  w->cursor(Oc::help_cursor());
68  }
69  } else {
70  if (w->cursor() == Oc::help_cursor()) {
71  w->pop_cursor();
72  }
73  }
74 }
75 
76 static const CursorPattern question_pat = {0x0000,
77  0x0000,
78  0x0000,
79  0x7c00,
80  0xce00,
81  0x0600,
82  0x0600,
83  0x0c00,
84  0x3000,
85  0x6000,
86  0x6000,
87  0x6000,
88  0x0000,
89  0x0000,
90  0x6000,
91  0x6000};
92 
93 static const CursorPattern question_mask = {
94 // 0x0000, 0x0000, 0x7c00, 0xfe00, 0xff00, 0xcf00, 0x0f00, 0x3e00,
95 // 0x7c00, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000
96 #if !defined(UNIX) && defined(WIN32)
97  0xffff,
98  0xffff,
99  0xffff,
100  0xffff,
101  0xffff,
102  0xffff,
103  0xffff,
104  0xffff,
105  0xffff,
106  0xffff,
107  0xffff,
108  0xffff,
109  0xffff,
110  0xffff,
111  0xffff,
112  0xffff
113 #else
114  0xfe00,
115  0xfe00,
116  0xfe00,
117  0xfe00,
118  0xfe00,
119  0xfe00,
120  0xfe00,
121  0xfe00,
122  0xfe00,
123  0xfe00,
124  0xfe00,
125  0xfe00,
126  0xfe00,
127  0xfe00,
128  0xfe00,
129  0xfe00
130 #endif
131 };
132 
133 
135 
137  if (!Oc::help_cursor_) {
138  help_cursor_ = new Cursor(4, 7, question_pat, question_mask);
139  }
140  return help_cursor_;
141 }
142 
143 
144 #endif
#define Window
Definition: _defines.h:330
#define Cursor
Definition: _defines.h:83
static Cursor * help_cursor_
Definition: ivoc.h:86
static void help(const char *)
static Cursor * help_cursor()
static bool helpmode_
Definition: ivoc.h:84
static bool helpmode()
Definition: ivoc.h:70
char * hoc_current_xopen(void)
Definition: fileio.cpp:161
char buf[512]
Definition: init.cpp:13
void ivoc_help(const char *)
Definition: ocnoiv1.cpp:14
printf
Definition: extdef.h:5
size_t p
s
Definition: multisend.cpp:521