⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decoder.h

📁 vncviewer_source_1.0
💻 H
字号:
/* Copyright (C) 2006 Lucas Gomez  All Rights Reserved.
 * 
 * This 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 software 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 software; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
 * USA.
 */

#ifndef __DECODER_H__
#define __DECODER_H__

// INCLUDES
#include <e32base.h>

#include "MsgHandler.h"
#include "ZLibInStream.h"

// ENUMERATIONS

// CONSTANTES
const TInt KBPP=8;

const TInt KHextileRaw=(1<<0);
const TInt KHextileBgSpecified=(1<<1);
const TInt KHextileFgSpecified=(1<<2);
const TInt KHextileAnySubrects=(1<<3);
const TInt KHextileSubrectsColoured=(1<<4);

// CLASS FORWARDING
class CMsgReader;

// CLASS DECLARATION

/**
* MDecoder interface
*/
class MDecoder
{   
public:	// class methods
    virtual void ReadRect(TInt aX,TInt aY,TInt aW,TInt aH,
                          CMsgHandler* aHandler)=0;

	static TBool Supported(TEncodings aEncoding);

	static MDecoder* CreateDecoder(TEncodings aEncoding,CMsgReader* aReader);
};

/**
* RawDecoder application class.
*/
class RawDecoder : public MDecoder
{
public:	// ctor & dtor
	RawDecoder(CMsgReader* aMsgReader);
	
	virtual	~RawDecoder();

public:	//class methods
	void ReadRect(TInt aX,TInt aY,TInt aW,TInt aH,
                  CMsgHandler* aHandler);
	
private: // member variables
	CMsgReader* iMsgReader;
};

/**
* RREDecoder application class.
*/
class RREDecoder : public MDecoder
{
public:	// ctor & dtor
	RREDecoder(CMsgReader* aMsgReader);
	
	virtual ~RREDecoder();

public:	//class methods
	void ReadRect(TInt aX,TInt aY,TInt aW,TInt aH,
                  CMsgHandler* aHandler);
                  
    inline TInt ReadPixel(InStream* aIS) {return aIS->ReadU8();}
	
private: // member variables
	CMsgReader* iMsgReader;
};

/**
* HextileDecoder application class.
*/
class HextileDecoder : public MDecoder
{
public:	// ctor & dtor
	HextileDecoder(CMsgReader* aMsgReader);
	
	virtual ~HextileDecoder();

public:	//class methods
	void ReadRect(TInt aX,TInt aY,TInt aW,TInt aH,
                  CMsgHandler* aHandler);
                  
    inline TInt ReadPixel(InStream* aIS) {return aIS->ReadU8();}
	
private: // member variables
	CMsgReader* iMsgReader;
};

/**
* ZRLEDecoder application class.
*/
class ZRLEDecoder : public MDecoder
{
public:	// ctor & dtor
	ZRLEDecoder(CMsgReader* aMsgReader);
	
	virtual ~ZRLEDecoder();

public:	//class methods
	void ReadRect(TInt aX,TInt aY,TInt aW,TInt aH,
                  CMsgHandler* aHandler);
                  
    inline TInt ReadPixel(InStream* aIS) {return aIS->ReadU8();}
	
private: // member variables
	CMsgReader* iMsgReader;
	
	ZLibInStream* iZIS;
};

#endif // __DECODER_H__


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -