source: libcaca/trunk/cpp/caca++.h @ 796

Last change on this file since 796 was 796, checked in by Jean-Yves Lamoureux, 14 years ago
  • Fixed compile problem, put Event outside Caca class
  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1/*
2 *  libcaca++      C++ bindings for libcaca
3 *  Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
4 *                All Rights Reserved
5 *
6 *  $Id: caca++.h 796 2006-04-17 13:23:28Z jylam $
7 *
8 *  This library is free software; you can redistribute it and/or
9 *  modify it under the terms of the Do What The Fuck You Want To
10 *  Public License, Version 2, as published by Sam Hocevar. See
11 *  http://sam.zoy.org/wtfpl/COPYING for more details.
12 */
13
14/** \file caca++.h
15 *  \version \$Id: caca++.h 796 2006-04-17 13:23:28Z jylam $
16 *  \author Jean-Yves Lamoureux <jylam@lnxscene.org>
17 *  \brief The \e libcaca++ public header.
18 *
19 *  This header contains the public types and functions that applications
20 *  using \e libcaca++ may use.
21 */
22#ifndef _CACA_PP_H
23#define _CACA_PP_H
24
25
26#include "cucul.h"
27#include "caca.h"
28
29#include "cucul++.h"
30
31
32class Event {
33    friend class Caca;
34 public:
35    enum caca_event_type
36    {
37        CACA_EVENT_NONE =          0x0000, /**< No event. */
38
39        CACA_EVENT_KEY_PRESS =     0x0001, /**< A key was pressed. */
40        CACA_EVENT_KEY_RELEASE =   0x0002, /**< A key was released. */
41        CACA_EVENT_MOUSE_PRESS =   0x0004, /**< A mouse button was pressed. */
42        CACA_EVENT_MOUSE_RELEASE = 0x0008, /**< A mouse button was released. */
43        CACA_EVENT_MOUSE_MOTION =  0x0010, /**< The mouse was moved. */
44        CACA_EVENT_RESIZE =        0x0020, /**< The window was resized. */
45
46        CACA_EVENT_ANY =           0xffff  /**< Bitmask for any event. */
47    } type;
48
49 protected:
50    caca_event *e;
51};
52
53class Caca {
54 public:
55    Caca();
56    Caca(Cucul *qq);
57    ~Caca();
58
59    void    attach (Cucul *qq);
60    void        detach ();
61    void        set_delay (unsigned int);
62    void        display ();
63    unsigned int        get_rendertime ();
64    unsigned int        get_window_width ();
65    unsigned int        get_window_height ();
66    int         set_window_title (char const *);
67    int         get_event (unsigned int, Event*, int);
68    unsigned int        get_mouse_x ();
69    unsigned int        get_mouse_y ();
70    void        set_mouse (int);
71
72
73   
74    private:
75    caca_t *kk;
76};
77
78
79#endif /* _CACA_PP_H */
Note: See TracBrowser for help on using the repository browser.