refactor font.c into an MwFL section
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit
This commit is contained in:
parent
cc2d3008d0
commit
fea0fc9c32
11 changed files with 468 additions and 385 deletions
|
|
@ -18,10 +18,12 @@ typedef struct _MwLLCommonPixmap* MwLLCommonPixmap;
|
|||
typedef union _MwLL* MwLL;
|
||||
typedef union _MwLLColor* MwLLColor;
|
||||
typedef union _MwLLPixmap* MwLLPixmap;
|
||||
typedef struct _MwFLFont* MwFLFont;
|
||||
#else
|
||||
typedef void* MwLL;
|
||||
typedef void* MwLLColor;
|
||||
typedef void* MwLLPixmap;
|
||||
typedef void* MwFLFont;
|
||||
#endif
|
||||
|
||||
enum MwLLBackends {
|
||||
|
|
@ -166,6 +168,14 @@ struct _MwLLHandler {
|
|||
void (*dark_theme)(MwLL handle, void* data);
|
||||
};
|
||||
|
||||
struct _MwLLTextDispatchTable {
|
||||
int (*drawText)(MwWidget handle, MwPoint* point, const char* text, int bold, int align, MwLLColor color);
|
||||
int (*textWidth)(MwWidget handle, const char* text);
|
||||
int (*textHeight)(MwWidget handle, int count);
|
||||
void* (*fontLoad)(unsigned char* data, unsigned int size);
|
||||
void (*fontFree)(void* handle);
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
@ -225,6 +235,22 @@ MWDECL void (*MwLLGetClipboard)(MwLL handle);
|
|||
MWDECL void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point);
|
||||
MWDECL void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect);
|
||||
|
||||
/*font renderer */
|
||||
MWDECL void MwFLSetup();
|
||||
|
||||
#ifdef USE_FREETYPE2
|
||||
MWDECL int MWFL_FT2Setup();
|
||||
#endif
|
||||
#ifdef USE_STB_TRUETYPE
|
||||
MWDECL int MwFL_STBTTSetup();
|
||||
#endif
|
||||
|
||||
MWDECL int (*MwFLDrawText)(MwWidget handle, MwPoint* point, const char* text, int bold, int align, MwLLColor color);
|
||||
MWDECL int (*MwFLTextWidth)(MwWidget handle, const char* text);
|
||||
MWDECL int (*MwFLTextHeight)(MwWidget handle, int count);
|
||||
MWDECL void* (*MwFLFontLoad)(unsigned char* data, unsigned int size);
|
||||
MWDECL void (*MwFLFontFree)(void* handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue