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

Last change on this file since 861 was 838, checked in by Sam Hocevar, 14 years ago
  • Removed soon-to-be-thrown-away sprite stuff from the C++ bindings.
  • 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 838 2006-04-22 19:00:14Z sam $
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 838 2006-04-22 19:00:14Z sam $
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#include <cucul.h>
26#include <caca.h>
27
28#include <cucul++.h>
29
30class Event
31{
32    friend class Caca;
33  public:
34    enum caca_event_type
35    {
36        CACA_EVENT_NONE =          0x0000, /**< No event. */
37
38        CACA_EVENT_KEY_PRESS =     0x0001, /**< A key was pressed. */
39        CACA_EVENT_KEY_RELEASE =   0x0002, /**< A key was released. */
40        CACA_EVENT_MOUSE_PRESS =   0x0004, /**< A mouse button was pressed. */
41        CACA_EVENT_MOUSE_RELEASE = 0x0008, /**< A mouse button was released. */
42        CACA_EVENT_MOUSE_MOTION =  0x0010, /**< The mouse was moved. */
43        CACA_EVENT_RESIZE =        0x0020, /**< The window was resized. */
44
45        CACA_EVENT_ANY =           0xffff  /**< Bitmask for any event. */
46    } type;
47
48  protected:
49    caca_event e;
50};
51
52class Caca
53{
54  public:
55    Caca();
56    Caca(Cucul *cv);
57    ~Caca();
58
59    void attach(Cucul *cv);
60    void detach();
61    void set_delay(unsigned int);
62    void display();
63    unsigned int get_rendertime();
64    unsigned int get_display_width();
65    unsigned int get_display_height();
66    int set_display_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  private:
73    caca_display_t *dp;
74};
75
76#endif /* _CACA_PP_H */
Note: See TracBrowser for help on using the repository browser.