46 #ifndef __D4D_SCREEN_H
47 #define __D4D_SCREEN_H
58 #ifndef D4D_SCR_TITLE_OFF_X
59 #define D4D_SCR_TITLE_OFF_X 3
64 #ifndef D4D_SCR_TITLE_OFF_Y
65 #define D4D_SCR_TITLE_OFF_Y 1
70 #ifndef D4D_SCR_HEADER_SIZE_MIN_SIZE
71 #define D4D_SCR_HEADER_SIZE_MIN_SIZE 13
76 #ifndef D4D_SCR_TITLE_EXITBTN_MIN_SIZE
77 #define D4D_SCR_TITLE_EXITBTN_MIN_SIZE 6
82 #ifndef D4D_SCR_EXITBTN_CROSS_SIZE
83 #define D4D_SCR_EXITBTN_CROSS_SIZE 2
88 #ifndef D4D_SCR_TITLE_EXITBTN_OFFSET
89 #define D4D_SCR_TITLE_EXITBTN_OFFSET 3
103 #define D4D_SCR_F_OUTLINE (0x01)
104 #define D4D_SCR_F_BEVEL (0x02)
105 #define D4D_SCR_F_TITLEBAR (0x04)
106 #define D4D_SCR_F_EXIT (0x08)
107 #define D4D_SCR_F_BCKG (0x10)
109 #define D4D_SCR_F_TOUCHENABLE (D4D_SCR_FINT_TOUCHENABLE << 8)
110 #define D4D_SCR_F_MOUSE_NORMAL (D4D_SCR_FINT_MOUSE_NORMAL << 8)
111 #define D4D_SCR_F_MOUSE_BUSY (D4D_SCR_FINT_MOUSE_BUSY << 8)
112 #define D4D_SCR_F_MOUSE_UNAVAILABLE (D4D_SCR_FINT_MOUSE_UNAVAILABLE << 8)
118 #ifndef D4D_SCR_F_DEFAULT
119 #define D4D_SCR_F_DEFAULT (D4D_SCR_FINT_MOUSE_NORMAL)
127 #define D4D_SCR_FINT_INITDONE (0x01)
128 #define D4D_SCR_FINT_TOUCHENABLE (0x02)
129 #define D4D_SCR_FINT_REDRAWC (0x04)
130 #define D4D_SCR_FINT_CHECKOBJECTS (0x08)
132 #define D4D_SCR_FINT_MOUSE_MASK (0x60)
133 #define D4D_SCR_FINT_MOUSE_SHIFT (5)
135 #define D4D_SCR_FINT_MOUSE_NORMAL (0x20)
136 #define D4D_SCR_FINT_MOUSE_BUSY (0x40)
137 #define D4D_SCR_FINT_MOUSE_UNAVAILABLE (0x60)
221 #define _D4D_DECLARE_SCREEN_BEGIN(type, name, funcPrefix, x ,y, cx, cy, radius, text, fontId, icon, initFlags, pScheme) \
222 extern const D4D_OBJECT * const name##_objects[]; \
223 static void funcPrefix##OnInit(void); \
224 static void funcPrefix##OnMain(void); \
225 static void funcPrefix##OnActivate(void); \
226 static void funcPrefix##OnDeactivate(void); \
227 static Byte funcPrefix##OnObjectMsg(D4D_MESSAGE* pMsg); \
228 static D4D_SCREEN_DATA name##_data = { NULL, (Byte)((D4D_SCREEN_FLAGS)(initFlags >> 8) & 0x00FF)}; \
229 static D4D_STR_PROPERTIES name##_strPrties = { D4D_FNT_PRTY_TRANSPARENT_YES_MASK, (D4D_ALIGN_H_LEFT_MASK | D4D_ALIGN_V_CENTER_MASK)}; \
230 type D4D_SCREEN name = \
233 funcPrefix##OnInit, \
234 funcPrefix##OnMain, \
235 funcPrefix##OnActivate, \
236 funcPrefix##OnDeactivate, \
237 funcPrefix##OnObjectMsg, \
242 { text, sizeof(text), fontId, &name##_strPrties, 0, 0}, \
244 (D4D_SCREEN_FLAGS)(initFlags & 0x00FF), \
248 const D4D_OBJECT * const name##_objects[] = \
268 #define D4D_DECLARE_SCREEN_BEGIN(name, funcPrefix, x ,y, cx, cy, text, fontId, icon, initFlags, pScheme)\
269 _D4D_DECLARE_SCREEN_BEGIN(D4D_CONST, name, funcPrefix, x ,y, cx, cy, 0, text, fontId, icon, initFlags, pScheme)
278 #define D4D_DECLARE_STD_SCREEN_BEGIN(name, funcPrefix) D4D_DECLARE_SCREEN_BEGIN(name, funcPrefix, 0 ,0, \
279 (D4D_COOR)(D4D_SCREEN_SIZE_LONGER_SIDE), (D4D_COOR)(D4D_SCREEN_SIZE_SHORTER_SIDE), NULL, 0, NULL, D4D_SCR_F_DEFAULT, NULL)
289 #define D4D_DECLARE_STD_PORTRAIT_SCREEN_BEGIN(name, funcPrefix) D4D_DECLARE_SCREEN_BEGIN(name, funcPrefix, 0 ,0, \
290 (D4D_COOR)(D4D_SCREEN_SIZE_SHORTER_SIDE), (D4D_COOR)(D4D_SCREEN_SIZE_LONGER_SIDE), NULL, 0, NULL, D4D_SCR_F_DEFAULT, NULL)
310 #define D4D_DECLARE_RSCREEN_BEGIN(name, funcPrefix, x ,y, cx, cy, radius, text, fontId, icon, initFlags, pScheme)\
311 _D4D_DECLARE_SCREEN_BEGIN(D4D_CONST, name, funcPrefix, x ,y, cx, cy, radius, text, fontId, icon, initFlags, pScheme)
325 #define D4D_DECLARE_SCREEN_OBJECT(name) &(name),
338 #define D4D_DECLARE_SCREEN_END() NULL };
357 #define D4D_DECLARE_SCREEN_BEGIN_INRAM(name, funcPrefix, x ,y, cx, cy, text, fontId, icon, initFlags, pScheme)\
358 _D4D_DECLARE_SCREEN_BEGIN(D4D_NO_CONST, name, funcPrefix, x ,y, cx, cy, 0, text, fontId, icon, initFlags, pScheme)
367 #define D4D_DECLARE_STD_SCREEN_BEGIN_INRAM(name, funcPrefix) D4D_DECLARE_SCREEN_BEGIN_INRAM(name, funcPrefix, 0 ,0, \
368 (D4D_COOR)(D4D_SCREEN_SIZE_LONGER_SIDE), (D4D_COOR)(D4D_SCREEN_SIZE_SHORTER_SIDE), NULL, 0, NULL, D4D_SCR_F_DEFAULT, NULL)
378 #define D4D_DECLARE_STD_PORTRAIT_SCREEN_BEGIN_INRAM(name, funcPrefix) D4D_DECLARE_SCREEN_BEGIN_INRAM(name, funcPrefix, 0 ,0, \
379 (D4D_COOR)(D4D_SCREEN_SIZE_SHORTER_SIDE), (D4D_COOR)(D4D_SCREEN_SIZE_LONGER_SIDE), NULL, 0, NULL, D4D_SCR_F_DEFAULT, NULL)
399 #define D4D_DECLARE_RSCREEN_BEGIN_INRAM(name, funcPrefix, x ,y, cx, cy, radius, text, fontId, icon, initFlags, pScheme)\
400 _D4D_DECLARE_SCREEN_BEGIN(D4D_NO_CONST, name, funcPrefix, x ,y, cx, cy, radius, text, fontId, icon, initFlags, pScheme)
407 #define D4D_EXTERN_SCREEN(name) \
408 extern D4D_SCREEN name;
420 #define D4D_EnableScrTouchScreen(pScr, bEnable)
void D4D_InvalidateScreen(const D4D_SCREEN *pScreen, D4D_BOOL bComplete)
The function mark the screen and its abject as "redraw pending".
Type definition of eGUI point structure.
const D4D_OBJECT *const * pObjects
NULL-terminated array of objects (may lay in ROM)
D4D object messages structure.
The string type. This structure contains all properties about string in eGUI.
void(* OnMain)(void)
Screen event handler of main screen handler function.
Byte D4D_SCREEN_FLAGS
The screen flags type. The masks are described here D4D SCREEN Defines masks of screen behaviour flag...
struct D4D_CLR_SCHEME_S * clrScheme
Screen color scheme.
D4D_SCREEN_FLAGS flags
Screen behaviour flags.
void D4D_InitScreen(const D4D_SCREEN *pScreen)
The function inits the screen and its objects for first time case.
struct D4D_SCREEN_S D4D_SCREEN
The screen structure type. The main screen structure that contains all needed data to run the eGUI sc...
This is the main structure of the color scheme in the D4D. It contains all the necessary colors to ru...
Byte D4D_TEXT_PROPERTIES
The string text properties type. The masks are described here D4D BASE Defines masks of aligment prop...
Byte D4D_COOR
Type definition of eGUI coordination variables.
D4D_COOR radius
Screen corner radius.
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
void D4D_ActivateScreen(const D4D_SCREEN *pNewScreen, D4D_BOOL bReplaceCurrent)
The function activate the new screen.
D4D_SCREEN * D4D_GetActiveScreen(void)
Returns pointer to current active screen.
D4D_BMP eGUI main image structure.
D4D_SIZE size
Screen size (standard screen has full size of physical screen)
Byte flags
Internal screen flags.
void D4D_SetScreenFontProperties(const D4D_SCREEN *pScreen, D4D_FONT_PROPERTIES property)
The function sets the screen font properties.
D4D_POINT D4D_GetClientToScreenPoint(D4D_OBJECT *pObject, D4D_POINT *nClientPoint)
The function convert client point on the screen to the global screen point.
Byte(* OnObjectMsg)(struct D4D_MESSAGE_S *pMsg)
Screen event handler of called before object receives the message.
The object main structure type definition.
D4D_SCREEN_DATA * pData
pointer to screen private run time data
const D4D_BMP * pIcon
Screen title icon.
void D4D_EscapeScreen(void)
The function return to previous screen recorded in the history.
void(* OnDeactivate)(void)
Screen event handler of called before deactivating.
D4D_POINT position
Screen coordination on physical screen (standard screen has {0,0})
LWord D4D_BOOL
Type definition of eGUI boolean.
Type definition of eGUI size structure.
void(* OnInit)(void)
Screen event handler of one-time initialization.
void D4D_EscapeToBaseScreen(void)
The function return to base screen recorded in the history.
The screen structure type. The main screen structure that contains all needed data to run the eGUI sc...
#define D4D_EnableScrTouchScreen(pScr, bEnable)
void(* OnActivate)(void)
Screen event handler of called before screen activation.
D4D_OBJECT * focusedObject
Pointer on currently focused object.
D4D_MARGIN * pMargin
Screen margin of user content.
void D4D_SetScreenTextProperties(const D4D_SCREEN *pScreen, D4D_TEXT_PROPERTIES property)
The function sets the screen text properties.
struct D4D_STRING_S textBuff
Screen title bar text buffer.
Type definition of eGUI client area margin structure.
D4D_POINT D4D_GetScreenToClientPoint(D4D_OBJECT *pObject, D4D_POINT *nScreenPoint)
The function convert global screen point on the screen to the client point.
The screen run time data type. It used to internal store the runtime data by eGUI.