source: libcaca/trunk/cxx/caca++.h @ 1002

Last change on this file since 1002 was 1002, checked in by Jean-Yves Lamoureux, 14 years ago
  • Updated 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 1002 2006-06-10 11:35:18Z 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 1002 2006-06-10 11:35:18Z 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#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 setDisplayTime(unsigned int);
62
63    void Display();
64    unsigned int getDisplayTime();
65    unsigned int getWidth();
66    unsigned int getHeight();
67    int setTitle(char const *);
68    int getEvent(unsigned int, Event*, int);
69    unsigned int getMouseX();
70    unsigned int getMouseY();
71    void setMouse(int);
72
73 private:
74    caca_display_t *dp;
75};
76
77#endif /* _CACA_PP_H */
Note: See TracBrowser for help on using the repository browser.