Changeset aa2f33b3
- Timestamp:
- Jul 16, 2002, 9:55:47 PM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- f2e36b5
- Parents:
- e50cd56
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
re50cd56 raa2f33b3 1 1 $Id$ 2 3 1.2.1-pre-3 4 Variables now have a summary and a long description. 5 Only the summary is shown with help. 6 The long description is shown with "show variable foo". 7 Fix the scrolling bug where we would sometimes fail to scroll 8 the screen down, leaving the current message off 9 the bottom of the screen. 10 Added a 'scrollmode' variable which determines how the screen 11 will scroll as the cursor moves. The default behaves 12 identically to previous versions of owl. 13 The following modes are supported: 14 normal - This is the owl default. Scrolling happens 15 when it needs to, and an attempt is made to 16 keep the current message roughly near 17 the middle of the screen. (default) 18 top - The current message will always be the 19 the top message displayed. 20 neartop - The current message will be one down 21 from the top message displayed, 22 where possible. 23 center - An attempt is made to keep the current 24 message near the center of the screen. 25 paged - The top message displayed only changes 26 when user moves the cursor to the top 27 or bottom of the screen. When it moves, 28 the screen will be paged up or down and 29 the cursor will be near the top or 30 the bottom. 31 pagedcenter - The top message displayed only changes 32 when user moves the cursor to the top 33 or bottom of the screen. When it moves, 34 the screen will be paged up or down and 35 the cursor will be near the center.\n", 2 36 3 37 1.2.1-pre-2 -
functions.c
re50cd56 raa2f33b3 712 712 713 713 void owl_function_calculate_topmsg(int direction) { 714 int recwinlines, y, savey, i, j, topmsg, curmsg, foo; 715 owl_mainwin *mw; 714 int recwinlines, topmsg, curmsg; 716 715 owl_view *v; 717 716 718 mw=owl_global_get_mainwin(&g);719 717 v=owl_global_get_current_view(&g); 718 curmsg=owl_global_get_curmsg(&g); 720 719 topmsg=owl_global_get_topmsg(&g); 721 curmsg=owl_global_get_curmsg(&g);722 v=owl_global_get_current_view(&g);723 720 recwinlines=owl_global_get_recwin_lines(&g); 724 721 … … 726 723 return; 727 724 } 725 726 switch (owl_global_get_scrollmode(&g)) { 727 case OWL_SCROLLMODE_TOP: 728 topmsg = owl_function_calculate_topmsg_top(direction, v, curmsg, 729 topmsg, recwinlines); 730 break; 731 case OWL_SCROLLMODE_NEARTOP: 732 topmsg = owl_function_calculate_topmsg_neartop(direction, v, curmsg, 733 topmsg, recwinlines); 734 break; 735 case OWL_SCROLLMODE_CENTER: 736 topmsg = owl_function_calculate_topmsg_center(direction, v, curmsg, 737 topmsg, recwinlines); 738 break; 739 case OWL_SCROLLMODE_PAGED: 740 topmsg = owl_function_calculate_topmsg_paged(direction, v, curmsg, 741 topmsg, recwinlines, 0); 742 break; 743 case OWL_SCROLLMODE_PAGEDCENTER: 744 topmsg = owl_function_calculate_topmsg_paged(direction, v, curmsg, 745 topmsg, recwinlines, 1); 746 break; 747 case OWL_SCROLLMODE_NORMAL: 748 default: 749 topmsg = owl_function_calculate_topmsg_normal(direction, v, curmsg, 750 topmsg, recwinlines); 751 } 752 owl_global_set_topmsg(&g, topmsg); 753 } 754 755 /* Returns what the new topmsg should be. 756 * Passed the last direction of movement, 757 * the current view, 758 * the current message number in the view, 759 * the top message currently being displayed, 760 * and the number of lines in the recwin. 761 */ 762 int owl_function_calculate_topmsg_top(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines) { 763 return curmsg; 764 } 765 766 int owl_function_calculate_topmsg_neartop(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines) { 767 if (curmsg>0 768 && (owl_message_get_numlines(owl_view_get_element(v, curmsg-1)) 769 < recwinlines/2)) { 770 return curmsg-1; 771 } else { 772 return curmsg; 773 } 774 } 775 776 int owl_function_calculate_topmsg_center(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines) { 777 int i, last, lines; 778 779 last = curmsg; 780 lines = 0; 781 for (i=curmsg-1; i>=0; i--) { 782 lines += owl_message_get_numlines(owl_view_get_element(v, i)); 783 if (lines > recwinlines/2) break; 784 last = i; 785 } 786 return last; 787 } 788 789 int owl_function_calculate_topmsg_paged(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines, int center_on_page) { 790 int i, last, lines, savey; 791 792 /* If we're off the top of the screen, scroll up such that the 793 * curmsg is near the botton of the screen. */ 794 if (curmsg < topmsg) { 795 last = curmsg; 796 lines = 0; 797 for (i=curmsg; i>=0; i--) { 798 lines += owl_message_get_numlines(owl_view_get_element(v, i)); 799 if (lines > recwinlines) break; 800 last = i; 801 } 802 if (center_on_page) { 803 return owl_function_calculate_topmsg_center(direction, v, curmsg, 0, recwinlines); 804 } else { 805 return last; 806 } 807 } 808 809 /* Find number of lines from top to bottom of curmsg (store in savey) */ 810 savey=0; 811 for (i=topmsg; i<=curmsg; i++) { 812 savey+=owl_message_get_numlines(owl_view_get_element(v, i)); 813 } 814 815 /* if we're off the bottom of the screen, scroll down */ 816 if (savey > recwinlines) { 817 if (center_on_page) { 818 return owl_function_calculate_topmsg_center(direction, v, curmsg, 0, recwinlines); 819 } else { 820 return curmsg; 821 } 822 } 823 824 /* else just stay as we are... */ 825 return topmsg; 826 } 827 828 829 int owl_function_calculate_topmsg_normal(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines) { 830 int savey, j, i, foo, y; 728 831 729 832 /* Find number of lines from top to bottom of curmsg (store in savey) */ … … 761 864 } 762 865 if (j<0) j=0; 763 owl_global_set_topmsg(&g, j); 764 return; 866 return j; 765 867 } 766 868 } … … 778 880 j--; 779 881 } 780 owl_global_set_topmsg(&g, j+1); 781 return; 782 } 783 } 882 return j+1; 883 } 884 } 885 886 return topmsg; 784 887 } 785 888 … … 1219 1322 "Variables: (use 'show variable <name>' for details)\n"); 1220 1323 owl_variable_dict_get_names(owl_global_get_vardict(&g), &varnames); 1221 owl_variable_get_summaryheader(&fm);1222 1324 numvarnames = owl_list_get_size(&varnames); 1223 1325 for (i=0; i<numvarnames; i++) { 1224 1326 varname = owl_list_get_element(&varnames, i); 1225 1327 if (varname && varname[0]!='_') { 1226 owl_variable_ get_summary(owl_global_get_vardict(&g), varname, &fm);1328 owl_variable_describe(owl_global_get_vardict(&g), varname, &fm); 1227 1329 } 1228 1330 } -
help.c
r6794f72 raa2f33b3 105 105 "Variables:\n"); 106 106 owl_variable_dict_get_names(owl_global_get_vardict(&g), &varnames); 107 owl_variable_get_summaryheader(&fm);108 107 numvarnames = owl_list_get_size(&varnames); 109 108 for (i=0; i<numvarnames; i++) { 110 109 varname = owl_list_get_element(&varnames, i); 111 110 if (varname && varname[0]!='_') { 112 owl_variable_ get_summary(owl_global_get_vardict(&g), varname, &fm);111 owl_variable_describe(owl_global_get_vardict(&g), varname, &fm); 113 112 } 114 113 } -
owl.h
rae9e6be raa2f33b3 12 12 static const char owl_h_fileIdent[] = "$Id$"; 13 13 14 #define OWL_VERSION 1.2.1-pre- 115 #define OWL_VERSION_STRING "1.2.1-pre- 1"14 #define OWL_VERSION 1.2.1-pre-3 15 #define OWL_VERSION_STRING "1.2.1-pre-3" 16 16 17 17 #define OWL_DEBUG 0 … … 46 46 #define OWL_DIRECTION_DOWNWARDS 1 47 47 #define OWL_DIRECTION_UPWARDS 2 48 49 #define OWL_SCROLLMODE_NORMAL 0 50 #define OWL_SCROLLMODE_TOP 1 51 #define OWL_SCROLLMODE_NEARTOP 2 52 #define OWL_SCROLLMODE_CENTER 3 53 #define OWL_SCROLLMODE_PAGED 4 54 #define OWL_SCROLLMODE_PAGEDCENTER 5 55 48 56 49 57 #define OWL_TAB 3 /* This *HAS* to be the size of TABSTR below */ … … 114 122 int ival_default; /* for types int and bool */ 115 123 char *validsettings; /* documentation of valid settings */ 116 char *docstring; /* documentation of valid settings */ 124 char *summary; /* summary of usage */ 125 char *description; /* detailed description */ 117 126 void *val; /* current value */ 118 127 int (*validate_fn)(struct _owl_variable *v, void *newval); -
variable.c
rae9e6be raa2f33b3 10 10 static int in_regtest = 0; 11 11 12 #define OWLVAR_BOOL(name,default, docstring) \13 { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", docstring, NULL, \12 #define OWLVAR_BOOL(name,default,summary,description) \ 13 { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \ 14 14 NULL, NULL, NULL, NULL, NULL } 15 15 16 #define OWLVAR_BOOL_FULL(name,default, docstring,validate,set,get) \17 { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", docstring, NULL, \16 #define OWLVAR_BOOL_FULL(name,default,summary,description,validate,set,get) \ 17 { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \ 18 18 validate, set, NULL, get, NULL } 19 19 20 #define OWLVAR_INT(name,default, docstring) \21 { name, OWL_VARIABLE_INT, NULL, default, "<int>", docstring, NULL, \20 #define OWLVAR_INT(name,default,summary,description) \ 21 { name, OWL_VARIABLE_INT, NULL, default, "<int>", summary,description, NULL, \ 22 22 NULL, NULL, NULL, NULL, NULL, NULL } 23 23 24 #define OWLVAR_INT_FULL(name,default, docstring,validset,validate,set,get) \25 { name, OWL_VARIABLE_INT, NULL, default, validset, docstring, NULL, \24 #define OWLVAR_INT_FULL(name,default,summary,description,validset,validate,set,get) \ 25 { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \ 26 26 validate, set, NULL, get, NULL, NULL } 27 27 28 #define OWLVAR_PATH(name,default, docstring) \29 { name, OWL_VARIABLE_STRING, default, 0, "<path>", docstring, NULL, \28 #define OWLVAR_PATH(name,default,summary,description) \ 29 { name, OWL_VARIABLE_STRING, default, 0, "<path>", summary,description, NULL, \ 30 30 NULL, NULL, NULL, NULL, NULL, NULL } 31 31 32 #define OWLVAR_STRING(name,default, docstring) \33 { name, OWL_VARIABLE_STRING, default, 0, "<string>", docstring, NULL, \32 #define OWLVAR_STRING(name,default,summary,description) \ 33 { name, OWL_VARIABLE_STRING, default, 0, "<string>", summary,description, NULL, \ 34 34 NULL, NULL, NULL, NULL, NULL, NULL } 35 35 … … 37 37 * list of strings which can be specified. The tokens, starting at 0, 38 38 * correspond to the values that may be specified. */ 39 #define OWLVAR_ENUM(name,default, docstring,validset) \40 { name, OWL_VARIABLE_INT, NULL, default, validset, docstring, NULL, \39 #define OWLVAR_ENUM(name,default,summary,description,validset) \ 40 { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \ 41 41 owl_variable_enum_validate, \ 42 42 NULL, owl_variable_enum_set_fromstring, \ … … 44 44 NULL } 45 45 46 #define OWLVAR_ENUM_FULL(name,default, docstring,validset,validate, set, get) \47 { name, OWL_VARIABLE_INT, NULL, default, validset, docstring, NULL, \46 #define OWLVAR_ENUM_FULL(name,default,summary,description,validset,validate, set, get) \ 47 { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \ 48 48 validate, \ 49 49 set, owl_variable_enum_set_fromstring, \ … … 54 54 55 55 OWLVAR_BOOL( "personalbell" /* %OwlVarStub */, 0, 56 "ring the terminal bell when personal messages are received" ), 56 "ring the terminal bell when personal messages are received", 57 "" ), 57 58 58 59 OWLVAR_BOOL( "bell" /* %OwlVarStub */, 1, 59 "enable / disable the terminal bell" ),60 "enable / disable the terminal bell", "" ), 60 61 61 62 OWLVAR_BOOL_FULL( "debug" /* %OwlVarStub */, OWL_DEBUG, 62 63 "whether debugging is enabled", 64 "If set to 'on', debugging messages are logged to the\n" 65 "file specified by the debugfile variable.\n", 63 66 NULL, owl_variable_debug_set, NULL), 64 67 65 68 OWLVAR_BOOL( "startuplogin" /* %OwlVarStub */, 1, 66 "send a login message when owl starts" ),69 "send a login message when owl starts", "" ), 67 70 68 71 OWLVAR_BOOL( "shutdownlogout" /* %OwlVarStub */, 1, 69 "send a logout message when owl exits" ),72 "send a logout message when owl exits", "" ), 70 73 71 74 OWLVAR_BOOL( "rxping" /* %OwlVarStub */, 0, 72 "display received pings" ),75 "display received pings", "" ), 73 76 74 77 OWLVAR_BOOL( "txping" /* %OwlVarStub */, 1, 75 "send pings" ),78 "send pings", "" ), 76 79 77 80 OWLVAR_BOOL( "displayoutgoing" /* %OwlVarStub */, 1, 78 "display outgoing messages" ),81 "display outgoing messages", "" ), 79 82 80 83 OWLVAR_BOOL( "loginsubs" /* %OwlVarStub */, 1, 81 "load logins from .anyone on startup" ),84 "load logins from .anyone on startup", "" ), 82 85 83 86 OWLVAR_BOOL( "logging" /* %OwlVarStub */, 0, 84 "turn personal logging on or off" ), 87 "turn personal logging on or off", 88 "If this is set to on, personal messages are\n" 89 "logged in the directory specified\n" 90 "by the 'logpath' variable. The filename in that\n" 91 "directory is derived from the sender of the message.\n" ), 85 92 86 93 OWLVAR_BOOL( "classlogging" /* %OwlVarStub */, 0, 87 "turn class logging on or off" ), 94 "turn class logging on or off", 95 "If this is set to on, class messages are\n" 96 "logged in the directory specified\n" 97 "by the 'classlogpath' variable.\n" 98 "The filename in that directory is derived from\n" 99 "the name of the class to which the message was sent.\n" ), 88 100 89 101 OWLVAR_BOOL( "colorztext" /* %OwlVarStub */, 1, 90 "allow @color() in zephyrs to change color" ), 102 "allow @color() in zephyrs to change color", 103 "Note that only messages received after this variable\n" 104 "is set will be affected." ), 91 105 92 106 OWLVAR_ENUM_FULL( "disable-ctrl-d" /* %OwlVarStub:lockout_ctrld */, 1, 93 "don't send zephyrs on C-d (or disable if in the middle of the message if set to 'middle')", "off,middle,on", 107 "don't send zephyrs on C-d", 108 "If set to 'off', C-d won't send a zephyr from the edit\n" 109 "window. If set to 'on', C-d will always send a zephyr\n" 110 "being composed in the edit window. If set to 'middle',\n" 111 "C-d will only ever send a zephyr if the cursor is at\n" 112 "the end of the message being composed.\n\n" 113 "Note that this works by changing the C-d keybinding\n" 114 "in the editmulti keymap.\n", 115 "off,middle,on", 94 116 NULL, owl_variable_disable_ctrl_d_set, NULL), 95 117 96 118 OWLVAR_BOOL( "_burningears" /* %OwlVarStub:burningears */, 0, 97 "[NOT YET IMPLEMENTED] beep on messages matching patterns" ),119 "[NOT YET IMPLEMENTED] beep on messages matching patterns", "" ), 98 120 99 121 OWLVAR_BOOL( "_summarymode" /* %OwlVarStub:summarymode */, 0, 100 "[NOT YET IMPLEMENTED]" ),122 "[NOT YET IMPLEMENTED]", "" ), 101 123 102 124 OWLVAR_PATH( "logpath" /* %OwlVarStub */, "~/zlog/people", 103 "path for logging personal zephyrs" ), 125 "path for logging personal zephyrs", 126 "Specifies a directory which must exist.\n" 127 "Files will be created in the directory for each sender.\n"), 104 128 105 129 OWLVAR_PATH( "classlogpath" /* %OwlVarStub:classlogpath */, "~/zlog/class", 106 "path for logging class zephyrs" ), 130 "path for logging class zephyrs", 131 "Specifies a directory which must exist.\n" 132 "Files will be created in the directory for each class.\n"), 107 133 108 134 OWLVAR_PATH( "debug_file" /* %OwlVarStub */, OWL_DEBUG_FILE, 109 "path for logging debug messages when debugging is enabled" ), 135 "path for logging debug messages when debugging is enabled", 136 "This file will be logged to if 'debug' is set to 'on'.\n"), 110 137 111 138 OWLVAR_PATH( "zsigproc" /* %OwlVarStub:zsig_exec */, NULL, 112 "name of a program to run that will generate zsigs" ), 139 "name of a program to run that will generate zsigs", 140 "This program should produce a zsig on stdout when run.\n" 141 "Note that it is important that this program not block.\n" ), 113 142 114 143 OWLVAR_STRING( "zsig" /* %OwlVarStub */, "", 115 "zephyr signature" ), 144 "zephyr signature", 145 "If 'zsigproc' is not set, this string will be used\n" 146 "as a zsig. If this is also unset, the 'zwrite-signature'\n" 147 "zephyr variable will be used instead.\n"), 116 148 117 149 OWLVAR_STRING( "appendtosepbar" /* %OwlVarStub */, "", 118 "string to append to the end of the sepbar" ), 150 "string to append to the end of the sepbar", 151 "The sepbar is the bar separating the top and bottom\n" 152 "of the owl screen. Any string specified here will\n" 153 "be displayed on the right of the sepbar\n"), 119 154 120 155 OWLVAR_BOOL( "zaway" /* %OwlVarStub */, 0, 121 "turn zaway on or off" ),156 "turn zaway on or off", "" ), 122 157 123 158 OWLVAR_STRING( "zaway_msg" /* %OwlVarStub */, 124 159 OWL_DEFAULT_ZAWAYMSG, 125 "zaway msg for responding to zephyrs when away" ),160 "zaway msg for responding to zephyrs when away", "" ), 126 161 127 162 OWLVAR_STRING( "zaway_msg_default" /* %OwlVarStub */, 128 163 OWL_DEFAULT_ZAWAYMSG, 129 "default zaway message" ),164 "default zaway message", "" ), 130 165 131 166 OWLVAR_STRING( "view_home" /* %OwlVarStub */, "all", 132 "home view to switch to after 'X'" ), 167 "home view to switch to after 'X' and 'V'", 168 "SEE ALSO: view, filter\n" ), 133 169 134 170 OWLVAR_INT( "edit:maxfillcols" /* %OwlVarStub:edit_maxfillcols */, 70, 135 "maximum number of columns for M-q to fill text to (or unlimited if 0)" ), 171 "maximum number of columns for M-q to fill text to", 172 "This specifies the maximum number of columns for M-q\n" 173 "to fill text to. If set to 0, ther will be no maximum\n" 174 "limit. In all cases, the current width of the screen\n" 175 "will also be taken into account. It will be used instead\n" 176 "if it is narrower than the maximum, or if this\n" 177 "is set to 0.\n" ), 136 178 137 179 OWLVAR_INT( "edit:maxwrapcols" /* %OwlVarStub:edit_maxwrapcols */, 0, 138 "maximum number of columns for line-wrapping (or unlimited if 0)" ), 180 "maximum number of columns for line-wrapping", 181 "This specifies the maximum number of columns for\n" 182 "auto-line-wrapping. If set to 0, ther will be no maximum\n" 183 "limit. In all cases, the current width of the screen\n" 184 "will also be taken into account. It will be used instead\n" 185 "if it is narrower than the maximum, or if this\n" 186 "is set to 0.\n\n" 187 "It is recommended that outgoing messages be no wider\n" 188 "than 60 columns, as a courtesy to recipients.\n"), 139 189 140 190 OWLVAR_INT_FULL( "typewinsize" /* %OwlVarStub:typwin_lines */, 141 191 OWL_TYPWIN_SIZE, 142 "number of lines in the typing window", "int > 0", 192 "number of lines in the typing window", 193 "This specifies the height of the window at the\n" 194 "bottom of the screen where commands are entered\n" 195 "and where messages are composed.\n", 196 "int > 0", 143 197 owl_variable_int_validate_gt0, 144 198 owl_variable_typewinsize_set, … … 146 200 ), 147 201 202 OWLVAR_ENUM( "scrollmode" /* %OwlVarStub */, OWL_SCROLLMODE_NORMAL, 203 "how to scroll up and down", 204 "This controls how the screen is scrolled as the\n" 205 "cursor moves between messages being displayed.\n" 206 "The following modes are supported:\n\n" 207 " normal - This is the owl default. Scrolling happens\n" 208 " when it needs to, and an attempt is made to\n" 209 " keep the current message roughly near\n" 210 " the middle of the screen.\n" 211 " top - The current message will always be the\n" 212 " the top message displayed.\n" 213 " neartop - The current message will be one down\n" 214 " from the top message displayed,\n" 215 " where possible.\n" 216 " center - An attempt is made to keep the current\n" 217 " message near the center of the screen.\n" 218 " paged - The top message displayed only changes\n" 219 " when user moves the cursor to the top\n" 220 " or bottom of the screen. When it moves,\n" 221 " the screen will be paged up or down and\n" 222 " the cursor will be near the top or\n" 223 " the bottom.\n" 224 " pagedcenter - The top message displayed only changes\n" 225 " when user moves the cursor to the top\n" 226 " or bottom of the screen. When it moves,\n" 227 " the screen will be paged up or down and\n" 228 " the cursor will be near the center.\n", 229 "normal,top,neartop,center,paged,pagedcenter" ), 230 148 231 OWLVAR_ENUM( "webbrowser" /* %OwlVarStub */, OWL_WEBBROWSER_NETSCAPE, 149 232 "web browser to use to launch URLs", 233 "When the 'w' key is pressed, this browser is used\n" 234 "to display the requested URL.\n", 150 235 "none,netscape,galeon,opera" ), 151 236 152 237 OWLVAR_BOOL( "_followlast" /* %OwlVarStub */, 0, 153 "enable automatic following of the last zephyr" ), 238 "enable automatic following of the last zephyr", 239 "If the cursor is at the last message, it will\n" 240 "continue to follow the last message if this is set.\n" 241 "Note that this is currently risky as you might accidentally\n" 242 "delete a message right as it came in.\n" ), 154 243 155 244 /* This MUST be last... */ 156 { NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } 245 { NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 246 NULL, NULL, NULL, NULL, NULL, NULL } 157 247 158 248 }; … … 300 390 301 391 302 char *owl_variable_get_docstring(owl_variable *v) { 303 return v->docstring; 392 char *owl_variable_get_description(owl_variable *v) { 393 return v->description; 394 } 395 396 char *owl_variable_get_summary(owl_variable *v) { 397 return v->summary; 304 398 } 305 399 … … 420 514 } 421 515 422 #define OWL_VARIABLE_HELP_FMT " %-15s %-9s %-9s %s\n" 423 424 /* appends to the end of the fmtext */ 425 void owl_variable_get_summaryheader(owl_fmtext *fm) { 426 char tmpbuff[512]; 427 snprintf(tmpbuff, 512, 428 OWL_VARIABLE_HELP_FMT OWL_VARIABLE_HELP_FMT, 429 "name", "settings", "default", "meaning", 430 "---------------", "--------", "-------", "-------"); 431 owl_fmtext_append_bold(fm, tmpbuff); 432 } 433 434 void owl_variable_get_summary(owl_vardict *d, char *name, owl_fmtext *fm) { 435 char defaultbuf[10]; 516 void owl_variable_describe(owl_vardict *d, char *name, owl_fmtext *fm) { 517 char defaultbuf[50]; 436 518 char buf[1024]; 437 519 int buflen = 1023; … … 446 528 } 447 529 if (v->type == OWL_VARIABLE_INT || v->type == OWL_VARIABLE_BOOL) { 448 v->get_tostring_fn(v, defaultbuf, 10, &(v->ival_default));530 v->get_tostring_fn(v, defaultbuf, 50, &(v->ival_default)); 449 531 } else { 450 v->get_tostring_fn(v, defaultbuf, 10, v->pval_default);451 } 452 snprintf(buf, buflen, OWL_ VARIABLE_HELP_FMT,532 v->get_tostring_fn(v, defaultbuf, 50, v->pval_default); 533 } 534 snprintf(buf, buflen, OWL_TABSTR "%-20s - %s (default: '%s')\n", 453 535 v->name, 454 owl_variable_get_validsettings(v), 455 defaultbuf, 456 owl_variable_get_docstring(v)); 536 owl_variable_get_summary(v), defaultbuf); 457 537 owl_fmtext_append_normal(fm, buf); 458 538 } … … 474 554 owl_fmtext_append_normal(fm, name); 475 555 owl_fmtext_append_normal(fm, " - "); 476 owl_fmtext_append_normal(fm, v-> docstring);556 owl_fmtext_append_normal(fm, v->summary); 477 557 owl_fmtext_append_normal(fm, "\n\n"); 478 558 … … 495 575 owl_fmtext_append_normal(fm, owl_variable_get_validsettings(v)); 496 576 owl_fmtext_append_normal(fm, "\n\n"); 577 578 if (v->description && *v->description) { 579 owl_fmtext_append_normal(fm, "Description:\n"); 580 owl_fmtext_append_normal(fm, owl_variable_get_description(v)); 581 owl_fmtext_append_normal(fm, "\n\n"); 582 } 497 583 } 498 584
Note: See TracChangeset
for help on using the changeset viewer.