fix bugs in Issue #120; and tune code to suppress some compilation warnings

This commit is contained in:
Vincent Wei
2023-07-05 12:37:59 +08:00
parent 33d744c37a
commit eca9813a47
11 changed files with 123 additions and 16 deletions
+32
View File
@@ -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~
+14 -1
View File
@@ -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
+1 -1
View File
@@ -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:
+4 -4
View File
@@ -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)
+8 -4
View File
@@ -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 {
+2
View File
@@ -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;
+3 -1
View File
@@ -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;
+6
View File
@@ -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:
+9 -3
View File
@@ -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) {
+37 -2
View File
@@ -13,6 +13,7 @@
#include <string.h>
#include <assert.h>
#include <stdarg.h>
#include <stdint.h>
#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)
+7
View File
@@ -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))