Changeset 796 for libcaca/trunk/cpp
- Timestamp:
- Apr 17, 2006, 3:23:28 PM (15 years ago)
- Location:
- libcaca/trunk/cpp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cpp/caca++.cpp
r784 r796 68 68 return caca_set_window_title(kk, s); 69 69 } 70 int Caca::get_event (unsigned int g, Caca::Event *n, int aa)70 int Caca::get_event (unsigned int g, Event *n, int aa) 71 71 { 72 72 return caca_get_event(kk, g, n->e, aa); -
libcaca/trunk/cpp/caca++.h
r784 r796 30 30 31 31 32 class 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 32 53 class Caca { 33 54 public: … … 35 56 Caca(Cucul *qq); 36 57 ~Caca(); 37 38 class Event {39 friend class Caca;40 protected:41 caca_event *e;42 };43 44 58 45 59 void attach (Cucul *qq); … … 51 65 unsigned int get_window_height (); 52 66 int set_window_title (char const *); 53 int get_event (unsigned int, Caca::Event*, int);67 int get_event (unsigned int, Event*, int); 54 68 unsigned int get_mouse_x (); 55 69 unsigned int get_mouse_y (); … … 60 74 private: 61 75 caca_t *kk; 62 63 64 76 }; 65 77 -
libcaca/trunk/cpp/cpptest.cpp
r785 r796 44 44 Cucul *qq; 45 45 Caca *kk; 46 Caca::Event ev; 46 Event ev; 47 47 48 int x = 0, y = 0, ix = 1, iy = 1; 48 49 … … 67 68 kk->set_delay(20000); 68 69 69 while(!kk->get_event( CACA_EVENT_KEY_PRESS, &ev, 0)) {70 while(!kk->get_event(ev.CACA_EVENT_KEY_PRESS, &ev, 0)) { 70 71 71 72 /* Draw pig */
Note: See TracChangeset
for help on using the changeset viewer.