Ver código fonte

* Renamed the event data member "ucs4" to "utf32" for consistency

with "utf8".
tags/v0.99.beta14
Sam Hocevar sam 18 anos atrás
pai
commit
0c1746c626
9 arquivos alterados com 13 adições e 13 exclusões
  1. +3
    -3
      caca/caca.h
  2. +1
    -1
      caca/driver_conio.c
  3. +2
    -2
      caca/driver_gl.c
  4. +1
    -1
      caca/driver_ncurses.c
  5. +1
    -1
      caca/driver_slang.c
  6. +1
    -1
      caca/driver_win32.c
  7. +2
    -2
      caca/driver_x11.c
  8. +1
    -1
      caca/event.c
  9. +1
    -1
      test/input.c

+ 3
- 3
caca/caca.h Ver arquivo

@@ -49,8 +49,8 @@ typedef struct caca_event caca_event_t;
* \li \b CACA_EVENT_KEY_PRESS, \b CACA_EVENT_KEY_RELEASE: the \e data.key.ch
* field is valid and contains either the ASCII value for the key, or
* an \e enum \e caca_key value. If the value is a printable ASCII
* character, the \e data.key.ucs4 and \e data.key.utf8 fields are
* also filled and contain respectively the UCS-4/UTF-32 and the UTF-8
* character, the \e data.key.utf32 and \e data.key.utf8 fields are
* also filled and contain respectively the UTF-32/UCS-4 and the UTF-8
* representations of the character. Otherwise, their content is
* undefined.
*
@@ -92,7 +92,7 @@ struct caca_event
{
struct { unsigned int x, y, button; } mouse;
struct { unsigned int w, h; } resize;
struct { unsigned int ch; unsigned long int ucs4; char utf8[8]; } key;
struct { unsigned int ch; unsigned long int utf32; char utf8[8]; } key;
} data;
};



+ 1
- 1
caca/driver_conio.c Ver arquivo

@@ -135,7 +135,7 @@ static int conio_get_event(caca_display_t *dp, caca_event_t *ev)

ev->type = CACA_EVENT_KEY_PRESS;
ev->data.key.ch = ch;
ev->data.key.ucs4 = (uint32_t)ch;
ev->data.key.utf32 = (uint32_t)ch;
ev->data.key.utf8[0] = ch;
ev->data.key.utf8[1] = '\0';



+ 2
- 2
caca/driver_gl.c Ver arquivo

@@ -476,7 +476,7 @@ static int gl_get_event(caca_display_t *dp, caca_event_t *ev)
{
ev->type = CACA_EVENT_KEY_PRESS;
ev->data.key.ch = dp->drv.p->key;
ev->data.key.ucs4 = (uint32_t)dp->drv.p->key;
ev->data.key.utf32 = (uint32_t)dp->drv.p->key;
ev->data.key.utf8[0] = dp->drv.p->key;
ev->data.key.utf8[1] = '\0';
dp->drv.p->key = 0;
@@ -514,7 +514,7 @@ static int gl_get_event(caca_display_t *dp, caca_event_t *ev)
}

ev->type = CACA_EVENT_KEY_PRESS;
ev->data.key.ucs4 = 0;
ev->data.key.utf32 = 0;
ev->data.key.utf8[0] = '\0';

dp->drv.p->special_key = 0;


+ 1
- 1
caca/driver_ncurses.c Ver arquivo

@@ -428,7 +428,7 @@ static int ncurses_get_event(caca_display_t *dp, caca_event_t *ev)
}

ev->type = CACA_EVENT_KEY_PRESS;
ev->data.key.ucs4 = 0;
ev->data.key.utf32 = 0;
ev->data.key.utf8[0] = '\0';
return 1;
}


+ 1
- 1
caca/driver_slang.c Ver arquivo

@@ -337,7 +337,7 @@ static int slang_get_event(caca_display_t *dp, caca_event_t *ev)
}

ev->type = CACA_EVENT_KEY_PRESS;
ev->data.key.ucs4 = 0;
ev->data.key.utf32 = 0;
ev->data.key.utf8[0] = '\0';
return 1;
}


+ 1
- 1
caca/driver_win32.c Ver arquivo

@@ -256,7 +256,7 @@ static int win32_get_event(caca_display_t *dp, caca_event_t *ev)
if(rec.Event.KeyEvent.uChar.AsciiChar)
{
ev->data.key.ch = rec.Event.KeyEvent.uChar.AsciiChar;
ev->data.key.ucs4 = (uint32_t)ev->data.key.ch;
ev->data.key.utf32 = (uint32_t)ev->data.key.ch;
ev->data.key.utf8[0] = ev->data.key.ch;
ev->data.key.utf8[1] = '\0';



+ 2
- 2
caca/driver_x11.c Ver arquivo

@@ -508,7 +508,7 @@ static int x11_get_event(caca_display_t *dp, caca_event_t *ev)
if(XLookupString(&xevent.xkey, &key, 1, NULL, NULL))
{
ev->data.key.ch = key;
ev->data.key.ucs4 = key;
ev->data.key.utf32 = key;
ev->data.key.utf8[0] = key;
ev->data.key.utf8[1] = '\0';
return 1;
@@ -548,7 +548,7 @@ static int x11_get_event(caca_display_t *dp, caca_event_t *ev)
default: ev->type = CACA_EVENT_NONE; return 0;
}

ev->data.key.ucs4 = 0;
ev->data.key.utf32 = 0;
ev->data.key.utf8[0] = '\0';
return 1;
}


+ 1
- 1
caca/event.c Ver arquivo

@@ -201,7 +201,7 @@ static int _get_next_event(caca_display_t *dp, caca_event_t *ev)
if(ev->type == CACA_EVENT_KEY_PRESS
&& dp->events.last_key_event.type
&& ev->data.key.ch == dp->events.last_key_event.data.key.ch
&& ev->data.key.ucs4 == dp->events.last_key_event.data.key.ucs4)
&& ev->data.key.utf32 == dp->events.last_key_event.data.key.utf32)
{
dp->events.last_key_ticks = 0;
return _get_next_event(dp, ev);


+ 1
- 1
test/input.c Ver arquivo

@@ -130,7 +130,7 @@ int main(void)
memmove(entries[e].buffer + entries[e].cursor + 1,
entries[e].buffer + entries[e].cursor,
(entries[e].size - entries[e].cursor) * 4);
entries[e].buffer[entries[e].cursor] = ev.data.key.ucs4;
entries[e].buffer[entries[e].cursor] = ev.data.key.utf32;
entries[e].size++;
entries[e].cursor++;
}


Carregando…
Cancelar
Salvar