eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_base.c
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * Copyright 2014 by Petr Gargulak. eGUI Community.
4 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License Version 3
9 * or later (the "LGPL").
10 *
11 * As a special exception, the copyright holders of the eGUI project give you
12 * permission to link the eGUI sources with independent modules to produce an
13 * executable, regardless of the license terms of these independent modules,
14 * and to copy and distribute the resulting executable under terms of your
15 * choice, provided that you also meet, for each linked independent module,
16 * the terms and conditions of the license of that module.
17 * An independent module is a module which is not derived from or based
18 * on this library.
19 * If you modify the eGUI sources, you may extend this exception
20 * to your version of the eGUI sources, but you are not obligated
21 * to do so. If you do not wish to do so, delete this
22 * exception statement from your version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * You should have received a copy of the GNU General Public License
29 * and the GNU Lesser General Public License along with this program.
30 * If not, see <http://www.gnu.org/licenses/>.
31 *
32 ***************************************************************************/
46 #include "d4d.h"
49 
50 /**************************************************************/
57 
58 /**************************************************************/
64 // screen activation hisotry array & index
67 
68 // if not NULL, keys are captured by this object
70 
71 // one and only message object being used to route information to objects
73 
74 const D4D_SIZE d4d_size_zero = {0, 0}; // zero size structure for automatic function capability
75 const D4D_POINT d4d_point_zero = {0, 0}; // zero point structure
76 
78 {
82  D4D_BEVEL_WIDTH
83 };
84 
85 // The buffer of input keys
87 
88 // The D4D system flags
90 
91 #ifdef D4D_LLD_TCH
92  static D4D_TOUCHSCREEN_STATUS d4d_TouchScreen_Status;
93  D4D_OBJECT* d4d_LastTouchedObj;
94  static D4D_POINT d4d_TouchScreenCoor = {0, 0};
95  static D4D_TOUCHSCREEN_EVENT d4d_touchEvent = { 0, {0, 0}};
96 
97  static void D4D_HandleTouchScreen(D4D_SCREEN* pScreen);
98  static void D4D_ManageTouchScreenEvents(void);
99  static D4D_BOOL D4D_GetTouchScreen(D4D_COOR *TouchPositionX, D4D_COOR *TouchPositionY);
100 #endif
101 
102 #ifdef __CWCC__
103  #pragma mark -
104  #pragma mark D4D System Functions
105  #pragma mark -
106 #endif
107 
108 /******************************************************************************
109 * Begin of D4D_BASE public functions
110 */
114 /**************************************************************************/
122 D4D_BOOL D4D_Init(const D4D_SCREEN* pInitScreen)
123 {
124  if(!D4D_LCD_Init()) // Init hardware of LCD
125  return D4D_FALSE;
126 
128 
129  #ifdef D4D_LLD_TCH
130  d4d_TouchScreen_Status = 0;
131  d4d_LastTouchedObj = NULL;
132  #endif
133 
134  #ifdef D4D_LLD_MOUSE
135  D4D_MouseInit();
136  #endif
137 
138  // In case that the external font is enabled, just initialize it
139  #if (D4D_EXTSRC_FILE_ENABLE != D4D_FALSE) && (D4D_FNT_EXTSRC_SUPPORT != D4D_FALSE)
140  // one time initialization
141  if(D4D_ExtFntInit() == D4D_FALSE)
142  return D4D_FALSE;
143  #endif
144 
145  d4d_systemFlags = 0;
146 
148  if(pInitScreen)
149  D4D_ActivateScreen(pInitScreen, D4D_FALSE);
150 
151  return D4D_TRUE;
152 }
153 
154 /**************************************************************************/
159 void D4D_Poll(void)
160 {
161  // get active screen
162  D4D_SCREEN* pScreen;
163 
164  // handle keys (may change active screen)
165  D4D_HandleKeys();
166 
167  #ifdef D4D_LLD_TCH
168  // handle Touch screen events - if any
169  if(d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_EVENTS)
170  {
171  D4D_ManageTouchScreenEvents();
172  d4d_TouchScreen_Status &= ~D4D_TCHSCR_STATUS_EVENTS;
173  }
174 
175  pScreen = D4D_GetActiveScreen();
176  if(pScreen == NULL)
177  return;
178  // Handle Touch screen to screen and objects
179  D4D_HandleTouchScreen(pScreen);
180  #endif
181 
182  #ifdef D4D_LLD_MOUSE
183  pScreen = D4D_GetActiveScreen();
184  if(pScreen == NULL)
185  return;
186 
187  // handle mouse events
188  D4D_HandleMouse();
189  #endif
190 
191  pScreen = D4D_GetActiveScreen();
192  if(pScreen == NULL)
193  return;
194  // call screen's main function
195  if(pScreen->OnMain)
196  pScreen->OnMain();
197 
198  // Handle the timeticks of D4D
199  pScreen = D4D_GetActiveScreen();
200  D4D_HandleTimeTicks(pScreen);
201 
202  // redraw all objects on active screen
203  pScreen = D4D_GetActiveScreen();
204  D4D_RedrawScreen(pScreen);
205 }
206 
207 /**************************************************************************/
214 {
215  // get active screen
216  D4D_SCREEN* pScreen = D4D_GetActiveScreen();
217 
218  D4D_LCD_SetOrientation(orient);
219 
220  #ifdef D4D_LLD_MOUSE
222  #endif
223 
224  if(pScreen)
225  D4D_InvalidateScreen(pScreen, D4D_TRUE);
226 }
227 
228 /**************************************************************************/
234 void D4D_TimeTickPut(void)
235 {
237 }
238 
239 /**************************************************************************/
245 {
246  d4d_KeysBuff.readPos = 0;
247  d4d_KeysBuff.writePos = 0;
248 }
249 
250 /**************************************************************************/
257 {
258  if(bEnable)
260  else
262 }
263 
264 
265 /**************************************************************************/
273 {
274  static D4D_KEYS keysLastState = 0;
275 
276  if(keys != keysLastState)
277  {
278  D4D_KEYS kChange;
279  D4D_KEY_SCANCODE tmp_scanCode;
280 
281  kChange = (Byte)(keys ^ keysLastState);
282 
283  if(kChange & D4D_KEY_UP)
284  {
285  tmp_scanCode = D4D_KEY_SCANCODE_UP;
286  if((keys & D4D_KEY_UP) == 0) // the key is released
287  tmp_scanCode |= D4D_KEY_SCANCODE_RELEASEMASK;
288 
289  D4D_NewKeyEvent(tmp_scanCode);
290  }
291 
292  if(kChange & D4D_KEY_DOWN)
293  {
294  tmp_scanCode = D4D_KEY_SCANCODE_DOWN;
295  if((keys & D4D_KEY_DOWN) == 0) // the key is released
296  tmp_scanCode |= D4D_KEY_SCANCODE_RELEASEMASK;
297 
298  D4D_NewKeyEvent(tmp_scanCode);
299  }
300 
301  if(kChange & D4D_KEY_LEFT)
302  {
303  tmp_scanCode = D4D_KEY_SCANCODE_LEFT;
304  if((keys & D4D_KEY_LEFT) == 0) // the key is released
305  tmp_scanCode |= D4D_KEY_SCANCODE_RELEASEMASK;
306 
307  D4D_NewKeyEvent(tmp_scanCode);
308  }
309 
310  if(kChange & D4D_KEY_RIGHT)
311  {
312  tmp_scanCode = D4D_KEY_SCANCODE_RIGHT;
313  if((keys & D4D_KEY_RIGHT) == 0) // the key is released
314  tmp_scanCode |= D4D_KEY_SCANCODE_RELEASEMASK;
315 
316  D4D_NewKeyEvent(tmp_scanCode);
317  }
318 
319  if(kChange & D4D_KEY_ENTER)
320  {
321  tmp_scanCode = D4D_KEY_SCANCODE_ENTER;
322  if((keys & D4D_KEY_ENTER) == 0) // the key is released
323  tmp_scanCode |= D4D_KEY_SCANCODE_RELEASEMASK;
324 
325  D4D_NewKeyEvent(tmp_scanCode);
326  }
327 
328  if(kChange & D4D_KEY_ESC)
329  {
330  tmp_scanCode = D4D_KEY_SCANCODE_ESC;
331  if((keys & D4D_KEY_ESC) == 0) // the key is released
332  tmp_scanCode |= D4D_KEY_SCANCODE_RELEASEMASK;
333 
334  D4D_NewKeyEvent(tmp_scanCode);
335  }
336 
337  keysLastState = keys;
338  }
339 }
340 
341 /**************************************************************************/
348 {
349  // Is there place for new record?
350  if((d4d_KeysBuff.writePos + 1 == d4d_KeysBuff.readPos) || ((d4d_KeysBuff.readPos == 0) && (d4d_KeysBuff.writePos + 1 == D4D_KEYS_BUFF_LENGTH)))
351  {
352  return;
353  }
354 
355  // place new record to buffer
356  d4d_KeysBuff.buff[d4d_KeysBuff.writePos++] = scanCode;
357  if(d4d_KeysBuff.writePos >= D4D_KEYS_BUFF_LENGTH)
358  d4d_KeysBuff.writePos = 0;
359 
360  #ifdef D4D_INPUT_EVENT_CALLBACK
361  D4D_INPUT_EVENT_CALLBACK();
362  #endif
363 }
364 
365 #ifdef D4D_LLD_TCH
366 
367 /**************************************************************************/
374 {
375  return D4D_GetScreenToClientPoint(pObject, &d4d_TouchScreenCoor);
376 }
377 
378 /**************************************************************************/
384 void D4D_CheckTouchScreen(void)
385 {
386  d4d_TouchScreen_Status |= D4D_TCHSCR_STATUS_CHECKTOUCH;
387 }
388 
389 /**************************************************************************/
398 void D4D_PutTouchScreen(D4D_BOOL touched, D4D_COOR x, D4D_COOR y)
399 {
400  if((d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_EVENTS) == D4D_TCHSCR_STATUS_NEWEVENT)
401  return;
402 
403  d4d_touchEvent.touched = touched;
404  d4d_touchEvent.point.x = x;
405  d4d_touchEvent.point.y = y;
406 
407  d4d_TouchScreen_Status |= D4D_TCHSCR_STATUS_NEWEVENT;
408 }
409 
410 /**************************************************************************/
421 {
422  if((d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_EVENTS) == D4D_TCHSCR_STATUS_NEWRAWEVENT)
423  return;
424 
425  d4d_touchEvent.touched = touched;
426  d4d_touchEvent.point.x = x;
427  d4d_touchEvent.point.y = y;
428 
429  d4d_TouchScreen_Status |= D4D_TCHSCR_STATUS_NEWRAWEVENT;
430 }
431 
432 /**************************************************************************/
438 {
439  d4d_TouchScreen_Status = 0;
440 }
441 
442 
443 /**************************************************************************/
448 void D4D_CalibrateTouchScreen(void)
449 {
454 }
455 
456 /**************************************************************************/
462 {
463  return D4D_TCH_GetCalibration();
464 }
465 
466 /**************************************************************************/
473 {
474  D4D_TCH_SetCalibration(newCalib);
475 }
476 #endif
477 
478 /**************************************************************************/
486 {
487 
488  D4D_STRING* p_TextBuff = NULL;
489 
490  if(pObject->pObjFunc->GetTextBuffer)
491  p_TextBuff = pObject->pObjFunc->GetTextBuffer((D4D_OBJECT*)pObject);
492 
493  if(p_TextBuff)
494  {
495  if(p_TextBuff->str_properties->font_properties == property)
496  return; // There is no change needed
497 
498  p_TextBuff->str_properties->font_properties = property;
500  }
501 
502 }
503 
504 /**************************************************************************/
512 {
513  D4D_STRING* p_TextBuff = NULL;
514 
515  if(pObject->pObjFunc->GetTextBuffer)
516  p_TextBuff = pObject->pObjFunc->GetTextBuffer((D4D_OBJECT*)pObject);
517 
518  if(p_TextBuff)
519  {
520  if(p_TextBuff->str_properties->text_properties == property)
521  return; // There is no change needed
522 
523  p_TextBuff->str_properties->text_properties = property;
525  }
526 }
527 
528 /**************************************************************************/
535 {
536  D4D_POINT tmp_point;
537 
538  tmp_point.x = point.y;
539  tmp_point.y = point.x;
540 
541  return tmp_point;
542 }
543 
544 /**************************************************************************/
551 {
552  if(pSz->cx > pSz->cy)
553  return pSz->cx;
554 
555  return pSz->cy;
556 }
557 
558 /**************************************************************************/
563 void D4D_FlushOutput(void)
564 {
566 }
567 
568 /******************************************************************************
569 * End of public functions */
571 /******************************************************************************/
572 
573 /******************************************************************************
574 * Private functions *
575 ******************************************************************************/
576 
577 /**************************************************************/
582 void D4D_HandleKeys(void)
583 {
584  // get active screen
585  D4D_SCREEN* pScreen = D4D_GetActiveScreen();
586  D4D_OBJECT* pFocus;
587  D4D_KEY_SCANCODE scanCode;
588  D4D_BOOL tmp_release;
589 
590  // TODO what about sending keys to Child objects??
591 
592  // Check the buffer of input keys changes
593  if(d4d_KeysBuff.writePos == d4d_KeysBuff.readPos)
594  return;
595 
596  // Read the latest record in the buffer of input key event
597  scanCode = d4d_KeysBuff.buff[d4d_KeysBuff.readPos++];
598 
599  // Check the overflow of the read pointer of readed input keys
600  if(d4d_KeysBuff.readPos >= D4D_KEYS_BUFF_LENGTH)
601  d4d_KeysBuff.readPos = 0;
602 
603  tmp_release = (D4D_BOOL)(scanCode & D4D_KEY_SCANCODE_RELEASEMASK);
604  scanCode &= ~D4D_KEY_SCANCODE_RELEASEMASK;
605 
606  // do we handle the keys ourselves (to navigate across the screen) ?
607  if(!d4d_pKeysCapturer && !(d4d_systemFlags & D4D_SYSTEM_F_SYSTEM_KEYS_DISABLE))
608  {
609  if((scanCode & D4D_KEY_SCANCODE_RELEASEMASK) == 0)
610  {
611  // escape the screen?
612  if(scanCode == D4D_KEY_SCANCODE_ESC)
613  {
614  if(tmp_release == 0)
616  return;
617  }
618  // focus previous object on the screen?
619  else if(scanCode == D4D_KEY_FUNC_FOCUS_PREV)
620  {
621  if(tmp_release == 0)
622  D4D_FocusPrevObject(pScreen);
623  return;
624  }
625  // focus next object on the screen?
626  else if(scanCode == D4D_KEY_FUNC_FOCUS_NEXT)
627  {
628  if(tmp_release == 0)
629  D4D_FocusNextObject(pScreen, D4D_FALSE);
630  return;
631  }
632  }
633  }
634 
635  // does the object get the key events?
636  // yes, invoke the key events to the active object
637  pFocus = (D4D_OBJECT*) (d4d_pKeysCapturer ? d4d_pKeysCapturer : D4D_GetFocusedObject(pScreen));
639  {
640  if(D4D_IsEnabled(pFocus))
641  {
642  // prepare the message
643  d4d_msg.pScreen = pScreen;
644  d4d_msg.pObject = pFocus;
645 
646  if(tmp_release == 0)
647  d4d_msg.nMsgId = D4D_MSG_KEYDOWN; // if key was pressed down?
648  else
649  d4d_msg.nMsgId = D4D_MSG_KEYUP; // if key was released up?
650 
651  d4d_msg.prm.key = (D4D_KEY_SCANCODE)(scanCode & D4D_KEY_SCANCODE_KEYMASK);
652 
653  D4D_SendMessageBack(&d4d_msg);
654  }
655  }
656  else
657  {
658  // The object cannot receive the KEY_EVENT, send it at least to screen
659  // prepare the message
660  d4d_msg.pScreen = pScreen;
661  d4d_msg.pObject = NULL;
662 
663  if(tmp_release == 0)
664  d4d_msg.nMsgId = D4D_MSG_KEYDOWN; // if key was pressed down?
665  else
666  d4d_msg.nMsgId = D4D_MSG_KEYUP; // if key was released up?
667 
668  d4d_msg.prm.key = (D4D_KEY_SCANCODE)(scanCode & D4D_KEY_SCANCODE_KEYMASK);
669 
670  D4D_SendMessage(&d4d_msg);
671  }
672 }
673 
674 /**************************************************************/
682 {
683  D4D_OBJECT* pObject = pMsg->pObject;
684 
685  // screen gets the first chance
686  if(pMsg->pScreen && pMsg->pScreen->OnObjectMsg)
687  {
688  // screen may discard the message by returning TRUE
689  if(pMsg->pScreen->OnObjectMsg(pMsg))
690  return ;
691  }
692 
693  if(pObject)
694  {
695  // now invoke the object's handler
696  if(pObject->OnUsrMessage)
697  {
698  if(pObject->OnUsrMessage(pMsg))
699  return;
700  }
701 
702  if(pObject->pObjFunc->OnSysMessage)
703  pObject->pObjFunc->OnSysMessage(pMsg);
704  }
705 }
706 
707 /**************************************************************/
714 void D4D_SendMessageMask(D4D_MESSAGE* pMsg, D4D_OBJECT_FLAGS parentFlagsMask, D4D_OBJECT_FLAGS endFlagMask)
715 {
716  D4D_OBJECT* pObject = pMsg->pObject;
717 
718  // Check if the object
719  if((pObject->pData->flags & parentFlagsMask) != parentFlagsMask)
720  return;
721 
722  // screen gets the first chance
723  if((pObject->pData->flags & endFlagMask) == endFlagMask)
724  if(pMsg->pScreen->OnObjectMsg)
725  {
726  // screen may discard the message by returning TRUE
727  if(pMsg->pScreen->OnObjectMsg(pMsg))
728  return ;
729  }
730 
731  if(pObject)
732  {
733  // now invoke the object's handler
734  if((pObject->pData->flags & endFlagMask) == endFlagMask)
735  {
736  if(pObject->OnUsrMessage)
737  {
738  if(pObject->OnUsrMessage(pMsg))
739  return;
740  }
741 
742  // Invoke to go the message to system handler of object
743  if(pObject->pObjFunc->OnSysMessage)
744  pObject->pObjFunc->OnSysMessage(pMsg);
745  }
746 
747  if(pObject->pRelations)
748  {
749  D4D_OBJECT** pChildObj = (D4D_OBJECT**)&pObject->pRelations[D4D_OBJECT_USR_DATA_CHILD_IX];
750  while(*pChildObj)
751  {
752  pMsg->pObject = *pChildObj;
753  D4D_SendMessageMask(pMsg, parentFlagsMask, endFlagMask);
754  pChildObj++;
755  }
756  }
757 
758  }
759 }
760 
761 
762 /**************************************************************/
770 {
771  D4D_OBJECT* pObject = pMsg->pObject;
772 
773  if(pObject && pObject->pRelations)
774  {
776  if(pParentObj)
777  {
778  pMsg->pObject = pParentObj;
779  D4D_SendMessageBack(pMsg);
780  }
781  }
782 
783  pMsg->pObject = pObject;
784  D4D_SendMessage(pMsg);
785 }
786 
787 #ifdef D4D_LLD_TCH
788 /**************************************************************/
793 static D4D_BOOL D4D_FindTouchedObject(D4D_OBJECT* pObject, D4D_POINT point)
794 {
795  D4D_BOOL validCoor;
796 
798  return D4D_FALSE;
799 
800  if(pObject->pObjFunc->CheckCoordinates == NULL)
801  validCoor = D4D_ObjectCheckCoordinates(pObject, D4D_GetScreenToClientPoint(pObject, &point));
802  else
803  // Check the coordination if its valid
804  validCoor = pObject->pObjFunc->CheckCoordinates(pObject, D4D_GetScreenToClientPoint(pObject, &point));
805 
806  // if the coordinations are valid or autorepeat is enabled
807  if(validCoor)
808  {
809  // This is new touch
810  d4d_LastTouchedObj = pObject;
811  d4d_msg.pObject = pObject;
812  d4d_msg.nMsgId = D4D_MSG_TOUCHED;
813  // send the D4D_MSG_TOUCHED message
814  D4D_SendMessage(&d4d_msg);
815 
816  if(pObject->pRelations)
817  {
818  D4D_OBJECT** pChildren = (D4D_OBJECT**)&pObject->pRelations[D4D_OBJECT_USR_DATA_CHILD_IX];
819 
820  while(*pChildren && !D4D_FindTouchedObject(*pChildren, point))
821  {
822  pChildren++;
823  }
824  }
825  return D4D_TRUE;
826  }
827  return D4D_FALSE;
828 }
829 
830 /**************************************************************/
835 static void D4D_HandleTouchScreen(D4D_SCREEN* pScreen)
836 {
837  D4D_SCREEN_DATA* pData = pScreen->pData;
838  D4D_BOOL validCoor;
839  D4D_OBJECT** pObjects;
840  //D4D_POINT tmpClientTouch = D4D_GetScreenToClientPoint(pScreen, &d4d_TouchScreenCoor);
841 
842  // prepare message
843  d4d_msg.pScreen = pScreen;
844  d4d_msg.prm.draw = 0;
845 
846  //1. Check if this is new touch or not
847  if(d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_NEWTOUCH)
848  {
849  // new touch operation
850  d4d_TouchScreen_Status &= ~(D4D_TCHSCR_STATUS_NEWTOUCH | D4D_TCHSCR_STATUS_LOSTTOUCH);
851 
852  // Handle Screen events
853  if(pData->flags & D4D_SCR_FINT_TOUCHENABLE)
854  {
855  if(pScreen->flags & D4D_SCR_F_EXIT)
856  {
857  if(D4D_ScrCheckExitBtnCoor(pScreen, &d4d_TouchScreenCoor))
858  {
860  d4d_TouchScreen_Status &= ~D4D_TCHSCR_STATUS_NEWTOUCH;
861  return;
862  }
863  }
864 
865  if(D4D_ScrCheckCoor(pScreen, &d4d_TouchScreenCoor))
866  {
867  d4d_msg.pObject = NULL;
868  d4d_msg.nMsgId = D4D_MSG_TOUCHED;
869  // send the D4D_MSG_TOUCHED message
870  D4D_SendMessage(&d4d_msg);
871  }
872  }
873 
874  pObjects = (D4D_OBJECT**)pScreen->pObjects;
875 
876  // check all objects
877  while(*pObjects)
878  {
879  if(D4D_FindTouchedObject(*pObjects, d4d_TouchScreenCoor))
880  break;
881  pObjects++;
882  }
883 
884  }else
885  {
886  if(d4d_LastTouchedObj)
887  {
888  //Untouch operation
889  if(!(d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_TOUCHED))
890  {
891  // prepare message
892  d4d_msg.nMsgId = D4D_MSG_UNTOUCHED;
893  d4d_msg.prm.draw = 0;
894 
895  if(pData->flags & D4D_SCR_FINT_TOUCHENABLE)
896  {
897  if(D4D_ScrCheckCoor(pScreen, &d4d_TouchScreenCoor))
898  {
899  d4d_msg.pObject = NULL;
900  // send the D4D_MSG_UNTOUCHED message to screen
901  D4D_SendMessage(&d4d_msg); // To screen
902  }
903  }
904 
905  if(d4d_LastTouchedObj)
906  {
907  d4d_msg.pObject = d4d_LastTouchedObj;
908  d4d_LastTouchedObj = NULL;
909  // send the D4D_MSG_UNTOUCHED message to Object
910  }else
911  return;
912  }
913  else
914  {
915  //Autorepeat operations
916 
917  // Handle Screen events
918  if(pData->flags & D4D_SCR_FINT_TOUCHENABLE)
919  {
920  if(D4D_ScrCheckCoor(pScreen, &d4d_TouchScreenCoor))
921  {
922  d4d_msg.pObject = NULL;
923  d4d_msg.nMsgId = D4D_MSG_TOUCH_AUTO;
924  // send the D4D_MSG_TOUCH_AUTO message
925  D4D_SendMessage(&d4d_msg); // To screen
926  }
927  }
928 
929  d4d_msg.pObject = d4d_LastTouchedObj;
930 
931  // Check the coordination if its valid
932  if(d4d_LastTouchedObj->pObjFunc->CheckCoordinates)
933  validCoor = d4d_LastTouchedObj->pObjFunc->CheckCoordinates(d4d_LastTouchedObj, D4D_GetScreenToClientPoint(d4d_LastTouchedObj, &d4d_TouchScreenCoor));
934  else
935  validCoor = D4D_ObjectCheckCoordinates(d4d_LastTouchedObj, D4D_GetScreenToClientPoint(d4d_LastTouchedObj, &d4d_TouchScreenCoor));
936 
937  // autorepeat touch
938  if(!validCoor && (d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_LOSTTOUCH))
939  return;
940 
941  // Check if the autorepeat touch is valid or no (LOST TOUCH EVENT)
942  if(!validCoor)
943  {
944  d4d_TouchScreen_Status |= D4D_TCHSCR_STATUS_LOSTTOUCH;
945  d4d_msg.nMsgId = D4D_MSG_TOUCH_LOST;
946  }else
947  {
948  d4d_TouchScreen_Status &= ~D4D_TCHSCR_STATUS_LOSTTOUCH;
949  d4d_msg.nMsgId = D4D_MSG_TOUCH_AUTO;
950  }
951  }
952  // Send prepared message
953  D4D_SendMessageBack(&d4d_msg);
954  }
955  }
956 }
957 
958 
959 //-----------------------------------------------------------------------------
960 // FUNCTION: D4D_GetTouchScreenPosition
961 // SCOPE: Global
962 // DESCRIPTION: Reads touch screen and returns X, Y coorinates if screen
963 // touched
964 // PARAMETERS: LWord *TouchPositionX Pointer to X coordinate
965 // LWord *TouchPositionY Pointer to Y ccordinate
966 // RETURNS: 0 no screen touch
967 // 1 screen touch,
968 //-----------------------------------------------------------------------------
969 static D4D_BOOL D4D_GetTouchScreen(D4D_COOR *TouchPositionX, D4D_COOR *TouchPositionY)
970 {
971  // Declare and initialise local variables
972  D4D_BOOL ScreenTouch;
973 
974 
975  if(d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_CHECKTOUCH)
976  {
977  // Read raw touch position into *TouchPositionX and *TouchPositionY
978  ScreenTouch = D4D_TCH_GetRawPosition(TouchPositionX, TouchPositionY);
979  }
980  else
981  {
982  ScreenTouch = d4d_touchEvent.touched;
983  *TouchPositionX = d4d_touchEvent.point.x;
984  *TouchPositionY = d4d_touchEvent.point.y;
985  }
986 
987 
988  if(ScreenTouch)
989  {
990  if(!(d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_NEWEVENT))
991  D4D_TCH_GetCalibratedPosition(TouchPositionX, TouchPositionY);
992  }
993  // Return flag to indicate if screen has been touched
994  return ScreenTouch;
995 }
996 
997 /**************************************************************/
1002 static void D4D_ManageTouchScreenEvents(void)
1003 {
1004  D4D_COOR x,y;
1005  D4D_BOOL tmp_res;
1006 
1007  if(D4D_TCH_GetCalibrationStatus() == 0)
1008  {
1010  return;
1011  }
1012 
1013  if(d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_NEWTOUCH)
1014  return;
1015 
1016  tmp_res = D4D_GetTouchScreen(&x, &y);
1017 
1018  if(((d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_TOUCHED) ^ (tmp_res)))
1019  {
1020  if(tmp_res)
1021  d4d_TouchScreen_Status |= D4D_TCHSCR_STATUS_TOUCHED;
1022  else
1023  d4d_TouchScreen_Status &= ~D4D_TCHSCR_STATUS_TOUCHED;
1024 
1025  if(tmp_res)
1026  d4d_TouchScreen_Status |= D4D_TCHSCR_STATUS_NEWTOUCH;
1027  }
1028 
1029  if(tmp_res)
1030  {
1031  d4d_TouchScreenCoor.x = (D4D_COOR)x;
1032  d4d_TouchScreenCoor.y = (D4D_COOR)y;
1033 
1034  #ifdef D4D_INPUT_EVENT_CALLBACK
1035  D4D_INPUT_EVENT_CALLBACK();
1036  #endif
1037  }
1038 
1039 }
1040 #endif
1041 
1042 /**************************************************************/
1047 void D4D_ComputeGeometry(D4D_GEOMETRY * pGeometry, D4D_OBJECT* pObject)
1048 {
1049  pGeometry->pnt = D4D_GetClientToScreenPoint(pObject, &pObject->position);
1050  pGeometry->sz = pObject->size;
1051 
1052  if(pObject->pMargin)
1053  {
1054  pGeometry->pnt.x += pObject->pMargin->left;
1055  pGeometry->pnt.y += pObject->pMargin->top;
1056 
1057  if(pGeometry->sz.cx >= (pObject->pMargin->left + pObject->pMargin->right))
1058  pGeometry->sz.cx -= (pObject->pMargin->left + pObject->pMargin->right);
1059  if(pGeometry->sz.cy >= (pObject->pMargin->top + pObject->pMargin->bottom))
1060  pGeometry->sz.cy -= (pObject->pMargin->top + pObject->pMargin->bottom);
1061 
1062  }else if(pObject->pData->flags & D4D_OBJECT_F_BEVEL_MASK)
1063  {
1064  pGeometry->pnt.x += D4D_BEVEL_WIDTH;
1065  pGeometry->pnt.y += D4D_BEVEL_WIDTH;
1066 
1067  if(pGeometry->sz.cx >= 2 * D4D_BEVEL_WIDTH)
1068  pGeometry->sz.cx -= 2 * D4D_BEVEL_WIDTH;
1069 
1070  if(pGeometry->sz.cy >= 2 * D4D_BEVEL_WIDTH)
1071  pGeometry->sz.cy -= 2 * D4D_BEVEL_WIDTH;
1072 
1073  }else if(pObject->pData->flags & D4D_OBJECT_F_FOCUSRECT)
1074  {
1075  pGeometry->pnt.x++;
1076  pGeometry->pnt.y++;
1077  if(pGeometry->sz.cx >= 2)
1078  pGeometry->sz.cx -= 2;
1079  if(pGeometry->sz.cy >= 2)
1080  pGeometry->sz.cy -= 2;
1081  }
1082 }
#define D4D_OBJECT_F_TOUCHENABLE
Object has enabled touch screen capability.
Definition: d4d_object.h:75
#define D4D_SCR_FINT_TOUCHENABLE
Definition: d4d_screen.h:128
UnTouched message - is send when the screen is untouched.
Definition: d4d_base.h:382
#define D4D_TCHSCR_STATUS_NEWTOUCH
Definition: d4d_base.h:459
void(* OnSysMessage)(struct D4D_MESSAGE_S *pMsg)
Object system message receiver function pointer.
Definition: d4d_object.h:137
#define D4D_OBJECT_F_FOCUSRECT
Object has an outlined rectangle.
Definition: d4d_object.h:77
#define D4D_KEY_SCANCODE_ESC
This macro is used to specify Key Scan Code ESC. If not defined, it sets to 0x01 as a default...
Definition: d4d_base.h:305
#define D4D_KEY_SCANCODE_RIGHT
This macro is used to specify Key Scan Code RIGHT. If not defined, it sets to 0x4D as a default...
Definition: d4d_base.h:295
D4D_OBJECT * d4d_pKeysCapturer
Definition: d4d_base.c:69
D4D_OBJECT_SYS_FUNCTION * pObjFunc
The pointer on object system functions.
Definition: d4d_object.h:174
Type definition of eGUI touch screen event structure.
Definition: d4d_types.h:360
#define D4D_KEY_SCANCODE_UP
This macro is used to specify Key Scan Code UP. If not defined, it sets to 0x51 as a default...
Definition: d4d_base.h:280
void D4D_InvalidateScreen(const D4D_SCREEN *pScreen, D4D_BOOL bComplete)
The function mark the screen and its abject as &quot;redraw pending&quot;.
Definition: d4d_screen.c:238
D4D_TEXT_PROPERTIES text_properties
Text properties structure.
Definition: d4d_string.h:96
D4D_ON_USR_MSG OnUsrMessage
The pointer on user message.
Definition: d4d_object.h:175
D4D_SYSTEM_FLAGS d4d_systemFlags
Definition: d4d_base.c:89
Byte D4D_TOUCHSCREEN_STATUS
Definition: d4d_base.h:455
Type definition of eGUI touch screen calibration structure.
Definition: d4d_types.h:350
Type definition of eGUI point structure.
Definition: d4d_types.h:223
const D4D_OBJECT *const * pObjects
NULL-terminated array of objects (may lay in ROM)
Definition: d4d_screen.h:165
void D4D_SendMessageMask(D4D_MESSAGE *pMsg, D4D_OBJECT_FLAGS parentFlagsMask, D4D_OBJECT_FLAGS endFlagMask)
Definition: d4d_base.c:714
D4D_COOR left
Margin of left side.
Definition: d4d_types.h:246
void(* D4DLCD_FlushBuffer)(D4DLCD_FLUSH_MODE mode)
The LCD driver flush function.
Definition: d4d_lldapi.h:154
D4D object messages structure.
Definition: d4d_base.h:400
D4D_OBJECT_DATA_PTR pData
Pointer on runtime object data.
Definition: d4d_object.h:180
void D4D_TCH_Calibrate(D4D_COLOR fore, D4D_COLOR bckg)
Definition: d4d_low.c:914
#define D4D_TCHSCR_STATUS_CHECKTOUCH
Definition: d4d_base.h:464
#define D4D_TCHSCR_STATUS_NEWEVENT
Definition: d4d_base.h:463
D4D_BOOL D4D_ScrCheckExitBtnCoor(D4D_SCREEN *pScreen, D4D_POINT *point)
Definition: d4d_screen.c:1134
#define D4D_KEY_UP
This macro is used to specify Key UP in mask mode (obsolete). If not defined, it sets to 0x01 as a de...
Definition: d4d_base.h:249
#define D4D_KEY_ESC
This macro is used to specify Key ESC in mask mode (obsolete). If not defined, it sets to 0x20 as a d...
Definition: d4d_base.h:274
#define D4D_FALSE
This is definition of boolean operation value in eGUI - FALSE.
Definition: d4d_types.h:104
The string type. This structure contains all properties about string in eGUI.
Definition: d4d_string.h:100
#define D4D_OBJECT_F_TABSTOP
Object can be focused.
Definition: d4d_object.h:74
D4D_POINT D4D_SwapCoor(D4D_POINT point)
Function swap the point coordination.
Definition: d4d_base.c:534
#define D4D_KEY_RIGHT
This macro is used to specify Key RIGHT in mask mode (obsolete). If not defined, it sets to 0x08 as a...
Definition: d4d_base.h:264
D4D_POINT point
Point of touch event or lost of touch event.
Definition: d4d_types.h:363
void(* OnMain)(void)
Screen event handler of main screen handler function.
Definition: d4d_screen.h:169
Byte D4D_KEYS
Type definition of eGUI keys - this is obsolete type that is kept just only for backward compatibilit...
Definition: d4d_types.h:301
D4D_KEY_SCANCODE buff[D4D_KEYS_BUFF_LENGTH]
Definition: d4d_base.h:449
#define D4D_OBJECT_F_ENABLED
Object after initialization is enabled.
Definition: d4d_object.h:73
D4D_POINT D4D_GetTouchScreenCoordinates(D4D_OBJECT *pObject)
D4D_BOOL D4D_Init(const D4D_SCREEN *pInitScreen)
Function inits the eGUI itself including all low level drivers.
Definition: d4d_base.c:122
void D4D_SetOrientation(D4D_ORIENTATION orient)
Set screen orientation function.
Definition: d4d_base.c:213
Byte D4D_TCH_GetCalibrationStatus(void)
void D4D_CalibrateTouchScreen(void)
#define D4D_TRUE
This is definition of boolean operation value in eGUI - TRUE.
Definition: d4d_types.h:106
D4D_BOOL D4D_ObjectCheckCoordinates(D4D_OBJECT *pThis, D4D_POINT point)
Definition: d4d_object.c:459
D4D_SCREEN_FLAGS flags
Screen behaviour flags.
Definition: d4d_screen.h:182
void D4D_TCH_GetCalibratedPosition(D4D_COOR *TouchPositionX, D4D_COOR *TouchPositionY)
#define D4D_TCHSCR_STATUS_LOSTTOUCH
Definition: d4d_base.h:461
struct D4D_OBJECT_S * pObject
Pointer to object who is receiver of this message. If the receiver is just screen this field must be ...
Definition: d4d_base.h:402
Key Up message - is send when the object get new Key Up event.
Definition: d4d_base.h:377
D4D Driver main header file.
void D4D_LCD_SetOrientation(D4D_ORIENTATION new_orientation)
Definition: d4d_low.c:152
D4D_TOUCHSCREEN_CALIB D4D_GetTouchScreenCalibration(void)
#define D4D_KEY_SCANCODE_ENTER
This macro is used to specify Key Scan Code ENTER. If not defined, it sets to 0x1C as a default...
Definition: d4d_base.h:300
void D4D_PutRawTouchScreen(D4D_BOOL touched, D4D_COOR x, D4D_COOR y)
D4D_OBJECT_FLAGS flags
runtime object flags
Definition: d4d_object.h:145
#define D4D_KEY_FUNC_FOCUS_PREV
This macro is used to specify standard system function to to set focus to previous object...
Definition: d4d_base.h:322
Auto Touched message - is send when the object is still keep touch by touch screen driver ...
Definition: d4d_base.h:380
#define D4D_TCHSCR_STATUS_TOUCHED
Definition: d4d_base.h:457
#define D4D_SCREEN_HISTORY
This macro is used to set the screen buffer depth. If not defined, the 5 is used as a default...
Definition: d4d_base.h:73
void D4D_ClearKeysBuffer(void)
Clear all rest information about pushed Keys in buffer.
Definition: d4d_base.c:244
#define D4D_SCRATCHPAD_SIZE
Call back function raised by any new input event (touch, mouse, keys).
Definition: d4d_base.h:579
void D4D_NewKeyEvent(D4D_KEY_SCANCODE scanCode)
Place to key event into key buffer.
Definition: d4d_base.c:347
const D4D_SIZE d4d_size_zero
Definition: d4d_base.c:74
D4D Driver private header file.
#define D4D_KEY_SCANCODE_DOWN
This macro is used to specify Key Scan Code DOWN. If not defined, it sets to 0x50 as a default...
Definition: d4d_base.h:285
D4D_ORIENTATION
Type definition of eGUI display orientation.
Definition: d4d_types.h:341
Byte D4D_TEXT_PROPERTIES
The string text properties type. The masks are described here D4D BASE Defines masks of aligment prop...
Definition: d4d_string.h:90
D4D_MESSAGE d4d_msg
Definition: d4d_base.c:72
void D4D_FocusNextObject(const D4D_SCREEN *pScreen, D4D_BOOL bInitialSearch)
The function change focus to the next object in the given screen.
Definition: d4d_screen.c:286
D4D_COOR cx
Size in axis X (width)
Definition: d4d_types.h:232
void D4D_HandleTimeTicks(D4D_SCREEN *pScreen)
Definition: d4d_screen.c:1107
Byte D4D_COOR
Type definition of eGUI coordination variables.
Definition: d4d_types.h:219
#define D4D_MouseCenterCursor()
Definition: d4d_mouse.h:244
D4D_POINT position
Position on the screen/object.
Definition: d4d_object.h:169
#define D4D_HandleMouse()
Definition: d4d_mouse.h:243
LWord D4D_OBJECT_FLAGS
The object flags type. The masks are described here D4D OBJECT Defines masks of object behaviour flag...
Definition: d4d_object.h:128
#define D4D_OBJECT_USR_DATA_CHILD_IX
The relations object index to relation array for first child object.
Definition: d4d_object.h:103
const D4D_MARGIN d4d_marginDefault
Definition: d4d_base.c:77
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
Definition: d4d_types.h:151
void D4D_FocusPrevObject(const D4D_SCREEN *pScreen)
The function change focus to the previous object in the given screen.
Definition: d4d_screen.c:356
D4D_COOR bottom
Margin of bottom side.
Definition: d4d_types.h:249
void D4D_HandleKeys(void)
Definition: d4d_base.c:582
D4D_BOOL(* CheckCoordinates)(struct D4D_OBJECT_S *pObj, D4D_POINT point)
Object check coordinates function pointer (return true or false if the input point fits into the obje...
Definition: d4d_object.h:138
D4D_COOR right
Margin of right side.
Definition: d4d_types.h:248
Byte d4d_scratchPad[D4D_SCRATCHPAD_SIZE]
Definition: d4d_base.c:56
void D4D_CheckTouchScreen(void)
D4D_TOUCHSCREEN_CALIB D4D_TCH_GetCalibration(void)
void D4D_ActivateScreen(const D4D_SCREEN *pNewScreen, D4D_BOOL bReplaceCurrent)
The function activate the new screen.
Definition: d4d_screen.c:94
#define NULL
Type definition of null pointer.
Definition: d4d_types.h:184
void D4D_SetTextProperties(D4D_OBJECT_PTR pObject, D4D_TEXT_PROPERTIES property)
Function sets object text properties.
Definition: d4d_base.c:511
#define D4D_KEY_FUNC_FOCUS_NEXT
This macro is used to specify standard system function to to set focus to next object. If not defined, it sets to D4D_KEY_SCANCODE_DOWN as a default.
Definition: d4d_base.h:316
D4D_STR_PROPERTIES * str_properties
pointer to string properties
Definition: d4d_string.h:105
D4D_COOR y
Coordination in axis Y.
Definition: d4d_types.h:226
D4D_SCREEN * D4D_GetActiveScreen(void)
Returns pointer to current active screen.
Definition: d4d_screen.c:78
#define D4D_COLOR_SYSTEM_FORE
This macro is used to define the system fore color (For example used in touch screen calibration)...
Definition: d4d_base.h:121
#define D4D_SCR_F_EXIT
The screen has exit button in title bar.
Definition: d4d_screen.h:106
Byte D4D_TCH_GetRawPosition(D4D_COOR *TouchPositionX, D4D_COOR *TouchPositionY)
#define D4D_SYSTEM_F_SYSTEM_KEYS_DISABLE
Definition: d4d_base.h:473
#define D4D_MouseShow(show)
Definition: d4d_mouse.h:228
D4D_SIZE sz
Size of object.
Definition: d4d_types.h:240
D4D_OBJECT_PTR D4D_GetFocusedObject(const D4D_SCREEN *pScreen)
The function returns pointer to object that is focused in given screen.
Definition: d4d_screen.c:266
#define D4D_KEY_ENTER
This macro is used to specify Key ENTER in mask mode (obsolete). If not defined, it sets to 0x10 as a...
Definition: d4d_base.h:269
D4D_MSGID nMsgId
Type of message.
Definition: d4d_base.h:404
D4D_SIZE size
Size of the object.
Definition: d4d_object.h:170
#define D4D_OBJECT_USR_DATA_PARENT_IX
The relations object index to relation array for parent object.
Definition: d4d_object.h:101
#define D4D_COLOR_SYSTEM_BCKG
This macro is used to define the system background color (For example used in touch screen calibratio...
Definition: d4d_base.h:127
void D4D_PutTouchScreen(D4D_BOOL touched, D4D_COOR x, D4D_COOR y)
Byte flags
Internal screen flags.
Definition: d4d_screen.h:156
#define D4D_KEY_SCANCODE_LEFT
This macro is used to specify Key Scan Code LEFT. If not defined, it sets to 0x4B as a default...
Definition: d4d_base.h:290
#define D4D_KEY_LEFT
This macro is used to specify Key LEFT in mask mode (obsolete). If not defined, it sets to 0x04 as a ...
Definition: d4d_base.h:259
D4D_POINT pnt
Left Top corner point.
Definition: d4d_types.h:239
D4D_KEY_SCANCODE key
There will be stored only code of key without release / press information - is valid with D4D_MSG_KEY...
Definition: d4d_base.h:409
D4D_POINT D4D_GetClientToScreenPoint(D4D_OBJECT *pObject, D4D_POINT *nClientPoint)
The function convert client point on the screen to the global screen point.
Definition: d4d_screen.c:536
Byte(* OnObjectMsg)(struct D4D_MESSAGE_S *pMsg)
Screen event handler of called before object receives the message.
Definition: d4d_screen.h:172
void D4D_TCH_SetCalibration(D4D_TOUCHSCREEN_CALIB newCalib)
The object main structure type definition.
Definition: d4d_object.h:167
#define D4D_BEVEL_WIDTH
D4D_BEVEL_WIDTH constant declaration - can&#39;t be changed!
D4D_SCREEN_DATA * pData
pointer to screen private run time data
Definition: d4d_screen.h:186
Lost Touch message - is send when the screen is still touch but the coordination leaves the original ...
Definition: d4d_base.h:381
void D4D_KeysChanged(D4D_KEYS keys)
Place to keys buffer new keys events by binary mask.
Definition: d4d_base.c:272
void D4D_ComputeGeometry(D4D_GEOMETRY *pGeometry, D4D_OBJECT *pObject)
Definition: d4d_base.c:1047
void D4D_EscapeScreen(void)
The function return to previous screen recorded in the history.
Definition: d4d_screen.c:130
D4D_COOR cy
Size in axis Y (height)
Definition: d4d_types.h:233
#define D4D_MouseInit()
Definition: d4d_mouse.h:242
void D4D_TimeTickPut(void)
Notify eGui about new tick tick occur.
Definition: d4d_base.c:234
void D4D_Poll(void)
Main eGUI function. Must be periodically called in main loop/task loop.
Definition: d4d_base.c:159
D4D_OBJECT_RELATIONS pRelations
Relationship between the objects.
Definition: d4d_object.h:177
D4D_BOOL D4D_LCD_Init(void)
Definition: d4d_low.c:86
#define D4D_KEY_SCANCODE_RELEASEMASK
Mask of scan code for key release. MSB bit of Byte. If this bit is clear, the goes down...
Definition: d4d_base.h:311
#define D4D_OBJECT_F_VISIBLE
Object after initialization is visible on the screen.
Definition: d4d_object.h:72
const D4DLCD_FUNCTIONS D4D_LLD_LCD
Touched message - is send when the object is touched by touch screen driver.
Definition: d4d_base.h:379
LWord D4D_BOOL
Type definition of eGUI boolean.
Definition: d4d_types.h:204
void D4D_FlushOutput(void)
Function force flush output to LCD.
Definition: d4d_base.c:563
Type definition of eGUI size structure.
Definition: d4d_types.h:230
struct D4D_STRING_S *(* GetTextBuffer)(struct D4D_OBJECT_S *pObj)
Object get text buffer function pointer (the function returns the pointer of the object text buffer...
Definition: d4d_object.h:139
void D4D_EnableSystemKeys(D4D_BOOL bEnable)
Function enable or disable handling system keys (ESC, UP/DOWN, LEFT/RIGHT) automatically.
Definition: d4d_base.c:256
#define D4D_KEYS_BUFF_LENGTH
This macro is used to specify leght of keybord events buffer. If not defined, it sets to 4 events as ...
Definition: d4d_base.h:328
D4D_OBJECT_DRAWFLAGS draw
Contains draw flags - is valid with D4D_MSG_DRAW and D4D_MSG_DRAWDONE message.
Definition: d4d_base.h:408
const D4D_POINT d4d_point_zero
Definition: d4d_base.c:75
void D4D_SetTouchScreenCalibration(D4D_TOUCHSCREEN_CALIB newCalib)
The screen structure type. The main screen structure that contains all needed data to run the eGUI sc...
Definition: d4d_screen.h:162
Type definition of eGUI geometry structure.
Definition: d4d_types.h:237
#define D4D_SYSTEM_F_TIMETICK
Definition: d4d_base.h:472
#define D4D_TCHSCR_STATUS_EVENTS
Definition: d4d_base.h:466
void D4D_SetFontProperties(D4D_OBJECT_PTR pObject, D4D_FONT_PROPERTIES property)
Function sets object text font properties.
Definition: d4d_base.c:485
#define D4D_KEY_DOWN
This macro is used to specify Key DOWN in mask mode (obsolete). If not defined, it sets to 0x02 as a ...
Definition: d4d_base.h:254
Byte d4d_screenHistoryIndex
Definition: d4d_base.c:66
void D4D_InvalidateObject(D4D_OBJECT_PTR pObject, D4D_BOOL bComplete)
Function invalidate object to redraw on screen.
Definition: d4d_object.c:71
Byte D4D_SYSTEM_FLAGS
Definition: d4d_base.h:469
D4D_MARGIN * pMargin
Object inner margin.
Definition: d4d_object.h:172
D4D driver - resistive touch screen driver function header file.
#define D4D_OBJECT_F_BEVEL_MASK
Object bevel border mask.
Definition: d4d_object.h:81
void D4D_SendMessage(D4D_MESSAGE *pMsg)
Definition: d4d_base.c:681
D4D_SCREEN * d4d_screenHistory[D4D_SCREEN_HISTORY]
Definition: d4d_base.c:65
Byte D4D_KEY_SCANCODE
Type definition of eGUI keys scan code.
Definition: d4d_types.h:304
#define D4D_TCHSCR_STATUS_NEWRAWEVENT
Definition: d4d_base.h:462
Key Down message - is send when the object get new Key Down event.
Definition: d4d_base.h:378
D4D_BOOL touched
Boolean of touch state (touched or non touched)
Definition: d4d_types.h:362
void D4D_RedrawScreen(D4D_SCREEN *pScreen)
Definition: d4d_screen.c:1058
void D4D_SendMessageBack(D4D_MESSAGE *pMsg)
Definition: d4d_base.c:769
struct D4D_SCREEN_S * pScreen
Pointer to screen who is receiver of this message.
Definition: d4d_base.h:403
D4D_FONT_PROPERTIES font_properties
Font properties structure.
Definition: d4d_string.h:95
Byte D4D_FONT_PROPERTIES
Definition: d4d_font.h:116
D4D_BOOL D4D_ScrCheckCoor(D4D_SCREEN *pScreen, D4D_POINT *point)
The function check if the coordination are in screen area.
Definition: d4d_screen.c:634
void D4D_ClearTouchScreenEvents(void)
D4D_COOR D4D_GetLongerSide(D4D_SIZE *pSz)
Function returns longer side of size structure.
Definition: d4d_base.c:550
The notification of forcing flush by user code.
Definition: d4d_lldapi.h:141
D4D_COOR top
Margin of top side.
Definition: d4d_types.h:247
D4D_COOR x
Coordination in axis X.
Definition: d4d_types.h:225
union D4D_MESSAGE_S::@0 prm
Additional data for some type of messages.
Type definition of eGUI client area margin structure.
Definition: d4d_types.h:244
static D4D_KEYS_BUFFER d4d_KeysBuff
Definition: d4d_base.c:86
D4D_BOOL D4D_IsEnabled(D4D_OBJECT *pObject)
Function find out if the object is enabled or not.
Definition: d4d_object.c:303
D4D_POINT D4D_GetScreenToClientPoint(D4D_OBJECT *pObject, D4D_POINT *nScreenPoint)
The function convert global screen point on the screen to the client point.
Definition: d4d_screen.c:586
The screen run time data type. It used to internal store the runtime data by eGUI.
Definition: d4d_screen.h:152
#define D4D_KEY_SCANCODE_KEYMASK
Mask of scan code for key index. Lower 7 bits of Byte.
Definition: d4d_base.h:309