WonxText.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*****************************************************************************/
  2. /* ここから */
  3. /*****************************************************************************/
  4. #include "WonxTextP.h"
  5. #include "etc.h"
  6. /*****************************************************************************/
  7. /* メンバ関数の定義 */
  8. /*****************************************************************************/
  9. WWText WonxText_GetWWText(WonxText wonx_text)
  10. { return (wonx_text->ww_text); }
  11. WWText WonxText_SetWWText(WonxText wonx_text, WWText ww_text)
  12. { return (wonx_text->ww_text = ww_text); }
  13. WonxText WonxText_Create(WWScreen screen, int x, int y, int width, int height,
  14. WWPalette palette)
  15. {
  16. WonxText wonx_text;
  17. WWText ww_text;
  18. wonx_text = (WonxText)malloc(sizeof(_WonxText));
  19. if (wonx_text == NULL)
  20. Wonx_Error("WonxText_Create", "Cannot allocate memory.");
  21. ww_text = WWText_Create(screen, x, y, width, height, palette);
  22. if (ww_text == NULL)
  23. Wonx_Error("WonxText_Create", "Cannot create WonderWitch text.");
  24. WonxText_SetWWText(wonx_text, ww_text);
  25. return (wonx_text);
  26. }
  27. WonxText WonxText_Destroy(WonxText wonx_text)
  28. {
  29. if (wonx_text == NULL)
  30. Wonx_Error("WonxText_Destroy", "Object is not created.");
  31. if (WonxText_GetWWText(wonx_text))
  32. WonxText_SetWWText(wonx_text,
  33. WWText_Destroy(WonxText_GetWWText(wonx_text)));
  34. free(wonx_text);
  35. return (NULL);
  36. }
  37. /*****************************************************************************/
  38. /* ここまで */
  39. /*****************************************************************************/
  40. /*****************************************************************************/
  41. /* End of File. */
  42. /*****************************************************************************/