diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..86bf2737 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +*.lo +*.o +*.la +*.al +*.a +*.so +\# +am--include-marker +Makefile +Makefile.in +.deps/ +.libs/ +/acinclude.m4 +/aclocal.m4 +/autom4te.cache +/compile +/missing +/stamp-h1 +/config.* +/configure +/depcomp +/install-sh +/libtool +/*.pc +/*config.h +/*config.h.in +/*config.h.in~ +/src/font/utils/emoji/ +/src/font/utils/ucd/ +/src/sysres/font_list +/src/sysres/license/dat_files/ +/configure~ diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 530041f4..a3801be7 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,12 +1,25 @@ # Release Notes +## Version 3.0.14 + +On July 31, 2023, FMSoft announces the availability of MiniGUI 3.0.13, +which is a bug fixing release of MiniGUI 3.0.x. + +### What's new in version 3.0.14 + +In this version, we fixed some bugs: + +* ENHANCEMENTS: + - Ignore C0CTRL characters when renerding text. + - Tune some code to suppress compilation warings. + ## Version 3.0.13 The MiniGUI development team announces the availability of MiniGUI 3.0.13. All users of MiniGUI are encouraged to test this version carefully, and report any bugs and incompatibilities in - https://github.com/VincentWei/minigui. + https://github.com/VincentWei/minigui ### What's new in this version diff --git a/Version b/Version index 0d566508..2c8f7cd3 100644 --- a/Version +++ b/Version @@ -1,4 +1,4 @@ -Version 3.0.13 (2017/12/06) +Version 3.0.14 (2023/07/31) This release needs the following resource packages: diff --git a/configure.ac b/configure.ac index c2929fb3..d7b06b8e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.60) -AC_INIT(libminigui, 3.0.13) +AC_INIT(libminigui, 3.0.14) AC_CONFIG_SRCDIR(src/main/main.c) dnl Set various version strings - taken gratefully from the SDL sources @@ -16,9 +16,9 @@ dnl Set various version strings - taken gratefully from the SDL sources # MINIGUI_MAJOR_VERSION=3 MINIGUI_MINOR_VERSION=0 -MINIGUI_MICRO_VERSION=13 -MINIGUI_INTERFACE_AGE=0 -MINIGUI_BINARY_AGE=0 +MINIGUI_MICRO_VERSION=14 +MINIGUI_INTERFACE_AGE=1 +MINIGUI_BINARY_AGE=1 MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION AC_SUBST(MINIGUI_MAJOR_VERSION) diff --git a/src/newgdi/bidi.c b/src/newgdi/bidi.c index b98c042a..018f0182 100644 --- a/src/newgdi/bidi.c +++ b/src/newgdi/bidi.c @@ -1055,8 +1055,10 @@ int GUIAPI GetGlyphsExtentPoint( (glyphs[i]); - if (glyph_type == MCHAR_TYPE_ZEROWIDTH - || (glyph_type & MCHAR_TYPE_NOSPACING_MARK)) { + if (glyph_type == MCHAR_TYPE_ZEROWIDTH || + glyph_type == MCHAR_TYPE_CTRL1 || + glyph_type == MCHAR_TYPE_CTRL2 || + (glyph_type & MCHAR_TYPE_NOSPACING_MARK)) { adv_x = adv_y = 0; } else { @@ -1112,8 +1114,10 @@ int GUIAPI GetGlyphsExtent( glyph_type = devfont->charset_ops->glyph_type (glyphs[i]); - if (glyph_type == MCHAR_TYPE_ZEROWIDTH - || (glyph_type & MCHAR_TYPE_NOSPACING_MARK)) { + if (glyph_type == MCHAR_TYPE_ZEROWIDTH || + glyph_type == MCHAR_TYPE_CTRL1 || + glyph_type == MCHAR_TYPE_CTRL2 || + (glyph_type & MCHAR_TYPE_NOSPACING_MARK)) { adv_x = adv_y = 0; } else { diff --git a/src/newgdi/drawtext.c b/src/newgdi/drawtext.c index 10da0120..35e18162 100644 --- a/src/newgdi/drawtext.c +++ b/src/newgdi/drawtext.c @@ -295,6 +295,8 @@ static BOOL cb_drawtextex2 (void* context, Glyph32 glyph_value, switch (glyph_type) { case MCHAR_TYPE_ZEROWIDTH: + case MCHAR_TYPE_CTRL1: + case MCHAR_TYPE_CTRL2: case MCHAR_TYPE_CR: adv_x = adv_y = 0; break; diff --git a/src/newgdi/glyph.c b/src/newgdi/glyph.c index 58e49ce0..ace460e9 100644 --- a/src/newgdi/glyph.c +++ b/src/newgdi/glyph.c @@ -137,7 +137,9 @@ int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value, glyph_type = devfont->charset_ops->glyph_type (glyph_value); - if (glyph_type == MCHAR_TYPE_ZEROWIDTH) { + if (glyph_type == MCHAR_TYPE_ZEROWIDTH || + glyph_type == MCHAR_TYPE_CTRL1 || + glyph_type == MCHAR_TYPE_CTRL2) { if (adv_x) *adv_x = 0; if (adv_y) *adv_y = 0; advance = 0; diff --git a/src/newgdi/tabbedtextout.c b/src/newgdi/tabbedtextout.c index 6dc35e69..98b9f12d 100644 --- a/src/newgdi/tabbedtextout.c +++ b/src/newgdi/tabbedtextout.c @@ -99,6 +99,8 @@ static BOOL cb_tabbedtextout (void* context, Glyph32 glyph_value, switch (glyph_type) { case MCHAR_TYPE_ZEROWIDTH: + case MCHAR_TYPE_CTRL1: + case MCHAR_TYPE_CTRL2: adv_x = adv_y = 0; break; @@ -176,6 +178,8 @@ static BOOL cb_tabbedtextoutex (void* context, Glyph32 glyph_value, switch (glyph_type) { case MCHAR_TYPE_ZEROWIDTH: + case MCHAR_TYPE_CTRL1: + case MCHAR_TYPE_CTRL2: adv_x = adv_y = 0; break; @@ -546,6 +550,8 @@ int GUIAPI GetTabbedTextExtentPoint (HDC hdc, const char* text, switch (glyph_type) { case MCHAR_TYPE_ZEROWIDTH: + case MCHAR_TYPE_CTRL1: + case MCHAR_TYPE_CTRL2: case MCHAR_TYPE_VOWEL: break; case MCHAR_TYPE_LF: diff --git a/src/newgdi/textout.c b/src/newgdi/textout.c index 6b140bc5..db4f8c5b 100644 --- a/src/newgdi/textout.c +++ b/src/newgdi/textout.c @@ -86,7 +86,9 @@ static BOOL cb_draw_glyph (void* context, Glyph32 glyph_value, int glyph_type) int adv_x, adv_y; int bkmode; - if (glyph_type == MCHAR_TYPE_ZEROWIDTH) { + if (glyph_type == MCHAR_TYPE_ZEROWIDTH || + glyph_type == MCHAR_TYPE_CTRL1 || + glyph_type == MCHAR_TYPE_CTRL2) { adv_x = adv_y = 0; } else if (glyph_type == MCHAR_TYPE_VOWEL){ @@ -142,7 +144,9 @@ static BOOL cb_textout (void* context, Glyph32 glyph_value, int glyph_type) int adv_x, adv_y; int bkmode; - if (glyph_type == MCHAR_TYPE_ZEROWIDTH) { + if (glyph_type == MCHAR_TYPE_ZEROWIDTH || + glyph_type == MCHAR_TYPE_CTRL1 || + glyph_type == MCHAR_TYPE_CTRL2) { adv_x = adv_y = 0; } else if (glyph_type == MCHAR_TYPE_VOWEL){ @@ -308,7 +312,9 @@ static BOOL cb_textout_omitted (void* context, Glyph32 glyph_value, int glyph_ty //BBOX bbox; int bkmode = ctxt->pdc->bkmode; - if (glyph_type == MCHAR_TYPE_ZEROWIDTH) { + if (glyph_type == MCHAR_TYPE_ZEROWIDTH || + glyph_type == MCHAR_TYPE_CTRL1 || + glyph_type == MCHAR_TYPE_CTRL2) { adv_x = adv_y = 0; } else if(glyph_type == MCHAR_TYPE_VOWEL) { diff --git a/src/textedit/object.c b/src/textedit/object.c index f631afc2..0c506375 100644 --- a/src/textedit/object.c +++ b/src/textedit/object.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "common.h" #include "minigui.h" @@ -200,6 +201,33 @@ BOOL ncsInstanceOf(mObject *object, mObjectClass* clss) return objClss != NULL; } +static inline int _va_check (va_list va) +{ +#if 0 + union { + va_list va; + DWORD dva; + } _va; + + if (va == 0) + return 0; + + va_copy (_va.va, va); + if(_va.dva == 0) + return 0; + + return 1; +#else + intptr_t zero = 0; + size_t n = sizeof (intptr_t); + + if (sizeof (va_list) < n) { + n = sizeof (va_list); + } + + return memcmp (&zero, &va, n); +#endif +} int ncsParseConstructParams(va_list args, const char* signature, ...) { @@ -207,8 +235,15 @@ int ncsParseConstructParams(va_list args, const char* signature, ...) int argc; int i; - if(GET_ARG_COUNT(args) <= 0) - return 0; + /* + ** the implementation of GET_ARG_COUNT is bad, because some systems + ** define va_list as a pointer, and others define it as an array of + ** pointers (of length 1). + if(GET_ARG_COUNT(args) <= 0) + return 0; + */ + if (_va_check (args) == 0) + return 0; argc = va_arg(args, int); if(argc <= 0) diff --git a/src/textedit/object.h b/src/textedit/object.h index e661af11..d14e584e 100644 --- a/src/textedit/object.h +++ b/src/textedit/object.h @@ -266,6 +266,11 @@ MGNCS_EXPORT mObject* mgInitObjectArgs(mObject* pobj, mObjectClass* _class, ...) #define INIT_OBJ(Clss, pobj) INIT_OBJEX(Clss, pobj, 0) #define INIT_OBJV(Clss, pobj, ...) ((Clss* )initObjectArgs((mObject*)((void*)(pobj)), \ (mObjectClass*)((void*)(&(Class(Clss)))), ##__VA_ARGS__)) + +/* +** the implementation of GET_ARG_COUNT is bad, because some systems +** define va_list as a pointer, and others define it as an array of +** pointers (of length 1). static inline int MGGET_ARG_COUNT(va_list va) { union { @@ -282,6 +287,8 @@ static inline int MGGET_ARG_COUNT(va_list va) return 1; } #define GET_ARG_COUNT MGGET_ARG_COUNT +*/ + #define UNIT_OBJ(pobj) (_c(pobj)->destroy(pobj))