19682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/*
29682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    SDL - Simple DirectMedia Layer
39682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Copyright (C) 2003  Sam Hocevar
49682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
59682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    This library is free software; you can redistribute it and/or
69682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    modify it under the terms of the GNU Library General Public
79682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    License as published by the Free Software Foundation; either
89682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    version 2 of the License, or (at your option) any later version.
99682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    This library is distributed in the hope that it will be useful,
119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    but WITHOUT ANY WARRANTY; without even the implied warranty of
129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Library General Public License for more details.
149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    You should have received a copy of the GNU Library General Public
169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    License along with this library; if not, write to the Free
179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Sam Hocevar
209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    sam@zoy.org
219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall*/
229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifdef SAVE_RCSID
249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstatic char rcsid =
259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall "@(#) $Id: libsdl-1.2.11-libcaca.patch,v 1.1 2006/09/18 16:06:06 mr_bones_ Exp $";
269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifndef _SDL_cacavideo_h
299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define _SDL_cacavideo_h
309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_mouse.h"
329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../SDL_sysvideo.h"
339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_mutex.h"
349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <sys/time.h>
369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <time.h>
379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <caca.h>
399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifdef CACA_API_VERSION_1
409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <caca0.h>
419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Hidden "this" pointer for the video functions */
449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define _THIS	SDL_VideoDevice *this
459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_NUMMODES 6
479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Private display data */
499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstruct SDL_PrivateVideoData {
509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	SDL_Rect *SDL_modelist[SDL_NUMMODES+1];
519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	SDL_mutex *mutex;
529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	struct caca_bitmap *bitmap;
549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	void *buffer;
559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	int w, h;
569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	int lastkey;
589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	struct timeval lasttime;
599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall};
609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Old variable names */
629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_modelist		(this->hidden->SDL_modelist)
639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Caca_palette		    (this->hidden->palette)
649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Caca_bitmap		    (this->hidden->bitmap)
659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Caca_buffer		    (this->hidden->buffer)
669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Caca_w		    (this->hidden->w)
689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Caca_h		    (this->hidden->h)
699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Caca_lastkey		    (this->hidden->lastkey)
719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Caca_lasttime		    (this->hidden->lasttime)
729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Caca_mutex		    (this->hidden->mutex)
749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif /* _SDL_cacavideo_h */
769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
77