diff options
Diffstat (limited to 'include/font.h')
| -rw-r--r-- | include/font.h | 166 | 
1 files changed, 83 insertions, 83 deletions
diff --git a/include/font.h b/include/font.h index d69fc50..9530a37 100644 --- a/include/font.h +++ b/include/font.h @@ -1,83 +1,83 @@ -/*
 - *  mogltk
 - *  Copyright (C) 1999-2004 Nicolas "Pixel" Noble
 - *
 - *  This program is free software; you can redistribute it and/or modify
 - *  it under the terms of the GNU General Public License as published by
 - *  the Free Software Foundation; either version 2 of the License, or
 - *  (at your option) any later version.
 - *
 - *  This program is distributed in the hope that it will be useful,
 - *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 - *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 - *  GNU General Public License for more details.
 - *
 - *  You should have received a copy of the GNU General Public License
 - *  along with this program; if not, write to the Free Software
 - *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 - */
 -
 -/* $Id: font.h,v 1.9 2004-11-27 21:44:50 pixel Exp $ */
 -
 -#ifndef __FONT_H__
 -#define __FONT_H__
 -
 -#include <SDL.h>
 -#include <stdarg.h>
 -#include <BString.h>
 -#include <Handle.h>
 -#include <texture.h>
 -#include <mcolor.h>
 -#include <base.h>
 -
 -namespace mogltk {
 -    class font : public Base {
 -      public:
 -          font(Handle *);
 -	  virtual ~font();
 -	virtual void drawentry(Uint16, int, int, ColorP = WHITE);
 -        void drawtotex(texture *, Uint16, int, int, ColorP = WHITE);
 -	void putcursor(int, int);
 -	void putentry(Uint16, ColorP = WHITE);
 -	void putentryontex(texture *, Uint16, ColorP = WHITE);
 -	void drawchar(char, ColorP = WHITE);
 -	void drawcharontex(texture *, char, ColorP = WHITE);
 -	void newline(void);
 -	int printf(const ugly_string &, ...);
 -	int printf(const char *, ...);
 -	int printf(const ugly_string &, va_list);
 -        rect size(const ugly_string &, ...);
 -	rect size(const char *, ...);
 -	rect size(const ugly_string &, va_list);
 -        rect printtotex(texture *, const ugly_string &, ...);
 -	rect printtotex(texture *, const char *, ...);
 -	rect printtotex(texture *, const ugly_string &, va_list);
 -        texture * printtex(rect *, const ugly_string &, ...);
 -	texture * printtex(rect *, const char *, ...);
 -	texture * printtex(rect *, const ugly_string &, va_list);
 -	void setcolor(ColorP);
 -	void setshadow(int);
 -	void setwspace(int);
 -	int findchar(char) const;
 -	int singletextsize(const String &) const;
 -	
 -      protected:
 -        Uint8 * sizes;
 -	Uint16 nbentries, nbcT, nbT;
 -	Uint8 flags, maxX, maxY, nbcU, nbcV, base, inter;
 -	int cx, cy, ox;
 -	ColorP textcolor;
 -	int shadow, wspace;
 -	texture * alloctexture();
 -	void Bind(int);
 -      private:
 -        void checknbind(int, ColorP);
 -	texture ** fonttex;
 -	texture ** fontcache[16];
 -	Uint16 * corresp;
 -    };
 -    extern font * SystemFont;
 -    extern font * FixedFont;
 -};
 -
 -#endif
 +/* + *  mogltk + *  Copyright (C) 1999-2004 Nicolas "Pixel" Noble + * + *  This program is free software; you can redistribute it and/or modify + *  it under the terms of the GNU General Public License as published by + *  the Free Software Foundation; either version 2 of the License, or + *  (at your option) any later version. + * + *  This program is distributed in the hope that it will be useful, + *  but WITHOUT ANY WARRANTY; without even the implied warranty of + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + *  GNU General Public License for more details. + * + *  You should have received a copy of the GNU General Public License + *  along with this program; if not, write to the Free Software + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA + */ + +/* $Id: font.h,v 1.10 2004-11-27 21:48:01 pixel Exp $ */ + +#ifndef __FONT_H__ +#define __FONT_H__ + +#include <SDL.h> +#include <stdarg.h> +#include <BString.h> +#include <Handle.h> +#include <texture.h> +#include <mcolor.h> +#include <base.h> + +namespace mogltk { +    class font : public Base { +      public: +          font(Handle *); +	  virtual ~font(); +	virtual void drawentry(Uint16, int, int, ColorP = WHITE); +        void drawtotex(texture *, Uint16, int, int, ColorP = WHITE); +	void putcursor(int, int); +	void putentry(Uint16, ColorP = WHITE); +	void putentryontex(texture *, Uint16, ColorP = WHITE); +	void drawchar(char, ColorP = WHITE); +	void drawcharontex(texture *, char, ColorP = WHITE); +	void newline(void); +	int printf(const ugly_string &, ...); +	int printf(const char *, ...); +	int printf(const ugly_string &, va_list); +        rect size(const ugly_string &, ...); +	rect size(const char *, ...); +	rect size(const ugly_string &, va_list); +        rect printtotex(texture *, const ugly_string &, ...); +	rect printtotex(texture *, const char *, ...); +	rect printtotex(texture *, const ugly_string &, va_list); +        texture * printtex(rect *, const ugly_string &, ...); +	texture * printtex(rect *, const char *, ...); +	texture * printtex(rect *, const ugly_string &, va_list); +	void setcolor(ColorP); +	void setshadow(int); +	void setwspace(int); +	int findchar(char) const; +	int singletextsize(const String &) const; +	 +      protected: +        Uint8 * sizes; +	Uint16 nbentries, nbcT, nbT; +	Uint8 flags, maxX, maxY, nbcU, nbcV, base, inter; +	int cx, cy, ox; +	ColorP textcolor; +	int shadow, wspace; +	texture * alloctexture(); +	void Bind(int); +      private: +        void checknbind(int, ColorP); +	texture ** fonttex; +	texture ** fontcache[16]; +	Uint16 * corresp; +    }; +    extern font * SystemFont; +    extern font * FixedFont; +}; + +#endif  | 
