Changeset 8fa9562 for commands.c


Ignore:
Timestamp:
Jan 20, 2007, 9:49:55 PM (14 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
575877f
Parents:
212764e
Message:
Added background color support to owl.

If we run out of color pairs during a painting of the screen, further
background colors will be silently dropped. I'm hoping this doesn't
happen often. The used pair list is reset with each draw, so only
what's actually on screen matters.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r12e5f17 r8fa9562  
    503503  OWLCMD_ARGS("filter", owl_command_filter, OWL_CTX_ANY,
    504504              "create a message filter",
    505               "filter <name> [ -c color ] [ <expression> ... ]",
     505              "filter <name> [ -c fgcolor ] [ -b bgcolor ] [ <expression> ... ]",
    506506              "The filter command creates a filter with the specified name,\n"
    507507              "or if one already exists it is replaced.  Example filter\n"
     
    533533              "    false\n"
    534534              "Spaces must be present before and after parenthesis.  If the\n"
    535               "optional color argument is used it specifies the color that\n"
     535              "optional color arguments are used they specifies the colors that\n"
    536536              "messages matching this filter should be displayed in.\n\n"
    537537              "SEE ALSO: view, viewclass, viewuser\n"),
    538538
    539539  OWLCMD_ARGS("colorview", owl_command_colorview, OWL_CTX_INTERACTIVE,
    540               "change the color on the current filter",
    541               "colorview <color>",
    542               "The color of messages in the current filter will be changed\n"
    543               "to <color>.  Use the 'show colors' command for a list\n"
     540              "change the colors on the current filter",
     541              "colorview <fgcolor> [<bgcolor>]",
     542              "The colors of messages in the current filter will be changed\n"
     543              "to <fgcolor>,<bgcolor>.  Use the 'show colors' command for a list\n"
    544544              "of valid colors.\n\n"
    545545              "SEE ALSO: 'show colors'\n"),
     
    547547  OWLCMD_ARGS("colorclass", owl_command_colorclass, OWL_CTX_INTERACTIVE,
    548548              "create a filter to color messages of the given class name",
    549               "colorclass <class> <color>",
     549              "colorclass <class> <fgcolor> [<bgcolor>]",
    550550              "A filter will be created to color messages in <class>"
    551               "in <color>.  Use the 'show colors' command for a list\n"
     551              "in <fgcolor>,<bgcolor>.  Use the 'show colors' command for a list\n"
    552552              "of valid colors.\n\n"
    553553              "SEE ALSO: 'show colors'\n"),
     
    22532253char *owl_command_colorview(int argc, char **argv, char *buff)
    22542254{
    2255   if (argc!=2) {
     2255  if (argc < 2 || argc > 3) {
    22562256    owl_function_makemsg("Wrong number of arguments to colorview command");
    22572257    return NULL;
    22582258  }
    2259   owl_function_color_current_filter(argv[1]);
     2259  owl_function_color_current_filter(argv[1], (argc == 3 ? argv[2] : NULL));
    22602260  return NULL;
    22612261}
     
    22652265  char *filtname;
    22662266 
    2267   if (argc!=3) {
     2267  if (argc < 3 || argc > 4) {
    22682268    owl_function_makemsg("Wrong number of arguments to colorclass command");
    22692269    return NULL;
     
    22712271
    22722272  filtname=owl_function_classinstfilt(argv[1], NULL);
    2273   (void) owl_function_color_filter(filtname, argv[2]);
     2273  (void) owl_function_color_filter(filtname, argv[2], (argc == 4 ? argv[3] : NULL));
    22742274  return NULL;
    22752275}
Note: See TracChangeset for help on using the changeset viewer.