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

📄 desktopwindowcontainer.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 __DESKTOPWINDOWCONTAINER_H__
#define __DESKTOPWINDOWCONTAINER_H__

// INCLUDES
#include <coecntrl.h>

#include "ConnDetailsSettingList.h"
#include "PixelFormat.h"
#include "PixelBuffer.h"
#include "Conn.h"

// CLASS DECLARATION
class CDesktopWindowContainer : public CCoeControl, 
								public MCoeControlObserver
{
public: // New methods

	/**
	 * NewL.
	 * Two-phased constructor.
	 * Create a CDesktopWindowContainer object, which will draw itself to aRect.
	 * @param aRect The rectangle this view will be drawn to.
	 * @return a pointer to the created instance of CDesktopWindowContainerw.
	 */
	static CDesktopWindowContainer* NewL(const TRect& aRect,CConn* aConn);

	/**
	 * NewLC.
	 * Two-phased constructor.
	 * Create a CDesktopWindowContainer object, which will draw itself
	 * to aRect.
	 * @param aRect Rectangle this view will be drawn to.
	 * @return A pointer to the created instance of CDesktopWindowContainer.
	 */
	static CDesktopWindowContainer* NewLC(const TRect& aRect,CConn* aConn);

	/**
	 * ~CDesktopWindowContainer
	 * Virtual Destructor.
	 */
	virtual ~CDesktopWindowContainer();

private:  // Functions from base classes

	/**
	 * From CCoeControl, Draw
	 * Draw this CDesktopWindowContainer to the screen.
	 * @param aRect the rectangle of this view that needs updating
	 */
	void Draw(const TRect& aRect) const;

	/**
	 * From CoeControl, SizeChanged.
	 * Called by framework when the view size is changed.
	 */
	virtual void SizeChanged();
	
	/**
	 * HandleControlEventL()
	 * Handles an event from an observed control.
	 * This function is called when a control for which 
	 * this control is the observer calls CCoeControl::ReportEventL().
	 *
	 * @param CCoeControl *aControl The control that sent the event.
	 * @param TCoeEvent aEventType The event type. 
	 */
	void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType);
	
	/*
	 -----------------------------------------------------------------------------

	 TInt CDesktopWindowContainer::CountComponentControls() const

	 Description: return the number of controls in the current container
	 Comments   :

	 Return values: number of controls in the container

	 -----------------------------------------------------------------------------
	 */
	TInt CountComponentControls() const;
	
	/*
	 -----------------------------------------------------------------------------

	 CCoeControl* CDesktopWindowContainer::ComponentControl(TInt aIndex) const

	 Description: return control pointer according to index
	 Comments   :

	 Return values: pointer to CCoeControl object

	 -----------------------------------------------------------------------------
	 */
	CCoeControl* ComponentControl(TInt aIndex) const;
	
	/*
	 -----------------------------------------------------------------------------

		TKeyResponse CDesktopWindowContainer::OfferKeyEventL(
			const TKeyEvent& aKeyEvent,TEventCode aType)

		Description: Called by framework when a key is pressed
		Comments   :

		Return values: whether the key has been consumed or not.

	 -----------------------------------------------------------------------------
	 */
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
	
public:
	void InitGraphics();
	
	CPixelFormat* GetPF();
	
	void SetCursor(TInt aHotspotX,TInt aHotspotY,TInt aW,TInt aH,RBuf8& aData,RBuf8& aMask);
	
	void SetColourMapEntries(TInt aFirstColour,TInt aNColours,RArray<TInt>& aRgbs);
	
	void Resize();
	
	void DrawInvalidRect();
	
	void Invalidate(TInt aX,TInt aY,TInt aW,TInt aH);
	
	void BeginRect(TInt aX,TInt aY,TInt aW,TInt aH,TEncodings aEncoding);
	
	void EndRect(TInt aX,TInt aY,TInt aW,TInt aH,TEncodings aEncoding);
	
	void FillRect(TInt aX,TInt aY,TInt aW,TInt aH,TInt aP);
	
	void ImageRect(TInt aX,TInt aY,TInt aW,TInt aH,TDes8& aP,TInt aOffset);
	
	void CopyRect(TInt aX,TInt aY,TInt aW,TInt aH,TInt aSx,TInt aSy);
	
	TBool OverlapsCursor(TInt aX,TInt aY,TInt aW,TInt aH);
	
	void ResetLocalCursor();
	
	void CheckClipboard();
	
	void HideLocalCursor();
	
	void ShowLocalCursor();

private: // Constructors

	/**
	 * ConstructL
	 * 2nd phase constructor.
	 * Perform the second phase construction of a
	 * CDesktopWindowContainer object.
	 * @param aRect The rectangle this view will be drawn to.
	 */
	void ConstructL(const TRect& aRect,CConn* aConn);

	/**
	 * CDesktopWindowContainerAppView.
	 * C++ default constructor.
	 */
	CDesktopWindowContainer();
	
private:	// Member variables	
	CConn* iConn;
	CPixelBufferImage* iImage;
	CWindowGc* iGraphics;
	
	CCursor* iCursor;
	TBool iCursorVisible;
	TBool iCursorAvailable;
	TInt iCursorPosX, iCursorPosY;
	CManagedPixelBuffer* iCursorBacking;
	TInt iCursorBackingX, iCursorBackingY;
	
	TBool iInvalidRect;
	TInt iInvalidLeft, iInvalidRight, iInvalidTop, iInvalidBottom;
	
	TInt iKeyAcceleration;
	
	TRect iZoom;
};

#endif // __DESKTOPWINDOWCONTAINER_H__

// End of File

⌨️ 快捷键说明

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