Compare commits

..
Author SHA1 Message Date
Vincent Wei 3cc16ababb update release notes 2022-09-28 15:11:52 +08:00
Vincent Wei d4097b577b tune 2022-09-27 21:54:36 +08:00
Vincent Wei 7ef6c14f3f relay MSG_IDLE to active child in PreDefControlProc 2022-09-27 21:54:30 +08:00
Vincent Wei cbb4e32992 Call UpdateInvalidClient in ScrollWindow; Only delaying MSG_IDLE to the child control if the main window is active 2022-09-27 13:20:18 +08:00
Vincent Wei 6bc85062b9 add an internal extended style: WS_EX_ACTIVATED 2022-09-27 13:17:15 +08:00
Vincent Wei b2dee57f4f tune relaying of MSG_IDLE 2022-09-27 11:44:26 +08:00
Vincent Wei a926754a6b Tuning: the MSG_IDLE message will be relayed to the descendant control if the control captured the mouse currently 2022-09-26 20:03:20 +08:00
Vincent Wei 7e470b0e78 tune code according to Issue #90 2022-09-26 20:01:47 +08:00
Vincent Wei 9f81cac662 reset binary age and interface age; update release notes 2022-09-26 14:30:49 +08:00
Vincent Wei a14bdd894a remove #include "window.h" 2022-09-26 14:18:14 +08:00
Vincent Wei 7004e156b8 use inline functions for SetCursor and SetDefaultCursor instead of macros 2022-09-26 14:17:55 +08:00
Vincent Wei e293cf03ba fix bugs when virtual window enabled for sa and procs runmodes 2022-09-26 14:06:09 +08:00
Vincent Wei 07f226f024 tune 2022-09-26 09:45:36 +08:00
Vincent Wei 4b2503e614 fix a bug when quiting dummy engine under compoisiting schema 2022-09-25 22:13:27 +08:00
Vincent Wei 2df5352356 fix a bug which may cause invalid values in log_clusters 2022-09-25 21:13:20 +08:00
Vincent Wei 67ccb2aafd give default RGBA masks for depth 32 when masks not specified 2022-09-24 14:33:49 +08:00
Vincent Wei 9a124dec50 fix a bug in search_win_tree_bfs; send MSG_MANAGE_MSGTHREAD messages only in message.c 2022-09-24 13:42:02 +08:00
Vincent Wei d013822979 add condition for loongarch 2022-09-23 21:45:00 +08:00
Vincent Wei 7f44e948d0 fix a bug mentioned in Issue #89 2022-09-23 16:04:11 +08:00
Vincent Wei 9a94fb9a7c enhance code for some uninitialized fields 2022-09-23 11:20:50 +08:00
Vincent Wei dfc7e95fcd fix the bug reported in Issue #89 2022-09-21 10:40:22 +08:00
Vincent Wei 362b852ec2 update anchor 2022-09-15 15:33:21 +08:00
Vincent Wei 9141e13640 suppress some warnings reported by GCC 12 2022-09-15 15:01:30 +08:00
Vincent Wei 4a22a38e63 update 2022-09-15 15:01:15 +08:00
Vincent Wei c7ce12449b use RUNMODE_LDADD and RUNMODE_SUBDIRS instead of conditions 2022-09-15 15:01:05 +08:00
Vincent Wei 824557b4f1 ignore configure~ 2022-09-15 11:20:18 +08:00
Vincent Wei 022542ef1b tune 2022-09-15 11:08:43 +08:00
Vincent Wei 3b12e71877 update README 2022-09-15 11:01:01 +08:00
Vincent Wei 9593168196 use recursive mutex for locking zorder info if not using *nix 2022-09-15 10:07:50 +08:00
Vincent Wei b5c5c3f8ae fix a deadlock bug (#87): use wrlock_owner to save the current thread holding the wrlock, skip rdlock if the wrlock owner is the current thread 2022-09-14 12:52:29 +08:00
Vincent Wei 492bd649ed update Release Notes for v5.0.10 2022-09-14 08:57:34 +08:00
Vincent Wei bc1a880479 cleanup and enhance shadow engine to use SyncUpdate method 2022-08-21 13:09:00 +08:00
Vincent Wei 0748f26f42 change version to 5.0.10; release notes for 5.0.10 2022-08-20 17:45:45 +08:00
50 changed files with 578 additions and 573 deletions
+1
View File
@@ -29,3 +29,4 @@ Makefile.in
/src/font/utils/ucd/ /src/font/utils/ucd/
/src/sysres/font_list /src/sysres/font_list
/src/sysres/license/dat_files/ /src/sysres/license/dat_files/
/configure~
+59 -49
View File
File diff suppressed because it is too large Load Diff
+27 -1
View File
@@ -1,5 +1,7 @@
# Release Notes # Release Notes
- [Version 5.0.10](#version-5010)
+ [What's new in version 5.0.10](#whats-new-in-version-5010)
- [Version 5.0.9](#version-508) - [Version 5.0.9](#version-508)
+ [What's new in version 5.0.9](#whats-new-in-version-508) + [What's new in version 5.0.9](#whats-new-in-version-508)
- [Version 5.0.8](#version-508) - [Version 5.0.8](#version-508)
@@ -24,9 +26,33 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility) + [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis) + [Deprecated APIs](#deprecated-apis)
## Version 5.0.10
On Sep. 30, 2022, FMSoft announces the availability of MiniGUI 5.0.10,
which is a bug fixing release with bug fixes and some minor enhancements
of MiniGUI 5.0.x.
### What's new in version 5.0.10
In this version, we made some enhancements
* ENHANCEMENTS:
- Enhance `fbcon` engine to support double buffering for Threads and Standalone mode. (Runtime option: `fbcon.double_buffering`).
- Cleanup and enhance `shadow` engine to use `SyncUpdate` method.
- Relaying `MSG_IDLE` messages to the active descendant controls in every 0.5s.
* BUGFIXING:
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/83
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/87
- Fix bugs reported in https://github.com/VincentWei/minigui/issues/89
- Fix some bugs when virtual window enabled under Standalone and Processes runtime modes.
* OPTIMIZATIONS:
* TUNING:
- Fix some warnings reported by GCC 12.
- Use inline functions for SetCursor and SetDefaultCursor instead of macros.
## Version 5.0.9 ## Version 5.0.9
On Jan. 14 2022, FMSoft announces the availability of MiniGUI 5.0.9, On Jan. 14, 2022, FMSoft announces the availability of MiniGUI 5.0.9,
which is a bug fixing release with minor enhancements of MiniGUI 5.0.x. which is a bug fixing release with minor enhancements of MiniGUI 5.0.x.
### What's new in version 5.0.9 ### What's new in version 5.0.9
+10 -6
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60) AC_PREREQ(2.60)
AC_INIT(libminigui, 5.0.9) AC_INIT(libminigui, 5.0.10)
AC_CONFIG_SRCDIR(src/main/main.c) AC_CONFIG_SRCDIR(src/main/main.c)
dnl Set various version strings - taken gratefully from the SDL sources 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=5 MINIGUI_MAJOR_VERSION=5
MINIGUI_MINOR_VERSION=0 MINIGUI_MINOR_VERSION=0
MINIGUI_MICRO_VERSION=9 MINIGUI_MICRO_VERSION=10
MINIGUI_INTERFACE_AGE=3 MINIGUI_INTERFACE_AGE=0
MINIGUI_BINARY_AGE=3 MINIGUI_BINARY_AGE=0
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
AC_SUBST(MINIGUI_MAJOR_VERSION) AC_SUBST(MINIGUI_MAJOR_VERSION)
@@ -1710,6 +1710,8 @@ case "$runtime_mode" in
AC_DEFINE(_MGRM_STANDALONE, 1, AC_DEFINE(_MGRM_STANDALONE, 1,
[Define if build MiniGUI-Standalone]) [Define if build MiniGUI-Standalone])
MINIGUI_RUNMODE="sa" MINIGUI_RUNMODE="sa"
RUNMODE_LADD="standalone/libstandalone.la"
RUNMODE_SUBDIRS="standalone"
;; ;;
ths) ths)
AC_DEFINE(_MGRM_THREADS, 1, AC_DEFINE(_MGRM_THREADS, 1,
@@ -1722,6 +1724,8 @@ case "$runtime_mode" in
AC_DEFINE(_MGRM_PROCESSES, 1, AC_DEFINE(_MGRM_PROCESSES, 1,
[Define if build MiniGUI-Processes]) [Define if build MiniGUI-Processes])
MINIGUI_RUNMODE="procs" MINIGUI_RUNMODE="procs"
RUNMODE_LADD="server/libserver.la client/libclient.la"
RUNMODE_SUBDIRS="server client"
if test "x$compositing_schema" = "xyes"; then if test "x$compositing_schema" = "xyes"; then
surface_schema="compositing" surface_schema="compositing"
fi fi
@@ -2665,9 +2669,9 @@ AC_SUBST(VIDEO_SUBDIRS)
AC_SUBST(VIDEO_DRIVERS) AC_SUBST(VIDEO_DRIVERS)
AC_SUBST(DEP_LIBS) AC_SUBST(DEP_LIBS)
AC_SUBST(MINIGUI_RUNMODE) AC_SUBST(MINIGUI_RUNMODE)
AC_SUBST(RUNMODE_LADD)
AC_SUBST(RUNMODE_SUBDIRS)
AM_CONDITIONAL(MGRM_PROCESSES, test "x$runtime_mode" = "xprocs")
AM_CONDITIONAL(MGRM_STANDALONE, test "x$runtime_mode" = "xsa")
AM_CONDITIONAL(MGIAL_LIBINPUT, test "x$build_libinput_ial_engine" = "xyes") AM_CONDITIONAL(MGIAL_LIBINPUT, test "x$build_libinput_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_SINGLETOUCHKEY, test "x$buid_singletouchkey_ial_engine" = "xyes") AM_CONDITIONAL(MGIAL_SINGLETOUCHKEY, test "x$buid_singletouchkey_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_CONSOLE, test "x$build_console_ial_engine" = "xyes") AM_CONDITIONAL(MGIAL_CONSOLE, test "x$build_console_ial_engine" = "xyes")
+1 -1
View File
@@ -127,7 +127,7 @@ defaultmode=800x600-16bpp
[shadow] [shadow]
real_engine=pc_xvfb real_engine=pc_xvfb
defaultmode=800x600-16bpp defaultmode=800x600-16bpp
rotate_screen=normal rotate_screen=ccw
#}} #}}
#{{ifdef _MGGAL_MLSHADOW #{{ifdef _MGGAL_MLSHADOW
+1
View File
@@ -311,6 +311,7 @@ MGUI_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
defined(__amd64) || \ defined(__amd64) || \
(defined(__alpha__) || defined(__alpha)) || \ (defined(__alpha__) || defined(__alpha)) || \
defined(__arm__) || defined(__aarch64__) || \ defined(__arm__) || defined(__aarch64__) || \
defined(__loongarch__) || \
defined(__riscv) || \ defined(__riscv) || \
(defined(__CC_ARM) && !defined(__BIG_ENDIAN)) || \ (defined(__CC_ARM) && !defined(__BIG_ENDIAN)) || \
(defined(__mips__) && defined(__MIPSEL__)) || \ (defined(__mips__) && defined(__MIPSEL__)) || \
+24 -25
View File
@@ -131,7 +131,31 @@
#define IAL_EVENT_GESTURE_PINCH_UPDATE 0x0084 #define IAL_EVENT_GESTURE_PINCH_UPDATE 0x0084
#define IAL_EVENT_GESTURE_PINCH_END 0x0085 #define IAL_EVENT_GESTURE_PINCH_END 0x0085
#define TABLET_TOOL_CHANGED_X (1 << 0)
#define TABLET_TOOL_CHANGED_Y (1 << 1)
#define TABLET_TOOL_CHANGED_PRESSURE (1 << 2)
#define TABLET_TOOL_CHANGED_DISTANCE (1 << 3)
#define TABLET_TOOL_CHANGED_TILT_X (1 << 4)
#define TABLET_TOOL_CHANGED_TILT_Y (1 << 5)
#define TABLET_TOOL_CHANGED_ROTATION (1 << 6)
#define TABLET_TOOL_CHANGED_SLIDER (1 << 7)
#define TABLET_TOOL_CHANGED_SIZE_MAJOR (1 << 8)
#define TABLET_TOOL_CHANGED_SIZE_MINOR (1 << 9)
#define TABLET_TOOL_CHANGED_WHEEL (1 << 10)
#ifndef TABLET_TOOL_X #ifndef TABLET_TOOL_X
#define TABLET_TOOL_X 0
#define TABLET_TOOL_Y 1
#define TABLET_TOOL_PRESSURE 2
#define TABLET_TOOL_DISTANCE 3
#define TABLET_TOOL_TILT_X 4
#define TABLET_TOOL_TILT_Y 5
#define TABLET_TOOL_ROTATION 6
#define TABLET_TOOL_SLIDER 7
#define TABLET_TOOL_SIZE_MAJOR 8
#define TABLET_TOOL_SIZE_MINOR 9
#define TABLET_TOOL_WHEEL 10
#define TABLET_TOOL_PROXIMITY_STATE_INVALID 0 #define TABLET_TOOL_PROXIMITY_STATE_INVALID 0
#define TABLET_TOOL_PROXIMITY_STATE_OUT 1 #define TABLET_TOOL_PROXIMITY_STATE_OUT 1
#define TABLET_TOOL_PROXIMITY_STATE_IN 2 #define TABLET_TOOL_PROXIMITY_STATE_IN 2
@@ -149,31 +173,6 @@
#define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0 #define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0
#define TABLET_PAD_STRIP_SOURCE_FINGER 1 #define TABLET_PAD_STRIP_SOURCE_FINGER 1
#define TABLET_TOOL_CHANGED_X (1 << 0)
#define TABLET_TOOL_CHANGED_Y (1 << 1)
#define TABLET_TOOL_CHANGED_PRESSURE (1 << 2)
#define TABLET_TOOL_CHANGED_DISTANCE (1 << 3)
#define TABLET_TOOL_CHANGED_TILT_X (1 << 4)
#define TABLET_TOOL_CHANGED_TILT_Y (1 << 5)
#define TABLET_TOOL_CHANGED_ROTATION (1 << 6)
#define TABLET_TOOL_CHANGED_SLIDER (1 << 7)
#define TABLET_TOOL_CHANGED_SIZE_MAJOR (1 << 8)
#define TABLET_TOOL_CHANGED_SIZE_MINOR (1 << 9)
#define TABLET_TOOL_CHANGED_WHEEL (1 << 10)
#define TABLET_TOOL_X 0
#define TABLET_TOOL_Y 1
#define TABLET_TOOL_PRESSURE 2
#define TABLET_TOOL_DISTANCE 3
#define TABLET_TOOL_TILT_X 4
#define TABLET_TOOL_TILT_Y 5
#define TABLET_TOOL_ROTATION 6
#define TABLET_TOOL_SLIDER 7
#define TABLET_TOOL_SIZE_MAJOR 8
#define TABLET_TOOL_SIZE_MINOR 9
#define TABLET_TOOL_WHEEL 10
#endif #endif
#define IAL_EVENT_TABLET_TOOL_AXIS 0x0090 #define IAL_EVENT_TABLET_TOOL_AXIS 0x0090
+1 -1
View File
@@ -587,7 +587,7 @@ enum {
* \sa InitBlockDataHeap, DestroyBlockDataHeap * \sa InitBlockDataHeap, DestroyBlockDataHeap
*/ */
typedef struct _BLOCKHEAP { typedef struct _BLOCKHEAP {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
/** Size of one block element in bytes. */ /** Size of one block element in bytes. */
+8 -4
View File
@@ -4097,7 +4097,7 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
#endif /* !_MGHAVE_CURSOR */ #endif /* !_MGHAVE_CURSOR */
/** /**
* \def SetCursor(hcsr) * \fn HCURSOR SetCursor(HCURSOR hcsr)
* \brief Changes the current cursor. * \brief Changes the current cursor.
* *
* This function changes the current cursor to be \a hcsr. * This function changes the current cursor to be \a hcsr.
@@ -4110,10 +4110,12 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
* *
* \sa SetCursorEx, SetDefaultCursor * \sa SetCursorEx, SetDefaultCursor
*/ */
#define SetCursor(hcsr) SetCursorEx (hcsr, FALSE) static inline HCURSOR SetCursor(HCURSOR hcsr) {
return SetCursorEx (hcsr, FALSE);
}
/** /**
* \def SetDefaultCursor(hcsr) * \fn HCURSOR SetDefaultCursor(HCURSOR hcsr)
* \brief Changes the current cursor, and set it as the default cursor. * \brief Changes the current cursor, and set it as the default cursor.
* *
* This function changes the current cursor to be \a hcsr, and set it as * This function changes the current cursor to be \a hcsr, and set it as
@@ -4127,7 +4129,9 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
* *
* \sa SetCursorEx, SetCursor * \sa SetCursorEx, SetCursor
*/ */
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE) static inline HCURSOR SetDefaultCursor(HCURSOR hcsr) {
return SetCursorEx (hcsr, TRUE);
}
/** @} end of cursor_fns */ /** @} end of cursor_fns */
+3
View File
@@ -2905,6 +2905,9 @@ typedef struct _WINMASKINFO {
* *
* This message is sent to the all main windows when the system * This message is sent to the all main windows when the system
* enters idle loop. * enters idle loop.
*
* Since 5.0.10, this messasge will be relayed to the active child control
* if the main window is currently active.
*/ */
#define MSG_IDLE 0x0142 #define MSG_IDLE 0x0142
+8 -24
View File
@@ -1,10 +1,10 @@
COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit newgal newgdi
COMMON_LADD = \ COMMON_LADD = \
libc/liblibc.la \ libc/liblibc.la \
misc/libmisc.la \ misc/libmisc.la \
control/libcontrol.la \ control/libcontrol.la \
ex_ctrl/libexctrl.la \ ex_ctrl/libexctrl.la \
font/libfont.la \ font/libfont.la \
font/in-core/libincore.la \ font/in-core/libincore.la \
ial/libial.la \ ial/libial.la \
@@ -13,31 +13,15 @@ COMMON_LADD = \
mybmp/libmybmp.la \ mybmp/libmybmp.la \
kernel/libkernel.la \ kernel/libkernel.la \
sysres/libsysres.la \ sysres/libsysres.la \
textedit/libtextedit.la textedit/libtextedit.la \
newgal/libnewgal.la \
newgdi/libnewgdi.la
if MGRM_STANDALONE DIST_SUBDIRS = $(COMMON_SUBDIRS) newgal newgdi server client standalone
LITE_LADD = standalone/libstandalone.la SUBDIRS = $(COMMON_SUBDIRS) @RUNMODE_SUBDIRS@
LITE_SUBDIRS = standalone
else
if MGRM_PROCESSES
LITE_LADD = server/libserver.la client/libclient.la
LITE_SUBDIRS = server client
else
LITE_LADD =
LITE_SUBDIRS =
endif
endif
NEWGAL_LADD = newgal/libnewgal.la newgdi/libnewgdi.la
NEWGAL_SUBDIRS = newgal newgdi
DIST_SUBDIRS = $(COMMON_SUBDIRS) newgal newgdi server client standalone
SUBDIRS = $(COMMON_SUBDIRS) $(NEWGAL_SUBDIRS) $(LITE_SUBDIRS)
MGSOURCES = template.c template.h MGSOURCES = template.c template.h
MGLIBADD = $(COMMON_LADD) \ MGLIBADD = $(COMMON_LADD) @RUNMODE_LADD@
$(LITE_LADD) \
$(NEWGAL_LADD)
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la
+12 -14
View File
@@ -299,7 +299,15 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
} }
} }
/*complete a click if the click if valid /* DK: When the radio or check button state changes do not erase the background,
* and the prospects for direct rendering */
btnGetRects (pctrl, &rcClient, &rcContent, &rcBitmap);
if (BUTTON_IS_PUSHBTN(pctrl) || (pctrl->dwStyle & BS_PUSHLIKE))
InvalidateRect((HWND)pctrl, NULL, TRUE);
else
InvalidateRect((HWND)pctrl, &rcBitmap, FALSE);
/* complete a click if the click if valid
* (mouse lbutton up in button )*/ * (mouse lbutton up in button )*/
if (old_pose == BST_PUSHED && new_pose != BST_DISABLE if (old_pose == BST_PUSHED && new_pose != BST_DISABLE
&& change_valid) && change_valid)
@@ -312,14 +320,6 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
NotifyParent ((HWND)pctrl, pctrl->id, BN_CLICKED); NotifyParent ((HWND)pctrl, pctrl->id, BN_CLICKED);
} }
/* DK: When the radio or check button state changes do not erase the background,
* and the prospects for direct rendering */
btnGetRects (pctrl, &rcClient, &rcContent, &rcBitmap);
if (BUTTON_IS_PUSHBTN(pctrl) || (pctrl->dwStyle & BS_PUSHLIKE))
InvalidateRect((HWND)pctrl, NULL, TRUE);
else
InvalidateRect((HWND)pctrl, &rcBitmap, FALSE);
} }
/*btnGetRects: /*btnGetRects:
@@ -423,8 +423,8 @@ static void draw_bitmap_button (PCONTROL pctrl, HDC hdc, DWORD dwStyle,
GetClientRect ((HWND)pctrl, &prcClient); GetClientRect ((HWND)pctrl, &prcClient);
if (dwStyle & BS_REALSIZEIMAGE) { if (dwStyle & BS_REALSIZEIMAGE) {
x += (w - bmp->bmWidth) >> 1; x += (int)(w - bmp->bmWidth) >> 1;
y += (h - bmp->bmHeight) >> 1; y += (int)(h - bmp->bmHeight) >> 1;
w = h = 0; w = h = 0;
if (bmp->bmWidth > RECTW(prcClient)){ if (bmp->bmWidth > RECTW(prcClient)){
@@ -847,8 +847,6 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break; break;
} }
case BM_SETSTYLE: case BM_SETSTYLE:
pctrl->dwStyle &= 0xFFFF0000; pctrl->dwStyle &= 0xFFFF0000;
pctrl->dwStyle |= (DWORD)(wParam & 0x0000FFFF); pctrl->dwStyle |= (DWORD)(wParam & 0x0000FFFF);
@@ -1054,7 +1052,7 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
} }
default: default:
break; break;
} }
return DefaultControlProc (hWnd, uMsg, wParam, lParam); return DefaultControlProc (hWnd, uMsg, wParam, lParam);
+9 -4
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -493,10 +493,15 @@ LRESULT ScrollViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
break; break;
} }
case MSG_DESTROY: case MSG_DESTROY: {
scrollview_destroy (psvdata); /* suppress a warning about calling free() before using the pointer */
free (psvdata); PSVDATA svdata = (PSVDATA) GetWindowAdditionalData2 (hWnd);
if (svdata) {
scrollview_destroy(svdata);
free (svdata);
}
break; break;
}
case MSG_GETDLGCODE: case MSG_GETDLGCODE:
return DLGC_WANTARROWS; return DLGC_WANTARROWS;
+2 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -283,7 +283,7 @@ static void DrawCoolBox (HWND hWnd, HDC hdc, PCOOLBARCTRL pdata)
WINDOWINFO *info; WINDOWINFO *info;
RECT rc; RECT rc;
if (tmpdata->Caption == NULL || tmpdata->Caption [0] == '\0') if (tmpdata->Caption [0] == '\0')
break; break;
GetTextExtent (hdc, tmpdata->Caption, -1, &size); GetTextExtent (hdc, tmpdata->Caption, -1, &size);
+2
View File
@@ -157,6 +157,8 @@ static int isInItem (MgList *mglst, int mouseX, int mouseY,
index = row * pivlist->nCol + col; index = row * pivlist->nCol + col;
pci = (IconviewItem *)mglist_getitem_byindex (mglst, index); pci = (IconviewItem *)mglist_getitem_byindex (mglst, index);
if (pci == NULL)
return -1;
if (pRet) if (pRet)
*pRet = (MgItem*)pci; *pRet = (MgItem*)pci;
-1
View File
@@ -59,7 +59,6 @@
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
#include "blockheap.h"
#include "accelkey.h" #include "accelkey.h"
static BLOCKHEAP ACHeap; static BLOCKHEAP ACHeap;
+2 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -803,7 +803,7 @@ BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
char buff [20]; char buff [20];
DWORD rgba; DWORD rgba;
if (!rdr || !rdr->name || rdr->name[0] == '\0') if (!rdr || rdr->name[0] == '\0')
return FALSE; return FALSE;
_DBG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n", _DBG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n",
-1
View File
@@ -71,7 +71,6 @@
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
#include "blockheap.h"
#include "menu.h" #include "menu.h"
#define SHORTEN 0 #define SHORTEN 0
+74 -33
View File
File diff suppressed because it is too large Load Diff
+14
View File
@@ -319,6 +319,19 @@ static void flush_rec (void)
#endif #endif
} }
static void close_rec (void)
{
#ifdef WIN32
/* TODO: */
#else
if (record_fd >= 0) {
close(record_fd);
record_fd = -1;
}
#endif
}
static void do_record(AUTO_IAL_INPUT_EVENT *event) static void do_record(AUTO_IAL_INPUT_EVENT *event)
{ {
@@ -744,6 +757,7 @@ void TermPCXVFBInput (void)
remove("/tmp/.pcxvfb_tmp"); remove("/tmp/.pcxvfb_tmp");
} }
#endif #endif
close_rec();
#endif /* WIN32 */ #endif /* WIN32 */
} }
+1 -1
View File
@@ -3,7 +3,7 @@ noinst_HEADERS = \
cursor.h dc.h event.h list.h element.h \ cursor.h dc.h event.h list.h element.h \
ial.h inline.h internals.h zorder.h menu.h misc.h \ ial.h inline.h internals.h zorder.h menu.h misc.h \
msgstr.h sysfont.h timer.h devfont.h fontname.h \ msgstr.h sysfont.h timer.h devfont.h fontname.h \
readbmp.h icon.h blockheap.h rbtree.h \ readbmp.h icon.h rbtree.h \
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \ ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \ gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
glyph.h license.h mgsock.h unicode-ops.h \ glyph.h license.h mgsock.h unicode-ops.h \
@@ -47,6 +47,8 @@
** blockheap.h: the head file of heap for block data. ** blockheap.h: the head file of heap for block data.
** **
** Create date: 2001/01/10 ** Create date: 2001/01/10
**
** DEPRECATED, USE window.h INSTEAD.
*/ */
#ifndef GUI_BLOCKHEAP_H #ifndef GUI_BLOCKHEAP_H
@@ -55,7 +57,7 @@
#ifndef _MGUI_GDI_H /* included in include/gdi.h */ #ifndef _MGUI_GDI_H /* included in include/gdi.h */
struct _BLOCKHEAP { struct _BLOCKHEAP {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
/* Size of one block element. */ /* Size of one block element. */
+13 -6
View File
@@ -84,15 +84,18 @@
#define WS_EX_MODALDISABLED 0x10000000L #define WS_EX_MODALDISABLED 0x10000000L
/* /*
* \def WS_EX_CTRLASMAINWIN * Internal extended style:
* \brief The control can be displayed out of the main window * The control can be displayed out of the main window
* which contains the control. * which contains the control.
*/ */
#define WS_EX_CTRLASMAINWIN 0x20000000L #define WS_EX_CTRLASMAINWIN 0x20000000L
/* Internal extended style. */ /* Internal extended style: dialog box. */
#define WS_EX_DIALOGBOX 0x40000000L #define WS_EX_DIALOGBOX 0x40000000L
/* Internal extended style: activated. */
#define WS_EX_ACTIVATED 0x80000000L
/* Make sure the internal window extended styles above are ok */ /* Make sure the internal window extended styles above are ok */
#define MGUI_COMPILE_TIME_ASSERT(name, x) \ #define MGUI_COMPILE_TIME_ASSERT(name, x) \
typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1] typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1]
@@ -101,6 +104,10 @@ MGUI_COMPILE_TIME_ASSERT(ws_ex_int_1,
WS_EX_INTERNAL_MASK & WS_EX_MODALDISABLED); WS_EX_INTERNAL_MASK & WS_EX_MODALDISABLED);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_2, MGUI_COMPILE_TIME_ASSERT(ws_ex_int_2,
WS_EX_INTERNAL_MASK & WS_EX_CTRLASMAINWIN); WS_EX_INTERNAL_MASK & WS_EX_CTRLASMAINWIN);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_3,
WS_EX_INTERNAL_MASK & WS_EX_DIALOGBOX);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_4,
WS_EX_INTERNAL_MASK & WS_EX_ACTIVATED);
#undef MGUI_COMPILE_TIME_ASSERT #undef MGUI_COMPILE_TIME_ASSERT
@@ -772,8 +779,8 @@ static inline PMSGQUEUE getMsgQueue (HWND hWnd)
} }
MSGQUEUE* mg_AllocMsgQueueForThisThread (void); MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in);
void mg_FreeMsgQueueForThisThread (void); void mg_FreeMsgQueueForThisThread (BOOL sign_off);
/* Since 5.0.0 */ /* Since 5.0.0 */
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd); int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd);
+1 -1
View File
@@ -55,9 +55,9 @@
#ifndef GUI_NEWGAL_H #ifndef GUI_NEWGAL_H
#define GUI_NEWGAL_H #define GUI_NEWGAL_H
#include "minigui.h"
#include "gdi.h" #include "gdi.h"
#include "constants.h" #include "constants.h"
#include "blockheap.h"
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
#include <sys/types.h> #include <sys/types.h>
+8 -2
View File
@@ -141,11 +141,17 @@ typedef struct _ZORDERINFO {
/* The size of usage bitmap for mask rect. */ /* The size of usage bitmap for mask rect. */
int size_maskrect_usage_bmp; int size_maskrect_usage_bmp;
/* use read/write lock for Unix-like OS */
#ifndef __NOUNIX__
#define __ZI_USE_RWLOCK 1
#endif
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
# ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
pthread_rwlock_t rwlock; pthread_rwlock_t rwlock;
pthread_t rwlock_owner;
# else # else
pthread_mutex_t rwlock; pthread_mutex_t mutex;
# endif # endif
#elif defined(_MGRM_PROCESSES) #elif defined(_MGRM_PROCESSES)
int zi_semid; int zi_semid;
+1
View File
@@ -1,5 +1,6 @@
# also for makefile.ng and makefile.msvc # also for makefile.ng and makefile.msvc
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
AM_CFLAGS = -Wno-zero-length-bounds
noinst_LTLIBRARIES = libkernel.la noinst_LTLIBRARIES = libkernel.la
+7 -7
View File
@@ -59,13 +59,13 @@
#include "common.h" #include "common.h"
#include "minigui.h" #include "minigui.h"
#include "gdi.h" #include "gdi.h"
#include "window.h"
#include "constants.h" #include "constants.h"
#include "blockheap.h"
#include "misc.h" #include "misc.h"
BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap) BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap)
{ {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_init (&heap->lock, NULL); pthread_mutex_init (&heap->lock, NULL);
#endif #endif
@@ -99,7 +99,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
int free_slot; int free_slot;
unsigned char* block_data = NULL; unsigned char* block_data = NULL;
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&heap->lock); pthread_mutex_lock (&heap->lock);
#endif #endif
@@ -118,7 +118,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
ret: ret:
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&heap->lock); pthread_mutex_unlock (&heap->lock);
#endif #endif
return block_data; return block_data;
@@ -128,7 +128,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
{ {
unsigned char* block_data = data; unsigned char* block_data = data;
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&heap->lock); pthread_mutex_lock (&heap->lock);
#endif #endif
@@ -146,7 +146,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
heap, slot); heap, slot);
} }
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&heap->lock); pthread_mutex_unlock (&heap->lock);
#endif #endif
} }
@@ -193,7 +193,7 @@ void DestroyBlockDataHeap (PBLOCKHEAP heap)
free (heap->usage_bmp); free (heap->usage_bmp);
heap->usage_bmp = NULL; heap->usage_bmp = NULL;
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_destroy (&heap->lock); pthread_mutex_destroy (&heap->lock);
#endif #endif
} }
+2 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2021, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -489,7 +489,7 @@ const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name)
return NULL; return NULL;
for (i = 0; i < MAX_NR_COMPOSITORS; i++) { for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
if (compositors [i].name && strcmp (compositors [i].name, name) == 0) { if (strcmp (compositors [i].name, name) == 0) {
return compositors [i].ops; return compositors [i].ops;
} }
} }
+1 -9
View File
@@ -231,14 +231,6 @@ static void init_desktop_win (void)
BOOL mg_InitDesktop (void) BOOL mg_InitDesktop (void)
{ {
#if 0 /* move to init-lite.c */
/* Since 5.0.0: allocate message queue for desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
_WRN_PRINTF ("failed to allocate message queue\n");
return FALSE;
}
#endif /* moved code */
#ifndef _MGSCHEMA_COMPOSITING #ifndef _MGSCHEMA_COMPOSITING
/* Init heap of clipping rects. */ /* Init heap of clipping rects. */
InitFreeClipRectList (&sg_FreeClipRectList, SIZE_CLIPRECTHEAP); InitFreeClipRectList (&sg_FreeClipRectList, SIZE_CLIPRECTHEAP);
@@ -259,7 +251,7 @@ BOOL mg_InitDesktop (void)
void mg_TerminateDesktop (void) void mg_TerminateDesktop (void)
{ {
/* Since 5.0.0: message queue for desktop thread was dynamically allocated */ /* Since 5.0.0: message queue for desktop thread was dynamically allocated */
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
#ifndef _MGSCHEMA_COMPOSITING #ifndef _MGSCHEMA_COMPOSITING
+1 -9
View File
@@ -102,14 +102,6 @@ BOOL mg_InitDesktop (void)
int ret; int ret;
RECT rcScr = GetScreenRect(); RECT rcScr = GetScreenRect();
#if 0 /* move to init-lite.c */
/* Since 5.0.0: allocate message queue for desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
_WRN_PRINTF ("failed to allocate message queue\n");
return FALSE;
}
#endif /* moved code */
/* /*
* Init ZOrderInfo here. * Init ZOrderInfo here.
*/ */
@@ -153,7 +145,7 @@ BOOL mg_InitDesktop (void)
void mg_TerminateDesktop (void) void mg_TerminateDesktop (void)
{ {
if (__mg_dsk_msg_queue) { if (__mg_dsk_msg_queue) {
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
} }
+2 -2
View File
@@ -145,7 +145,7 @@ void* __kernel_desktop_main (void* data)
MSG Msg; MSG Msg;
/* init message queue of desktop thread */ /* init message queue of desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) { if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread (TRUE)) ) {
_ERR_PRINTF ("failed to allocate message queue\n"); _ERR_PRINTF ("failed to allocate message queue\n");
sem_post ((sem_t*)data); sem_post ((sem_t*)data);
return NULL; return NULL;
@@ -191,7 +191,7 @@ void* __kernel_desktop_main (void* data)
#endif #endif
} }
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
return NULL; return NULL;
} }
+36 -26
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -597,55 +597,63 @@ static void reset_window (PMAINWIN pWin, RECT* rcWin)
#endif #endif
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
#ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
/*for unix system, using read/write lock*/ static inline void lock_zi_for_change (ZORDERINFO* zi)
static inline void lock_zi_for_change (const ZORDERINFO* zi)
{ {
pthread_rwlock_wrlock(&((ZORDERINFO*)zi)->rwlock); pthread_rwlock_wrlock(&zi->rwlock);
zi->rwlock_owner = pthread_self();
} }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) static inline void unlock_zi_for_change (ZORDERINFO* zi)
{ {
pthread_rwlock_unlock(&((ZORDERINFO*)zi)->rwlock); pthread_rwlock_unlock(&zi->rwlock);
zi->rwlock_owner = 0;
} }
static inline void lock_zi_for_read (const ZORDERINFO* zi) static inline void lock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_rwlock_rdlock(&((ZORDERINFO*)zi)->rwlock); if (zi->rwlock_owner == pthread_self()) {
return;
}
pthread_rwlock_rdlock(&zi->rwlock);
} }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) static inline void unlock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_rwlock_unlock(&((ZORDERINFO*)zi)->rwlock); if (zi->rwlock_owner == pthread_self()) {
return;
}
pthread_rwlock_unlock(&zi->rwlock);
} }
#else /* __NOUNIX__ */ # else /* __ZI_USE_RWLOCK */
/*for non-unix system, using mutex*/ static inline void lock_zi_for_change (ZORDERINFO* zi)
static inline void lock_zi_for_change (const ZORDERINFO* zi)
{ {
pthread_mutex_lock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_lock(&zi->mutex);
} }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) static inline void unlock_zi_for_change (ZORDERINFO* zi)
{ {
pthread_mutex_unlock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_unlock(&zi->mutex);
} }
static inline void lock_zi_for_read (const ZORDERINFO* zi) static inline void lock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_mutex_lock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_lock(&zi->mutex);
} }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) static inline void unlock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_mutex_unlock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_unlock(&zi->mutex);
} }
#endif /* __NOUNIX__ */ # endif /* notdef __ZI_USE_RWLOCK */
#elif defined(_MGRM_STANDALONE) #elif defined(_MGRM_STANDALONE)
static inline void lock_zi_for_change (const ZORDERINFO* zi) { } static inline void lock_zi_for_change (ZORDERINFO* zi) { }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) { } static inline void unlock_zi_for_change (ZORDERINFO* zi) { }
static inline void lock_zi_for_read (const ZORDERINFO* zi) { } static inline void lock_zi_for_read (ZORDERINFO* zi) { }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) { } static inline void unlock_zi_for_read (ZORDERINFO* zi) { }
#else /* for procs */ #else /* for procs */
/* NULL. see desktop-procs.c */ /* NULL. see desktop-procs.c */
#endif /* _MGRM_THREADS */ #endif /* _MGRM_THREADS */
@@ -4499,7 +4507,9 @@ int __mg_join_all_message_threads (void)
list_for_each (l, &msg_queue_list) { list_for_each (l, &msg_queue_list) {
MSGQUEUE *msg_queue = (MSGQUEUE*)l; MSGQUEUE *msg_queue = (MSGQUEUE*)l;
#ifndef NDEBUG
dump_message_queue (msg_queue, __func__); dump_message_queue (msg_queue, __func__);
#endif
pthread_cancel (msg_queue->th); pthread_cancel (msg_queue->th);
} }
+8 -8
View File
@@ -66,7 +66,7 @@ static struct FIXSTR {
BYTE bitmap[LEN_BITMAP]; BYTE bitmap[LEN_BITMAP];
int offset[NR_HEAP]; int offset[NR_HEAP];
char* heap[NR_HEAP + 1]; char* heap[NR_HEAP + 1];
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
} FixStrHeap; } FixStrHeap;
@@ -98,7 +98,7 @@ BOOL mg_InitFixStr (void)
offset += 1<<i; offset += 1<<i;
} }
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_init (&FixStrHeap.lock, NULL); pthread_mutex_init (&FixStrHeap.lock, NULL);
#endif #endif
return TRUE; return TRUE;
@@ -106,7 +106,7 @@ BOOL mg_InitFixStr (void)
void mg_TerminateFixStr (void) void mg_TerminateFixStr (void)
{ {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_destroy (&FixStrHeap.lock); pthread_mutex_destroy (&FixStrHeap.lock);
#endif #endif
free (FixStrHeap.heap[0]); free (FixStrHeap.heap[0]);
@@ -154,7 +154,7 @@ char* GUIAPI FixStrAlloc (int len)
// .. // ..
// if i == 0; then bufflen = 512 // if i == 0; then bufflen = 512
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&FixStrHeap.lock); pthread_mutex_lock (&FixStrHeap.lock);
#endif #endif
@@ -166,7 +166,7 @@ char* GUIAPI FixStrAlloc (int len)
for(j = 0; j < 8; j++) { for(j = 0; j < 8; j++) {
if (*bitmap & (0x80 >> j)) { if (*bitmap & (0x80 >> j)) {
*bitmap &= (~(0x80 >> j)); *bitmap &= (~(0x80 >> j));
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
#if 0 #if 0
@@ -181,7 +181,7 @@ char* GUIAPI FixStrAlloc (int len)
bitmap++; bitmap++;
} }
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
return (char*)malloc (len + 1); return (char*)malloc (len + 1);
@@ -216,7 +216,7 @@ void GUIAPI FreeFixStr (char* str)
// if i == 0; then bufflen = 512 // if i == 0; then bufflen = 512
bufflen = 1 << (NR_HEAP + 1 - i); bufflen = 1 << (NR_HEAP + 1 - i);
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&FixStrHeap.lock); pthread_mutex_lock (&FixStrHeap.lock);
#endif #endif
heap = FixStrHeap.heap[i]; heap = FixStrHeap.heap[i];
@@ -236,7 +236,7 @@ void GUIAPI FreeFixStr (char* str)
bitmap = bitmap + (stroff>>3); bitmap = bitmap + (stroff>>3);
*bitmap |= (0x80 >> (stroff%8)); *bitmap |= (0x80 >> (stroff%8));
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
} }
+1 -1
View File
@@ -386,7 +386,7 @@ int InitGUI (int argc, const char* agr[])
/* Since 5.0.0 /* Since 5.0.0
allocate message queue for desktop thread before starting client. */ allocate message queue for desktop thread before starting client. */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) { if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread (TRUE)) ) {
err_message (step, "Failed to allocate message queue!"); err_message (step, "Failed to allocate message queue!");
return step; return step;
} }
+2 -2
View File
@@ -578,7 +578,7 @@ int GUIAPI InitGUI (int args, const char *agr[])
/* init message queue of main GUI thread */ /* init message queue of main GUI thread */
step++; step++;
if (!(msg_queue = mg_AllocMsgQueueForThisThread ())) { if (!(msg_queue = mg_AllocMsgQueueForThisThread (TRUE))) {
_ERR_PRINTF ("KERNEL>InitGUI: failed to allocate message queue!\n"); _ERR_PRINTF ("KERNEL>InitGUI: failed to allocate message queue!\n");
goto failure; goto failure;
} }
@@ -655,7 +655,7 @@ void GUIAPI TerminateGUI (int not_used)
miFreeArcCache (); miFreeArcCache ();
#endif #endif
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
deleteThreadInfoKey (); deleteThreadInfoKey ();
+16 -17
View File
@@ -60,7 +60,6 @@
#include "gdi.h" #include "gdi.h"
#include "window.h" #include "window.h"
#include "blockheap.h"
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
@@ -159,7 +158,7 @@ void mg_DestroyFreeQMSGList (void)
pthread_key_t __mg_threadinfo_key; pthread_key_t __mg_threadinfo_key;
#endif #endif
MSGQUEUE* mg_AllocMsgQueueForThisThread (void) MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in)
{ {
MSGQUEUE* pMsgQueue; MSGQUEUE* pMsgQueue;
@@ -177,13 +176,14 @@ MSGQUEUE* mg_AllocMsgQueueForThisThread (void)
pthread_setspecific (__mg_threadinfo_key, pMsgQueue); pthread_setspecific (__mg_threadinfo_key, pMsgQueue);
#endif #endif
// register this new message queue if (sign_in) {
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD, SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue); MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue);
}
return pMsgQueue; return pMsgQueue;
} }
void mg_FreeMsgQueueForThisThread (void) void mg_FreeMsgQueueForThisThread (BOOL sign_off)
{ {
MSGQUEUE* pMsgQueue; MSGQUEUE* pMsgQueue;
@@ -194,6 +194,11 @@ void mg_FreeMsgQueueForThisThread (void)
_WRN_PRINTF ("there are still some windows not destroyed\n"); _WRN_PRINTF ("there are still some windows not destroyed\n");
} }
if (sign_off) {
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNOUT, (LPARAM)pMsgQueue);
}
mg_DestroyMsgQueue (pMsgQueue); mg_DestroyMsgQueue (pMsgQueue);
free (pMsgQueue); free (pMsgQueue);
@@ -823,8 +828,9 @@ checkagain:
goto got_ret; goto got_ret;
} }
} }
else else {
pMsgQueue->dwState &= ~QS_POSTMSG; pMsgQueue->dwState &= ~QS_POSTMSG;
}
} }
/* /*
@@ -1410,6 +1416,9 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
to the controls of the main window will be thrown away as well. */ to the controls of the main window will be thrown away as well. */
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd) int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
{ {
/* For a main window, we use pMainWin to check whether we
should throw away a message for controls of the main window.
Note that checkAndGetMainWindowIfControl returns NULL for non control. */
PMAINWIN pMainWin = (PMAINWIN)hWnd; PMAINWIN pMainWin = (PMAINWIN)hWnd;
PMSG pMsg; PMSG pMsg;
PQMSG pQMsg; PQMSG pQMsg;
@@ -1421,16 +1430,6 @@ int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
LOCK_MSGQ (pMsgQueue); LOCK_MSGQ (pMsgQueue);
/* for virtual window and main window, use pMainWin to check whether we
should throw away a message for controls of a main window.
checkAndGetMainWindowIfControl returns NULL for non control. */
if (pMainWin != HWND_NULL && pMainWin != HWND_INVALID &&
(pMainWin->WinType == TYPE_MAINWIN ||
pMainWin->WinType == TYPE_VIRTWIN))
pMainWin = (PMAINWIN)hWnd;
else
pMainWin = NULL;
if (pMsgQueue->pFirstNotifyMsg) { if (pMsgQueue->pFirstNotifyMsg) {
PQMSG pPrev = NULL, pNext; PQMSG pPrev = NULL, pNext;
pQMsg = pMsgQueue->pFirstNotifyMsg; pQMsg = pMsgQueue->pFirstNotifyMsg;
+20 -8
View File
@@ -243,11 +243,23 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_mask
#endif /* deprecated code */ #endif /* deprecated code */
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
#ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
pthread_rwlock_init(&__mg_zorder_info->rwlock, NULL); pthread_rwlock_init(&__mg_zorder_info->rwlock, NULL);
#else __mg_zorder_info->rwlock_owner = 0;
pthread_mutex_init(&__mg_zorder_info->rwlock, NULL); # else
#endif do {
int ret;
pthread_mutexattr_t my_attr;
ret = pthread_mutexattr_init(&my_attr);
assert(ret == 0);
ret = pthread_mutexattr_settype(&my_attr, PTHREAD_MUTEX_RECURSIVE);
assert(ret == 0);
pthread_mutex_init(&__mg_zorder_info->mutex, &my_attr);
ret = pthread_mutexattr_destroy(&my_attr);
assert(ret == 0);
(void)ret;
} while (0);
# endif
#endif #endif
return 0; return 0;
#endif #endif
@@ -261,11 +273,11 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
#else #else
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
#ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
pthread_rwlock_destroy(&zi->rwlock); pthread_rwlock_destroy(&zi->rwlock);
#else # else
pthread_mutex_destroy(&zi->rwlock); pthread_mutex_destroy(&zi->mutex);
#endif # endif
#endif #endif
free (zi); free (zi);
__mg_zorder_info = NULL; __mg_zorder_info = NULL;
+5 -1
View File
@@ -187,7 +187,8 @@ int __mg_bmp_compute_pitch(int bpp, Uint32 width, Uint32 *pitch, BOOL does_round
return bytespp; return bytespp;
} }
void* GUIAPI InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp, RGB* pal) void* GUIAPI
InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp, RGB* pal)
{ {
int type; int type;
LOAD_MYBITMAP_INFO* load_info; LOAD_MYBITMAP_INFO* load_info;
@@ -209,8 +210,11 @@ void* GUIAPI InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp,
my_bmp->frames = 1; my_bmp->frames = 1;
my_bmp->depth = GetGDCapability (HDC_SCREEN, GDCAP_BPP) << 3; my_bmp->depth = GetGDCapability (HDC_SCREEN, GDCAP_BPP) << 3;
// initialize the palette with the screen palette.
if (my_bmp->depth <= 8) if (my_bmp->depth <= 8)
GetPalette (HDC_SCREEN, 0, 256, (GAL_Color*)pal); GetPalette (HDC_SCREEN, 0, 256, (GAL_Color*)pal);
else
memset (pal, 0, sizeof(RGB) * 256); // reset the palette.
/* This is just for gray screen. If your screen is gray, /* This is just for gray screen. If your screen is gray,
* please define this macro _GRAY_SCREEN. * please define this macro _GRAY_SCREEN.
+5 -3
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2021, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -106,7 +106,8 @@ void* __mg_init_webp(MG_RWops *fp, MYBITMAP *mybmp, RGB *pal)
else else
goto error; goto error;
sc = WebPGetFeatures(info->data, info->sz_data, &info->config.input); sc = WebPGetFeatures((const uint8_t *)info->data, info->sz_data,
&info->config.input);
if (sc == VP8_STATUS_OK) { if (sc == VP8_STATUS_OK) {
break; break;
} }
@@ -210,7 +211,8 @@ int __mg_load_webp(MG_RWops *fp, void *init_info, MYBITMAP *mybmp,
while (1) { while (1) {
int n; int n;
VP8StatusCode status = WebPIAppend(idec, info->data, info->sz_data); VP8StatusCode status = WebPIAppend(idec,
(const uint8_t *)info->data, info->sz_data);
if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) { if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) {
_ERR_PRINTF ("__mg_load_webp: WebPIAppend failed: %d\n", status); _ERR_PRINTF ("__mg_load_webp: WebPIAppend failed: %d\n", status);
rc = ERR_BMP_LOAD; rc = ERR_BMP_LOAD;
+3 -1
View File
@@ -323,11 +323,13 @@ static void DUMMY_VideoQuit(_THIS)
if (mgIsServer) { if (mgIsServer) {
shm_unlink (DUMMYVID_SHAREDMEM_NAME); shm_unlink (DUMMYVID_SHAREDMEM_NAME);
} }
#else #elif !defined(_MGRM_PROCESSES)
if (this->screen->pixels != NULL) { if (this->screen->pixels != NULL) {
free (this->screen->pixels); free (this->screen->pixels);
this->screen->pixels = NULL; this->screen->pixels = NULL;
} }
#else
// do nothing (COMPOSITING_SCHEMA)
#endif /* not (defined(_MGRM_PROCESSES) && defined (_MGSCHEMA_SHAREDFB)) */ #endif /* not (defined(_MGRM_PROCESSES) && defined (_MGSCHEMA_SHAREDFB)) */
} }
+8
View File
@@ -76,6 +76,14 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
//memset(format, 0, sizeof(*format)); //memset(format, 0, sizeof(*format));
format->alpha = GAL_ALPHA_OPAQUE; format->alpha = GAL_ALPHA_OPAQUE;
/* Give defaults for the special case */
if (bpp == 32 && Rmask == 0 && Gmask == 0 && Bmask == 0 && Amask == 0) {
Amask = 0xFF000000;
Rmask = 0x00FF0000;
Gmask = 0x0000FF00;
Bmask = 0x000000FF;
}
/* Set up the format */ /* Set up the format */
format->BitsPerPixel = bpp; format->BitsPerPixel = bpp;
format->BytesPerPixel = (bpp+7)/8; format->BytesPerPixel = (bpp+7)/8;
+133 -248
View File
File diff suppressed because it is too large Load Diff
+30 -39
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -57,64 +57,55 @@ extern "C" {
#define _THIS GAL_VideoDevice *this #define _THIS GAL_VideoDevice *this
typedef struct _ShadowFBHeader { typedef struct _ShadowFBHeader {
unsigned int info_size; unsigned int info_size;
int width; int width;
int height; int height;
int depth; int depth;
int pitch; int pitch;
int dirty; /* true for dirty, and should reset to false after refreshing the dirty area */ int dirty; /* true for dirty, and should reset to false after refreshing the dirty area */
RECT dirty_rect; RECT dirty_rect;
int palette_changed; /* true for changed, and should reset to false after reflecting the change */ int palette_changed; /* true for changed, and should reset to false after reflecting the change */
int palette_offset; int palette_offset;
int fb_offset; int fb_offset;
Uint32 Rmask; Uint32 Rmask;
Uint32 Gmask; Uint32 Gmask;
Uint32 Bmask; Uint32 Bmask;
Uint32 Amask; Uint32 Amask;
int firstcolor; int firstcolor;
int ncolors; int ncolors;
} ShadowFBHeader; } ShadowFBHeader;
#define FLAG_REALFB_PREALLOC 0x01 #define FLAG_REALFB_PREALLOC 0x01
typedef struct _RealFBInfo { typedef struct _RealFBInfo {
DWORD flags; DWORD flags;
int height, width; int height, width;
int depth; int depth;
int pitch; int pitch;
void* fb; void* fb;
void * real_device; void * real_device;
} RealFBInfo; } RealFBInfo;
/* Private display data */ /* Private display data */
struct GAL_PrivateVideoData { struct GAL_PrivateVideoData {
RealFBInfo * realfb_info; RealFBInfo * realfb_info;
/*GAL_VideoDevice *_real_device ;
int w, h, pitch;
void *fb;
BOOL alloc_fb;
BOOL dirty;
RECT update;*/
pthread_t update_th; pthread_t update_th;
#ifdef _MGRM_PROCESSES #ifdef _MGRM_PROCESSES
int semid; int semid;
#else
pthread_mutex_t update_lock;
#endif #endif
}; };
typedef struct _ShadowFBOps { typedef struct _ShadowFBOps {
int (*init) (void); int (*init) (void);
int (*get_realfb_info) (RealFBInfo* realfb_info); int (*get_realfb_info) (RealFBInfo* realfb_info);
int (*release) (RealFBInfo* realfb_info); int (*release) (RealFBInfo* realfb_info);
int (*set_palette) (RealFBInfo* realfb_info, int firstcolor, int ncolors, void* colors); int (*set_palette) (RealFBInfo* realfb_info, int firstcolor,
void (*sleep) (void); int ncolors, void* colors);
void (*refresh) (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb_info, void* update); void (*refresh) (ShadowFBHeader* shadowfb_header,
RealFBInfo* realfb_info, void* update);
} ShadowFBOps; } ShadowFBOps;
ShadowFBOps * __mg_shadow_fb_ops;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
+1 -1
View File
@@ -173,7 +173,7 @@ BLOCKHEAP __mg_free_update_region_list;
int GAL_VideoInit(const char *driver_name, Uint32 flags); int GAL_VideoInit(const char *driver_name, Uint32 flags);
void GAL_VideoQuit(void); void GAL_VideoQuit(void);
static GAL_VideoDevice *GAL_GetVideo(const char* driver_name) GAL_VideoDevice *GAL_GetVideo(const char* driver_name)
{ {
GAL_VideoDevice *video; GAL_VideoDevice *video;
int index; int index;
+4 -4
View File
@@ -511,11 +511,11 @@ static void shape_space(const LAYOUT* layout, const LayoutRun* lrun,
gstr->glyphs[i].is_cluster_start = 1; gstr->glyphs[i].is_cluster_start = 1;
gstr->log_clusters[i] = i; gstr->log_clusters[i] = i;
}
if (BIDI_LEVEL_IS_RTL(lrun->el) && gstr->nr_glyphs > 1) { if (BIDI_LEVEL_IS_RTL(lrun->el) && gstr->nr_glyphs > 1) {
__mg_reverse_shaped_glyphs(gstr->glyphs, gstr->nr_glyphs); __mg_reverse_shaped_glyphs(gstr->glyphs, gstr->nr_glyphs);
__mg_reverse_log_clusters(gstr->log_clusters, gstr->nr_glyphs); __mg_reverse_log_clusters(gstr->log_clusters, gstr->nr_glyphs);
}
} }
} }
+4 -3
View File
@@ -148,14 +148,15 @@ static BOOL find_color_key (GAL_PixelFormat* format, const MYBITMAP* my_bmp,
goto free_and_ret; goto free_and_ret;
color_num = 1 << my_bmp->depth; color_num = 1 << my_bmp->depth;
pixels = malloc (color_num * sizeof (Uint32)); pixels = calloc (color_num, sizeof (Uint32));
for (i = 0; i < color_num; i++) for (i = 0; i < color_num; i++) {
pixels[i] = GAL_MapRGB (format, pal[i].r, pal[i].g, pal[i].b); pixels[i] = GAL_MapRGB (format, pal[i].r, pal[i].g, pal[i].b);
}
pixel_key = pixels [my_bmp->transparent]; pixel_key = pixels [my_bmp->transparent];
for (i = 0; i < color_num; i++) { for (i = 0; i < color_num; i++) {
if (pixels[i] == pixel_key && i != my_bmp->transparent) if (pixels[i] == pixel_key && i != my_bmp->transparent)
break; break;
} }
if (i == color_num) if (i == color_num)
-1
View File
@@ -140,7 +140,6 @@ SOFTWARE.
#include "gdi.h" #include "gdi.h"
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "blockheap.h"
typedef void (*voidProcp1)(CLIPRGN *region, const CLIPRECT *r1, const CLIPRECT *r1End, typedef void (*voidProcp1)(CLIPRGN *region, const CLIPRECT *r1, const CLIPRECT *r1End,
const CLIPRECT *r2, const CLIPRECT *r2End, int top, int bottom); const CLIPRECT *r2, const CLIPRECT *r2End, int top, int bottom);
-1
View File
@@ -254,7 +254,6 @@ static BOOL shape_layout_run(SEInstance* inst,
gs->log_clusters[j] = i; gs->log_clusters[j] = i;
j++; j++;
} }
} }
gs->nr_glyphs = j; gs->nr_glyphs = j;
+3
View File
@@ -747,6 +747,8 @@ void GUIAPI UpdateTopmostLayer (const RECT* dirty_rc)
SendMessage (HWND_DESKTOP, MSG_PAINT, 0, 0); SendMessage (HWND_DESKTOP, MSG_PAINT, 0, 0);
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wzero-length-bounds"
int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type, int* cli) int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type, int* cli)
{ {
ZORDERINFO* zi; ZORDERINFO* zi;
@@ -774,6 +776,7 @@ int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type, int* cli)
return topmost; return topmost;
} }
#pragma GCC diagnostic pop
int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode, int* cli) int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode, int* cli)
{ {
+1 -1
View File
@@ -1001,7 +1001,7 @@ static inline MYBMP_WITH_PAL* new_mybmp_with_pal (void)
MYBMP_WITH_PAL* mybmp_pal; MYBMP_WITH_PAL* mybmp_pal;
mybmp_pal = NEW(MYBMP_WITH_PAL); mybmp_pal = NEW(MYBMP_WITH_PAL);
mybmp_pal->pal = malloc (sizeof (RGB) * 256); mybmp_pal->pal = calloc (256, sizeof (RGB));
return mybmp_pal; return mybmp_pal;
} }