From 33f441b42438e6a48b49fc77ea109d251ee0d660 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 25 Nov 2007 11:11:59 +0000 Subject: [PATCH] * Adapt the C++ bindings to the event API change. --- cxx/caca++.cpp | 4 ++-- cxx/caca++.h | 2 +- cxx/cxxtest.cpp | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cxx/caca++.cpp b/cxx/caca++.cpp index 6a243d1..a8734b3 100644 --- a/cxx/caca++.cpp +++ b/cxx/caca++.cpp @@ -18,10 +18,10 @@ * so on. */ +#include #include "caca++.h" - Caca::Caca(Cucul *cv) { dp = caca_create_display(cv->get_cucul_canvas_t()); @@ -78,7 +78,7 @@ int Caca::setTitle(char const *s) int Caca::getEvent(unsigned int g, Event *n, int aa) { - return caca_get_event(dp, g, &n->e, aa); + return caca_get_event(dp, g, n ? &n->e : NULL, aa); } unsigned int Caca::getMouseX() diff --git a/cxx/caca++.h b/cxx/caca++.h index 29ebc70..c47df78 100644 --- a/cxx/caca++.h +++ b/cxx/caca++.h @@ -47,7 +47,7 @@ class Event } type; protected: - caca_event e; + caca_event_t e; }; class Caca diff --git a/cxx/cxxtest.cpp b/cxx/cxxtest.cpp index ccf56dc..ddf35b8 100644 --- a/cxx/cxxtest.cpp +++ b/cxx/cxxtest.cpp @@ -43,7 +43,6 @@ int main(int argc, char *argv[]) { Cucul *qq, *pig; Caca *kk; - Event ev; int x = 0, y = 0, ix = 1, iy = 1; @@ -76,7 +75,7 @@ int main(int argc, char *argv[]) kk->setDisplayTime(20000); - while(!kk->getEvent(ev.CACA_EVENT_KEY_PRESS, &ev, 0)) { + while(!kk->getEvent(Event::CACA_EVENT_KEY_PRESS, NULL, 0)) { /* In case of resize ...*/