ruby-changes:20097
From: drbrain <ko1@a...>
Date: Fri, 17 Jun 2011 09:26:27 +0900 (JST)
Subject: [ruby-changes:20097] drbrain:r32144 (trunk): * ext/curses/curses.c: Document curses constants. Patch by Vincent
drbrain 2011-06-17 09:25:43 +0900 (Fri, 17 Jun 2011) New Revision: 32144 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32144 Log: * ext/curses/curses.c: Document curses constants. Patch by Vincent Batts. [Ruby 1.9 - Bug #4880] Modified files: trunk/ChangeLog trunk/ext/curses/curses.c Index: ChangeLog =================================================================== --- ChangeLog (revision 32143) +++ ChangeLog (revision 32144) @@ -1,3 +1,8 @@ +Fri Jun 17 09:25:14 2011 Eric Hodel <drbrain@s...> + + * ext/curses/curses.c: Document curses constants. Patch by Vincent + Batts. [Ruby 1.9 - Bug #4880] + Fri Jun 17 09:11:05 2011 Eric Hodel <drbrain@s...> * object.c: Document Module#method_added and #method_removed. Index: ext/curses/curses.c =================================================================== --- ext/curses/curses.c (revision 32143) +++ ext/curses/curses.c (revision 32144) @@ -1255,7 +1255,7 @@ * * This will read and pop the mouse event data off the queue * - * TODO: all the BUTTON* constants are needed here, to examine the mask of the event + * See the BUTTON*, ALL_MOUSE_EVENTS and REPORT_MOUSE_POSITION constants, to examine the mask of the event */ static VALUE curses_getmouse(VALUE obj) @@ -2476,11 +2476,6 @@ * :include: rain.rb * * - * == TODO - * - * * document all the A_* constants - * * document all the BUTTON*_* constants - * * document all the ALL_MOUSE_EVENTS and REPORT_MOUSE_POSITION constants */ void Init_curses(void) @@ -2685,40 +2680,173 @@ #define rb_curses_define_const(c) rb_define_const(mCurses,#c,UINT2NUM(c)) #ifdef USE_COLOR + /* Document-const: A_ATTRIBUTES + * + * Character attribute mask: + * Bit-mask to extract attributes + * + * See Curses.inch or Curses::Window.inch + */ rb_curses_define_const(A_ATTRIBUTES); #ifdef A_NORMAL + /* Document-const: A_NORMAL + * + * Attribute mask: + * Normal display (no highlight) + * + * See Curses.attrset + */ rb_curses_define_const(A_NORMAL); #endif + /* Document-const: A_STANDOUT + * + * Attribute mask: + * Best highlighting mode of the terminal. + * + * See Curses.attrset + */ rb_curses_define_const(A_STANDOUT); + /* Document-const: A_UNDERLINE + * + * Attribute mask: + * Underlining + * + * See Curses.attrset + */ rb_curses_define_const(A_UNDERLINE); + /* Document-const: A_REVERSE + * + * Attribute mask: + * Reverse video + * + * See Curses.attrset + */ rb_curses_define_const(A_REVERSE); + /* Document-const: A_BLINK + * + * Attribute mask: + * Blinking + * + * See Curses.attrset + */ rb_curses_define_const(A_BLINK); + /* Document-const: A_DIM + * + * Attribute mask: + * Half bright + * + * See Curses.attrset + */ rb_curses_define_const(A_DIM); + /* Document-const: A_BOLD + * + * Attribute mask: + * Extra bright or bold + * + * See Curses.attrset + */ rb_curses_define_const(A_BOLD); + /* Document-const: A_PROTECT + * + * Attribute mask: + * Protected mode + * + * See Curses.attrset + */ rb_curses_define_const(A_PROTECT); #ifdef A_INVIS /* for NetBSD */ + /* Document-const: A_INVIS + * + * Attribute mask: + * Invisible or blank mode + * + * See Curses.attrset + */ rb_curses_define_const(A_INVIS); #endif + /* Document-const: A_ALTCHARSET + * + * Attribute mask: + * Alternate character set + * + * See Curses.attrset + */ rb_curses_define_const(A_ALTCHARSET); + /* Document-const: A_CHARTEXT + * + * Attribute mask: + * Bit-mask to extract a character + * + * See Curses.attrset + */ rb_curses_define_const(A_CHARTEXT); #ifdef A_HORIZONTAL + /* Document-const: A_HORIZONTAL + * + * Attribute mask: + * horizontal highlight + * + * Check system curs_attr(3x) for support + */ rb_curses_define_const(A_HORIZONTAL); #endif #ifdef A_LEFT + /* Document-const: A_LEFT + * + * Attribute mask: + * left highlight + * + * Check system curs_attr(3x) for support + */ rb_curses_define_const(A_LEFT); #endif #ifdef A_LOW + /* Document-const: A_LOW + * + * Attribute mask: + * low highlight + * + * Check system curs_attr(3x) for support + */ rb_curses_define_const(A_LOW); #endif #ifdef A_RIGHT + /* Document-const: A_RIGHT + * + * Attribute mask: + * right highlight + * + * Check system curs_attr(3x) for support + */ rb_curses_define_const(A_RIGHT); #endif #ifdef A_TOP + /* Document-const: A_TOP + * + * Attribute mask: + * top highlight + * + * Check system curs_attr(3x) for support + */ rb_curses_define_const(A_TOP); #endif #ifdef A_VERTICAL + /* Document-const: A_VERTICAL + * + * Attribute mask: + * vertical highlight + * + * Check system curs_attr(3x) for support + */ rb_curses_define_const(A_VERTICAL); #endif + /* Document-const: A_COLOR + * + * Character attribute mask: + * Bit-mask to extract color-pair field information + * + * See Curses.inch or Curses::Window.inch + */ rb_curses_define_const(A_COLOR); #ifdef COLORS @@ -2780,149 +2908,342 @@ #endif /* USE_COLOR */ #ifdef USE_MOUSE #ifdef BUTTON1_PRESSED + /* Document-const: BUTTON1_PRESSED + * + * Mouse event mask: + * mouse button 1 down + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON1_PRESSED); #endif #ifdef BUTTON1_RELEASED + /* Document-const: BUTTON1_RELEASED + * + * Mouse event mask: + * mouse button 1 up + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON1_RELEASED); #endif #ifdef BUTTON1_CLICKED + /* Document-const: BUTTON1_CLICKED + * + * Mouse event mask: + * mouse button 1 clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON1_CLICKED); #endif #ifdef BUTTON1_DOUBLE_CLICKED + /* Document-const: BUTTON1_DOUBLE_CLICKED + * + * Mouse event mask: + * mouse button 1 double clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON1_DOUBLE_CLICKED); #endif #ifdef BUTTON1_TRIPLE_CLICKED + /* Document-const: BUTTON1_TRIPLE_CLICKED + * + * Mouse event mask: + * mouse button 1 triple clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON1_TRIPLE_CLICKED); #endif #ifdef BUTTON2_PRESSED + /* Document-const: BUTTON2_PRESSED + * + * Mouse event mask: + * mouse button 2 down + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON2_PRESSED); #endif #ifdef BUTTON2_RELEASED + /* Document-const: BUTTON2_RELEASED + * + * Mouse event mask: + * mouse button 2 up + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON2_RELEASED); #endif #ifdef BUTTON2_CLICKED + /* Document-const: BUTTON2_CLICKED + * + * Mouse event mask: + * mouse button 2 clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON2_CLICKED); #endif #ifdef BUTTON2_DOUBLE_CLICKED + /* Document-const: BUTTON2_DOUBLE_CLICKED + * + * Mouse event mask: + * mouse button 2 double clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON2_DOUBLE_CLICKED); #endif #ifdef BUTTON2_TRIPLE_CLICKED + /* Document-const: BUTTON2_TRIPLE_CLICKED + * + * Mouse event mask: + * mouse button 2 triple clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON2_TRIPLE_CLICKED); #endif #ifdef BUTTON3_PRESSED + /* Document-const: BUTTON3_PRESSED + * + * Mouse event mask: + * mouse button 3 down + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON3_PRESSED); #endif #ifdef BUTTON3_RELEASED + /* Document-const: BUTTON3_RELEASED + * + * Mouse event mask: + * mouse button 3 up + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON3_RELEASED); #endif #ifdef BUTTON3_CLICKED + /* Document-const: BUTTON3_CLICKED + * + * Mouse event mask: + * mouse button 3 clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON3_CLICKED); #endif #ifdef BUTTON3_DOUBLE_CLICKED + /* Document-const: BUTTON3_DOUBLE_CLICKED + * + * Mouse event mask: + * mouse button 3 double clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON3_DOUBLE_CLICKED); #endif #ifdef BUTTON3_TRIPLE_CLICKED + /* Document-const: BUTTON3_TRIPLE_CLICKED + * + * Mouse event mask: + * mouse button 3 triple clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON3_TRIPLE_CLICKED); #endif #ifdef BUTTON4_PRESSED + /* Document-const: BUTTON4_PRESSED + * + * Mouse event mask: + * mouse button 4 down + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON4_PRESSED); #endif #ifdef BUTTON4_RELEASED + /* Document-const: BUTTON4_RELEASED + * + * Mouse event mask: + * mouse button 4 up + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON4_RELEASED); #endif #ifdef BUTTON4_CLICKED + /* Document-const: BUTTON4_CLICKED + * + * Mouse event mask: + * mouse button 4 clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON4_CLICKED); #endif #ifdef BUTTON4_DOUBLE_CLICKED + /* Document-const: BUTTON4_DOUBLE_CLICKED + * + * Mouse event mask: + * mouse button 4 double clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON4_DOUBLE_CLICKED); #endif #ifdef BUTTON4_TRIPLE_CLICKED + /* Document-const: BUTTON4_TRIPLE_CLICKED + * + * Mouse event mask: + * mouse button 4 triple clicked + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON4_TRIPLE_CLICKED); #endif #ifdef BUTTON_SHIFT + /* Document-const: BUTTON_SHIFT + * + * Mouse event mask: + * shift was down during button state change + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON_SHIFT); #endif #ifdef BUTTON_CTRL + /* Document-const: BUTTON_CTRL + * + * Mouse event mask: + * control was down during button state change + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON_CTRL); #endif #ifdef BUTTON_ALT + /* Document-const: BUTTON_ALT + * + * Mouse event mask: + * alt was down during button state change + * + * See Curses.getmouse + */ rb_curses_define_const(BUTTON_ALT); #endif #ifdef ALL_MOUSE_EVENTS + /* Document-const: ALL_MOUSE_EVENTS + * + * Mouse event mask: + * report all button state changes + * + * See Curses.getmouse + */ rb_curses_define_const(ALL_MOUSE_EVENTS); #endif #ifdef REPORT_MOUSE_POSITION + /* Document-const: REPORT_MOUSE_POSITION + * + * Mouse event mask: + * report mouse movement + * + * See Curses.getmouse + */ rb_curses_define_const(REPORT_MOUSE_POSITION); #endif #endif /* USE_MOUSE */ #if defined(KEY_MOUSE) && defined(USE_MOUSE) + /* Document-const: KEY_MOUSE + * Mouse event read + */ /* Document-const: MOUSE - * * Mouse event read */ rb_curses_define_const(KEY_MOUSE); rb_define_const(mKey, "MOUSE", INT2NUM(KEY_MOUSE)); #endif #ifdef KEY_MIN + /* Document-const: KEY_MIN + * The minimum allowed curses key value. + */ /* Document-const: MIN - * * The minimum allowed curses key value. */ rb_curses_define_const(KEY_MIN); rb_define_const(mKey, "MIN", INT2NUM(KEY_MIN)); #endif #ifdef KEY_BREAK + /* Document-const: KEY_BREAK + * Break key + */ /* Document-const: BREAK - * * Break key */ rb_curses_define_const(KEY_BREAK); rb_define_const(mKey, "BREAK", INT2NUM(KEY_BREAK)); #endif #ifdef KEY_DOWN + /* Document-const: KEY_DOWN + * the down arrow key + */ /* Document-const: DOWN - * * the down arrow key */ rb_curses_define_const(KEY_DOWN); rb_define_const(mKey, "DOWN", INT2NUM(KEY_DOWN)); #endif #ifdef KEY_UP + /* Document-const: KEY_UP + * the up arrow key + */ /* Document-const: UP - * * the up arrow key */ rb_curses_define_const(KEY_UP); rb_define_const(mKey, "UP", INT2NUM(KEY_UP)); #endif #ifdef KEY_LEFT + /* Document-const: KEY_LEFT + * the left arrow key + */ /* Document-const: LEFT - * * the left arrow key */ rb_curses_define_const(KEY_LEFT); rb_define_const(mKey, "LEFT", INT2NUM(KEY_LEFT)); #endif #ifdef KEY_RIGHT + /* Document-const: KEY_RIGHT + * the right arrow key + */ /* Document-const: RIGHT - * * the right arrow key */ rb_curses_define_const(KEY_RIGHT); rb_define_const(mKey, "RIGHT", INT2NUM(KEY_RIGHT)); #endif #ifdef KEY_HOME + /* Document-const: KEY_HOME + * Home key (upward+left arrow) + */ /* Document-const: HOME - * * Home key (upward+left arrow) */ rb_curses_define_const(KEY_HOME); rb_define_const(mKey, "HOME", INT2NUM(KEY_HOME)); #endif #ifdef KEY_BACKSPACE + /* Document-const: KEY_BACKSPACE + * Backspace + */ /* Document-const: BACKSPACE - * * Backspace */ rb_curses_define_const(KEY_BACKSPACE); @@ -2942,200 +3263,250 @@ } #endif #ifdef KEY_DL + /* Document-const: KEY_DL + * Delete line + */ /* Document-const: DL - * * Delete line */ rb_curses_define_const(KEY_DL); rb_define_const(mKey, "DL", INT2NUM(KEY_DL)); #endif #ifdef KEY_IL + /* Document-const: KEY_IL + * Insert line + */ /* Document-const: IL - * * Insert line */ rb_curses_define_const(KEY_IL); rb_define_const(mKey, "IL", INT2NUM(KEY_IL)); #endif #ifdef KEY_DC + /* Document-const: KEY_DC + * Delete character + */ /* Document-const: DC - * * Delete character */ rb_curses_define_const(KEY_DC); rb_define_const(mKey, "DC", INT2NUM(KEY_DC)); #endif #ifdef KEY_IC + /* Document-const: KEY_IC + * Insert char or enter insert mode + */ /* Document-const: IC - * * Insert char or enter insert mode */ rb_curses_define_const(KEY_IC); rb_define_const(mKey, "IC", INT2NUM(KEY_IC)); #endif #ifdef KEY_EIC + /* Document-const: KEY_EIC + * Enter insert char mode + */ /* Document-const: EIC - * * Enter insert char mode */ rb_curses_define_const(KEY_EIC); rb_define_const(mKey, "EIC", INT2NUM(KEY_EIC)); #endif #ifdef KEY_CLEAR + /* Document-const: KEY_CLEAR + * Clear Screen + */ /* Document-const: CLEAR - * * Clear Screen */ rb_curses_define_const(KEY_CLEAR); rb_define_const(mKey, "CLEAR", INT2NUM(KEY_CLEAR)); #endif #ifdef KEY_EOS + /* Document-const: KEY_EOS + * Clear to end of screen + */ /* Document-const: EOS - * * Clear to end of screen */ rb_curses_define_const(KEY_EOS); rb_define_const(mKey, "EOS", INT2NUM(KEY_EOS)); #endif #ifdef KEY_EOL + /* Document-const: KEY_EOL + * Clear to end of line + */ /* Document-const: EOL - * * Clear to end of line */ rb_curses_define_const(KEY_EOL); rb_define_const(mKey, "EOL", INT2NUM(KEY_EOL)); #endif #ifdef KEY_SF + /* Document-const: KEY_SF + * Scroll 1 line forward + */ /* Document-const: SF - * * Scroll 1 line forward */ rb_curses_define_const(KEY_SF); rb_define_const(mKey, "SF", INT2NUM(KEY_SF)); #endif #ifdef KEY_SR + /* Document-const: KEY_SR + * Scroll 1 line backware (reverse) + */ /* Document-const: SR - * * Scroll 1 line backware (reverse) */ rb_curses_define_const(KEY_SR); rb_define_const(mKey, "SR", INT2NUM(KEY_SR)); #endif #ifdef KEY_NPAGE + /* Document-const: KEY_NPAGE + * Next page + */ /* Document-const: NPAGE - * * Next page */ rb_curses_define_const(KEY_NPAGE); rb_define_const(mKey, "NPAGE", INT2NUM(KEY_NPAGE)); #endif #ifdef KEY_PPAGE + /* Document-const: KEY_PPAGE + * Previous page + */ /* Document-const: PPAGE - * * Previous page */ rb_curses_define_const(KEY_PPAGE); rb_define_const(mKey, "PPAGE", INT2NUM(KEY_PPAGE)); #endif #ifdef KEY_STAB + /* Document-const: KEY_STAB + * Set tab + */ /* Document-const: STAB - * * Set tab */ rb_curses_define_const(KEY_STAB); rb_define_const(mKey, "STAB", INT2NUM(KEY_STAB)); #endif #ifdef KEY_CTAB + /* Document-const: KEY_CTAB + * Clear tab + */ /* Document-const: CTAB - * * Clear tab */ rb_curses_define_const(KEY_CTAB); rb_define_const(mKey, "CTAB", INT2NUM(KEY_CTAB)); #endif #ifdef KEY_CATAB + /* Document-const: KEY_CATAB + * Clear all tabs + */ /* Document-const: CATAB - * * Clear all tabs */ rb_curses_define_const(KEY_CATAB); rb_define_const(mKey, "CATAB", INT2NUM(KEY_CATAB)); #endif #ifdef KEY_ENTER + /* Document-const: KEY_ENTER + * Enter or send + */ /* Document-const: ENTER - * * Enter or send */ rb_curses_define_const(KEY_ENTER); rb_define_const(mKey, "ENTER", INT2NUM(KEY_ENTER)); #endif #ifdef KEY_SRESET + /* Document-const: KEY_SRESET + * Soft (partial) reset + */ /* Document-const: SRESET - * * Soft (partial) reset */ rb_curses_define_const(KEY_SRESET); rb_define_const(mKey, "SRESET", INT2NUM(KEY_SRESET)); #endif #ifdef KEY_RESET + /* Document-const: KEY_RESET + * Reset or hard reset + */ /* Document-const: RESET - * * Reset or hard reset */ rb_curses_define_const(KEY_RESET); rb_define_const(mKey, "RESET", INT2NUM(KEY_RESET)); #endif #ifdef KEY_PRINT + /* Document-const: KEY_PRINT + * Print or copy + */ /* Document-const: PRINT - * * Print or copy */ rb_curses_define_const(KEY_PRINT); rb_define_const(mKey, "PRINT", INT2NUM(KEY_PRINT)); #endif #ifdef KEY_LL + /* Document-const: KEY_LL + * Home down or bottom (lower left) + */ /* Document-const: LL - * * Home down or bottom (lower left) */ rb_curses_define_const(KEY_LL); rb_define_const(mKey, "LL", INT2NUM(KEY_LL)); #endif #ifdef KEY_A1 + /* Document-const: KEY_A1 + * Upper left of keypad + */ /* Document-const: A1 - * * Upper left of keypad */ rb_curses_define_const(KEY_A1); rb_define_const(mKey, "A1", INT2NUM(KEY_A1)); #endif #ifdef KEY_A3 + /* Document-const: KEY_A3 + * Upper right of keypad + */ /* Document-const: A3 - * * Upper right of keypad */ rb_curses_define_const(KEY_A3); rb_define_const(mKey, "A3", INT2NUM(KEY_A3)); #endif #ifdef KEY_B2 + /* Document-const: KEY_B2 + * Center of keypad + */ /* Document-const: B2 - * * Center of keypad */ rb_curses_define_const(KEY_B2); rb_define_const(mKey, "B2", INT2NUM(KEY_B2)); #endif #ifdef KEY_C1 + /* Document-const: KEY_C1 + * Lower left of keypad + */ /* Document-const: C1 - * * Lower left of keypad */ rb_curses_define_const(KEY_C1); rb_define_const(mKey, "C1", INT2NUM(KEY_C1)); #endif #ifdef KEY_C3 + /* Document-const: KEY_C3 + * Lower right of keypad + */ /* Document-const: C3 - * * Lower right of keypad */ rb_curses_define_const(KEY_C3); @@ -3143,463 +3514,579 @@ #endif #ifdef KEY_BTAB /* D (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/