Changeset 56fa418 in mainline


Ignore:
Timestamp:
2009-04-05T15:50:53Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0175246
Parents:
726ef849
Message:

Make Czech layout work partially in bdsh.

Location:
uspace
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/input.c

    r726ef849 r56fa418  
    3535#include <io/stream.h>
    3636#include <console.h>
     37#include <kbd/kbd.h>
     38#include <kbd/keycode.h>
    3739
    3840#include "config.h"
     
    9799static void read_line(char *buffer, int n)
    98100{
    99         char c;
     101        kbd_event_t ev;
    100102        int chars;
    101103
    102104        chars = 0;
    103105        while (chars < n - 1) {
    104                 c = getchar();
    105                 if (c < 0)
     106                fflush(stdout);
     107                if (kbd_get_event(&ev) < 0)
    106108                        return;
    107                 if (c == '\n')
     109                if (ev.type == KE_RELEASE)
     110                        continue;
     111
     112                if (ev.key == KC_ENTER || ev.key == KC_NENTER)
    108113                        break;
    109                 if (c == '\b') {
     114                if (ev.key == KC_BACKSPACE) {
    110115                        if (chars > 0) {
    111116                                putchar('\b');
     
    114119                        continue;
    115120                }
    116                 if (c >= ' ') {
    117                         putchar(c);
    118                         buffer[chars++] = c;
     121                if (ev.c >= ' ') {
     122                        //putchar(ev.c);
     123                        console_putchar(ev.c);
     124                        buffer[chars++] = ev.c;
    119125                }
    120126        }
  • uspace/app/tester/print/print4.c

    r726ef849 r56fa418  
    8282                printf("Russian:  %ls\n", L"Леннон познакомился с художницей-авангардисткой");
    8383                printf("Armenian: %ls\n", L"Սկսեց հրատարակվել Երուսաղեմի հայկական");
     84
     85                printf("Test: [%d] '%lc'\n", L'\x0161', L'\x0161');
    8486        }
    8587
  • uspace/lib/libc/Makefile.toolchain

    r726ef849 r56fa418  
    2727#
    2828
    29 CFLAGS = -fno-builtin -Wall -Werror-implicit-function-declaration -Wmissing-prototypes -O3 -nostdlib -nostdinc -imacros $(LIBC_PREFIX)/../../../config.h -I$(LIBC_PREFIX)/include -pipe -g
     29CFLAGS = -fno-builtin -Wall -Werror-implicit-function-declaration\
     30    -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32 -finput-charset=UTF-8\
     31    -Wmissing-prototypes -O3 -nostdlib -nostdinc -imacros\
     32    $(LIBC_PREFIX)/../../../config.h -I$(LIBC_PREFIX)/include -pipe -g
    3033LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a
    3134AFLAGS =
  • uspace/lib/libc/generic/console.c

    r726ef849 r56fa418  
    5858
    5959static ssize_t cons_write(const char *buf, size_t nbyte);
    60 static void cons_putchar(int c);
     60static void cons_putchar(wchar_t c);
    6161
    6262static void cbuffer_flush(void);
     
    120120}
    121121
    122 void console_putchar(int c)
    123 {
    124         cbuffer_putc(c);
     122void console_putchar(wchar_t c)
     123{
     124//      cbuffer_putc(c);
     125        cbuffer_flush();
     126        cons_putchar(c);
    125127}
    126128
     
    163165
    164166/** Write one character to the console via IPC. */
    165 static void cons_putchar(int c)
     167static void cons_putchar(wchar_t c)
    166168{
    167169        int cons_phone = console_phone_get(true);
  • uspace/lib/libc/generic/io/io.c

    r726ef849 r56fa418  
    3737#include <stdio.h>
    3838#include <io/io.h>
     39#include <string.h>
     40#include <errno.h>
    3941
    4042const static char nl = '\n';
     
    8890int putchar(int c)
    8991{
    90         unsigned char ch = c;
    91         if (write_stdout((void *) &ch, 1) == 1)
     92        char buf[STR_BOUNDS(1)];
     93        size_t offs;
     94
     95        offs = 0;
     96        if (chr_encode(c, buf, &offs, STR_BOUNDS(1)) != EOK)
     97                return EOF;
     98
     99        if (write_stdout((void *) buf, offs) == offs)
    92100                return c;
    93        
     101
    94102        return EOF;
    95103}
  • uspace/lib/libc/include/console.h

    r726ef849 r56fa418  
    3838#include <console/style.h>
    3939#include <console/color.h>
     40#include <sys/types.h>
    4041#include <bool.h>
    4142
     
    4849extern void console_clear(void);
    4950extern void console_goto(int, int);
    50 extern void console_putchar(int);
     51extern void console_putchar(wchar_t);
    5152extern ssize_t console_write(const char *buf, size_t nbyte);
    5253extern void console_putstr(const char *s);
  • uspace/srv/kbd/layout/cz.c

    r726ef849 r56fa418  
    3838
    3939static wchar_t map_lcase[] = {
    40         [KC_2] = 'ě',
    41         [KC_3] = 'š',
    42         [KC_4] = 'č',
    43         [KC_5] = 'ř',
    44         [KC_6] = 'ž',
    45         [KC_7] = 'ý',
    46         [KC_8] = 'á',
    47         [KC_9] = 'í',
    48         [KC_0] = 'é',
    49 
    50         [KC_LBRACKET] = 'ú',
    51         [KC_SEMICOLON] = 'ů',
     40        [KC_2] = L'ě',
     41        [KC_3] = L'š',
     42        [KC_4] = L'č',
     43        [KC_5] = L'ř',
     44        [KC_6] = L'ž',
     45        [KC_7] = L'ý',
     46        [KC_8] = L'á',
     47        [KC_9] = L'í',
     48        [KC_0] = L'é',
     49
     50        [KC_LBRACKET] = L'ú',
     51        [KC_SEMICOLON] = L'ů',
    5252
    5353        [KC_Q] = 'q',
     
    8282
    8383static wchar_t map_ucase[] = {
    84         [KC_2] = 'Ě',
    85         [KC_3] = 'Š',
    86         [KC_4] = 'Č',
    87         [KC_5] = 'Ř',
    88         [KC_6] = 'Ž',
    89         [KC_7] = 'Ý',
    90         [KC_8] = 'Á',
    91         [KC_9] = 'Í',
    92         [KC_0] = 'É',
    93 
    94         [KC_LBRACKET] = 'Ú',
    95         [KC_SEMICOLON] = 'Ů',
     84        [KC_2] = L'Ě',
     85        [KC_3] = L'Š',
     86        [KC_4] = L'Č',
     87        [KC_5] = L'Ř',
     88        [KC_6] = L'Ž',
     89        [KC_7] = L'Ý',
     90        [KC_8] = L'Á',
     91        [KC_9] = L'Í',
     92        [KC_0] = L'É',
     93
     94        [KC_LBRACKET] = L'Ú',
     95        [KC_SEMICOLON] = L'Ů',
    9696
    9797        [KC_Q] = 'Q',
     
    134134        [KC_RBRACKET] = ')',
    135135
    136         [KC_QUOTE] = '§',
     136        [KC_QUOTE] = L'§',
    137137
    138138        [KC_COMMA] = ',',
Note: See TracChangeset for help on using the changeset viewer.