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

Last change on this file since 899 was 899, checked in by Jean-Yves Lamoureux, 15 years ago
  • Updated C++ bindings and renamed directory to more comprehensive cxx
  • Property svn:keywords set to Id
File size: 1.9 KB
RevLine 
[784]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 899 2006-04-26 12:11:55Z 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 899 2006-04-26 12:11:55Z 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 */
[781]22#ifndef _CACA_PP_H
23#define _CACA_PP_H
24
[827]25#include <cucul.h>
26#include <caca.h>
[781]27
[827]28#include <cucul++.h>
[781]29
[827]30class Event
31{
[796]32    friend class Caca;
[827]33  public:
[796]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
[827]48  protected:
[831]49    caca_event e;
[796]50};
51
[827]52class Caca
53{
54  public:
[781]55    Caca();
[838]56    Caca(Cucul *cv);
[781]57    ~Caca();
58
[897]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);
[781]71
[827]72  private:
[811]73    caca_display_t *dp;
[781]74};
75
76#endif /* _CACA_PP_H */
Note: See TracBrowser for help on using the repository browser.