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 {
00047 void * (ALICEMLCALL *CreateSurface)(ML_Message *message,
00048 int width, int height);
00049
00055 void (ALICEMLCALL *DestroySurface)(void *surface);
00056
00058 int (ALICEMLCALL *GetSurfaceSize)(void *surface, int *width, int *height);
00059
00061 int (ALICEMLCALL *BlitSurface)(void *dst, int dst_x, int dst_y,
00062 void *src, ML_Rect *src_rect);
00063
00065 int (ALICEMLCALL *BlitSurfaceAlpha)(void *dst, int dst_x, int dst_y,
00066 void *src, ML_Rect *src_rect,
00067 ML_uint8 alpha);
00068
00070 void * (ALICEMLCALL *CreateFont)(ML_Message *message,
00071 const ML_SimpleFont *font);
00072
00074 void (ALICEMLCALL *DestroyFont)(ML_Message *message, void *abstract_font);
00075
00080 void * (ALICEMLCALL *CreateTextSurface)(ML_Message *message,
00081 const ML_SimpleFont *font,
00082 ML_char32 ucs4);
00083
00088 int (ALICEMLCALL *GetGlyphMetrics)(ML_Message *message,
00089 const ML_SimpleFont *font,
00090 ML_char32 ucs4,
00091 ML_GlyphMetrics *metrics);
00092 };
00093
00097 ALICEMLAPI void * ALICEMLCALL
00098 ML_Backend_CreateSurface(ML_Message *message, int width, int height);
00099
00101 ALICEMLAPI void ALICEMLCALL
00102 ML_Backend_DestroySurface(ML_Backend *backend, void *surface);
00103
00105 ALICEMLAPI int ALICEMLCALL
00106 ML_Backend_GetSurfaceSize(ML_Backend *backend, void *surface,
00107 int *width, int *height);
00108
00110 ALICEMLAPI int ALICEMLCALL
00111 ML_Backend_Blit(ML_Backend *backend, void *dst, int dst_x, int dst_y,
00112 void *src, ML_Rect *src_rect);
00113
00115 ALICEMLAPI int ALICEMLCALL
00116 ML_Backend_BlitAlpha(ML_Backend *backend, void *dst, int dst_x, int dst_y,
00117 void *src, ML_Rect *src_rect, ML_uint8 alpha);
00118
00120 ALICEMLAPI void * ALICEMLCALL
00121 ML_Backend_CreateFont(ML_Message *message, const ML_Font *font);
00122
00124 ALICEMLAPI void ALICEMLCALL
00125 ML_Backend_DestroyFont(ML_Message *message, void *abstract_font);
00126
00132 ALICEMLAPI void * ALICEMLCALL
00133 ML_Backend_CreateTextSurface(ML_Message *message, const ML_Font *font,
00134 ML_char32 ucs4);
00135
00137 ALICEMLAPI int ALICEMLCALL
00138 ML_Backend_GetGlyphMetrics(ML_Message *message, const ML_Font *font,
00139 ML_char32 ucs4, ML_GlyphMetrics *metrics);
00140
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144
00145 #endif