ZFFramework
Loading...
Searching...
No Matches
ZFProtocolZFUIDraw.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFProtocolZFUIDraw_h_
7#define _ZFI_ZFProtocolZFUIDraw_h_
8
9#include "ZFCore/ZFProtocol.h"
10#include "../ZFUIDraw.h"
12
43
44// ============================================================
49public:
58
60 virtual void drawRequest(ZF_IN ZFUIDrawableView *drawableView) zfpurevirtual;
61
62public:
67
68public:
73 drawableView->_ZFP_ZFUIDrawableView_onDraw();
74 }
75ZFPROTOCOL_INTERFACE_END(ZFUIDrawForView)
76
77// ============================================================
82public:
86 , ZF_IN const ZFUISize &imageSizePixel
90ZFPROTOCOL_INTERFACE_END(ZFUIDrawForImage)
91
92// ============================================================
97public:
100 ZF_IN ZFUIDrawToken &token
101 , ZF_IN const ZFUIRect &targetFramePixel
102 ) {
103 return zffalse;
104 }
105
107 ZF_IN ZFUIDrawToken &token
108 , ZF_IN const ZFUIColor &color
109 , ZF_IN const ZFUIRect &targetFramePixel
110 ) {
111 return zffalse;
112 }
113
115 ZF_IN ZFUIDrawToken &token
116 , ZF_IN ZFUIImage *image
117 , ZF_IN const ZFUIRect &imageFramePixel
118 , ZF_IN const ZFUIRect &targetFramePixel
119 ) {
120 return zffalse;
121 }
122
124 ZF_IN ZFUIDrawToken &token
125 , ZF_IN const zfstring &text
126 , ZF_IN ZFUITextConfig *config
127 , ZF_IN const ZFUIRect &targetFramePixel
128 ) {
129 return zffalse;
130 }
132
134#endif // #ifndef _ZFI_ZFProtocolZFUIDraw_h_
135
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfpurevirtual
dummy macro shows that a method is pure virtual method
Definition ZFCoreTypeDef_ClassType.h:68
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:198
#define zfclassNotPOD
shows the class is not a POD type, you should not memset it or declare it in stack or copy value by c...
Definition ZFCoreTypeDef_ClassType.h:48
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:214
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_zft_zffloat zffloat
same as float, see zfindex
Definition ZFCoreTypeDef_CoreType.h:183
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
protocol definitions for ZFFramework
#define ZFPROTOCOL_INTERFACE_END(ModuleName)
for more information, please refer to ZFPROTOCOL_INTERFACE_BEGIN
Definition ZFProtocol.h:418
#define ZFPROTOCOL_INTERFACE_BEGIN(ZFLIB_, ModuleName)
declare a protocol interface for ZFFramework
Definition ZFProtocol.h:412
global style for ui elements
#define ZFLIB_ZFUIKit
used to export symbols
Definition ZFUIKitDef.h:16
_zft_ZFUIColor ZFUIColor
color with AARRGGBB format
Definition ZFUITypeDef.h:1213
base class of all objects
Definition ZFObjectCore.h:195
virtual zfbool beginForImage(ZFUIDrawToken &token, const ZFUISize &imageSizePixel)=0
see ZFUIDraw::beginForImage
virtual void * endForImage(ZFUIDrawToken &token)=0
see ZFUIDraw::beginForImage
void notifyOnDraw(ZFUIDrawableView *drawableView)
implementations must notify when need to draw the view
Definition ZFProtocolZFUIDraw.h:72
virtual void * nativeDrawableViewCreate(ZFUIDrawableView *drawableView)=0
create native drawable view
virtual void drawRequest(ZFUIDrawableView *drawableView)=0
see ZFUIDrawableView::drawRequest
virtual void endForView(ZFUIDrawToken &token)=0
see ZFUIDraw::beginForView
virtual void nativeDrawableViewDestroy(ZFUIDrawableView *drawableView)=0
destroy native text view
virtual zfbool beginForView(ZFUIDrawToken &token)=0
see ZFUIDraw::beginForView
virtual zfbool drawColor(ZFUIDrawToken &token, const ZFUIColor &color, const ZFUIRect &targetFramePixel)
see ZFUIDraw::beginForView
Definition ZFProtocolZFUIDraw.h:106
virtual zfbool drawText(ZFUIDrawToken &token, const zfstring &text, ZFUITextConfig *config, const ZFUIRect &targetFramePixel)
see ZFUIDraw::beginForView
Definition ZFProtocolZFUIDraw.h:123
virtual zfbool drawClear(ZFUIDrawToken &token, const ZFUIRect &targetFramePixel)
see ZFUIDraw::beginForView
Definition ZFProtocolZFUIDraw.h:99
virtual zfbool drawImage(ZFUIDrawToken &token, ZFUIImage *image, const ZFUIRect &imageFramePixel, const ZFUIRect &targetFramePixel)
see ZFUIDraw::beginForView
Definition ZFProtocolZFUIDraw.h:114
token for impl
Definition ZFProtocolZFUIDraw.h:14
void * impl
impl
Definition ZFProtocolZFUIDraw.h:25
ZFUIDrawToken(ZFUIDrawToken::Type type, ZFObject *target, ZFUISize targetSizePixel, zffloat targetScale)
main constructor
Definition ZFProtocolZFUIDraw.h:29
ZFUISize targetSizePixel
target size in pixel
Definition ZFProtocolZFUIDraw.h:23
zfauto target
target
Definition ZFProtocolZFUIDraw.h:22
Type type
type
Definition ZFProtocolZFUIDraw.h:21
Type
type
Definition ZFProtocolZFUIDraw.h:17
@ TypeView
target is ZFUIDrawableView
Definition ZFProtocolZFUIDraw.h:18
@ TypeImage
target is ZFUIImage
Definition ZFProtocolZFUIDraw.h:19
zffloat targetScale
target scale
Definition ZFProtocolZFUIDraw.h:24
abstract view that can draw user content
Definition ZFUIDraw.h:19
image storage
Definition ZFUIImage.h:30
2D rectangle
Definition ZFUITypeDef.h:667
2D size
Definition ZFUITypeDef.h:418
text config
Definition ZFUIText.h:52
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
Definition ZFUIDraw.h:61