gds_text.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * (c) Philippe G. 2019, philippe_44@outlook.com
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. */
  18. #pragma once
  19. #include "gds_font.h"
  20. #define GDS_TEXT_CLEAR 0x01
  21. #define GDS_TEXT_CLEAR_EOL 0x02
  22. #define GDS_TEXT_UPDATE 0x04
  23. #define GDS_TEXT_MONOSPACE 0x08
  24. // these ones are for 'Pos' parameter of TextLine
  25. #define GDS_TEXT_LEFT 0
  26. #define GDS_TEXT_RIGHT 0xff00
  27. #define GDS_TEXT_CENTER 0xff01
  28. // these ones are for the 'Where' parameter of TextPos
  29. enum { GDS_TEXT_TOP_LEFT, GDS_TEXT_MIDDLE_LEFT, GDS_TEXT_BOTTOM_LEFT, GDS_TEXT_CENTERED };
  30. enum { GDS_FONT_DEFAULT, GDS_FONT_LINE_1, GDS_FONT_LINE_2, GDS_FONT_SEGMENT,
  31. GDS_FONT_TINY, GDS_FONT_SMALL, GDS_FONT_MEDIUM, GDS_FONT_LARGE, GDS_FONT_FONT_HUGE };
  32. struct GDS_Device;
  33. bool GDS_TextSetFontAuto(struct GDS_Device* Device, int N, int FontType, int Space);
  34. bool GDS_TextSetFont(struct GDS_Device* Device, int N, const struct GDS_FontDef *Font, int Space);
  35. bool GDS_TextLine(struct GDS_Device* Device, int N, int Pos, int Attr, char *Text);
  36. int GDS_TextStretch(struct GDS_Device* Device, int N, char *String, int Max);
  37. void GDS_TextPos(struct GDS_Device* Device, int FontType, int Where, int Attr, char *Text, ...);