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

Last change on this file since 917 was 917, checked in by Jean-Yves Lamoureux, 15 years ago
  • Fixed indentation. I did it myself, I'm a big boy.
  • 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 917 2006-04-26 18:53:08Z 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 917 2006-04-26 18:53:08Z 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 setDelay(unsigned int);
62    void Display();
63    unsigned int getRendertime();
64    unsigned int getWidth();
65    unsigned int getHeight();
66    int setTitle(char const *);
67    int getEvent(unsigned int, Event*, int);
68    unsigned int getMouseX();
69    unsigned int getMouseY();
70    void setMouse(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.