~lidaobing/+junk/zhcon

« back to all changes in this revision

Viewing changes to src/display/libggi.h

  • Committer: LI Daobing
  • Date: 2008-11-04 04:39:18 UTC
  • Revision ID: lidaobing@gmail.com-20081104043918-nfwwvgfb0uied0mt
importĀ 1:0.2.6-5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vi:ts=4:shiftwidth=4:expandtab
 
2
/***************************************************************************
 
3
                          libggi.h  -  description
 
4
                             -------------------
 
5
    begin                : Fri July 20 2001
 
6
    copyright            : (C) 2001 by huyong
 
7
    email                : ccpaging@online.sh.cn
 
8
 
 
9
 ***************************************************************************/
 
10
 
 
11
/***************************************************************************
 
12
 *                                                                         *
 
13
 *   This program is free software; you can redistribute it and/or modify  *
 
14
 *   it under the terms of the GNU General Public License as published by  *
 
15
 *   the Free Software Foundation; either version 2 of the License, or     *
 
16
 *   (at your option) any later version.                                   *
 
17
 *                                                                         *
 
18
 ***************************************************************************/
 
19
 
 
20
#ifndef LIBGGI_H
 
21
#define LIBGGI_H
 
22
 
 
23
#include <ggi/ggi.h>
 
24
#include "basefont.h"
 
25
#include "graphdev.h"
 
26
 
 
27
class LIBGGI : public GraphDev  {
 
28
    public:
 
29
        static bool TryOpen();
 
30
        virtual ~LIBGGI();
 
31
 
 
32
        void PutPixel(int x,int y,int color);
 
33
        void FillRect(int x1,int y1,int x2,int y2,int color);
 
34
        void RevRect(int x1,int y1,int x2,int y2);
 
35
        void DrawChar(int x,int y,int fg,int bg,struct CharBitMap* pFont);
 
36
 
 
37
        void SwitchToGraph();
 
38
        void SwitchToText();
 
39
        void Update();
 
40
        string Name() { return "ggi"; }
 
41
 
 
42
    private:
 
43
        int GetPixMap(char* expanded,int fg,int bg,struct CharBitMap* pFont);
 
44
 
 
45
        static char* mpixMapBuf;
 
46
        static size_t mPixMapBufSize;
 
47
        static char* GetPixMapBuf(size_t size);
 
48
        
 
49
        static ggi_visual_t visual;
 
50
        static ggi_mode mode;
 
51
        static ggi_pixel mPixelColor[16];
 
52
        static int mBytesPixel;
 
53
};
 
54
 
 
55
#endif
 
56