]> git.vomp.tv Git - vompclient.git/blob - surface.h
Changes for demuxer. New mutex code
[vompclient.git] / surface.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3     Portions copyright 2004 Jon Gettler
4
5     This file is part of VOMP.
6
7     VOMP is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11
12     VOMP is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with VOMP; if not, write to the Free Software
19     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 */
21
22 #ifndef SURFACE_H
23 #define SURFACE_H
24
25 #include <stdio.h>
26 #include "defines.h"
27 #include "log.h"
28
29 // Font stuff
30
31 typedef struct bogl_font {
32   char *name;     /* Font name. */
33   int height;     /* Height in pixels. */
34   int spacing;     /* Vertical spacing in pixels. */
35   unsigned long *content;   /* 32-bit right-padded bitmap array. */
36   short *offset;      /* 256 offsets into content. */
37   unsigned char *width;   /* 256 character widths. */
38 } osd_font_t;
39
40 extern osd_font_t font_CaslonRoman_1_25;
41 extern osd_font_t font_helvB24;
42 extern osd_font_t font_helvB18;
43
44 class Surface
45 {
46   public:
47     Surface(int id = 0);
48     virtual ~Surface();
49
50     static Surface* getScreen();
51     static int getFontHeight();
52     int getCharWidth(char c);
53
54     int drawText(char* text, int x, int y, ULONG rgba);
55     int drawTextRJ(char* text, int x, int y, ULONG rgba);
56     int drawTextCentre(char* text, int x, int y, ULONG rgba);
57
58     virtual int create(UINT width, UINT height)=0;
59     virtual void display()=0;
60
61     virtual int fillblt(int x, int y, int width, int height, unsigned int c)=0;
62     virtual void drawPixel(int x, int y, unsigned int c)=0;
63     virtual void drawHorzLine(int x1, int x2, int y, unsigned int c)=0;
64     virtual void drawVertLine(int x, int y1, int y2, unsigned int c)=0;
65     virtual int updateToScreen(int sx, int sy, int w, int h, int dx, int dy)=0;
66     virtual void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b)=0;
67     virtual void screenShot(char* fileName)=0;
68
69     virtual int blt(int fd, unsigned long shandle, int sx, int sy, int width, int height, unsigned long dhandle, int dx, int dy)=0;
70
71     const static int SCREEN = 1;
72     const static int BUFFER = 2;
73
74   protected:
75     static Surface* screen;
76     static osd_font_t* font;
77 };
78
79 #endif