Ignore:
Timestamp:
2010-04-19T19:58:18Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
369a5f8
Parents:
caad59a
Message:

console output improvements

  • define new generic styles (STYLE_INVERTED for inverted print and STYLE_SELECTION for selections), use them primarily instead of specifying colors or RGBs
  • use console_set_style(fphone(stdout), STYLE_NORMAL) as the correct mean for reseting console settings (instead of specifying conrete hardcoded colors)
  • rename console_goto() to console_set_pos() (consistency with console_get_pos())
  • use semantically correct unsigned types for console sizes and cursor positions (instead of signed types)
  • use unsigned types for sizes and positions in libclui
  • top: nicer screen redrawing (do not use console_clear() which causes flickering, but repaint the screen properly — not entirely finished yet)
  • initialize mouse pointer coordinates (so the mouse cursor does not behave erratic after boot, unfortunatelly this does not solve ticket #223)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/console/console1.c

    rcaad59a r9f1362d4  
    5353                fflush(stdout);
    5454                console_set_style(fphone(stdout), STYLE_NORMAL);
    55                 printf("normal ");
     55                printf(" normal ");
    5656                fflush(stdout);
    5757                console_set_style(fphone(stdout), STYLE_EMPHASIS);
    58                 printf("emphasized");
     58                printf(" emphasized ");
     59                fflush(stdout);
     60                console_set_style(fphone(stdout), STYLE_INVERTED);
     61                printf(" inverted ");
     62                fflush(stdout);
     63                console_set_style(fphone(stdout), STYLE_SELECTED);
     64                printf(" selected ");
    5965                fflush(stdout);
    6066                console_set_style(fphone(stdout), STYLE_NORMAL);
    61                 printf(".\n");
     67                printf("\n");
    6268               
    6369                unsigned int i;
     
    7379                        }
    7480                        fflush(stdout);
    75                         console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0);
     81                        console_set_style(fphone(stdout), STYLE_NORMAL);
    7682                        putchar('\n');
    7783                }
     
    8692                        }
    8793                        fflush(stdout);
    88                         console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0);
     94                        console_set_style(fphone(stdout), STYLE_NORMAL);
    8995                        putchar('\n');
    9096                }
     
    94100                for (i = 0; i < 255; i += 16) {
    95101                        fflush(stdout);
    96                         console_set_rgb_color(fphone(stdout), 0xffffff, i << 16);
     102                        console_set_rgb_color(fphone(stdout), (255 - i) << 16, i << 16);
    97103                        putchar('X');
    98104                }
     
    103109                for (i = 0; i < 255; i += 16) {
    104110                        fflush(stdout);
    105                         console_set_rgb_color(fphone(stdout), 0xffffff, i << 8);
     111                        console_set_rgb_color(fphone(stdout), (255 - i) << 8, i << 8);
    106112                        putchar('X');
    107113                }
     
    112118                for (i = 0; i < 255; i += 16) {
    113119                        fflush(stdout);
    114                         console_set_rgb_color(fphone(stdout), 0xffffff, i);
     120                        console_set_rgb_color(fphone(stdout), 255 - i, i);
    115121                        putchar('X');
    116122                }
    117123                fflush(stdout);
    118                 console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0);
     124                console_set_style(fphone(stdout), STYLE_NORMAL);
    119125                putchar('\n');
    120126        }
Note: See TracChangeset for help on using the changeset viewer.