wonx/WonxText.c
Hiroaki Sakai eb06f7f4f8 Added text display function. (Only 0 to 127 ASCII characters, kanji is not supported)
Changed to create Wonx class and manage all resources with Wonx class.
(See Wonx.x WonxP.h)

When p is pressed to switch display / non-display of the screen, redraw the LCD panel
Improvement.

Added -Wall to compile option.

We have summarized the processing part of the function which is duplicated processing in disp.c.

Version 0.1 beta - from wonx-b01.tar.gz
2018-03-07 23:05:40 +00:00

56 lines
1.9 KiB
C

/*****************************************************************************/
/* ここから */
/*****************************************************************************/
#include "WonxTextP.h"
#include "etc.h"
/*****************************************************************************/
/* メンバ関数の定義 */
/*****************************************************************************/
WWText WonxText_GetWWText(WonxText wonx_text)
{ return (wonx_text->ww_text); }
WWText WonxText_SetWWText(WonxText wonx_text, WWText ww_text)
{ return (wonx_text->ww_text = ww_text); }
WonxText WonxText_Create(WWScreen screen, int x, int y, int width, int height,
WWPalette palette)
{
WonxText wonx_text;
WWText ww_text;
wonx_text = (WonxText)malloc(sizeof(_WonxText));
if (wonx_text == NULL)
Error("WonxText_Create", "Cannot allocate memory.");
ww_text = WWText_Create(screen, x, y, width, height, palette);
if (ww_text == NULL)
Error("WonxText_Create", "Cannot create WonderWitch text.");
WonxText_SetWWText(wonx_text, ww_text);
return (wonx_text);
}
WonxText WonxText_Destroy(WonxText wonx_text)
{
if (wonx_text == NULL)
Error("WonxText_Destroy", "Object is not created.");
if (WonxText_GetWWText(wonx_text))
WonxText_SetWWText(wonx_text,
WWText_Destroy(WonxText_GetWWText(wonx_text)));
free(wonx_text);
return (NULL);
}
/*****************************************************************************/
/* ここまで */
/*****************************************************************************/
/*****************************************************************************/
/* End of File. */
/*****************************************************************************/