00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __ALICEML_BACKEND_H__
00028 #define __ALICEML_BACKEND_H__
00029
00030 #include "aliceml.h"
00031 #include "aliceml_rect.h"
00032 #include "aliceml_font.h"
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00045 struct ML_Backend {
00050 void * (ALICEMLCALL *CreateSurface)(ML_Message *message, int width, int height);
00051
00056 void (ALICEMLCALL *DestroySurface)(void *surface);
00057
00059 int (ALICEMLCALL *GetSurfaceSize)(void *surface, int *width, int *height);
00060
00062 int (ALICEMLCALL *BlitSurface)(void *dst, int x, int y, ML_Rect *rect, void *src);
00063
00065 int (ALICEMLCALL *BlitSurfaceWithAlpha)(void *dst, int x, int y, ML_Rect *rect, void *src, int alpha);
00066
00068 void * (ALICEMLCALL *CreateFont)(ML_Message *message, const ML_SimpleFont *font);
00069
00071 void (ALICEMLCALL *DestroyFont)(void *abstract_font);
00072
00077 void * (ALICEMLCALL *CreateTextSurfaceUCS4)(ML_Message *message, const ML_SimpleFont *font, ML_char32 ucs4);
00078
00083 int (ALICEMLCALL *GetTextSurfaceSizeUCS4)(const ML_SimpleFont *font, ML_char32 ucs4, int *w, int *h);
00084
00089 void * (ALICEMLCALL *CreateTextSurfaceUTF16)(ML_Message *message, const ML_SimpleFont *font, const ML_char16 *utf16);
00090
00095 int (ALICEMLCALL *GetTextSurfaceSizeUTF16)(const ML_SimpleFont *font, const ML_char16 *utf16, int *w, int *h);
00096
00101 void * (ALICEMLCALL *CreateTextSurfaceUTF8)(ML_Message *message, const ML_SimpleFont *font, const ML_char8 *utf8);
00102
00107 int (ALICEMLCALL *GetTextSurfaceSizeUTF8)(const ML_SimpleFont *font, const ML_char8 *utf8, int *w, int *h);
00108 };
00109
00111 ALICEMLAPI void * ALICEMLCALL ML_Backend_CreateSurface(ML_Message *message, int width, int height);
00112
00114 ALICEMLAPI void ALICEMLCALL ML_Backend_DestroySurface(ML_Backend *backend, void *surface);
00115
00117 ALICEMLAPI int ALICEMLCALL ML_Backend_GetSurfaceSize(ML_Backend *backend, void *surface, int *width, int *height);
00118
00120 int ALICEMLCALL ML_Backend_Blit(ML_Backend *backend, void *dst, int x, int y, ML_Rect *rect, void *src);
00121
00123 int ALICEMLCALL ML_Backend_BlitWithAlpha(ML_Backend *backend, void *dst, int x, int y, ML_Rect *rect, void *src, int alpha);
00124
00126 ALICEMLAPI void * ALICEMLCALL ML_Backend_CreateFont(ML_Message *message, const ML_Font *font);
00127
00129 ALICEMLAPI void ALICEMLCALL ML_Backend_DestroyFont(ML_Backend *backend, void *abstract_font);
00130
00136 ALICEMLAPI void * ALICEMLCALL ML_Backend_CreateTextSurface(ML_Message *message, const ML_Font *font, ML_char32 ucs4);
00137
00139 ALICEMLAPI int ALICEMLCALL ML_Backend_GetTextSurfaceSize(ML_Backend *backend, const ML_Font *font, ML_char32 ucs4, int *w, int *h);
00140
00144 typedef enum ML_VerticalText {
00145 ML_VERTICALTEXT_NORMAL,
00146 ML_VERTICALTEXT_ROTATE,
00147 ML_VERTICALTEXT_B_TO_T,
00148 ML_VERTICALTEXT_BL_TO_TR,
00149 } ML_VerticalText;
00150
00152 ML_VerticalText ALICEMLCALL ML_FontBackend_GetVerticalTextUTF16(const ML_char16 *utf16);
00153
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157
00158 #endif