Changeset 9f1362d4 in mainline for uspace/lib/clui/tinput.h


Ignore:
Timestamp:
2010-04-19T19:58:18Z (14 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/lib/clui/tinput.h

    rcaad59a r9f1362d4  
    2929/** @addtogroup libclui
    3030 * @{
    31  */ 
     31 */
    3232/**
    3333 * @file
     
    3737#define LIBCLUI_TINPUT_H_
    3838
    39 #define HISTORY_LEN 10
    40 #define INPUT_MAX_SIZE 1024
     39#include <ipc/ipc.h>
     40
     41#define HISTORY_LEN     10
     42#define INPUT_MAX_SIZE  1024
    4143
    4244/** Text input field (command line).
     
    4749        /** Buffer holding text currently being edited */
    4850        wchar_t buffer[INPUT_MAX_SIZE + 1];
     51       
    4952        /** Screen coordinates of the top-left corner of the text field */
    50         int col0, row0;
     53        ipcarg_t col0;
     54        ipcarg_t row0;
     55       
    5156        /** Screen dimensions */
    52         int con_cols, con_rows;
     57        ipcarg_t con_cols;
     58        ipcarg_t con_rows;
     59       
    5360        /** Number of characters in @c buffer */
    54         int nc;
     61        size_t nc;
     62       
    5563        /** Caret position within buffer */
    56         int pos;
     64        size_t pos;
     65       
    5766        /** Selection mark position within buffer */
    58         int sel_start;
    59 
     67        size_t sel_start;
     68       
    6069        /** History (dynamically allocated strings) */
    61         char *history[1 + HISTORY_LEN];
     70        char *history[HISTORY_LEN + 1];
     71       
    6272        /** Number of entries in @c history, not counting [0] */
    63         int hnum;
     73        size_t hnum;
     74       
    6475        /** Current position in history */
    65         int hpos;
     76        size_t hpos;
     77       
    6678        /** @c true if finished with this line (return to caller) */
    6779        bool done;
     80       
    6881        /** @c true if user requested to abort interactive loop */
    6982        bool exit_clui;
     
    7184
    7285extern tinput_t *tinput_new(void);
    73 extern void tinput_destroy(tinput_t *ti);
    74 extern int tinput_read(tinput_t *ti, char **str);
     86extern void tinput_destroy(tinput_t *);
     87extern int tinput_read(tinput_t *, char **);
    7588
    7689#endif
     
    7891/** @}
    7992 */
    80 
Note: See TracChangeset for help on using the changeset viewer.