ruby_doc_updates-20110520_1648-curses_vbatts.patch

Vincent Batts, 05/21/2011 05:55 AM

Download (21.3 KB)

View differences:

ext/curses/curses.c
149 149
 */
150 150
#define curses_stdscr curses_init_screen
151 151

  
152
/*
153
 * Document-method: Curses.close_screen
154
 *
155
 * A program should always call Curses.close_screen before exiting or
156
 * escaping from curses mode temporarily. This routine
157
 * restores tty modes, moves the cursor to the lower
158
 * left-hand corner of the screen and resets the terminal
159
 * into the proper non-visual mode.
160
 *
161
 * Calling Curses.refresh or Curses.doupdate after a temporary
162
 * escape causes the program to resume visual mode.
163
 *
164
 */
152 165
static VALUE
153 166
curses_close_screen(void)
154 167
{
......
161 174
    return Qnil;
162 175
}
163 176

  
177
/*
178
 * This is no runtime method,
179
 * but a function called before the proc ends
180
 *
181
 * Similar to Curses.close_screen, except that it also
182
 * garbage collects/unregisters the Curses.stdscr
183
 */
164 184
static void
165 185
curses_finalize(VALUE dummy)
166 186
{
......
175 195
}
176 196

  
177 197
#ifdef HAVE_ISENDWIN
198
/*
199
 * Document-method: Curses.closed?
200
 *
201
 * Returns +true+ if the window/screen has been closed,
202
 * without any subsequent Curses.refresh calls,
203
 * returns +false+ otherwise.
204
 */
178 205
static VALUE
179 206
curses_closed(void)
180 207
{
......
188 215
#define curses_closed rb_f_notimplement
189 216
#endif
190 217

  
218
/*
219
 * Document-method: Curses.clear
220
 *
221
 * Clears every position on the screen completely,
222
 * so that a subsequent call by Curses.refresh for the screen/window 
223
 * will be repainted from scratch.
224
 */
191 225
static VALUE
192 226
curses_clear(VALUE obj)
193 227
{
......
196 230
    return Qnil;
197 231
}
198 232

  
233
/*  
234
 * Document-method: Curses.clrtoeol
235
 *
236
 * Clears to the end of line, that the cursor is currently on.
237
 */
199 238
static VALUE
200 239
curses_clrtoeol(void)
201 240
{
......
204 243
    return Qnil;
205 244
}
206 245

  
246
/*  
247
 * Document-method: Curses.refresh
248
 *
249
 * Refreshes the windows and lines.
250
 *
251
 */
207 252
static VALUE
208 253
curses_refresh(VALUE obj)
209 254
{
......
212 257
    return Qnil;
213 258
}
214 259

  
260
/*  
261
 * Document-method: Curses.doupdate
262
 *
263
 * Refreshes the windows and lines.
264
 *
265
 * Curses.doupdate allows multiple updates with
266
 * more efficiency than Curses.refresh alone.
267
 */
215 268
static VALUE
216 269
curses_doupdate(VALUE obj)
217 270
{
......
224 277
    return Qnil;
225 278
}
226 279

  
280
/*
281
 * Document-method: Curses.echo
282
 *
283
 * Enables characters typed by the user
284
 * to be echoed by Curses.getch as they are typed.
285
 */
227 286
static VALUE
228 287
curses_echo(VALUE obj)
229 288
{
......
232 291
    return Qnil;
233 292
}
234 293

  
294
/*
295
 * Document-method: Curses.noecho
296
 *
297
 * Disables characters typed by the user
298
 * to be echoed by Curses.getch as they are typed.
299
 */
235 300
static VALUE
236 301
curses_noecho(VALUE obj)
237 302
{
......
240 305
    return Qnil;
241 306
}
242 307

  
308
/*
309
 * Document-method: Curses.raw
310
 *
311
 * Put the terminal into raw mode.
312
 *
313
 * Raw mode is similar to Curses.cbreak mode, in that characters typed
314
 * are immediately passed through to the user program.
315
 *
316
 * The differences are that in raw mode, the interrupt, quit,
317
 * suspend, and flow control characters are all passed through
318
 * uninterpreted, instead of generating a signal. The behavior
319
 * of the BREAK key depends on other bits in the tty driver
320
 * that are not set by curses.
321
 */
243 322
static VALUE
244 323
curses_raw(VALUE obj)
245 324
{
......
248 327
    return Qnil;
249 328
}
250 329

  
330
/*
331
 * Document-method: Curses.noraw
332
 *
333
 * Put the terminal out of raw mode.
334
 *
335
 * see Curses.raw for more detail
336
 */
251 337
static VALUE
252 338
curses_noraw(VALUE obj)
253 339
{
......
256 342
    return Qnil;
257 343
}
258 344

  
345
/*
346
 * Document-method: Curses.cbreak
347
 *
348
 * Put the terminal into cbreak mode.
349
 *
350
 * Normally, the tty driver buffers typed characters until
351
 * a newline or carriage return is typed. The Curses.cbreak
352
 * routine disables line buffering and erase/kill
353
 * character-processing (interrupt and flow control characters
354
 * are unaffected), making characters typed by the user
355
 * immediately available to the program.
356
 *
357
 * The Curses.nocbreak routine returns the terminal to normal (cooked) mode.
358
 *
359
 * Initially the terminal may or may not be in cbreak mode,
360
 * as the mode is inherited; therefore, a program should
361
 * call Curses.cbreak or Curses.nocbreak explicitly.
362
 * Most interactive programs using curses set the cbreak mode.
363
 * Note that Curses.cbreak overrides Curses.raw.
364
 * 
365
 * see also Curses.raw
366
 */
259 367
static VALUE
260 368
curses_cbreak(VALUE obj)
261 369
{
......
264 372
    return Qnil;
265 373
}
266 374

  
375
/*
376
 * Document-method: Curses.nocbreak
377
 *
378
 * Put the terminal into normal mode (out of cbreak mode).
379
 *
380
 * See Curses.cbreak for more detail.
381
 */
267 382
static VALUE
268 383
curses_nocbreak(VALUE obj)
269 384
{
......
272 387
    return Qnil;
273 388
}
274 389

  
390
/*
391
 * Document-method: Curses.nl
392
 *
393
 * Enable the underlying display device to translate
394
 * the return key into newline on input, and whether it
395
 * translates newline into return and line-feed on output
396
 * (in either case, the call Curses.addch('\n') does the
397
 * equivalent of return and line feed on the virtual screen).
398
 *
399
 * Initially, these translations do occur. If you disable
400
 * them using Curses.nonl, curses will be able to make better use
401
 * of the line-feed capability, resulting in faster cursor
402
 * motion. Also, curses will then be able to detect the return key.
403
 */
275 404
static VALUE
276 405
curses_nl(VALUE obj)
277 406
{
......
280 409
    return Qnil;
281 410
}
282 411

  
412
/*
413
 * Document-method: Curses.nl
414
 *
415
 * Disable the underlying display device to translate
416
 * the return key into newline on input
417
 *
418
 * See Curses.nl for more detail
419
 */
283 420
static VALUE
284 421
curses_nonl(VALUE obj)
285 422
{
......
288 425
    return Qnil;
289 426
}
290 427

  
428
/*
429
 * Document-method: Curses.beep
430
 *
431
 * Sounds an audible alarm on the terminal, if possible;
432
 * otherwise it flashes the screen (visual bell).
433
 * 
434
 * see also Curses.flash
435
 */
291 436
static VALUE
292 437
curses_beep(VALUE obj)
293 438
{
......
298 443
    return Qnil;
299 444
}
300 445

  
446
/*
447
 * Document-method: Curses.flash
448
 *
449
 * Flashs the screen, for visual alarm on the terminal, if possible;
450
 * otherwise it sounds the alert.
451
 * 
452
 * see also Curses.beep
453
 */
301 454
static VALUE
302 455
curses_flash(VALUE obj)
303 456
{
......
351 504
#define curses_ungetch rb_f_notimplement
352 505
#endif
353 506

  
507
/*  
508
 * Document-method: Curses.setpos
509
 * call-seq: setpos(y, x)
510
 *
511
 * A setter for the position of the cursor,
512
 * using coordinates +x+ and +y+
513
 *
514
 */
354 515
static VALUE
355 516
curses_setpos(VALUE obj, VALUE y, VALUE x)
356 517
{
......
359 520
    return Qnil;
360 521
}
361 522

  
523
/* 
524
 * Document-method: Curses.standout
525
 *
526
 * Enables the best highlighting mode of the terminal.
527
 *
528
 * This is equivalent to Curses:Window.attron(A_STANDOUT)
529
 *
530
 * see also Curses::Window.attrset additional information
531
 */
362 532
static VALUE
363 533
curses_standout(VALUE obj)
364 534
{
......
367 537
    return Qnil;
368 538
}
369 539

  
540
/* 
541
 * Document-method: Curses.standend
542
 *
543
 * Enables the Normal display (no highlight)
544
 *
545
 * This is equivalent to Curses.attron(A_NORMAL)
546
 *
547
 * see also Curses::Window.attrset for additional information.
548
 */
370 549
static VALUE
371 550
curses_standend(VALUE obj)
372 551
{
......
375 554
    return Qnil;
376 555
}
377 556

  
557
/* 
558
 * Document-method: Curses.inch
559
 *
560
 * Returns the character at the current position.
561
 */
378 562
static VALUE
379 563
curses_inch(VALUE obj)
380 564
{
......
382 566
    return CH2FIX(inch());
383 567
}
384 568

  
569
/* 
570
 * Document-method: Curses.addch
571
 * call-seq: addch(ch)
572
 *
573
 * Add a character +ch+, with attributes, then advance the cursor.
574
 * 
575
 * see also the system manual for curs_addch(3)
576
 */
385 577
static VALUE
386 578
curses_addch(VALUE obj, VALUE ch)
387 579
{
......
390 582
    return Qnil;
391 583
}
392 584

  
585
/* 
586
 * Document-method: Curses.insch
587
 * call-seq: insch(ch)
588
 *
589
 * Insert a character +ch+, before the cursor.
590
 * 
591
 */
393 592
static VALUE
394 593
curses_insch(VALUE obj, VALUE ch)
395 594
{
......
464 663
    return Qnil;
465 664
}
466 665

  
666
/*
667
 * Document-method: Curses.getstr
668
 *
669
 * This is equivalent to a series f Curses::Window.getch calls
670
 *
671
 */
467 672
static VALUE
468 673
curses_getstr(VALUE obj)
469 674
{
......
474 679
    return rb_locale_str_new_cstr(rtn);
475 680
}
476 681

  
682
/*
683
 * Document-method: Curses.delch
684
 *
685
 * Delete the character under the cursor
686
 *
687
 */
477 688
static VALUE
478 689
curses_delch(VALUE obj)
479 690
{
......
482 693
    return Qnil;
483 694
}
484 695

  
696
/*
697
 * Document-method: Curses.deleteln
698
 *
699
 * Delete the line under the cursor.
700
 *
701
 */
485 702
static VALUE
486 703
curses_deleteln(VALUE obj)
487 704
{
......
492 709
    return Qnil;
493 710
}
494 711

  
712
/*
713
 * Document-method: Curses.insertln
714
 *
715
 * Inserts a line above the cursor, and the bottom line is lost
716
 *
717
 */
495 718
static VALUE
496 719
curses_insertln(VALUE obj)
497 720
{
......
502 725
    return Qnil;
503 726
}
504 727

  
728
/*
729
 * Document-method: Curses.keyname
730
 * call-seq: keyname(c)
731
 *
732
 * Returns the character string corresponding to key +c+
733
 */
505 734
static VALUE
506 735
curses_keyname(VALUE obj, VALUE c)
507 736
{
......
522 751
#endif
523 752
}
524 753

  
754
/*
755
 * Document-method: Curses.lines
756
 *
757
 * Returns the number of lines on the screen
758
 */
525 759
static VALUE
526 760
curses_lines(void)
527 761
{
528 762
    return INT2FIX(LINES);
529 763
}
530 764

  
765
/*
766
 * Document-method: Curses.cols
767
 *
768
 * Returns the number of columns on the screen
769
 */
531 770
static VALUE
532 771
curses_cols(void)
533 772
{
534 773
    return INT2FIX(COLS);
535 774
}
536 775

  
537
/**
776
/*
777
 * Document-method: Curses.curs_set
778
 * call-seq: curs_set(visibility)
779
 *
538 780
 * Sets Cursor Visibility.
539 781
 * 0: invisible
540 782
 * 1: visible
......
552 794
#endif
553 795
}
554 796

  
797
/* 
798
 * Document-method: Curses.scrl
799
 * call-seq: scrl(num)
800
 *
801
 * Scrolls the current window Fixnum +num+ lines.
802
 * The current cursor position is not changed.
803
 *
804
 * For positive +num+, it scrolls up.
805
 *
806
 * For negative +num+, it scrolls down.
807
 *
808
 */
555 809
static VALUE
556 810
curses_scrl(VALUE obj, VALUE n)
557 811
{
......
564 818
#endif
565 819
}
566 820

  
821
/* 
822
 * Document-method: Curses.setscrreg
823
 * call-seq: setscrreg(top, bottom)
824
 *
825
 * Set a software scrolling region in a window.
826
 * +top+ and +bottom+ are lines numbers of the margin.
827
 *
828
 *  If this option and Curses.scrollok are enabled, an attempt to move off
829
 *  the bottom margin line causes all lines in the scrolling region
830
 *  to scroll one line in the direction of the first line.
831
 *  Only the text of the window is scrolled.
832
 *
833
 */
567 834
static VALUE
568 835
curses_setscrreg(VALUE obj, VALUE top, VALUE bottom)
569 836
{
......
576 843
#endif
577 844
}
578 845

  
846
/* 
847
 * Document-method: Curses.attroff
848
 * call-seq: attroff(attrs)
849
 *
850
 * Turns on the named attributes +attrs+ without affecting any others.
851
 *
852
 * See also Curses::Window.attrset for additional information.
853
 */
579 854
static VALUE
580 855
curses_attroff(VALUE obj, VALUE attrs)
581 856
{
......
584 859
    /* return INT2FIX(attroff(NUM2INT(attrs))); */
585 860
}
586 861

  
862
/* 
863
 * Document-method: Curses.attron
864
 * call-seq: attron(attrs)
865
 *
866
 * Turns off the named attributes +attrs+
867
 * without turning any other attributes on or off.
868
 *
869
 * See also Curses::Window.attrset for additional information.
870
 */
587 871
static VALUE
588 872
curses_attron(VALUE obj, VALUE attrs)
589 873
{
......
593 877
}
594 878

  
595 879
/*
880
 * Document-method: Curses.attrset
596 881
 * call-seq: attrset(attrs)
597 882
 *
883
 * Sets the current attributes of the given window to +attrs+.
884
 *
598 885
 * see also Curses::Window.attrset
599 886
 *
600 887
 */
......
755 1042
}
756 1043

  
757 1044
#ifdef USE_COLOR
1045
/*
1046
 * Document-method: Curses.start_color
1047
 *
1048
 * Initializes the color attributes, for terminals that support it.
1049
 *
1050
 * This must be called, in order to use color attributes.
1051
 * It is good practice to call it just after Curses.init_screen
1052
 */
758 1053
static VALUE
759 1054
curses_start_color(VALUE obj)
760 1055
{
......
763 1058
    return (start_color() == OK) ? Qtrue : Qfalse;
764 1059
}
765 1060

  
1061
/*
1062
 * Document-method: Curses.init_pair
1063
 * call-seq: init_pair(pair, f, b)
1064
 *
1065
 * Changes the definition of a color-pair.
1066
 *
1067
 * It takes three arguments: the number of the color-pair to be changed +pair+,
1068
 * the foreground color number +f+, and the background color number +b+.
1069
 *
1070
 * If the color-pair was previously initialized, the screen is
1071
 * refreshed and all occurrences of that color-pair are changed
1072
 * to the new definition.
1073
 *
1074
 */
766 1075
static VALUE
767 1076
curses_init_pair(VALUE obj, VALUE pair, VALUE f, VALUE b)
768 1077
{
......
771 1080
    return (init_pair(NUM2INT(pair),NUM2INT(f),NUM2INT(b)) == OK) ? Qtrue : Qfalse;
772 1081
}
773 1082

  
1083
/*
1084
 * Document-method: Curses.init_color
1085
 * call-seq: init_color(color, r, g, b)
1086
 *
1087
 * Changes the definition of a color. It takes four arguments:
1088
 * * the number of the color to be changed, +color+
1089
 * * the amount of red, +r+
1090
 * * the amount of green, +g+
1091
 * * the amount of blue, +b+
1092
 *
1093
 * The value of the first argument must be between 0 and  COLORS.
1094
 * (See the section Colors for the default color index.)  Each
1095
 * of the last three arguments must be a value between 0 and 1000.
1096
 * When Curses.init_color is used, all occurrences of that color
1097
 * on the screen immediately change to the new definition.
1098
 */
774 1099
static VALUE
775 1100
curses_init_color(VALUE obj, VALUE color, VALUE r, VALUE g, VALUE b)
776 1101
{
......
780 1105
		       NUM2INT(g),NUM2INT(b)) == OK) ? Qtrue : Qfalse;
781 1106
}
782 1107

  
1108
/*
1109
 * Document-method: Curses.has_colors?
1110
 *
1111
 * Returns +true+ or +false+ depending on whether the terminal has color capbilities.
1112
 */
783 1113
static VALUE
784 1114
curses_has_colors(VALUE obj)
785 1115
{
......
787 1117
    return has_colors() ? Qtrue : Qfalse;
788 1118
}
789 1119

  
1120
/*
1121
 * Document-method: Curses.can_change_color?
1122
 *
1123
 * Returns +true+ or +false+ depending on whether the terminal can change color attributes
1124
 */
790 1125
static VALUE
791 1126
curses_can_change_color(VALUE obj)
792 1127
{
......
795 1130
}
796 1131

  
797 1132
#if defined(HAVE_COLORS)
1133
/*
1134
 * Document-method: Curses.color
1135
 *
1136
 * returns COLORS
1137
 */
798 1138
static VALUE
799 1139
curses_colors(VALUE obj)
800 1140
{
......
804 1144
#define curses_colors rb_f_notimplement
805 1145
#endif
806 1146

  
1147
/*
1148
 * Document-method: Curses.color_content
1149
 * call-seq: color_content(color)
1150
 *
1151
 * Returns an 3 item Array of the RGB values in +color+
1152
 */
807 1153
static VALUE
808 1154
curses_color_content(VALUE obj, VALUE color)
809 1155
{
......
816 1162

  
817 1163

  
818 1164
#if defined(HAVE_COLOR_PAIRS)
1165
/*
1166
 * Document-method: Curses.color_pairs
1167
 *
1168
 * Returns the COLOR_PAIRS available, if the curses library supports it.
1169
 */
819 1170
static VALUE
820 1171
curses_color_pairs(VALUE obj)
821 1172
{
......
825 1176
#define curses_color_pairs rb_f_notimplement
826 1177
#endif
827 1178

  
1179
/*
1180
 * Document-method: Curses.pair_content
1181
 * call-seq: pair_content(pair)
1182
 *
1183
 * Returns a 2 item Array, with the foreground and 
1184
 * background color, in +pair+
1185
 */
828 1186
static VALUE
829 1187
curses_pair_content(VALUE obj, VALUE pair)
830 1188
{
......
835 1193
    return rb_ary_new3(2,INT2FIX(f),INT2FIX(b));
836 1194
}
837 1195

  
1196
/*
1197
 * Document-method: Curses.color_pair
1198
 * call-seq: color_pair(attrs)
1199
 *
1200
 * Sets the color pair attributes to +attrs+.
1201
 *
1202
 * This should be equivalent to Curses.attrset(COLOR_PAIR(+attrs+))
1203
 *
1204
 * TODO: validate that equivalency
1205
 */
838 1206
static VALUE
839 1207
curses_color_pair(VALUE obj, VALUE attrs)
840 1208
{
841 1209
    return INT2FIX(COLOR_PAIR(NUM2INT(attrs)));
842 1210
}
843 1211

  
1212
/*
1213
 * Document-method: Curses.pair_number
1214
 * call-seq: pair_number(attrs)
1215
 *
1216
 * Returns the Fixnum color pair number of attributes +attrs+.
1217
 */
844 1218
static VALUE
845 1219
curses_pair_number(VALUE obj, VALUE attrs)
846 1220
{
......
877 1251
/* 
878 1252
 * Document-method: Curses.getmouse
879 1253
 *
880
 * Returns the current mouse or nil
1254
 * Returns coordinates of the mouse.
1255
 *
1256
 * This will read and pop the mouse event data off the queue
1257
 *
1258
 * TODO: all the BUTTON* constants are needed here, to examine the mask of the event
881 1259
 */
882 1260
static VALUE
883 1261
curses_getmouse(VALUE obj)
......
892 1270
    return (getmouse(mdata->mevent) == OK) ? val : Qnil;
893 1271
}
894 1272

  
1273
/*
1274
 * Document-method: Curses.ungetmouse
1275
 *
1276
 * It pushes a KEY_MOUSE event onto the input queue, and associates with that
1277
 * event the given state data and screen-relative character-cell coordinates.
1278
 *
1279
 * The Curses.ungetmouse function behaves analogously to Curses.ungetch.
1280
 */
895 1281
static VALUE
896 1282
curses_ungetmouse(VALUE obj, VALUE mevent)
897 1283
{
......
902 1288
    return (ungetmouse(mdata->mevent) == OK) ? Qtrue : Qfalse;
903 1289
}
904 1290

  
1291
/*
1292
 * Document-method: Curses.mouseinterval
1293
 * call-seq: mouseinterval(interval)
1294
 *
1295
 * The Curses.mouseinterval function sets the maximum time
1296
 * (in thousands of a second) that can elapse between press
1297
 * and release events for them to be recognized as a click.
1298
 *
1299
 * Use Curses.mouseinterval(0) to disable click resolution.
1300
 * This function returns the previous interval value.
1301
 *
1302
 * Use Curses.mouseinterval(-1) to obtain the interval without
1303
 * altering it.
1304
 *
1305
 * The default is one sixth of a second.
1306
 */
905 1307
static VALUE
906 1308
curses_mouseinterval(VALUE obj, VALUE interval)
907 1309
{
......
909 1311
    return mouseinterval(NUM2INT(interval)) ? Qtrue : Qfalse;
910 1312
}
911 1313

  
1314
/*
1315
 * Document-method: Curses.mousemask
1316
 * call-seq: mousemask(mask)
1317
 *
1318
 * Returns the +mask+ of the reportable events
1319
 */
912 1320
static VALUE
913 1321
curses_mousemask(VALUE obj, VALUE mask)
914 1322
{
......
982 1390
#endif
983 1391

  
984 1392
#ifdef HAVE_DEF_PROG_MODE
1393
/*
1394
 * Document-method: Curses.def_prog_mode
1395
 *
1396
 * Save the current terminal modes as the "program"
1397
 * state for use by the Curses.reset_prog_mode
1398
 * 
1399
 * This is done automatically by Curses.init_screen
1400
 */
985 1401
static VALUE
986 1402
curses_def_prog_mode(VALUE obj)
987 1403
{
......
993 1409
#endif
994 1410

  
995 1411
#ifdef HAVE_RESET_PROG_MODE
1412
/*
1413
 * Document-method: Curses.reset_prog_mode
1414
 *
1415
 * Reset the current terminal modes to the saved state
1416
 * by the Curses.def_prog_mode
1417
 * 
1418
 * This is done automatically by Curses.close_screen
1419
 */
996 1420
static VALUE
997 1421
curses_reset_prog_mode(VALUE obj)
998 1422
{
......
1179 1603
 * Document-method: Curses::Window.setpos
1180 1604
 * call-seq: setpos(y, x)
1181 1605
 *
1182
 * A setter for the position of the window,
1606
 * A setter for the position of the cursor
1607
 * in the current window,
1183 1608
 * using coordinates +x+ and +y+
1184 1609
 *
1185 1610
 */
......
2030 2455
 * == Description
2031 2456
 * An implementation of the CRT screen handling and optimization library.
2032 2457
 *
2033
 * == Structures
2458
 * == Structures and such
2034 2459
 *
2035 2460
 * === Classes
2036 2461
 *
......
2042 2467
 * * Curses - basis for the curses implementation
2043 2468
 * * Curses::Key - the collection of constants
2044 2469
 *
2470
 * === Constants
2471
 *
2472
 * For whatever reason, these are not picked up in the RDoc
2473
 * These are Integer of the colors.
2474
 *
2475
 * * COLOR_BLACK	= 0
2476
 * * COLOR_RED		= 1
2477
 * * COLOR_GREEN	= 2
2478
 * * COLOR_YELLOW	= 3
2479
 * * COLOR_BLUE		= 4
2480
 * * COLOR_MAGENTA	= 5
2481
 * * COLOR_CYAN		= 6
2482
 * * COLOR_WHITE	= 7
2483
 *
2484
 *
2045 2485
 * == Examples
2046 2486
 * 
2047 2487
 * * hello.rb
......
2051 2491
 * * rain.rb
2052 2492
 *     :include: rain.rb
2053 2493
 *
2494
 *
2495
 * == TODO
2496
 *
2497
 * * document all the A_* constants
2498
 * * document all the BUTTON*_* constants
2499
 * * document all the ALL_MOUSE_EVENTS and REPORT_MOUSE_POSITION constants
2054 2500
 */
2055 2501
void
2056 2502
Init_curses(void)
......
2292 2738
    rb_curses_define_const(A_COLOR);
2293 2739

  
2294 2740
#ifdef COLORS
2741
    /* 
2742
     * Document-const: Curses::COLORS
2743
     *
2744
     * Integer of the colors available
2745
     */
2295 2746
    rb_curses_define_const(COLORS);
2296 2747
#endif
2748
    /* 
2749
     * Document-const: Curses::COLOR_BLACK
2750
     *
2751
     * Integer of the color black
2752
     */
2297 2753
    rb_curses_define_const(COLOR_BLACK);
2754
    /* 
2755
     * Document-const: COLOR_RED
2756
     *
2757
     * Integer of the color red
2758
     */
2298 2759
    rb_curses_define_const(COLOR_RED);
2760
    /* 
2761
     * Document-const: COLOR_GREEN
2762
     *
2763
     * Integer of the color green
2764
     */
2299 2765
    rb_curses_define_const(COLOR_GREEN);
2766
    /* 
2767
     * Document-const: COLOR_YELLOW
2768
     *
2769
     * Integer of the color yellow
2770
     */
2300 2771
    rb_curses_define_const(COLOR_YELLOW);
2772
    /* 
2773
     * Document-const: COLOR_BLUE
2774
     *
2775
     * Integer of the color blue
2776
     */
2301 2777
    rb_curses_define_const(COLOR_BLUE);
2778
    /* 
2779
     * Document-const: COLOR_MAGENTA
2780
     *
2781
     * Integer of the color magenta
2782
     */
2302 2783
    rb_curses_define_const(COLOR_MAGENTA);
2784
    /* 
2785
     * Document-const: COLOR_CYAN
2786
     *
2787
     * Integer of the color cyan
2788
     */
2303 2789
    rb_curses_define_const(COLOR_CYAN);
2790
    /* 
2791
     * Document-const: COLOR_WHITE
2792
     *
2793
     * Integer of the color white
2794
     */
2304 2795
    rb_curses_define_const(COLOR_WHITE);
2305 2796
#endif /* USE_COLOR */
2306 2797
#ifdef USE_MOUSE