eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_basic_draw.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 /**************************************************************/
62 // last point remembered for MoveTo, LineTo etc.
64 
65 /******************************************************************************
66 * Begin of D4D_BASIC_DRAW public functions
67 */
71 /**************************************************************************/
78 {
79  d4d_curXY = *ppt;
80 }
81 
82 /**************************************************************************/
90 {
91  d4d_curXY.x = x;
92  d4d_curXY.y = y;
93 }
94 
95 /**************************************************************************/
105 {
106  D4D_LCD_PutPixel(ppt->x, ppt->y, type, color);
107  d4d_curXY = *ppt;
108 }
109 
110 /**************************************************************************/
119 {
120  D4D_LCD_PutPixel(d4d_curXY.x, d4d_curXY.y, type, color);
121 }
122 
123 /**************************************************************************/
134 {
135  D4D_LCD_PutPixel(x, y, type, color);
136  d4d_curXY.x = x;
137  d4d_curXY.y = y;
138 }
139 
140 /**************************************************************************/
148 {
150  d4d_curXY.x = 0;
151  d4d_curXY.y = 0;
152 }
153 
154 /**************************************************************************/
164 void D4D_LineTo(D4D_POINT* ppt, D4D_LINETYPE ltype, D4D_COLOR color)
165 {
166  D4D_LCD_Line(d4d_curXY.x, d4d_curXY.y, ppt->x, ppt->y, ltype, color);
167 
168  d4d_curXY = *ppt;
169 }
170 
171 /**************************************************************************/
183 {
184  D4D_LCD_Line(d4d_curXY.x, d4d_curXY.y, x, y, ltype, color);
185 
186  d4d_curXY.x = x;
187  d4d_curXY.y = y;
188 }
189 
190 /**************************************************************************/
200 void D4D_Rect(D4D_POINT* ppt, D4D_SIZE* psz, D4D_LINETYPE ltype, D4D_COLOR color)
201 {
202  if(psz->cx && psz->cy)
203  D4D_LCD_Rect((D4D_COOR)ppt->x, (D4D_COOR)ppt->y, (D4D_COOR)(ppt->x+psz->cx - 1), (D4D_COOR)(ppt->y+psz->cy - 1), (D4D_LINETYPE)ltype, (D4D_COLOR)color);
204 
205  d4d_curXY = *ppt;
206 }
207 
208 /**************************************************************************/
221 {
222  D4D_LCD_Rect(x1, y1, x2, y2, ltype, color);
223 
224  d4d_curXY.x = x1;
225  d4d_curXY.y = y1;
226 }
227 
228 /**************************************************************************/
238 void D4D_RectTo(D4D_POINT* ppt, D4D_LINETYPE ltype, D4D_COLOR color)
239 {
240  D4D_LCD_Rect(d4d_curXY.x, d4d_curXY.y, ppt->x, ppt->y, ltype, color);
241 
242  d4d_curXY = *ppt;
243 }
244 
245 /**************************************************************************/
257 {
258  D4D_LCD_Rect(d4d_curXY.x, d4d_curXY.y, x, y, ltype, color);
259 
260  d4d_curXY.x = x;
261  d4d_curXY.y = y;
262 }
263 
264 
265 /**************************************************************************/
274 void D4D_FillRect(D4D_POINT* ppt, D4D_SIZE* psz, D4D_COLOR color)
275 {
276  if(psz->cx && psz->cy)
277  D4D_LCD_Box((D4D_COOR)ppt->x, (D4D_COOR)ppt->y, (D4D_COOR)(ppt->x+psz->cx - 1), (D4D_COOR)(ppt->y+psz->cy - 1), (D4D_COLOR)color);
278 
279  d4d_curXY = *ppt;
280 }
281 
282 /**************************************************************************/
294 {
295  D4D_LCD_Box(x1, y1, x2, y2, color);
296 
297  d4d_curXY.x = x1;
298  d4d_curXY.y = y1;
299 }
300 
301 /**************************************************************************/
311 {
312  D4D_LCD_Box(d4d_curXY.x, d4d_curXY.y, ppt->x, ppt->y, (D4D_COLOR)color);
313 
314  d4d_curXY = *ppt;
315 }
316 
317 /**************************************************************************/
328 {
329  D4D_LCD_Box(d4d_curXY.x, d4d_curXY.y, x, y, color);
330 
331  d4d_curXY.x = x;
332  d4d_curXY.y = y;
333 }
334 
335 /**************************************************************************/
346 void D4D_Box(D4D_POINT* ppt, D4D_SIZE* psz, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill)
347 {
348  if(psz->cx && psz->cy)
349  D4D_BoxXY(ppt->x, ppt->y, (D4D_COOR)(ppt->x+psz->cx - 1), (D4D_COOR)(ppt->y+psz->cy - 1), ltype, colorLine, colorFill);
350 }
351 
352 /**************************************************************************/
365 void D4D_BoxXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill)
366 {
367  // fill background
368  D4D_LCD_Box(x1, y1, x2, y2, colorFill);
369 
370  // draw rectangle around
371  D4D_LCD_Rect(x1, y1, x2, y2, ltype, colorLine);
372 
373  d4d_curXY.x = x1;
374  d4d_curXY.y = y1;
375 }
376 
377 /**************************************************************************/
388 void D4D_BoxTo(D4D_POINT* ppt, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill)
389 {
390  D4D_BoxToXY(ppt->x, ppt->y, ltype, colorLine, colorFill);
391 }
392 
393 /**************************************************************************/
405 void D4D_BoxToXY(D4D_COOR x, D4D_COOR y, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill)
406 {
407  // fill background
408  D4D_LCD_Box(d4d_curXY.x, d4d_curXY.y, x, y, colorFill);
409 
410  // draw rectangle around
411  D4D_LCD_Rect(d4d_curXY.x, d4d_curXY.y, x, y, ltype, colorLine);
412 
413  d4d_curXY.x = x;
414  d4d_curXY.y = y;
415 }
416 
417 
418 /**************************************************************************/
429 void D4D_FillRectColorScale(D4D_POINT* ppt, D4D_SIZE* psz, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction)
430 {
431  if(psz->cx && psz->cy)
432  D4D_FillRectColorScaleXY(ppt->x, ppt->y, (D4D_COOR)(ppt->x+psz->cx - 1), (D4D_COOR)(ppt->y+psz->cy - 1), startColor, endColor, direction);
433 }
434 
435 /**************************************************************************/
448 void D4D_FillRectColorScaleXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction)
449 {
450  D4D_COOR range, i;
451  D4D_COLOR color = startColor;
452 
453  d4d_curXY.x = x1;
454  d4d_curXY.y = y1;
455 
456  switch(direction)
457  {
458  case D4D_DIR_UP:
459  // switch X and Y coodinates and change direction of drawing
460  startColor = endColor;
461  endColor = color;
462  case D4D_DIR_DOWN:
463  // just switch X and Y coodinates
464  range = (D4D_COOR)(y2 - y1);
465 
466  i = 0;
467  for( ; y1 <= y2; y1++)
468  {
469  if(range)
470  color = D4D_GetCrossColor(startColor, endColor, (Byte)D4D_MulDivUU(255, i, range));
471  i++;
472 
473  D4D_LCD_Box(x1, y1, x2, y1, color);
474  }
475  break;
476 
477  case D4D_DIR_LEFT:
478  // switch colors
479  startColor = endColor;
480  endColor = color;
481  case D4D_DIR_RIGHT:
482  // just keep all fine
483  range = (D4D_COOR)(x2 - x1);
484  i = 0;
485  for( ; x1 <= x2; x1++)
486  {
487  if(range)
488  color = D4D_GetCrossColor(startColor, endColor, (Byte)D4D_MulDivUU(255, i, range));
489  i++;
490 
491  D4D_LCD_Box(x1, y1, x1, y2, color);
492  }
493 
494  break;
495  }
496 }
497 
498 /**************************************************************************/
508 void D4D_FillRectColorScaleTo(D4D_POINT* ppt, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction)
509 {
510  D4D_FillRectColorScaleXY(d4d_curXY.x, d4d_curXY.y, ppt->x, ppt->y, startColor, endColor, direction);
511 }
512 
513 /**************************************************************************/
525 {
526  D4D_FillRectColorScaleXY(d4d_curXY.x, d4d_curXY.y, x, y, startColor, endColor, direction);
527 }
528 
529 
530 /**************************************************************************/
539 void D4D_FillCircle(D4D_POINT* pCenter, D4D_COOR r, D4D_COLOR color)
540 {
541  D4D_LCD_Circle(pCenter->x, pCenter->y, r, D4D_TRUE, D4D_LINE_THIN, color);
542 }
543 
544 /**************************************************************************/
555 {
556  D4D_LCD_Circle(x, y, r, D4D_TRUE, D4D_LINE_THIN, color);
557 }
558 
559 /**************************************************************************/
569 void D4D_Circle(D4D_POINT* pCenter, D4D_COOR r, D4D_LINETYPE ltype, D4D_COLOR color)
570 {
571  D4D_LCD_Circle(pCenter->x, pCenter->y, r, D4D_FALSE, ltype, color);
572 }
573 
574 /**************************************************************************/
587 {
588  D4D_LCD_Circle(x, y, r, D4D_FALSE, ltype, color);
589 }
590 
591 /**************************************************************************/
603 void D4D_DrawTextTabXY(D4D_COOR x, D4D_COOR y, D4D_STRING* buffText, D4D_TAB* pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
604 {
605  D4D_PRINT_DESC tmp_strDes;
606 
607  tmp_strDes.x = x;
608  tmp_strDes.y = y;
609  tmp_strDes.pText = buffText->pText;
610  tmp_strDes.pFontType = D4D_GetFont(buffText->fontId);
611  tmp_strDes.pTab = pTab;
612  tmp_strDes.colorText = colorText;
613  tmp_strDes.colorBack = colorBkgd;
614  tmp_strDes.properties = buffText->str_properties->font_properties;
615  tmp_strDes.textLength = buffText->printLen;
616  tmp_strDes.textOffset = buffText->printOff;
617  tmp_strDes.maxWidth = 0;
618  D4D_LCD_PrintStr(&tmp_strDes);
619 }
620 
621 /**************************************************************************/
634 void D4D_DrawTextRectTab(D4D_POINT* ppt, D4D_SIZE* psz, D4D_STRING* buffText, D4D_TAB* pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
635 {
636  D4D_PRINT_DESC tmp_strDes;
637  D4D_TEXT_PROPERTIES tmp_txtProp;
638  D4D_COOR tmp_txtWidth = D4D_GetTextBuffWidthTab(buffText, pTab);
639  D4D_COOR tmp_txtHeight = D4D_GetFontHeight(buffText->fontId);
640 
641  tmp_strDes.pText = buffText->pText;
642  tmp_strDes.pFontType = D4D_GetFont(buffText->fontId);
643  tmp_strDes.pTab = pTab;
644  tmp_strDes.colorText = colorText;
645  tmp_strDes.colorBack = colorBkgd;
646  tmp_strDes.properties = buffText->str_properties->font_properties;
647  tmp_strDes.textLength = buffText->printLen;
648  tmp_strDes.textOffset = buffText->printOff;
649 
650  if(!psz->cx || !psz->cy)
651  return;
652 
653  if(tmp_txtHeight > psz->cy)
654  return;
655 
656  if(tmp_txtWidth >= psz->cx)
657  tmp_txtWidth = psz->cx;
658 
659  tmp_strDes.maxWidth = tmp_txtWidth;
660 
661  tmp_txtProp = buffText->str_properties->text_properties;
662 
663  tmp_strDes.x = ppt->x;
664  tmp_strDes.y = ppt->y;
665 
666 
667  if(tmp_txtHeight != psz->cy)
668  {
669  // Compute the text position in rectangle in Y axis
670  switch(tmp_txtProp & D4D_ALIGN_V_MASK)
671  {
673  tmp_strDes.y += (D4D_COOR)(psz->cy - tmp_txtHeight);
674  break;
675 
677  tmp_strDes.y += (D4D_COOR)((psz->cy - tmp_txtHeight) / 2);
678  break;
679  }
680  }
681 
682 
683  if(tmp_txtWidth != psz->cx)
684  {
685  // Compute the text position in rectangle in X axis
686  switch(tmp_txtProp & D4D_ALIGN_H_MASK)
687  {
689  tmp_strDes.x += (D4D_COOR)(psz->cx - tmp_txtWidth);
690  break;
691 
693  tmp_strDes.x += (D4D_COOR)((psz->cx - tmp_txtWidth) / 2);
694  break;
695  }
696  }
697 
698 
699  // Redraw the rest of rectangle where isn't text for normal (non trasparent) texts
700  if(!(tmp_strDes.properties & D4D_FNT_PRTY_TRANSPARENT_MASK))
701  {
702  if(tmp_txtWidth != psz->cx)
703  {
704  D4D_COOR width = tmp_txtWidth;
705  if(width)
706  width--;
707 
708  if((tmp_txtProp & D4D_ALIGN_H_MASK) != D4D_ALIGN_H_LEFT_MASK)
709  {
710  // Fill the part of rect in front of the text in full height of rect
711  D4D_FillRectXY(ppt->x, ppt->y, tmp_strDes.x, (D4D_COOR)(ppt->y + psz->cy - 1), colorBkgd);
712  }
713 
714  if((tmp_txtProp & D4D_ALIGN_H_MASK) != D4D_ALIGN_H_RIGHT_MASK)
715  {
716  // Fill the part of rect behind the text in full height of rect
717  D4D_FillRectXY((D4D_COOR)(tmp_strDes.x + width), ppt->y, (D4D_COOR)(ppt->x + psz->cx - 1), (D4D_COOR)(ppt->y + psz->cy - 1), colorBkgd);
718  }
719  }
720 
721  if(tmp_txtHeight != psz->cy)
722  {
723  D4D_COOR width = tmp_txtWidth;
724  if(width)
725  width--;
726 
727  if((tmp_txtProp & D4D_ALIGN_V_MASK) != D4D_ALIGN_V_TOP_MASK)
728  {
729  // Fill the part of rect above the text in lenght of text
730  D4D_FillRectXY(tmp_strDes.x, ppt->y, (D4D_COOR)(tmp_strDes.x + width), tmp_strDes.y, colorBkgd);
731  }
732 
733  if((tmp_txtProp & D4D_ALIGN_V_MASK) != D4D_ALIGN_V_BOTTOM_MASK)
734  {
735  // Fill the part of rect under the text in lenght of text
736  D4D_FillRectXY(tmp_strDes.x, (D4D_COOR)(tmp_strDes.y + tmp_txtHeight - 1), (D4D_COOR)(tmp_strDes.x + width), (D4D_COOR)(ppt->y + psz->cy - 1), colorBkgd);
737  }
738  }
739  }
740 
741  // Print the string itself
742  D4D_LCD_PrintStr(&tmp_strDes);
743 }
744 
745 /**************************************************************************/
758 void D4D_DrawTextRectTabTo(D4D_POINT* ppt, D4D_STRING* buffText, D4D_TAB* pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
759 {
760  D4D_SIZE tmp_size;
761 
762  tmp_size.cx = (D4D_COOR)(ppt->x - d4d_curXY.x);
763  tmp_size.cy = (D4D_COOR)(ppt->y - d4d_curXY.y);
764 
765  D4D_DrawTextRectTab( &d4d_curXY, &tmp_size, buffText, pTab, colorText, colorBkgd);
766 }
767 
768 /**************************************************************************/
783 void D4D_DrawTextRectTabXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_STRING* buffText, D4D_TAB* pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
784 {
785  D4D_POINT tmp_point;
786  D4D_SIZE tmp_size;
787 
788  tmp_point.x = x1;
789  tmp_point.y = y1;
790 
791  tmp_size.cx = (D4D_COOR)(x2 - x1);
792  tmp_size.cy = (D4D_COOR)(y2 - y1);
793 
794 
795  D4D_DrawTextRectTab( &tmp_point, &tmp_size, buffText, pTab, colorText, colorBkgd);
796 }
797 
798 /**************************************************************************/
812 void D4D_DrawTextRectTabToXY(D4D_COOR x, D4D_COOR y, D4D_STRING* buffText, D4D_TAB* pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
813 {
814  D4D_SIZE tmp_size;
815 
816  tmp_size.cx = (D4D_COOR)(x - d4d_curXY.x);
817  tmp_size.cy = (D4D_COOR)(y - d4d_curXY.y);
818 
819 
820  D4D_DrawTextRectTab( &d4d_curXY, &tmp_size, buffText, pTab, colorText, colorBkgd);
821 }
822 
823 
824 #ifdef __CWCC__
825  #pragma mark -
826  #pragma mark Drawing Round Corner Functions
827  #pragma mark -
828 #endif
829 
830 #if D4D_ROUND_CORNER_ENABLE == D4D_TRUE
831 
832 /**************************************************************************/
844 {
845  if(psz->cx && psz->cy)
846  D4D_LCD_RRect((D4D_COOR)ppt->x, (D4D_COOR)ppt->y, (D4D_COOR)(ppt->x+psz->cx - 1), (D4D_COOR)(ppt->y+psz->cy - 1), ltype, color, radius);
847 
848  d4d_curXY = *ppt;
849 }
850 
851 /**************************************************************************/
865 {
866  D4D_LCD_RRect(x1, y1, x2, y2, ltype, color,radius);
867 
868  d4d_curXY.x = x1;
869  d4d_curXY.y = y1;
870 }
871 
872 /**************************************************************************/
884 {
885  D4D_LCD_RRect(d4d_curXY.x, d4d_curXY.y, ppt->x, ppt->y, ltype, color, radius);
886 
887  d4d_curXY = *ppt;
888 }
889 
890 /**************************************************************************/
903 {
904  D4D_LCD_RRect(d4d_curXY.x, d4d_curXY.y, x, y, ltype, color, radius);
905 
906  d4d_curXY.x = x;
907  d4d_curXY.y = y;
908 }
909 
910 /**************************************************************************/
921 {
922  if(psz->cx && psz->cy)
923  D4D_LCD_RBox((D4D_COOR)ppt->x, (D4D_COOR)ppt->y, (D4D_COOR)(ppt->x + psz->cx - 1), (D4D_COOR)(ppt->y + psz->cy - 1), color, radius);
924  d4d_curXY = *ppt;
925 }
926 
927 /**************************************************************************/
940 {
941  D4D_LCD_RBox(x1, y1, x2, y2, color, radius);
942 
943  d4d_curXY.x = x1;
944  d4d_curXY.y = y1;
945 }
946 
947 /**************************************************************************/
958 {
959  D4D_LCD_RBox(d4d_curXY.x, d4d_curXY.y, ppt->x, ppt->y, (D4D_COLOR)color, radius);
960 
961  d4d_curXY = *ppt;
962 }
963 
964 /**************************************************************************/
976 {
977  D4D_LCD_RBox(d4d_curXY.x, d4d_curXY.y, x, y, color, radius);
978 
979  d4d_curXY.x = x;
980  d4d_curXY.y = y;
981 }
982 
983 /**************************************************************************/
995 void D4D_RBox(D4D_POINT* ppt, D4D_SIZE* psz, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill, D4D_COOR radius)
996 {
997  if(psz->cx && psz->cy)
998  D4D_RBoxXY(ppt->x, ppt->y, (D4D_COOR)(ppt->x + psz->cx - 1), (D4D_COOR)(ppt->y + psz->cy - 1), ltype, colorLine, colorFill, radius);
999 }
1000 
1001 /**************************************************************************/
1015 void D4D_RBoxXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill, D4D_COOR radius)
1016 {
1017  // fill background
1018  D4D_LCD_RBox(x1, y1, x2, y2, colorFill, radius);
1019 
1020  // draw rectangle around
1021  D4D_LCD_RRect(x1, y1, x2, y2, ltype, colorLine, radius);
1022 
1023  d4d_curXY.x = x1;
1024  d4d_curXY.y = y1;
1025 }
1026 
1027 /**************************************************************************/
1039 void D4D_RBoxTo(D4D_POINT* ppt, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill, D4D_COOR radius)
1040 {
1041  D4D_RBoxToXY(ppt->x, ppt->y, ltype, colorLine, colorFill, radius);
1042 }
1043 
1044 /**************************************************************************/
1058 {
1059  // fill background
1060  D4D_LCD_RBox(d4d_curXY.x, d4d_curXY.y, x, y, colorFill, radius);
1061 
1062  // draw rectangle around
1063  D4D_LCD_RRect(d4d_curXY.x, d4d_curXY.y, x, y, ltype, colorLine, radius);
1064 
1065  d4d_curXY.x = x;
1066  d4d_curXY.y = y;
1067 }
1068 
1069 /**************************************************************************/
1080 {
1081  D4D_LCD_QCircle(pCenter->x, pCenter->y, radius, D4D_TRUE, D4D_LINE_THIN, color, quadrant);
1082 }
1083 
1084 /**************************************************************************/
1096 {
1097  D4D_LCD_QCircle(x, y, radius, D4D_TRUE, D4D_LINE_THIN, color, quadrant);
1098 }
1099 
1100 /**************************************************************************/
1112 {
1113  D4D_LCD_QCircle(pCenter->x, pCenter->y, radius, D4D_FALSE, ltype, color, quadrant);
1114 }
1115 
1116 /**************************************************************************/
1129 {
1130  D4D_LCD_QCircle(x, y, radius, D4D_FALSE, ltype, color, quadrant);
1131 }
1132 
1133 
1134 /**************************************************************************/
1146 void D4D_FillRRectColorScale(D4D_POINT* ppt, D4D_SIZE* psz, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction, D4D_COOR radius)
1147 {
1148  if(psz->cx && psz->cy)
1149  D4D_FillRRectColorScaleXY(ppt->x, ppt->y, (D4D_COOR)(ppt->x+psz->cx - 1), (D4D_COOR)(ppt->y+psz->cy - 1), startColor, endColor, direction, radius);
1150 }
1151 
1152 /**************************************************************************/
1167 {
1168  D4D_COOR range, i, non_print_len;
1169  D4D_COLOR color = startColor;
1170 
1171  if(radius)
1172  {
1173 
1174  d4d_curXY.x = x1;
1175  d4d_curXY.y = y1;
1176 
1177  switch(direction)
1178  {
1179  case D4D_DIR_UP:
1180  // switch X and Y coodinates and change direction of drawing
1181  startColor = endColor;
1182  endColor = color;
1183  case D4D_DIR_DOWN:
1184  // just switch X and Y coodinates
1185  range = (D4D_COOR)(y2 - y1);
1186 
1187  i = 0;
1188  for( ; y1 <= y2; y1++)
1189  {
1190  if(range)
1191  color = D4D_GetCrossColor(startColor, endColor, (Byte)D4D_MulDivUU(255, i, range));
1192 
1193 
1194  if(i < radius)
1195  non_print_len = D4D_RndCornerGetNonPrintedPxl(radius, i); // get len of non printed pixels
1196  else if((range - i) < radius)
1197  non_print_len = D4D_RndCornerGetNonPrintedPxl(radius, (D4D_COOR)(range - i)); // get len of non printed pixels
1198  else
1199  non_print_len = 0;
1200 
1201  i++;
1202  D4D_LCD_Box((D4D_COOR)(x1 + non_print_len), y1, (D4D_COOR)(x2 - non_print_len), y1, color);
1203  }
1204  break;
1205 
1206  case D4D_DIR_LEFT:
1207  // switch colors
1208  startColor = endColor;
1209  endColor = color;
1210  case D4D_DIR_RIGHT:
1211  // just keep all fine
1212  range = (D4D_COOR)(x2 - x1);
1213 
1214  i = 0;
1215  for( ; x1 <= x2; x1++)
1216  {
1217  if(range)
1218  color = D4D_GetCrossColor(startColor, endColor, (Byte)D4D_MulDivUU(255, i, range));
1219 
1220 
1221  if(i < radius)
1222  non_print_len = D4D_RndCornerGetNonPrintedPxl(radius, i); // get len of non printed pixels
1223  else if((range - i) < radius)
1224  non_print_len = D4D_RndCornerGetNonPrintedPxl(radius, (D4D_COOR)(range - i)); // get len of non printed pixels
1225  else
1226  non_print_len = 0;
1227 
1228  i++;
1229  D4D_LCD_Box(x1, (D4D_COOR)(y1 + non_print_len), x1, (D4D_COOR)(y2 - non_print_len), color);
1230  }
1231 
1232  break;
1233  }
1234  }else
1235  {
1236  D4D_FillRectColorScaleXY(x1, y1, x2, y2, startColor, endColor, direction);
1237  }
1238 
1239 }
1240 
1241 /**************************************************************************/
1253 {
1254  D4D_FillRRectColorScaleXY(d4d_curXY.x, d4d_curXY.y, ppt->x, ppt->y, startColor, endColor, direction, radius);
1255 }
1256 
1257 /**************************************************************************/
1270 {
1271  D4D_FillRRectColorScaleXY(d4d_curXY.x, d4d_curXY.y, x, y, startColor, endColor, direction, radius);
1272 }
1273 
1274 
1275 /**************************************************************************/
1283 {
1285  D4D_COOR x = radius;
1286  D4D_COOR y = 0;
1287  D4D_COOR x1_bf,y1_bf;
1288  D4D_BOOL match = D4D_FALSE;
1289 
1290  line = (D4D_COOR)(radius - line);
1291 
1292  if(line == 0) return radius;
1293 
1294  while (x >= y)
1295  {
1296  if ((x != 0) && (y != 0)) //Valid point
1297  {
1298  if(y == line) return (D4D_COOR)(radius - x);
1299 
1300  if(x == line)
1301  {
1302  match = D4D_TRUE;
1303  x1_bf = (Byte)x;
1304  y1_bf = (Byte)y;
1305  }
1306 
1307  if(match && (x != x1_bf))
1308  return (D4D_COOR)(radius - y1_bf);
1309  }
1310 
1311  error += y;
1312  ++y;
1313  error += y;
1314 
1315  if (error >= 0)
1316  {
1317  if((radius - x) >= line)
1318  return (D4D_COOR)(radius - y);
1319 
1320  x--;
1321  error -= x;
1322  error -= x;
1323  }
1324  }
1325 
1326  return (D4D_COOR)(radius - x);
1327 }
1328 
1329 /**************************************************************************/
1343 void D4D_DrawTextRRectTab(D4D_POINT* ppt, D4D_SIZE* psz, D4D_STRING* buffText, D4D_TAB* pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd, D4D_COOR radius)
1344 {
1345  D4D_PRINT_DESC tmp_strDes;
1346  //D4D_SIZE tmp_size = *psz;
1347  D4D_TEXT_PROPERTIES tmp_txtProp;
1348  D4D_COOR tmp_txtWidth;
1349  D4D_COOR tmp_txtHeight;
1350  //D4D_POINT tmp_Pos;
1351 
1352  if(!radius)
1353  {
1354  D4D_DrawTextRectTab(ppt, psz, buffText, pTab, colorText, colorBkgd);
1355  return;
1356  }
1357 
1358  tmp_txtWidth = D4D_GetTextBuffWidthTab(buffText, pTab);
1359  tmp_txtHeight = D4D_GetFontHeight(buffText->fontId);
1360 
1361  tmp_strDes.pText = buffText->pText;
1362  tmp_strDes.pFontType = D4D_GetFont(buffText->fontId);
1363  tmp_strDes.pTab = pTab;
1364  tmp_strDes.colorText = colorText;
1365  tmp_strDes.colorBack = colorBkgd;
1366  tmp_strDes.properties = buffText->str_properties->font_properties;
1367  tmp_strDes.textLength = buffText->printLen;
1368  tmp_strDes.textOffset = buffText->printOff;
1369 
1370  if(tmp_txtWidth + radius >= psz->cx)
1371  {
1372  if(psz->cx - radius > 0)
1373  tmp_txtWidth = (D4D_COOR)(psz->cx - radius);
1374  else
1375  tmp_txtWidth = 0;
1376  }
1377 
1378  tmp_strDes.maxWidth = tmp_txtWidth;
1379 
1380  tmp_txtProp = buffText->str_properties->text_properties;
1381 
1382  tmp_strDes.x = ppt->x;
1383  tmp_strDes.y = ppt->y;
1384 
1385  // Compute the text position in rectangle in Y axis
1386  switch(tmp_txtProp & D4D_ALIGN_V_MASK)
1387  {
1389  tmp_strDes.y += (D4D_COOR)(psz->cy - tmp_txtHeight - radius / 2);
1390  break;
1391 
1393  tmp_strDes.y += (D4D_COOR)((psz->cy - tmp_txtHeight) / 2);
1394  break;
1395 
1396  default:
1397  case D4D_ALIGN_V_TOP_MASK:
1398  tmp_strDes.y += (D4D_COOR)(radius / 2);
1399  break;
1400  }
1401 
1402  // Compute the text position in rectangle in X axis
1403  switch(tmp_txtProp & D4D_ALIGN_H_MASK)
1404  {
1406  tmp_strDes.x += (D4D_COOR)(psz->cx - tmp_txtWidth - radius / 2);
1407  break;
1408 
1410  tmp_strDes.x += (D4D_COOR) ((psz->cx - tmp_txtWidth) / 2);
1411  break;
1412 
1413  default:
1414  case D4D_ALIGN_H_LEFT_MASK:
1415  tmp_strDes.x += (D4D_COOR)(radius / 2);
1416  break;
1417  }
1418 
1419  // Redraw the rest of rectangle where isn't text for normal (non trasparent) texts
1420  if(!(tmp_strDes.properties & D4D_FNT_PRTY_TRANSPARENT_MASK))
1421  {
1422  D4D_FillRRect(ppt, psz, colorBkgd, radius);
1423 #if 0
1424 
1425 
1426  tmp_Pos = *ppt;
1427 
1428  tmp_Pos.x += radius;
1429  tmp_Pos.y += radius;
1430  D4D_FillQuadrant(&tmp_Pos, radius, colorBkgd, D4D_QUAD_4);
1431  tmp_Pos.x += psz->cx - radius * 2 - 1;
1432  D4D_FillQuadrant(&tmp_Pos, radius, colorBkgd, D4D_QUAD_1);
1433  tmp_Pos.y += psz->cy - radius * 2 - 1;
1434  D4D_FillQuadrant(&tmp_Pos, radius, colorBkgd, D4D_QUAD_2);
1435  tmp_Pos.x -= (psz->cx - radius * 2 - 1);
1436  D4D_FillQuadrant(&tmp_Pos, radius, colorBkgd, D4D_QUAD_3);
1437 
1438 
1439  if((tmp_txtProp & D4D_ALIGN_H_MASK) != D4D_ALIGN_H_LEFT_MASK)
1440  {
1441  // Fill the part of rect in front of the text in full height of rect
1442  D4D_FillRectXY(ppt->x, (D4D_COOR)(ppt->y + radius), tmp_strDes.x, (D4D_COOR)(ppt->y + psz->cy - 1 - radius), colorBkgd);
1443  }
1444 
1445  if((tmp_txtProp & D4D_ALIGN_H_MASK) != D4D_ALIGN_H_RIGHT_MASK)
1446  {
1447  // Fill the part of rect behind the text in full height of rect if()
1448  D4D_FillRectXY((D4D_COOR)(tmp_strDes.x + tmp_txtWidth - 1), (D4D_COOR)(ppt->y), (D4D_COOR)(ppt->x + psz->cx - 1 - radius), (D4D_COOR)(ppt->y + psz->cy - 1), colorBkgd);
1449  }
1450 
1451  if((tmp_txtProp & D4D_ALIGN_V_MASK) != D4D_ALIGN_V_TOP_MASK)
1452  {
1453  // Fill the part of rect above the text in lenght of text
1454  D4D_FillRectXY((D4D_COOR)(ppt->x + radius), ppt->y, (D4D_COOR)(ppt->x + psz->cx - 1 - radius), (D4D_COOR)(tmp_strDes.y + 1), colorBkgd);
1455  }
1456 
1457  if((tmp_txtProp & D4D_ALIGN_V_MASK) != D4D_ALIGN_V_BOTTOM_MASK)
1458  {
1459  // Fill the part of rect under the text in lenght of text
1460  D4D_FillRectXY((D4D_COOR)(ppt->x + radius), (D4D_COOR)(tmp_strDes.y + tmp_txtHeight - 1), (D4D_COOR)(ppt->x + psz->cx - 1 - radius), (D4D_COOR)(ppt->y + psz->cy - 1), colorBkgd);
1461  }
1462 #endif
1463 
1464  }
1465 
1466  // Print the string itself
1467  D4D_LCD_PrintStr(&tmp_strDes);
1468 }
1469 
1470 /**************************************************************************/
1484 void D4D_DrawTextRRectTabTo(D4D_POINT* ppt, D4D_STRING* buffText, D4D_TAB* pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd, D4D_COOR radius)
1485 {
1486  D4D_SIZE tmp_size;
1487 
1488  tmp_size.cx = (D4D_COOR)(ppt->x - d4d_curXY.x);
1489  tmp_size.cy = (D4D_COOR)(ppt->y - d4d_curXY.y);
1490 
1491  D4D_DrawTextRRectTab( &d4d_curXY, &tmp_size, buffText, pTab, colorText, colorBkgd, radius);
1492 }
1493 
1494 /**************************************************************************/
1510 void D4D_DrawTextRRectTabXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_STRING* buffText, D4D_TAB* pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd, D4D_COOR radius)
1511 {
1512  D4D_POINT tmp_point;
1513  D4D_SIZE tmp_size;
1514 
1515  tmp_point.x = x1;
1516  tmp_point.y = y1;
1517 
1518  tmp_size.cx = (D4D_COOR)(x2 - x1);
1519  tmp_size.cy = (D4D_COOR)(y2 - y1);
1520 
1521 
1522  D4D_DrawTextRRectTab( &tmp_point, &tmp_size, buffText, pTab, colorText, colorBkgd, radius);
1523 }
1524 
1525 /**************************************************************************/
1541 {
1542  D4D_SIZE tmp_size;
1543 
1544  tmp_size.cx = (D4D_COOR)(x - d4d_curXY.x);
1545  tmp_size.cy = (D4D_COOR)(y - d4d_curXY.y);
1546 
1547 
1548  D4D_DrawTextRRectTab( &d4d_curXY, &tmp_size, buffText, pTab, colorText, colorBkgd, radius);
1549 }
1550 #endif
1551 
1552 /**************************************************************************/
1566 {
1567  D4D_COLOR fore, bck;
1568  D4D_POINT shPos;
1569  D4D_SIZE shSize;
1570 
1571  #if (D4D_ROUND_CORNER_ENABLE == D4D_FALSE) //if no Round corners
1572  D4D_UNUSED(radius)
1573  #endif
1574 
1575  switch(type)
1576  {
1577  case D4D_BEVEL_NONE:
1578  // Draw nothing :-)
1579  return;
1580  case D4D_BEVEL_RAISED:
1583  break;
1584  case D4D_BEVEL_DENTED:
1587  break;
1588  case D4D_BEVEL_RESERVED:
1589  // Draw nothing :-)
1590  return;
1591  default:
1592  return;
1593  }
1594 
1595  if(psz->cx < (D4D_BEVEL_WIDTH * 2))
1596  return;
1597 
1598  if(psz->cy < (D4D_BEVEL_WIDTH * 2))
1599  return;
1600 
1601  // Draw Bevel
1602  shPos = *ppt;
1603  shSize.cx = psz->cx;
1604  shSize.cy = D4D_BEVEL_WIDTH;
1605 
1606 #if (D4D_ROUND_CORNER_ENABLE != D4D_FALSE) //if Round corners
1607  shPos.x += radius;
1608  shPos.y += radius;
1609  D4D_Quadrant(&shPos, radius, D4D_LINE_THICK, fore, D4D_QUAD_4);
1610  shPos.x += psz->cx - radius * 2 - 2;
1611  D4D_Quadrant(&shPos, radius, D4D_LINE_THICK, fore, D4D_QUAD_1);
1612  shPos.y += psz->cy - radius * 2 - 2;
1613  D4D_Quadrant(&shPos, radius, D4D_LINE_THICK, bck, D4D_QUAD_2);
1614  shPos.x -= (psz->cx - radius * 2 - 2);
1615  D4D_Quadrant(&shPos, radius, D4D_LINE_THICK, bck, D4D_QUAD_3);
1616 
1617  shPos = *ppt;
1618  shPos.x += radius;
1619  shSize.cx -= radius * 2;
1620 #endif
1621 
1622  D4D_FillRect(&shPos, &shSize, fore);
1623 
1624  shPos.y += (psz->cy - D4D_BEVEL_WIDTH);
1625  D4D_FillRect(&shPos, &shSize, bck);
1626 
1627  shPos = *ppt;
1628 
1629  // change pos
1630  shSize.cx = D4D_BEVEL_WIDTH;
1631  shSize.cy = psz->cy;
1632 
1633 #if (D4D_ROUND_CORNER_ENABLE != D4D_FALSE) //if Round corners
1634  shPos.y += radius;
1635  shSize.cy -= radius * 2;
1636 #endif
1637  D4D_FillRect(&shPos, &shSize, fore);
1638 
1639  shPos.x += (psz->cx - D4D_BEVEL_WIDTH);
1640 
1641  D4D_FillRect(&shPos, &shSize, bck);
1642 
1643 }
1644 
1645 
1646 /**************************************************************************/
1654 void D4D_DrawFrame(D4D_OBJECT* pObject, D4D_COLOR clrT, D4D_COLOR clrB)
1655 {
1656  D4D_POINT position = D4D_GetClientToScreenPoint(pObject, &pObject->position);
1657 
1658  // Draw the frame
1659  if(pObject->pData->flags & D4D_OBJECT_F_BEVEL_MASK)
1660  {
1661  D4D_COLOR clrBevel;
1662  // In case that focus rect is enabled and also BEVEL, just change the color of bevel
1663  if(pObject->pData->flags & D4D_OBJECT_F_FOCUSRECT)
1664  clrBevel = clrT;
1665  else
1666  {
1667  if(D4D_GetFocusedObject(pObject->pData->pScreen) == pObject)
1668  clrBevel = clrT;
1669  else
1670  clrBevel = clrB;
1671  }
1672  D4D_Bevel(&position, &pObject->size, clrBevel, D4D_OBJECT_FLAGS2BEVEL(pObject), pObject->radius);
1673  }else
1674  {
1675  if(pObject->pData->flags & D4D_OBJECT_F_FOCUSRECT)
1676  D4D_RRect(&position, &pObject->size, D4D_LINE_THIN, clrT, pObject->radius);
1677  }
1678 }
1679 
1680 /******************************************************************************
1681 * End of public functions */
1683 /******************************************************************************/
1684 
D4D_COLOR D4D_GetCrossColor(D4D_COLOR startColor, D4D_COLOR endColor, Byte value)
Compute cross color between two basic color in 256 steps.
Definition: d4d_scheme.c:243
void D4D_LCD_RBox(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_COLOR color, D4D_COOR radius)
Definition: d4d_low.c:397
#define D4D_BEVEL_BCKG_INTENSITY
D4D_BEVEL_BCKG_INTENSITY constant default declaration. Sets the percentual change of color for bevel ...
void D4D_RBoxTo(D4D_POINT *ppt, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill, D4D_COOR radius)
Function draw filled rectangle with outline on the screen with round corners.
D4D_LINETYPE
Type definition of eGUI line type.
Definition: d4d_types.h:291
void D4D_RBox(D4D_POINT *ppt, D4D_SIZE *psz, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill, D4D_COOR radius)
Function draw filled rectangle with outline on the screen with round corners.
void D4D_Quadrant(D4D_POINT *pCenter, D4D_COOR radius, D4D_LINETYPE ltype, D4D_COLOR color, D4D_QUADRANT quadrant)
Function draw quadrant of circle on the screen.
void D4D_BoxTo(D4D_POINT *ppt, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill)
Function draw filled rectangle with outline on the screen.
#define D4D_OBJECT_F_FOCUSRECT
Object has an outlined rectangle.
Definition: d4d_object.h:77
void D4D_Box(D4D_POINT *ppt, D4D_SIZE *psz, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill)
Function draw filled rectangle with outline on the screen.
D4D_FONT_TYPE * pFontType
Definition: d4d_font.h:220
Dented bevel type.
Definition: d4d_types.h:336
#define D4D_ALIGN_V_CENTER_MASK
The vertical center aligment option mask (for texts and also bitmaps).
Definition: d4d_base.h:234
void D4D_RBoxXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill, D4D_COOR radius)
Function draw filled rectangle with outline on the screen with round corners.
void D4D_DrawTextRRectTabToXY(D4D_COOR x, D4D_COOR y, D4D_STRING *buffText, D4D_TAB *pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd, D4D_COOR radius)
Function draw text on XY coordination with TAB function in rectangle with round corners.
D4D_FONT_TYPE * D4D_GetFont(D4D_FONT ix)
Definition: d4d_font.c:340
D4D_TEXT_PROPERTIES text_properties
Text properties structure.
Definition: d4d_string.h:96
void D4D_FillRect(D4D_POINT *ppt, D4D_SIZE *psz, D4D_COLOR color)
Function draw filled rectangle on the screen.
D4D_INDEX printLen
Length of string that should be used (printed).
Definition: d4d_string.h:106
struct D4D_SCREEN_S * pScreen
pointer to object screen owner - it is placed in RAM bacause one object could be used in multiply scr...
Definition: d4d_object.h:146
Type definition of eGUI point structure.
Definition: d4d_types.h:223
void D4D_FillRectXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_COLOR color)
Function draw filled rectangle on the screen.
D4D_OBJECT_DATA_PTR pData
Pointer on runtime object data.
Definition: d4d_object.h:180
First quadrant &lt;0-90)
Definition: d4d_types.h:325
void D4D_FillRectColorScaleTo(D4D_POINT *ppt, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction)
Function draw filled rectangle with changing color (cross color from start to end color) on the scree...
D4D_INDEX textLength
Definition: d4d_font.h:225
void D4D_FillQuadrantXY(D4D_COOR x, D4D_COOR y, D4D_COOR radius, D4D_COLOR color, D4D_QUADRANT quadrant)
Function draw fill quadrant of circle on the screen.
#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
D4D_COOR maxWidth
Definition: d4d_font.h:227
D4D_COOR D4D_DisplayHeight(void)
Definition: d4d_low.c:167
void D4D_BoxToXY(D4D_COOR x, D4D_COOR y, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill)
Function draw filled rectangle with outline on the screen.
void D4D_DrawTextRectTab(D4D_POINT *ppt, D4D_SIZE *psz, D4D_STRING *buffText, D4D_TAB *pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
Function draw text with TAB function in rectangle.
#define D4D_ALIGN_H_RIGHT_MASK
The horizontal right aligment option mask (for texts and also bitmaps).
Definition: d4d_base.h:223
D4D_COLOR colorText
Definition: d4d_font.h:222
D4D_COOR y
Definition: d4d_font.h:218
void D4D_LCD_Line(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_LINETYPE line_type, D4D_COLOR color)
Definition: d4d_low.c:245
void D4D_LCD_Rect(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_LINETYPE line_type, D4D_COLOR color)
Definition: d4d_low.c:237
D4D_FONT_PROPERTIES properties
Definition: d4d_font.h:224
#define D4D_OBJECT_FLAGS2BEVEL(pObject)
Macro that gets the type of bevel from the object flags.
Definition: d4d_object.h:232
D4D_FONT fontId
index of used font
Definition: d4d_string.h:104
void D4D_RRectToXY(D4D_COOR x, D4D_COOR y, D4D_LINETYPE ltype, D4D_COLOR color, D4D_COOR radius)
Function draw rectangle on the screen with round corners.
void D4D_LCD_Box(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_COLOR color)
Definition: d4d_low.c:212
void D4D_MoveToXY(D4D_COOR x, D4D_COOR y)
Function move logic cursor to new position.
#define D4D_TRUE
This is definition of boolean operation value in eGUI - TRUE.
Definition: d4d_types.h:106
void D4D_DrawFrame(D4D_OBJECT *pObject, D4D_COLOR clrT, D4D_COLOR clrB)
Function draw standard object frame based on the object settings and current state.
void D4D_DrawTextRectTabTo(D4D_POINT *ppt, D4D_STRING *buffText, D4D_TAB *pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
Function draw text on XY coordination with TAB function in rectangle.
void D4D_ClearScreen(D4D_COLOR color)
Function readraw complete screen by one color.
Third quadrant &lt;180-270)
Definition: d4d_types.h:327
D4D Driver main header file.
None Bevel is used.
Definition: d4d_types.h:334
D4D_OBJECT_FLAGS flags
runtime object flags
Definition: d4d_object.h:145
void D4D_Rect(D4D_POINT *ppt, D4D_SIZE *psz, D4D_LINETYPE ltype, D4D_COLOR color)
Function draw rectangle on the screen.
void D4D_FillRectColorScaleToXY(D4D_COOR x, D4D_COOR y, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction)
Function draw filled rectangle with changing color (cross color from start to end color) on the scree...
void D4D_DrawTextTabXY(D4D_COOR x, D4D_COOR y, D4D_STRING *buffText, D4D_TAB *pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
Function draw text on XY coordination with TAB function.
void D4D_FillCircleXY(D4D_COOR x, D4D_COOR y, D4D_COOR r, D4D_COLOR color)
Function draw filled circle on the screen.
Direction UP.
Definition: d4d_types.h:309
D4D_COOR D4D_GetTextBuffWidthTab(D4D_STRING *text_buffer, D4D_TAB *pTab)
The function returns width of text in pixels, also with tab table.
Definition: d4d_string.c:403
void D4D_RectTo(D4D_POINT *ppt, D4D_LINETYPE ltype, D4D_COLOR color)
Function draw rectangle on the screen.
D4D Driver private header file.
void D4D_FillRectTo(D4D_POINT *ppt, D4D_COLOR color)
Function draw filled rectangle on the screen.
void D4D_FillRRectToXY(D4D_COOR x, D4D_COOR y, D4D_COLOR color, D4D_COOR radius)
Function draw filled rectangle on the screen with round corners.
D4D_INDEX textOffset
Definition: d4d_font.h:226
void D4D_DrawTextRRectTabXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_STRING *buffText, D4D_TAB *pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd, D4D_COOR radius)
Function draw text with TAB function in rectangle with round corners.
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_TCHAR * pText
Definition: d4d_font.h:219
Direction RIGHT.
Definition: d4d_types.h:311
D4D_COOR cx
Size in axis X (width)
Definition: d4d_types.h:232
Byte D4D_COOR
Type definition of eGUI coordination variables.
Definition: d4d_types.h:219
D4D_POINT position
Position on the screen/object.
Definition: d4d_object.h:169
D4D_COOR radius
Screen corner radius.
Definition: d4d_screen.h:177
#define D4D_ALIGN_H_LEFT_MASK
The horizontal left aligment option mask (for texts and also bitmaps).
Definition: d4d_base.h:221
D4D_COOR radius
Object corners radius.
Definition: d4d_object.h:171
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
Definition: d4d_types.h:151
void D4D_Circle(D4D_POINT *pCenter, D4D_COOR r, D4D_LINETYPE ltype, D4D_COLOR color)
Function draw circle on the screen.
void D4D_FillRectToXY(D4D_COOR x, D4D_COOR y, D4D_COLOR color)
Function draw filled rectangle on the screen.
void D4D_FillRRectColorScaleToXY(D4D_COOR x, D4D_COOR y, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction, D4D_COOR radius)
Function draw filled rectangle with round corners with changing color (cross color from start to end ...
void D4D_FillCircle(D4D_POINT *pCenter, D4D_COOR r, D4D_COLOR color)
Function draw filled circle on the screen.
void D4D_CircleXY(D4D_COOR x, D4D_COOR y, D4D_COOR r, D4D_LINETYPE ltype, D4D_COLOR color)
Function draw circle on the screen.
Reserved for future use.
Definition: d4d_types.h:337
D4D_COLOR D4D_ChangeColorIntesity(D4D_COLOR color, sByte intensity)
Compute change of color intesity.
Definition: d4d_scheme.c:286
#define D4D_ALIGN_H_MASK
The horizontal aligment option mask (for texts and also bitmaps).
Definition: d4d_base.h:219
void D4D_PutPixelXY(D4D_COOR x, D4D_COOR y, D4D_LINETYPE type, D4D_COLOR color)
Function puts one pixel on the screen.
void D4D_QuadrantXY(D4D_COOR x, D4D_COOR y, D4D_COOR radius, D4D_LINETYPE ltype, D4D_COLOR color, D4D_QUADRANT quadrant)
Function draw quadrant of circle on the screen.
void D4D_LCD_PutPixel(D4D_COOR x1, D4D_COOR y1, D4D_LINETYPE line_type, D4D_COLOR color)
Definition: d4d_low.c:192
Line type thick.
Definition: d4d_types.h:294
Direction LEFT.
Definition: d4d_types.h:312
D4D_TCHAR * pText
pointer to text array
Definition: d4d_string.h:102
void D4D_BoxXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill)
Function draw filled rectangle with outline on the screen.
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_COOR x
Definition: d4d_font.h:217
void D4D_FillRectColorScale(D4D_POINT *ppt, D4D_SIZE *psz, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction)
Function draw filled rectangle with changing color (cross color from start to end color) on the scree...
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_BEVEL_FORE_INTENSITY
D4D_BEVEL_FORE_INTENSITY constant default declaration. Sets the percentual change of color for bevel ...
void D4D_PutPixel(D4D_POINT *ppt, D4D_LINETYPE type, D4D_COLOR color)
Function puts one pixel on the screen.
Raised bevel type.
Definition: d4d_types.h:335
D4D_SIZE size
Size of the object.
Definition: d4d_object.h:170
void D4D_RRect(D4D_POINT *ppt, D4D_SIZE *psz, D4D_LINETYPE ltype, D4D_COLOR color, D4D_COOR radius)
Function draw rectangle on the screen with round corners.
#define D4D_FNT_PRTY_TRANSPARENT_MASK
Definition: d4d_font.h:112
D4D_COLOR colorBack
Definition: d4d_font.h:223
void D4D_Bevel(D4D_POINT *ppt, D4D_SIZE *psz, D4D_COLOR color, D4D_BEVEL type, D4D_COOR radius)
Function draw standard object bevel specified by parameters.
static D4D_POINT d4d_curXY
D4D_COOR D4D_RndCornerGetNonPrintedPxl(D4D_COOR radius, D4D_COOR line)
Function that counts number of printed pixels in specified line of circle quadrant.
D4D_DIRECTION
Type definition of eGUI direction type.
Definition: d4d_types.h:307
Type definition of eGUI tabulation structure.
Definition: d4d_types.h:253
void D4D_FillRRectTo(D4D_POINT *ppt, D4D_COLOR color, D4D_COOR radius)
Function draw filled rectangle on the screen with round corners.
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
D4D_BEVEL
Type definition of eGUI bevel type.
Definition: d4d_types.h:332
#define D4D_ALIGN_V_BOTTOM_MASK
The vertical bottom aligment option mask (for texts and also bitmaps).
Definition: d4d_base.h:232
The object main structure type definition.
Definition: d4d_object.h:167
D4D_QUADRANT
Type definition of eGUI circle quadrant.
Definition: d4d_types.h:323
#define D4D_BEVEL_WIDTH
D4D_BEVEL_WIDTH constant declaration - can&#39;t be changed!
Second quadrant &lt;90-180)
Definition: d4d_types.h:326
void D4D_LCD_QCircle(D4D_COOR cx, D4D_COOR cy, D4D_COOR radius, D4D_BOOL fill, D4D_LINETYPE line_type, D4D_COLOR color, D4D_QUADRANT quadrant)
Definition: d4d_low.c:561
void D4D_FillRRectColorScaleXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction, D4D_COOR radius)
Function draw filled rectangle with round corners with changing color (cross color from start to end ...
void D4D_LCD_PrintStr(D4D_PRINT_DESC *p_StrDes)
Definition: d4d_string.c:635
Direction DOWN.
Definition: d4d_types.h:310
Fourth quadrant &lt;270-360)
Definition: d4d_types.h:328
#define D4D_ALIGN_H_CENTER_MASK
The horizontal center aligment option mask (for texts and also bitmaps).
Definition: d4d_base.h:225
D4D_COOR cy
Size in axis Y (height)
Definition: d4d_types.h:233
#define D4D_ALIGN_V_MASK
The vertical aligment option mask (for texts and also bitmaps).
Definition: d4d_base.h:228
D4D_POINT position
Screen coordination on physical screen (standard screen has {0,0})
Definition: d4d_screen.h:175
void D4D_FillRectColorScaleXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction)
Function draw filled rectangle with changing color (cross color from start to end color) on the scree...
LWord D4D_BOOL
Type definition of eGUI boolean.
Definition: d4d_types.h:204
#define D4D_UNUSED(x)
Macro used just for notify compiler that the input parameter is not used.
Definition: d4d_base.h:504
void D4D_RectXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_LINETYPE ltype, D4D_COLOR color)
Function draw rectangle on the screen.
void D4D_FillQuadrant(D4D_POINT *pCenter, D4D_COOR radius, D4D_COLOR color, D4D_QUADRANT quadrant)
Function draw fill quadrant of circle on the screen.
Type definition of eGUI size structure.
Definition: d4d_types.h:230
void D4D_DrawTextRectTabXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_STRING *buffText, D4D_TAB *pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
Function draw text with TAB function in rectangle.
void D4D_DrawTextRectTabToXY(D4D_COOR x, D4D_COOR y, D4D_STRING *buffText, D4D_TAB *pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd)
Function draw text on XY coordination with TAB function in rectangle.
void D4D_LCD_Circle(D4D_COOR cx, D4D_COOR cy, D4D_COOR radius, D4D_BOOL fill, D4D_LINETYPE line_type, D4D_COLOR color)
Definition: d4d_low.c:367
sLWord D4D_INDEX_DELTA
Type definition of eGUI general index variables for signed offsets.
Definition: d4d_types.h:208
void D4D_RRectXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_LINETYPE ltype, D4D_COLOR color, D4D_COOR radius)
Function draw rectangle on the screen with round corners.
void D4D_RRectTo(D4D_POINT *ppt, D4D_LINETYPE ltype, D4D_COLOR color, D4D_COOR radius)
Function draw rectangle on the screen with round corners.
void D4D_RBoxToXY(D4D_COOR x, D4D_COOR y, D4D_LINETYPE ltype, D4D_COLOR colorLine, D4D_COLOR colorFill, D4D_COOR radius)
Function draw filled rectangle with outline on the screen with round corners.
D4D_TAB * pTab
Definition: d4d_font.h:221
void D4D_FillRRect(D4D_POINT *ppt, D4D_SIZE *psz, D4D_COLOR color, D4D_COOR radius)
Function draw filled rectangle on the screen with round corners.
Line type thin.
Definition: d4d_types.h:293
void D4D_FillRRectColorScale(D4D_POINT *ppt, D4D_SIZE *psz, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction, D4D_COOR radius)
Function draw filled rectangle with round corners with changing color (cross color from start to end ...
void D4D_FillRRectColorScaleTo(D4D_POINT *ppt, D4D_COLOR startColor, D4D_COLOR endColor, D4D_DIRECTION direction, D4D_COOR radius)
Function draw filled rectangle with round corners with changing color (cross color from start to end ...
void D4D_DrawTextRRectTabTo(D4D_POINT *ppt, D4D_STRING *buffText, D4D_TAB *pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd, D4D_COOR radius)
Function draw text on XY coordination with TAB function in rectangle with round corners.
#define D4D_ALIGN_V_TOP_MASK
The vertical top aligment option mask (for texts and also bitmaps).
Definition: d4d_base.h:230
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_FillRRectXY(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_COLOR color, D4D_COOR radius)
Function draw filled rectangle on the screen with round corners.
#define D4D_MulDivUU
Definition: d4d_math.h:103
void D4D_LineToXY(D4D_COOR x, D4D_COOR y, D4D_LINETYPE ltype, D4D_COLOR color)
Function draw line on the screen.
void D4D_PutPixelTo(D4D_LINETYPE type, D4D_COLOR color)
Function puts one pixel on the screen.
void D4D_LineTo(D4D_POINT *ppt, D4D_LINETYPE ltype, D4D_COLOR color)
Function draw line on the screen.
LWord D4D_COLOR
Type definition of eGUI color variables.
Definition: d4d_types.h:262
D4D_FONT_PROPERTIES font_properties
Font properties structure.
Definition: d4d_string.h:95
D4D_FONT_SIZE D4D_GetFontHeight(D4D_FONT ix)
Definition: d4d_font.c:381
void D4D_RectToXY(D4D_COOR x, D4D_COOR y, D4D_LINETYPE ltype, D4D_COLOR color)
Function draw rectangle on the screen.
void D4D_MoveTo(D4D_POINT *ppt)
Function move logic cursor to new position.
void D4D_LCD_RRect(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_LINETYPE line_type, D4D_COLOR color, D4D_COOR radius)
Definition: d4d_low.c:453
D4D_INDEX printOff
Offset of string that should be used (printed).
Definition: d4d_string.h:107
D4D_COOR x
Coordination in axis X.
Definition: d4d_types.h:225
D4D_COOR D4D_DisplayWidth(void)
Definition: d4d_low.c:159
void D4D_DrawTextRRectTab(D4D_POINT *ppt, D4D_SIZE *psz, D4D_STRING *buffText, D4D_TAB *pTab, D4D_COLOR colorText, D4D_COLOR colorBkgd, D4D_COOR radius)
Function draw text with TAB function in rectangle with round corners.