- Timestamp:
- Apr 22, 2006, 9:46:43 PM (15 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/event.c
r811 r849 51 51 * function to wait indefinitely until a matching event is received. 52 52 * 53 * If not null, \c ev will be filled with information about the event 54 * received. If null, the function will return but no information about 55 * the event will be sent. 56 * 53 57 * \param dp The libcaca graphical context. 54 58 * \param event_mask Bitmask of requested events. 55 59 * \param timeout A timeout value in microseconds 56 * \param ev A pointer to a caca_event structure .57 * \return The next matching event in the queue, or 0 if no event is pending.60 * \param ev A pointer to a caca_event structure, or NULL. 61 * \return 1 if a matching event was received, or 0 if the wait timeouted. 58 62 */ 59 63 int caca_get_event(caca_display_t *dp, unsigned int event_mask, 60 64 caca_event_t *ev, int timeout) 61 65 { 66 caca_event_t dummy_event; 62 67 caca_timer_t timer; 63 68 int usec = 0; … … 68 73 if(timeout > 0) 69 74 _caca_getticks(&timer); 75 76 if(ev == NULL) 77 ev = &dummy_event; 70 78 71 79 for( ; ; ) -
libcaca/trunk/doc/migrating.dox
r848 r849 48 48 /* Initialise libcaca */ 49 49 cucul_canvas_t *cv; 50 caca_display_t *dp; caca_event_t ev;50 caca_display_t *dp; 51 51 cv = cucul_create_canvas(0, 0); 52 52 dp = caca_create_display(cv); … … 62 62 /* Wait for a key press event */ 63 63 caca_get_event(dp, CACA_EVENT_KEY_PRESS, 64 &ev, -1);64 NULL, -1); 65 65 /* Clean up library */ 66 66 caca_free_display(dp); -
libcaca/trunk/test/colors.c
r832 r849 25 25 cucul_canvas_t *cv; 26 26 caca_display_t *dp; 27 caca_event_t ev;28 27 int i, j; 29 28 … … 52 51 53 52 caca_refresh_display(dp); 54 caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);53 caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1); 55 54 56 55 caca_free_display(dp); -
libcaca/trunk/test/dithering.c
r819 r849 13 13 14 14 #include "config.h" 15 16 #include <stdio.h> 15 17 16 18 #include "cucul.h" … … 35 37 int main(void) 36 38 { 37 caca_event_t ev;38 39 cucul_canvas_t *cv; 39 40 caca_display_t *dp; … … 125 126 caca_refresh_display(dp); 126 127 127 caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);128 caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1); 128 129 129 130 caca_free_display(dp); -
libcaca/trunk/test/font.c
r819 r849 39 39 cucul_font_t *f; 40 40 cucul_dither_t *d; 41 caca_event_t ev;42 41 unsigned char *buf; 43 42 unsigned int w, h; … … 98 97 caca_refresh_display(dp); 99 98 100 caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);99 caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1); 101 100 102 101 /* Free everything */ -
libcaca/trunk/test/frames.c
r843 r849 22 22 #endif 23 23 24 #include <stdio.h> 25 24 26 #include "cucul.h" 25 27 #include "caca.h" … … 27 29 int main(void) 28 30 { 29 caca_event_t ev;30 31 cucul_canvas_t *cv; 31 32 caca_display_t *dp; … … 58 59 59 60 n = 0; 60 while(!caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, 0))61 while(!caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, 0)) 61 62 { 62 63 cucul_set_canvas_frame(cv, n % 16); -
libcaca/trunk/test/hsv.c
r819 r849 22 22 #endif 23 23 24 #include <stdio.h> 25 24 26 #include "cucul.h" 25 27 #include "caca.h" … … 29 31 int main(void) 30 32 { 31 caca_event_t ev;32 33 cucul_canvas_t *cv; 33 34 caca_display_t *dp; … … 53 54 caca_refresh_display(dp); 54 55 55 caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);56 caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1); 56 57 57 58 caca_free_display(dp); -
libcaca/trunk/test/transform.c
r819 r849 50 50 int main(void) 51 51 { 52 caca_event_t ev;53 52 cucul_canvas_t *cv, *normal, *flip, *flop, *rotate; 54 53 caca_display_t *dp; … … 109 108 caca_refresh_display(dp); 110 109 111 caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);110 caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1); 112 111 113 112 caca_free_display(dp); -
libcaca/trunk/test/truecolor.c
r819 r849 22 22 #endif 23 23 24 #include <stdio.h> 25 24 26 #include "cucul.h" 25 27 #include "caca.h" … … 27 29 int main(void) 28 30 { 29 caca_event_t ev;30 31 cucul_canvas_t *cv; 31 32 caca_display_t *dp; … … 51 52 caca_refresh_display(dp); 52 53 53 caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);54 caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1); 54 55 55 56 caca_free_display(dp); -
libcaca/trunk/test/unicode.c
r819 r849 22 22 #endif 23 23 24 #include <stdio.h> 25 24 26 #include "cucul.h" 25 27 #include "caca.h" … … 27 29 int main(void) 28 30 { 29 caca_event_t ev;30 31 cucul_canvas_t *cv; 31 32 caca_display_t *dp; … … 88 89 caca_refresh_display(dp); 89 90 90 caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);91 caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1); 91 92 92 93 caca_free_display(dp);
Note: See TracChangeset
for help on using the changeset viewer.