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

📄 kr_jitmapper.h

📁 这是法国Kaleido公司提供了一个手机mmi设计平台
💻 H
字号:
/***************************************************************************
KR_JitMapper.h  -  
-------------------
begin                : Tue Mar 3 2004
copyright            : (C) 2004 by DigitalAirways
email                : info@digitalairways.com
***************************************************************************/

/*
* Copyright (c) 2000-2004 DigitalAirways, sarl. All Rights Reserved.
*
* This software is the confidential and proprietary information of
* DigitalAirways, sarl. ("Confidential Information").  You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with DigitalAirways.
* A copy of this license is included in the licence.txt file included
* in this software package.
*/

/*
**************************************************************
* TODO
**************************************************************

- 

**************************************************************
* HISTORY
**************************************************************

- 
*/



#ifndef __KR_JITMAPPER__
#define __KR_JITMAPPER__

#include "EB_Defs.h"
#include "EB_PFWImage.h"
#include "KR_Option.h"
#include "KR_Resources.h"

#ifdef USE_DEPRECATED
#define SELECTED 		1
#define DIMMED   		2
#define UNIMPLEMENTED	4
#endif



class KREBDLIBS_API JitMapper : public Plugin {

protected:
	// BEWARE: bgImageSrc stores a pointer on the value that is still OWNED by the Option.
	// Therefore it may ONLY be changed by a Option object 
	pchar fBgImageSrc ; // BEWARE: fBgImageSrc stores a pointer on the value that is still OWNED by the Option. Therefore it may ONLY be changed by a Option object
	PFWImage* fBgImage ;
#ifdef DEV_PROFILE
	int useNumber ;
#endif // def DEV_PROFILE
	Option* fOption ; 
public:

	INSTANCIATOR(JitMapper) ;
	DEFINE_NEW(JitMapper);
	DEFINE_DELETE(JitMapper);	

	JitMapper(GContext* newGContext);
	virtual ~JitMapper();

	static JitMapper* makeInstance(GContext* newGContext, char* theclass); 

	virtual void init(char* /*param*/)  {}	

#ifdef USE_DEPRECATED
	void setOwner(Option* newOwner) {
		fOption = newOwner ; 
	}

	Option* getOwner() {
		return fOption; 
	}
#endif

	Option* getOption() { 
		return fOption; 
	}

	virtual void setOption(Option* newOwner) {
		fOption = newOwner ; 
	}

#ifdef USE_DEPRECATED
	long getState();
#endif

	Group* getGroup();

	/*
	<kaleidoc><filename>JitMapper</filename><page><api>
	<class>JitMapper</class>
	<method>getCaption</method>
	<java>public Object getCaption()</java>
	<cpp>void* getCaption()</cpp>
	<descr>
	<p>This method returns the caption of the associated option. If the option has the focus, its caption "on" is returned. Else, its caption "off" is returned.</p>
	</descr>
	</api></page></kaleidoc>
	*/
	virtual void* getCaption();

	//#ifdef USE_DEPRECATED
	virtual void setParameters(char* p);	
	virtual  void setParameters(char* p, long /*s*/) {
		setParameters(p);
	}
	//#endif


#ifdef USE_DEPRECATED
	virtual void setInfo(PFWImage* newBackground, int newState);
#endif

	/*
	<kaleidoc><filename>JitMapper</filename><page><api>
	<class>JitMapper</class>
	<method>setGraphicsImg</method>
	<cpp>void setGraphicsImg(PFWImage* newBackground)</cpp>
	<descr>
	<p>This method allows to set the image that must be used as the background image for the concerned JitMapper. Note that the name of this image as known by the JitMapper is not modified by this method, but a call to JitMapper::setGraphicsImg(pchar src) may induce a call to JitMapper::setGraphicsImg(PFWImage* newBackground).
	</p>
	</descr>
	</api></page></kaleidoc>
	*/
	void setGraphicsImg(PFWImage* newBackground);

	/*
	<kaleidoc><filename>JitMapper</filename><page><api>
	<class>JitMapper</class>
	<method>setGraphicsImg</method>
	<cpp>void setGraphicsImg(pchar src)</cpp>
	<descr>
	<p>This method allows to set the source of the bitmap that must be used as the background image for the concerned JitMapper. It actually changes the current backgroung image only if the new one is different from the previous one. From this bitmap name, the JitMapper will create a new image if it needs to do so. In this case, it will call JitMapper::setGraphicsImg(PFWImage* newBackground) later. Note that this function is very often called by the default implementation of Option.</p>
	<note>A concrete example of a JitMapper plugin implementation in C++ and Java can be found in the "My First Plug-ins" chapter.</note>
	</descr>
	</api></page></kaleidoc>
	*/
	void setGraphicsImg(pchar src);

	/*
	<kaleidoc><filename>JitMapper</filename><page><api>
	<class>JitMapper</class>
	<method>getGraphicsImg</method>
	<cpp>PFWImage* getGraphicsImg()</cpp>
	<descr>
	<p>In order to allow a Jitmapper to manage its background, this method and the next are available.</p>
	</descr>
	</api></page></kaleidoc>
	*/
	PFWImage* getGraphicsImg() { return fBgImage; }

	/*
	<kaleidoc><filename>JitMapper</filename><page><api>
	<class>JitMapper</class>
	<method>getGraphics</method>
	<cpp>Graphics* getGraphics()</cpp>
	</api></page></kaleidoc>
	*/
	Graphics* getGraphics() 
	{ 
		if(!fBgImage)
			return NULL;
		return fBgImage->getGraphics(); 
	}
	virtual void paint(Graphics* g, long x, long y);
	/*
	* Allows to paint a part of the current JitMapper into a g target surface.
	*/
	virtual void paintExtract(Graphics* g, int xT, int yT, int xF, int yF, int w, int h);

	/*
	<kaleidoc><filename>JitMapper</filename><page><api>
	<class>JitMapper</class>
	<method>getHeight</method>
	<java>public int getHeight()</java>
	<cpp>public int getHeight()</cpp>
	<descr>
	<p>This method returns the width of the JitMapper抯 background that is usually considered at design-time as the object抯 size. Of course, a JitMapper can draw out of its space as defined as design-time, but the method must be used carefully.</p>
	</descr>
	</api></page></kaleidoc>
	*/
	virtual int getHeight() ;

	/*
	<kaleidoc><filename>JitMapper</filename><page><api>
	<class>JitMapper</class>
	<method>getWidth</method>
	<java>public int getWidth()</java>
	<cpp>public int getWidth()</cpp>
	<descr>
	<p>This method returns the width of the JitMapper抯 background that is usually considered at design-time as the object抯 size. Of course, a JitMapper can draw out of its space as defined at design-time, but the method must be used carefully.</p>
	</descr>
	</api></page></kaleidoc>
	*/
	virtual int getWidth() ;

	/*
	* Request the runtime to repaint me at least in ms ms.
	* If a repaint is already scheduled in a shorter delay, it is kept
	* and this one is canceled.
	* If fullScreen==true, all the screen will ne repainted.
	* Otherwise, only this JitMapper will be repainted.
	*/
	void repaintBefore(KALEIDO_TIME_TYPE ms, boolean fullScreen=true);

	/*
	* This naming is more compliant with KREB's naming conventions as 
	* this is a request to do an asynchronous call
	*/
	void requestRepaintBefore(KALEIDO_TIME_TYPE ms, boolean fullScreen=true)
	{ repaintBefore(ms, fullScreen); }

};

typedef JitMapper* pJitMapper ;
typedef pJitMapper (*jitMapperInstanciator)(GContext* newGContext) ;

#endif // ndef __KR_JITMAPPER__

⌨️ 快捷键说明

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