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 "ZFUIKit/ZFUIDraw.h"
12
40
41// ============================================================
46public:
51 ZF_IN ZFUIDrawableView *drawableView
52 , ZF_OUT zfbool &nativeImplViewRequireVirtualIndex
58 ZF_IN ZFUIDrawableView *drawableView
59 , ZF_IN void *nativeDrawableView
61
63 virtual void drawRequest(ZF_IN ZFUIDrawableView *drawableView) zfpurevirtual;
64
65public:
70
71public:
76 drawableView->_ZFP_ZFUIDrawableView_onDraw();
77 }
78ZFPROTOCOL_INTERFACE_END(ZFUIDrawForView)
79
80// ============================================================
85public:
89 , ZF_IN const ZFUISize &imageSizePixel
93ZFPROTOCOL_INTERFACE_END(ZFUIDrawForImage)
94
95// ============================================================
100public:
103 ZF_IN ZFUIDrawToken &token
104 , ZF_IN const ZFUIRect &targetFramePixel
105 ) {
106 return zffalse;
107 }
108
110 ZF_IN ZFUIDrawToken &token
111 , ZF_IN const ZFUIColor &color
112 , ZF_IN const ZFUIRect &targetFramePixel
113 ) {
114 return zffalse;
115 }
116
118 ZF_IN ZFUIDrawToken &token
119 , ZF_IN ZFUIImage *image
120 , ZF_IN const ZFUIRect &imageFramePixel
121 , ZF_IN const ZFUIRect &targetFramePixel
122 ) {
123 return zffalse;
124 }
125
127 ZF_IN ZFUIDrawToken &token
128 , ZF_IN const zfstring &text
129 , ZF_IN ZFUITextConfig *config
130 , ZF_IN const ZFUIRect &targetFramePixel
131 ) {
132 return zffalse;
133 }
135
137#endif // #ifndef _ZFI_ZFProtocolZFUIDraw_h_
138
#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:180
#define ZF_OUT
dummy macro that shows the param used as required output
Definition ZFCoreTypeDef_ClassType.h:188
#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:196
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#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:414
#define ZFPROTOCOL_INTERFACE_BEGIN(ZFLIB_, ModuleName)
declare a protocol interface for ZFFramework
Definition ZFProtocol.h:408
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:1184
base class of all objects
Definition ZFObjectCore.h:209
virtual zfbool beginForImage(ZFUIDrawToken &token, const ZFUISize &imageSizePixel)=0
see ZFUIDraw::beginForImage
virtual void * endForImage(ZFUIDrawToken &token)=0
see ZFUIDraw::beginForImage
virtual void nativeDrawableViewDestroy(ZFUIDrawableView *drawableView, void *nativeDrawableView)=0
destroy native text view
virtual void * nativeDrawableViewCreate(ZFUIDrawableView *drawableView, zfbool &nativeImplViewRequireVirtualIndex)=0
create native drawable view
void notifyOnDraw(ZFUIDrawableView *drawableView)
implementations must notify when need to draw the view
Definition ZFProtocolZFUIDraw.h:75
virtual void drawRequest(ZFUIDrawableView *drawableView)=0
see ZFUIDrawableView::drawRequest
virtual void endForView(ZFUIDrawToken &token)=0
see ZFUIDraw::beginForView
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:109
virtual zfbool drawText(ZFUIDrawToken &token, const zfstring &text, ZFUITextConfig *config, const ZFUIRect &targetFramePixel)
see ZFUIDraw::beginForView
Definition ZFProtocolZFUIDraw.h:126
virtual zfbool drawClear(ZFUIDrawToken &token, const ZFUIRect &targetFramePixel)
see ZFUIDraw::beginForView
Definition ZFProtocolZFUIDraw.h:102
virtual zfbool drawImage(ZFUIDrawToken &token, ZFUIImage *image, const ZFUIRect &imageFramePixel, const ZFUIRect &targetFramePixel)
see ZFUIDraw::beginForView
Definition ZFProtocolZFUIDraw.h:117
token for impl
Definition ZFProtocolZFUIDraw.h:14
ZFUIDrawToken(ZFUIDrawToken::Type type, ZFObject *target, ZFUISize targetSizePixel)
main constructor
Definition ZFProtocolZFUIDraw.h:28
void * impl
impl
Definition ZFProtocolZFUIDraw.h:24
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
abstract view that can draw user content
Definition ZFUIDraw.h:19
image storage
Definition ZFUIImage.h:30
2D rectangle
Definition ZFUITypeDef.h:636
2D size
Definition ZFUITypeDef.h:397
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