source: neercs/trunk/src/mini-client.c @ 4370

Last change on this file since 4370 was 4370, checked in by Sam Hocevar, 10 years ago

Add a mini-neercs project to test some client/server refactoring.

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1/*
2 *  neercs        console-based window manager
3 *  Copyright (c) 2006-2010 Sam Hocevar <sam@hocevar.net>
4 *                2008-2010 Jean-Yves Lamoureux <jylam@lnxscene.org>
5 *                2008-2010 Pascal Terjan <pterjan@linuxfr.org>
6 *                All Rights Reserved
7 *
8 *  This program is free software. It comes without any warranty, to
9 *  the extent permitted by applicable law. You can redistribute it
10 *  and/or modify it under the terms of the Do What The Fuck You Want
11 *  To Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15#include "mini-neercs.h"
16
17#include <caca.h>
18
19caca_display_t *dp;
20caca_canvas_t *cv;
21
22void client_init(void)
23{
24    cv = caca_create_canvas(0, 0);
25    dp = caca_create_display(cv);
26    caca_set_display_title(dp, "Press Esc to quit");
27}
28
29int client_step(void)
30{
31    caca_event_t ev;
32    if(caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, 0)
33        && caca_get_event_key_ch(&ev) == CACA_KEY_ESCAPE)
34        return 0;
35    return 1;
36}
37
38void client_fini(void)
39{
40    caca_free_display(dp);
41    caca_free_canvas(cv);
42}
43
Note: See TracBrowser for help on using the repository browser.