Compare commits

...
40 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
Vincent Wei 2f72f24a49 debug 2022-08-20 17:29:43 +08:00
Vincent Wei 43e174a604 set dirty_rc empty initially 2022-08-20 17:23:16 +08:00
Vincent Wei 13d36a2785 add double_buffering options in fbcon section in MiniGUI.cfg 2022-08-20 16:26:23 +08:00
Vincent Wei 9ec3e9f7e6 support for double buffering for fbcon 2022-08-20 16:21:15 +08:00
Vincent Wei 148f1b1745 fix a typo 2022-04-24 11:48:37 +08:00
Vincent Wei f76c9187a8 remove _ERR_PRINTF 2022-03-21 17:52:01 +08:00
Vincent Wei 2e8eba7dd0 fix a deadlock bug: https://github.com/VincentWei/minigui/issues/83 2022-03-21 17:48:03 +08:00
56 changed files with 637 additions and 627 deletions
+1
View File
@@ -29,3 +29,4 @@ Makefile.in
/src/font/utils/ucd/
/src/sysres/font_list
/src/sysres/license/dat_files/
/configure~
+59 -49
View File
@@ -8,7 +8,7 @@ _TABLE OF CONTENTS_
- [TABLE OF CONTENTS](#table-of-contents)
- [INTRODUCTION](#introduction)
+ [What's MiniGUI](#whats-minigui)
+ [App Frameworks on MiniGUI](#app-frameworks-on-minigui)
+ [HVML App Framework on MiniGUI](#hvml-app-framework-on-minigui)
+ [MiniGUI and HybridOS](#minigui-and-hybridos)
+ [Source Code Repositories](#source-code-repositories)
- [NEW FEATURES IN VERSION 5.0.x](#new-features-in-version-50x)
@@ -37,51 +37,45 @@ _TABLE OF CONTENTS_
### What's MiniGUI
MiniGUI aims to provide a fast, stable, full-featured, and cross-platform
windowing and GUI support system, which is especially fit for
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX,
Nucleus, pSOS, uC/OS-II, OSE, and others.
MiniGUI aims to provide a fast, stable, full-featured, and cross-platform windowing and GUI support system,
which is especially fit for embedded systems or smart IoT devices based-on Linux/uClinux, eCos,
and other traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX, Nucleus, pSOS, uC/OS-II, OSE, and others.
This is the source tree of MiniGUI Core, which provides the windowing
and graphics interfaces as well as a lot of standard controls (toolkit).
This is the source tree of MiniGUI Core, which provides the windowing and graphics interfaces as well as a lot of standard controls (toolkit).
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial
use. In December 1998, the initiator of FMSoft, Wei Yongming, began to develop
MiniGUI under the GNU General Public License (GPL). In September 2002, the core
developers of MiniGUI founded [FMSoft](https://www.fmsoft.cn) and started the
commercial marketing with the free software. By now, FMSoft still continues to
release MiniGUI as a free software project.
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial use.
In December 1998, the initiator of FMSoft, [Vincent Wei], began to develop MiniGUI under the GNU General Public License (GPL).
In September 2002, the core developers of MiniGUI founded [FMSoft] and started the commercial marketing with the free software.
By now, FMSoft still continues to release MiniGUI as a free software project.
For the live demos, source tarballs, and cases of MiniGUI, you can refer
to the following website:
For the live demos, source tarballs, and cases of MiniGUI, you can refer to the following website:
<http://www.minigui.com>
### App Frameworks on MiniGUI
### HVML App Framework on MiniGUI
MiniGUI and its components provides a lot of controls/widgets to
help your develop GUI apps in C/C++ programming language. However,
alternatively, you can choose one of the following frameworks to
develop your apps in a easy-to-use programming language other than C/C++.
MiniGUI and its components provide a lot of controls/widgets to help your develop GUI apps in C/C++ programming language.
However, alternatively, you can use the following software to develop your apps in an easy-to-use programming language [HVML].
* [HybridOS](https://gitlab.fmsoft.cn/HybridOS/hybridos) provides
a complete software stack to develop an app which have rich functions
and excellent expressive in HTML5, CSS3, and JavaScript.
* [hiACEJS](https://gitlab.fmsoft.cn/HybridOS/hiACEJS) provides
a light-weight app framework in JavaScript.
* [HVML] is a descriptive programming language proposed and designed by [Vincent Wei].
* [PurC] is the prime interpreter of HVML written in C lauguage.
* [xGUI Pro] is a full-featured HVML renderer based on the tailored WebKit engine.
You can also choose [HybridOS Lite](https://gitlab.fmsoft.cn/HybridOS/hybridos-lite)
to develop apps with excellent expressive for cost-sensitive devices in C/C++ language.
In short, the above software suite provides an Electron-like solution that can help people develop cross-platform applications using web front-end technology.
The difference is that the solution replaces JavaScript with HVML and Node.JS with PurC.
It provides an entirely new application framework that isolates the interpreter and renderer from running in separate processes, which brings several benefits.
It greatly reduces the size and resource consumption of the entire solution, improves the overall performance, promotes the interactive responsiveness,
and provides a simpler mechanism to integrate existing C/C++ code modules.
### MiniGUI and HybridOS
[HybridOS](https://gitlab.fmsoft.cn/HybridOS/hybridos) is another large open source project
initiated by FMSoft. It is a totally new open source operating system designed for
embedded and smart IoT devices and cloud computing environment.
[HybridOS] is another large open source project initiated by FMSoft.
It is an open source operating system designed for embedded/AIoT devices and cloud computing environment.
In practice, MiniGUI and the software which are used to integrated with GPU
constitute the graphics stack of HybridOS.
HybridOS provides the complete software stack and the app framework based on HVML for embedded systems.
You can easily develop your products which has rich functions and excellent expressiveness by using HybridOS.
In practice, MiniGUI and the software which are used to integrated with GPU constitute the graphics stack of HybridOS.
HybridOS uses MiniGUI as the underlying windowing system, and the members of
HybridOS project are now maintaining the whole graphics stack.
@@ -89,7 +83,7 @@ The following chart shows the graphics stack of HybridOS:
```
-----------------------------------------------
| MiniGUI/HybridOS Apps |
| MiniGUI/HVML Apps |
|-----------------------------------------------|
| | (Graphics Stack) |
| | ---------------------|
@@ -105,8 +99,7 @@ The following chart shows the graphics stack of HybridOS:
-----------------------------------------------
```
As shown in the chart above, the HybridOS graphics stack consists of
the following software:
As shown in the chart above, the HybridOS graphics stack consists of the following software:
- `libDRM` provides some user land APIs for Linux Direct Rendering Infrastructure.
- `hiDRMDrivers` contains the drivers (user land drivers, not kernel drivers) for
@@ -133,11 +126,11 @@ FMSoft had created the public repositories for MiniGUI Core, MiniGUI
components, HybridOS, and other open source apps on GitHub. You can visit
them on:
<https://gitlab.fmsoft.cn/VincentWei>
<https://github.com/VincentWei>
We now maintain all documents about MiniGUI on the following public repo:
<https://gitlab.fmsoft.cn/VincentWei/minigui-docs>
<https://github.com/VincentWei/minigui-docs>
You can download the source code tarballs of MiniGUI Core, MiniGUI
components, and the dependent libraries from the download zone of the site:
@@ -261,7 +254,7 @@ so that the old applications can smoothly migrate to the new
version. However, there are still some slight changes you need to take care.
For more information, please refer to `RELEASE-NOTES.md` file:
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
<https://github.com/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
## NEW FEATURES IN VERSION 4.0.x
@@ -292,7 +285,7 @@ in order to support [HybridOS Foundation Class Library].
For more information, please refer to `RELEASE-NOTES.md` file:
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md>
<https://github.com/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md>
Because of the changes of some APIs, we recommended strongly that you
use this version for new projects.
@@ -307,7 +300,7 @@ We introduce some new features in MiniGUI Version 3.2.x:
For more information, please refer to `RELEASE-NOTES.md` file:
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md>
<https://github.com/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md>
## THE RUNTIME MODES OF MINIGUI
@@ -361,15 +354,15 @@ and MiniGUI components, please fetch one of the following repositories
from GitHub and follow the instructions to build MiniGUI Core,
MiniGUI components, the samples, and the demonstration programs:
[Build MiniGUI 5.0](https://gitlab.fmsoft.cn/VincentWei/build-minigui-5.0)
[Build MiniGUI 5.0](https://github.com/VincentWei/build-minigui-5.0)
or
[Build MiniGUI 4.0](https://gitlab.fmsoft.cn/VincentWei/build-minigui-4.0)
[Build MiniGUI 4.0](https://github.com/VincentWei/build-minigui-4.0)
or
[Build MiniGUI 3.2](https://gitlab.fmsoft.cn/VincentWei/build-minigui-3.2)
[Build MiniGUI 3.2](https://github.com/VincentWei/build-minigui-3.2)
### Building MiniGUI Core
@@ -410,7 +403,7 @@ For more information, please run
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
following repository:
<https://gitlab.fmsoft.cn/VincentWei/mg-tests>
<https://github.com/VincentWei/mg-tests>
If you are interested in hacking the MiniGUI code, please visit this repository.
@@ -567,15 +560,15 @@ A brief history description of the development progress is listed as follow:
1. Mar., 2020: FMSoft released MiniGUI version 5.0.0.
1. May., 2021: FMSoft released MiniGUI version 5.0.6.
1. Jan., 2022: FMSoft released MiniGUI version 5.0.9.
1. Sep., 2022: FMSoft released MiniGUI version 5.0.10.
## AUTHORS AND COPYING
The original author of MiniGUI is WEI Yongming, and now MiniGUI is
maintained by FMSoft. For more information, please refer to
<http://www.fmsoft.cn>.
The original author of MiniGUI is Vincent Wei, and now MiniGUI is maintained by FMSoft.
For more information, please refer to <http://www.fmsoft.cn>.
Copyright (C) 2002 ~ 2022, Beijing FMSoft Technologies Co., Ltd.
Copyright (C) 1998 ~ 2002, WEI Yongming
Copyright (C) 1998 ~ 2002, Vincent Wei
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -647,3 +640,20 @@ Q: Can I get the tech support from MiniGUI team?
A: Yes, FMSoft can provide you with guaranteed commercial technical
support services. Please send messages to <sales@minigui.com>.
[Beijing FMSoft Technologies Co., Ltd.]: https://www.fmsoft.cn
[FMSoft Technologies]: https://www.fmsoft.cn
[FMSoft]: https://www.fmsoft.cn
[HybridOS Official Site]: https://hybridos.fmsoft.cn
[MiniGUI Official Site]: https://hvml.fmsoft.cn
[HVML Official Site]: https://hvml.fmsoft.cn
[Vincent Wei]: https://github.com/VincentWei
[MiniGUI]: https://github.com/VincentWei/MiniGUI
[HybridOS]: https://github.com/FMSoftCN/HybridOS
[HVML]: https://github.com/HVML
[PurC]: https://github.com/HVML/PurC
[xGUI Pro]: https://github.com/HVML/xGUI-Pro
[WebKit]: https://webkit.org
+27 -1
View File
@@ -1,5 +1,7 @@
# 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)
+ [What's new in version 5.0.9](#whats-new-in-version-508)
- [Version 5.0.8](#version-508)
@@ -24,9 +26,33 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [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
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.
### 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.
AC_PREREQ(2.60)
AC_INIT(libminigui, 5.0.9)
AC_INIT(libminigui, 5.0.10)
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=5
MINIGUI_MINOR_VERSION=0
MINIGUI_MICRO_VERSION=9
MINIGUI_INTERFACE_AGE=3
MINIGUI_BINARY_AGE=3
MINIGUI_MICRO_VERSION=10
MINIGUI_INTERFACE_AGE=0
MINIGUI_BINARY_AGE=0
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
AC_SUBST(MINIGUI_MAJOR_VERSION)
@@ -1710,6 +1710,8 @@ case "$runtime_mode" in
AC_DEFINE(_MGRM_STANDALONE, 1,
[Define if build MiniGUI-Standalone])
MINIGUI_RUNMODE="sa"
RUNMODE_LADD="standalone/libstandalone.la"
RUNMODE_SUBDIRS="standalone"
;;
ths)
AC_DEFINE(_MGRM_THREADS, 1,
@@ -1722,6 +1724,8 @@ case "$runtime_mode" in
AC_DEFINE(_MGRM_PROCESSES, 1,
[Define if build MiniGUI-Processes])
MINIGUI_RUNMODE="procs"
RUNMODE_LADD="server/libserver.la client/libclient.la"
RUNMODE_SUBDIRS="server client"
if test "x$compositing_schema" = "xyes"; then
surface_schema="compositing"
fi
@@ -2665,9 +2669,9 @@ AC_SUBST(VIDEO_SUBDIRS)
AC_SUBST(VIDEO_DRIVERS)
AC_SUBST(DEP_LIBS)
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_SINGLETOUCHKEY, test "x$buid_singletouchkey_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_CONSOLE, test "x$build_console_ial_engine" = "xyes")
+7 -1
View File
@@ -105,6 +105,12 @@ seat=seat0
[fbcon]
defaultmode=1024x768-16bpp
dpi=96
# Whether double buffering is enabled (only for threads and standalone runmodes).
# Use `true` or `yes` for enabled, anything else for disabled.
# Note that under compositing schema, double buffering is always enabled.
# Since 5.0.10.
double_buffering=true
#}}
#{{ifdef _MGGAL_PCXVFB
@@ -121,7 +127,7 @@ defaultmode=800x600-16bpp
[shadow]
real_engine=pc_xvfb
defaultmode=800x600-16bpp
rotate_screen=normal
rotate_screen=ccw
#}}
#{{ifdef _MGGAL_MLSHADOW
+1
View File
@@ -311,6 +311,7 @@ MGUI_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
defined(__amd64) || \
(defined(__alpha__) || defined(__alpha)) || \
defined(__arm__) || defined(__aarch64__) || \
defined(__loongarch__) || \
defined(__riscv) || \
(defined(__CC_ARM) && !defined(__BIG_ENDIAN)) || \
(defined(__mips__) && defined(__MIPSEL__)) || \
+24 -25
View File
@@ -131,7 +131,31 @@
#define IAL_EVENT_GESTURE_PINCH_UPDATE 0x0084
#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
#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_OUT 1
#define TABLET_TOOL_PROXIMITY_STATE_IN 2
@@ -149,31 +173,6 @@
#define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0
#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
#define IAL_EVENT_TABLET_TOOL_AXIS 0x0090
+1 -1
View File
@@ -587,7 +587,7 @@ enum {
* \sa InitBlockDataHeap, DestroyBlockDataHeap
*/
typedef struct _BLOCKHEAP {
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock;
#endif
/** 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 */
/**
* \def SetCursor(hcsr)
* \fn HCURSOR SetCursor(HCURSOR hcsr)
* \brief Changes the current cursor.
*
* This function changes the current cursor to be \a hcsr.
@@ -4110,10 +4110,12 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
*
* \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.
*
* 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
*/
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE)
static inline HCURSOR SetDefaultCursor(HCURSOR hcsr) {
return SetCursorEx (hcsr, TRUE);
}
/** @} 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
* 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
+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 = \
libc/liblibc.la \
misc/libmisc.la \
control/libcontrol.la \
ex_ctrl/libexctrl.la \
ex_ctrl/libexctrl.la \
font/libfont.la \
font/in-core/libincore.la \
ial/libial.la \
@@ -13,31 +13,15 @@ COMMON_LADD = \
mybmp/libmybmp.la \
kernel/libkernel.la \
sysres/libsysres.la \
textedit/libtextedit.la
textedit/libtextedit.la \
newgal/libnewgal.la \
newgdi/libnewgdi.la
if MGRM_STANDALONE
LITE_LADD = standalone/libstandalone.la
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)
DIST_SUBDIRS = $(COMMON_SUBDIRS) newgal newgdi server client standalone
SUBDIRS = $(COMMON_SUBDIRS) @RUNMODE_SUBDIRS@
MGSOURCES = template.c template.h
MGLIBADD = $(COMMON_LADD) \
$(LITE_LADD) \
$(NEWGAL_LADD)
MGLIBADD = $(COMMON_LADD) @RUNMODE_LADD@
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
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 )*/
if (old_pose == BST_PUSHED && new_pose != BST_DISABLE
&& change_valid)
@@ -312,14 +320,6 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
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:
@@ -423,8 +423,8 @@ static void draw_bitmap_button (PCONTROL pctrl, HDC hdc, DWORD dwStyle,
GetClientRect ((HWND)pctrl, &prcClient);
if (dwStyle & BS_REALSIZEIMAGE) {
x += (w - bmp->bmWidth) >> 1;
y += (h - bmp->bmHeight) >> 1;
x += (int)(w - bmp->bmWidth) >> 1;
y += (int)(h - bmp->bmHeight) >> 1;
w = h = 0;
if (bmp->bmWidth > RECTW(prcClient)){
@@ -847,8 +847,6 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break;
}
case BM_SETSTYLE:
pctrl->dwStyle &= 0xFFFF0000;
pctrl->dwStyle |= (DWORD)(wParam & 0x0000FFFF);
@@ -1054,7 +1052,7 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
}
default:
break;
break;
}
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 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
*
* 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;
}
case MSG_DESTROY:
scrollview_destroy (psvdata);
free (psvdata);
case MSG_DESTROY: {
/* suppress a warning about calling free() before using the pointer */
PSVDATA svdata = (PSVDATA) GetWindowAdditionalData2 (hWnd);
if (svdata) {
scrollview_destroy(svdata);
free (svdata);
}
break;
}
case MSG_GETDLGCODE:
return DLGC_WANTARROWS;
+2 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* 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
*
* 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;
RECT rc;
if (tmpdata->Caption == NULL || tmpdata->Caption [0] == '\0')
if (tmpdata->Caption [0] == '\0')
break;
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;
pci = (IconviewItem *)mglist_getitem_byindex (mglst, index);
if (pci == NULL)
return -1;
if (pRet)
*pRet = (MgItem*)pci;
-1
View File
@@ -59,7 +59,6 @@
#include "cliprect.h"
#include "gal.h"
#include "internals.h"
#include "blockheap.h"
#include "accelkey.h"
static BLOCKHEAP ACHeap;
+2 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* 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
*
* This program is free software: you can redistribute it and/or modify
@@ -803,7 +803,7 @@ BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
char buff [20];
DWORD rgba;
if (!rdr || !rdr->name || rdr->name[0] == '\0')
if (!rdr || rdr->name[0] == '\0')
return FALSE;
_DBG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n",
-1
View File
@@ -71,7 +71,6 @@
#include "cliprect.h"
#include "gal.h"
#include "internals.h"
#include "blockheap.h"
#include "menu.h"
#define SHORTEN 0
+74 -33
View File
@@ -2225,6 +2225,13 @@ static LRESULT DefaultPostMsgHandler(PMAINWIN pWin, UINT message,
OnQueryClientArea(pWin, (PRECT)lParam);
break;
case MSG_ACTIVE:
if (wParam)
pWin->dwExStyle |= WS_EX_ACTIVATED;
else
pWin->dwExStyle &= ~WS_EX_ACTIVATED;
break;
case MSG_SETFOCUS:
case MSG_KILLFOCUS:
if (pWin->hActiveChild && !lParam)
@@ -2597,23 +2604,44 @@ static LRESULT DefaultSessionMsgHandler(PMAINWIN pWin, UINT message,
return 0;
}
#if 0
static HWND get_active_descendant(PMAINWIN pWin)
{
HWND hwnd = (HWND)pWin;
HWND active;
while ((active = )) {
hwnd = active;
}
if (hwnd == (HWND)pWin)
return HWND_NULL;
return hwnd;
}
#endif
static LRESULT DefaultSystemMsgHandler(PMAINWIN pWin, UINT message,
WPARAM wParam, LPARAM lParam)
{
/*
** Should handle following messages:
**
** MSG_IDLE, MSG_CARETBLINK:
*/
if (message == MSG_IDLE) {
#if 0 /* deprecated code */
if (pWin == checkAndGetMainWinIfWindow (sg_repeat_msg.hwnd)) {
SendNotifyMessage (sg_repeat_msg.hwnd,
sg_repeat_msg.message,
sg_repeat_msg.wParam, sg_repeat_msg.lParam);
/* Since 5.0.10, MSG_IDLE will also be relayed to
the active child control if the main window is active currently */
if (pWin->dwExStyle & WS_EX_ACTIVATED) {
HWND active = GetFocusChild((HWND)pWin);
if (active) {
static DWORD last_tick_count;
if (wParam >= last_tick_count + 50) { /* 0.5s */
PostMessage(active, MSG_IDLE, wParam, lParam);
last_tick_count = wParam;
}
}
}
#endif /* deprecated code */
}
else if (message == MSG_CARETBLINK && pWin->dwStyle & WS_VISIBLE) {
BlinkCaret ((HWND)pWin);
@@ -2673,18 +2701,32 @@ LRESULT PreDefMainWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
LRESULT PreDefControlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == MSG_SETTEXT)
switch (message) {
case MSG_SETTEXT:
return 0;
else if (message == MSG_SETCURSOR) {
case MSG_IDLE:
{
HWND active = GetFocusChild(hWnd);
if (active) {
PostMessage(active, MSG_IDLE, wParam, lParam);
}
}
return 0;
case MSG_SETCURSOR:
if (GetWindowExStyle (hWnd) & WS_EX_USEPARENTCURSOR)
return 0;
SetCursor (GetWindowCursor (hWnd));
return 0;
}
else if (message == MSG_NCSETCURSOR) {
case MSG_NCSETCURSOR:
SetCursor (GetSystemCursor (IDC_ARROW));
return 0;
default:
break;
}
return DefaultMainWinProc (hWnd, message, wParam, lParam);
@@ -2992,6 +3034,7 @@ HWND GUIAPI GetFirstHosted (HWND hWnd)
PMAINWIN pMainWin;
if ((pMainWin = getMainWinIfWindowInThisThread (hWnd)) == NULL) {
_WRN_PRINTF("hWnd (%p) is not in the current thread\n", hWnd);
return HWND_INVALID;
}
@@ -3005,6 +3048,7 @@ HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted)
PMAINWIN pHosted;
if ((pHosting = getMainWinIfWindowInThisThread (hHosting)) == NULL) {
_WRN_PRINTF("hHosing (%p) is not in the current thread\n", hHosting);
return HWND_INVALID;
}
@@ -3013,10 +3057,13 @@ HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted)
}
if ((pHosted = getMainWinIfWindowInThisThread (hHosted)) == NULL) {
_WRN_PRINTF("hHosted (%p) is not in the current thread\n", hHosted);
return HWND_INVALID;
}
if (MG_UNLIKELY (pHosted->pHosting != pHosting)) {
_ERR_PRINTF("Bad hosting relationship between hosting(%p) and hosted(%p)\n",
pHosting, pHosted);
return HWND_INVALID;
}
@@ -3078,6 +3125,7 @@ static PMAINWIN search_win_tree_bfs (struct _search_context *ctxt)
}
}
hosting = hosted;
hosted = GetFirstHosted (hosted);
}
@@ -3164,8 +3212,8 @@ HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild)
HWND GUIAPI GetNextMainWindow (HWND hMainWnd)
{
MG_CHECK_RET (hMainWnd != HWND_NULL &&
!MG_IS_NORMAL_MAIN_WINDOW (hMainWnd), HWND_INVALID);
MG_CHECK_RET (hMainWnd == HWND_NULL ||
MG_IS_NORMAL_MAIN_WINDOW (hMainWnd), HWND_INVALID);
return (HWND)SendMessage (HWND_DESKTOP,
MSG_GETNEXTMAINWIN, (WPARAM)hMainWnd, 0L);
@@ -3233,6 +3281,7 @@ int GUIAPI ScrollWindowEx (HWND hWnd, int dx, int dy,
}
SendMessage (HWND_DESKTOP, MSG_SCROLLMAINWIN, (WPARAM)hWnd, (LPARAM)(&swi));
UpdateInvalidClient(hWnd, FALSE);
/* show caret */
if (fCaret) ShowCaretEx (hWnd, FALSE);
@@ -3704,6 +3753,8 @@ BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow)
return TRUE;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
/* moved here from desktop.c; can be used on virtual window */
static void guiAddNewHostedMainWindow (PMAINWIN pHosting, PMAINWIN pHosted)
{
@@ -3755,6 +3806,7 @@ static void guiRemoveHostedMainWindow (PMAINWIN pHosting, PMAINWIN pHosted)
}
#endif /* debug code */
}
#pragma GCC diagnostic pop
/************************* Support for virtual window ************************/
#ifdef _MGHAVE_VIRTUAL_WINDOW
@@ -3775,29 +3827,32 @@ static void* _message_thread_entry (void* arg)
goto failed;
/* create message queue for this thread */
if (!(entry_args.msg_queue = mg_AllocMsgQueueForThisThread ()))
if (!(entry_args.msg_queue = mg_AllocMsgQueueForThisThread (FALSE)))
goto failed;
orig_args->msg_queue = entry_args.msg_queue;
sem_post (entry_args.wait);
/* register the message queue */
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNIN, (LPARAM)&entry_args.msg_queue);
if (pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL))
goto failed;
goto cancelled;
/* call start routine of app */
entry_args.start_routine (entry_args.arg);
/* unregister the message queue */
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNOUT, (LPARAM)&entry_args.msg_queue);
mg_FreeMsgQueueForThisThread ();
mg_FreeMsgQueueForThisThread (FALSE);
return NULL;
failed:
sem_post (entry_args.wait);
cancelled:
return NULL;
}
@@ -3902,9 +3957,7 @@ HWND GUIAPI CreateVirtualWindow (HWND hHosting, WNDPROC WndProc,
if (pMsgQueue != getMsgQueueIfWindowInThisThread (hHosting)) {
goto err;
}
else {
pVirtWin->pHosting = (PVIRTWIN)hHosting;
}
pVirtWin->pHosting = (PVIRTWIN)hHosting;
}
if (SendMessage ((HWND)pVirtWin, MSG_CREATE,
@@ -4207,10 +4260,8 @@ HWND GUIAPI CreateMainWindowEx2 (PMAINWINCREATE pCreateInfo, LINT id,
if (pWin->pMsgQueue != getMsgQueue (pCreateInfo->hHosting)) {
goto err;
}
}
if (pWin->pHosting == NULL)
pWin->pHosting = getMainWindowPtr (pCreateInfo->hHosting);
}
#else /* defined _MGRM_THREADS */
@@ -4494,7 +4545,7 @@ BOOL GUIAPI DestroyMainWindow (HWND hWnd)
}
else
#endif /* defined _MGHAVE_VIRTUAL_WINDOW */
if (pWin->dwExStyle & WS_EX_DIALOGBOX) {
if (hosted->dwExStyle & WS_EX_DIALOGBOX) {
if (!EndDialog ((HWND)hosted, IDCANCEL))
return FALSE;
}
@@ -4529,11 +4580,6 @@ BOOL GUIAPI DestroyMainWindow (HWND hWnd)
SendMessage (HWND_DESKTOP, MSG_REMOVEMAINWIN, (WPARAM)hWnd, 0);
#if 0 /* deprecated code */
if (sg_repeat_msg.hwnd == hWnd)
sg_repeat_msg.hwnd = 0;
#endif /* deprecated code */
/* make the window to be invalid for PeekMessageEx, PostMessage etc */
pWin->DataType = TYPE_WINTODEL;
@@ -6085,11 +6131,6 @@ BOOL GUIAPI DestroyWindow (HWND hWnd)
pCtrl->privCDC = 0;
}
#if 0 /* deprecated code */
if (sg_repeat_msg.hwnd == hWnd)
sg_repeat_msg.hwnd = 0;
#endif /* deprecated code */
ThrowAwayMessages (hWnd);
if (pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN) {
+14
View File
@@ -319,6 +319,19 @@ static void flush_rec (void)
#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)
{
@@ -744,6 +757,7 @@ void TermPCXVFBInput (void)
remove("/tmp/.pcxvfb_tmp");
}
#endif
close_rec();
#endif /* WIN32 */
}
+1 -1
View File
@@ -3,7 +3,7 @@ noinst_HEADERS = \
cursor.h dc.h event.h list.h element.h \
ial.h inline.h internals.h zorder.h menu.h misc.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 \
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
glyph.h license.h mgsock.h unicode-ops.h \
@@ -47,6 +47,8 @@
** blockheap.h: the head file of heap for block data.
**
** Create date: 2001/01/10
**
** DEPRECATED, USE window.h INSTEAD.
*/
#ifndef GUI_BLOCKHEAP_H
@@ -55,7 +57,7 @@
#ifndef _MGUI_GDI_H /* included in include/gdi.h */
struct _BLOCKHEAP {
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock;
#endif
/* Size of one block element. */
+1 -1
View File
@@ -93,7 +93,7 @@ typedef struct tagDC* PDC;
# else /* not defined _MGSCHEMA_COMPOSITING */
void __mg_lock_recalc_gcrinfo (PDC pdc);
void __mg_unlock_gcrinfo (PDC pdc);
#define LOCK_GCRINFO(pdc) __mg_lock_recalc_gcrinfo (pdc)
#define LOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_lock_recalc_gcrinfo (pdc)
#define UNLOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_unlock_gcrinfo (pdc)
# endif /* not defined _MGSCHEMA_COMPOSITING */
+13 -6
View File
@@ -84,15 +84,18 @@
#define WS_EX_MODALDISABLED 0x10000000L
/*
* \def WS_EX_CTRLASMAINWIN
* \brief The control can be displayed out of the main window
* which contains the control.
* Internal extended style:
* The control can be displayed out of the main window
* which contains the control.
*/
#define WS_EX_CTRLASMAINWIN 0x20000000L
/* Internal extended style. */
/* Internal extended style: dialog box. */
#define WS_EX_DIALOGBOX 0x40000000L
/* Internal extended style: activated. */
#define WS_EX_ACTIVATED 0x80000000L
/* Make sure the internal window extended styles above are ok */
#define MGUI_COMPILE_TIME_ASSERT(name, x) \
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);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_2,
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
@@ -772,8 +779,8 @@ static inline PMSGQUEUE getMsgQueue (HWND hWnd)
}
MSGQUEUE* mg_AllocMsgQueueForThisThread (void);
void mg_FreeMsgQueueForThisThread (void);
MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in);
void mg_FreeMsgQueueForThisThread (BOOL sign_off);
/* Since 5.0.0 */
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd);
+3 -3
View File
@@ -55,9 +55,9 @@
#ifndef GUI_NEWGAL_H
#define GUI_NEWGAL_H
#include "minigui.h"
#include "gdi.h"
#include "constants.h"
#include "blockheap.h"
#if IS_COMPOSITING_SCHEMA
#include <sys/types.h>
@@ -1067,8 +1067,8 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
uint32_t name, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video,
uint32_t handle, size_t size, uint32_t drm_format, uint32_t pixels_off,
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
size_t size, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
+8 -2
View File
@@ -141,11 +141,17 @@ typedef struct _ZORDERINFO {
/* The size of usage bitmap for mask rect. */
int size_maskrect_usage_bmp;
/* use read/write lock for Unix-like OS */
#ifndef __NOUNIX__
#define __ZI_USE_RWLOCK 1
#endif
#ifdef _MGRM_THREADS
# ifndef __NOUNIX__
# ifdef __ZI_USE_RWLOCK
pthread_rwlock_t rwlock;
pthread_t rwlock_owner;
# else
pthread_mutex_t rwlock;
pthread_mutex_t mutex;
# endif
#elif defined(_MGRM_PROCESSES)
int zi_semid;
+1
View File
@@ -1,5 +1,6 @@
# also for makefile.ng and makefile.msvc
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
AM_CFLAGS = -Wno-zero-length-bounds
noinst_LTLIBRARIES = libkernel.la
+7 -7
View File
@@ -59,13 +59,13 @@
#include "common.h"
#include "minigui.h"
#include "gdi.h"
#include "window.h"
#include "constants.h"
#include "blockheap.h"
#include "misc.h"
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);
#endif
@@ -99,7 +99,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
int free_slot;
unsigned char* block_data = NULL;
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&heap->lock);
#endif
@@ -118,7 +118,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
ret:
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&heap->lock);
#endif
return block_data;
@@ -128,7 +128,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
{
unsigned char* block_data = data;
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&heap->lock);
#endif
@@ -146,7 +146,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
heap, slot);
}
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&heap->lock);
#endif
}
@@ -193,7 +193,7 @@ void DestroyBlockDataHeap (PBLOCKHEAP heap)
free (heap->usage_bmp);
heap->usage_bmp = NULL;
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_destroy (&heap->lock);
#endif
}
+2 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* 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
*
* 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;
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;
}
}
+2 -2
View File
@@ -1403,7 +1403,7 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
else {
from = 0;
}
lock_zi_for_read (zi);
from = __kernel_get_next_znode (zi, from);
@@ -1821,7 +1821,7 @@ static void dskRefreshAllWindow (const RECT* invrc)
info.is_empty_invrc = TRUE;
#ifdef _MGHAVE_MENU
dskForceCloseMenu ();
dskForceCloseMenu ();
#endif
SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0,
+1 -9
View File
@@ -231,14 +231,6 @@ static void init_desktop_win (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
/* Init heap of clipping rects. */
InitFreeClipRectList (&sg_FreeClipRectList, SIZE_CLIPRECTHEAP);
@@ -259,7 +251,7 @@ BOOL mg_InitDesktop (void)
void mg_TerminateDesktop (void)
{
/* Since 5.0.0: message queue for desktop thread was dynamically allocated */
mg_FreeMsgQueueForThisThread ();
mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL;
#ifndef _MGSCHEMA_COMPOSITING
+1 -9
View File
@@ -102,14 +102,6 @@ BOOL mg_InitDesktop (void)
int ret;
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.
*/
@@ -153,7 +145,7 @@ BOOL mg_InitDesktop (void)
void mg_TerminateDesktop (void)
{
if (__mg_dsk_msg_queue) {
mg_FreeMsgQueueForThisThread ();
mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL;
}
+2 -2
View File
@@ -145,7 +145,7 @@ void* __kernel_desktop_main (void* data)
MSG Msg;
/* 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");
sem_post ((sem_t*)data);
return NULL;
@@ -191,7 +191,7 @@ void* __kernel_desktop_main (void* data)
#endif
}
mg_FreeMsgQueueForThisThread ();
mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL;
return NULL;
}
+39 -29
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* 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
*
* 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
#ifdef _MGRM_THREADS
#ifndef __NOUNIX__
/*for unix system, using read/write lock*/
static inline void lock_zi_for_change (const ZORDERINFO* zi)
# ifdef __ZI_USE_RWLOCK
static inline void lock_zi_for_change (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__ */
/*for non-unix system, using mutex*/
static inline void lock_zi_for_change (const ZORDERINFO* zi)
# else /* __ZI_USE_RWLOCK */
static inline void lock_zi_for_change (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)
static inline void lock_zi_for_change (const ZORDERINFO* zi) { }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) { }
static inline void lock_zi_for_read (const ZORDERINFO* zi) { }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) { }
static inline void lock_zi_for_change (ZORDERINFO* zi) { }
static inline void unlock_zi_for_change (ZORDERINFO* zi) { }
static inline void lock_zi_for_read (ZORDERINFO* zi) { }
static inline void unlock_zi_for_read (ZORDERINFO* zi) { }
#else /* for procs */
/* NULL. see desktop-procs.c */
#endif /* _MGRM_THREADS */
@@ -3641,6 +3649,9 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
@@ -3680,9 +3691,6 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
update_client_window_rgn (nodes [idx_znode].cli,
nodes [idx_znode].hwnd);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
}
else {
lock_zi_for_change (zi);
@@ -4499,7 +4507,9 @@ int __mg_join_all_message_threads (void)
list_for_each (l, &msg_queue_list) {
MSGQUEUE *msg_queue = (MSGQUEUE*)l;
#ifndef NDEBUG
dump_message_queue (msg_queue, __func__);
#endif
pthread_cancel (msg_queue->th);
}
+8 -8
View File
@@ -66,7 +66,7 @@ static struct FIXSTR {
BYTE bitmap[LEN_BITMAP];
int offset[NR_HEAP];
char* heap[NR_HEAP + 1];
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock;
#endif
} FixStrHeap;
@@ -98,7 +98,7 @@ BOOL mg_InitFixStr (void)
offset += 1<<i;
}
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_init (&FixStrHeap.lock, NULL);
#endif
return TRUE;
@@ -106,7 +106,7 @@ BOOL mg_InitFixStr (void)
void mg_TerminateFixStr (void)
{
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_destroy (&FixStrHeap.lock);
#endif
free (FixStrHeap.heap[0]);
@@ -154,7 +154,7 @@ char* GUIAPI FixStrAlloc (int len)
// ..
// if i == 0; then bufflen = 512
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&FixStrHeap.lock);
#endif
@@ -166,7 +166,7 @@ char* GUIAPI FixStrAlloc (int len)
for(j = 0; j < 8; j++) {
if (*bitmap & (0x80 >> j)) {
*bitmap &= (~(0x80 >> j));
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock);
#endif
#if 0
@@ -181,7 +181,7 @@ char* GUIAPI FixStrAlloc (int len)
bitmap++;
}
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock);
#endif
return (char*)malloc (len + 1);
@@ -216,7 +216,7 @@ void GUIAPI FreeFixStr (char* str)
// if i == 0; then bufflen = 512
bufflen = 1 << (NR_HEAP + 1 - i);
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&FixStrHeap.lock);
#endif
heap = FixStrHeap.heap[i];
@@ -236,7 +236,7 @@ void GUIAPI FreeFixStr (char* str)
bitmap = bitmap + (stroff>>3);
*bitmap |= (0x80 >> (stroff%8));
#ifdef _MGRM_THREADS
#ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock);
#endif
}
+1 -1
View File
@@ -386,7 +386,7 @@ int InitGUI (int argc, const char* agr[])
/* Since 5.0.0
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!");
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 */
step++;
if (!(msg_queue = mg_AllocMsgQueueForThisThread ())) {
if (!(msg_queue = mg_AllocMsgQueueForThisThread (TRUE))) {
_ERR_PRINTF ("KERNEL>InitGUI: failed to allocate message queue!\n");
goto failure;
}
@@ -655,7 +655,7 @@ void GUIAPI TerminateGUI (int not_used)
miFreeArcCache ();
#endif
mg_FreeMsgQueueForThisThread ();
mg_FreeMsgQueueForThisThread (TRUE);
deleteThreadInfoKey ();
+16 -17
View File
@@ -60,7 +60,6 @@
#include "gdi.h"
#include "window.h"
#include "blockheap.h"
#include "cliprect.h"
#include "gal.h"
#include "internals.h"
@@ -159,7 +158,7 @@ void mg_DestroyFreeQMSGList (void)
pthread_key_t __mg_threadinfo_key;
#endif
MSGQUEUE* mg_AllocMsgQueueForThisThread (void)
MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in)
{
MSGQUEUE* pMsgQueue;
@@ -177,13 +176,14 @@ MSGQUEUE* mg_AllocMsgQueueForThisThread (void)
pthread_setspecific (__mg_threadinfo_key, pMsgQueue);
#endif
// register this new message queue
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue);
if (sign_in) {
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue);
}
return pMsgQueue;
}
void mg_FreeMsgQueueForThisThread (void)
void mg_FreeMsgQueueForThisThread (BOOL sign_off)
{
MSGQUEUE* pMsgQueue;
@@ -194,6 +194,11 @@ void mg_FreeMsgQueueForThisThread (void)
_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);
free (pMsgQueue);
@@ -823,8 +828,9 @@ checkagain:
goto got_ret;
}
}
else
else {
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. */
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;
PMSG pMsg;
PQMSG pQMsg;
@@ -1421,16 +1430,6 @@ int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
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) {
PQMSG pPrev = NULL, pNext;
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 */
#ifdef _MGRM_THREADS
#ifndef __NOUNIX__
# ifdef __ZI_USE_RWLOCK
pthread_rwlock_init(&__mg_zorder_info->rwlock, NULL);
#else
pthread_mutex_init(&__mg_zorder_info->rwlock, NULL);
#endif
__mg_zorder_info->rwlock_owner = 0;
# else
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
return 0;
#endif
@@ -261,11 +273,11 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
#else
#ifdef _MGRM_THREADS
#ifndef __NOUNIX__
# ifdef __ZI_USE_RWLOCK
pthread_rwlock_destroy(&zi->rwlock);
#else
pthread_mutex_destroy(&zi->rwlock);
#endif
# else
pthread_mutex_destroy(&zi->mutex);
# endif
#endif
free (zi);
__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;
}
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;
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->depth = GetGDCapability (HDC_SCREEN, GDCAP_BPP) << 3;
// initialize the palette with the screen palette.
if (my_bmp->depth <= 8)
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,
* 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 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
*
* 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
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) {
break;
}
@@ -210,7 +211,8 @@ int __mg_load_webp(MG_RWops *fp, void *init_info, MYBITMAP *mybmp,
while (1) {
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) {
_ERR_PRINTF ("__mg_load_webp: WebPIAppend failed: %d\n", status);
rc = ERR_BMP_LOAD;
+1 -1
View File
@@ -3575,7 +3575,7 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
/* called by drmCreateDCFromHandle */
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
unsigned long size, uint32_t drm_format, uint32_t pixels_off,
size_t size, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch)
{
GAL_VideoDevice *this = (GAL_VideoDevice *)video;
+3 -1
View File
@@ -323,11 +323,13 @@ static void DUMMY_VideoQuit(_THIS)
if (mgIsServer) {
shm_unlink (DUMMYVID_SHAREDMEM_NAME);
}
#else
#elif !defined(_MGRM_PROCESSES)
if (this->screen->pixels != NULL) {
free (this->screen->pixels);
this->screen->pixels = NULL;
}
#else
// do nothing (COMPOSITING_SCHEMA)
#endif /* not (defined(_MGRM_PROCESSES) && defined (_MGSCHEMA_SHAREDFB)) */
}
+34 -33
View File
@@ -102,8 +102,6 @@ static void FB_FreeHWSurface(_THIS, GAL_Surface *surface);
static void FB_WaitVBL(_THIS);
static void FB_WaitIdle(_THIS);
#ifdef _MGSCHEMA_COMPOSITING
#include "../shadow-screen.h"
#include "debug.h"
@@ -133,13 +131,6 @@ static BOOL FB_SyncUpdate (_THIS)
return FALSE;
}
#endif /* _MGSCHEMA_COMPOSITING */
#if 0
static int FB_LockHWSurface(_THIS, GAL_Surface *surface);
static void FB_UnlockHWSurface(_THIS, GAL_Surface *surface);
static int FB_FlipHWSurface(_THIS, GAL_Surface *surface);
#endif
/* Internal palette functions */
static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo,
@@ -169,11 +160,9 @@ static int FB_Available(void)
static void FB_DeleteDevice(GAL_VideoDevice *device)
{
#ifdef _MGSCHEMA_COMPOSITING
if (device->hidden->shadow_screen) {
GAL_FreeSurface (device->hidden->real_screen);
}
#endif /* _MGSCHEMA_COMPOSITING */
free(device->hidden);
free(device);
@@ -197,11 +186,8 @@ static GAL_VideoDevice *FB_CreateDevice(int devindex)
return(0);
}
memset(this->hidden, 0, (sizeof *this->hidden));
/* For compositing schema, we force to use double buffering */
#ifdef _MGSCHEMA_COMPOSITING
this->hidden->magic = MAGIC_SHADOW_SCREEN_HEADER;
this->hidden->version = 0;
#endif
wait_vbl = FB_WaitVBL;
wait_idle = FB_WaitIdle;
@@ -278,7 +264,7 @@ static int FB_EnterGraphicsMode (_THIS)
if (ioctl (ttyfd, KDSETMODE, KD_GRAPHICS) == -1) {
_WRN_PRINTF ("Error when setting the terminal (%s) "
"to graphics mode: %m\n", tty_dev);
_WRN_PRINTF ("It might is not a console.\n");
_WRN_PRINTF ("It might not be a console.\n");
goto fail;
}
#ifdef _MGRM_PROCESSES
@@ -421,16 +407,6 @@ static int FB_VideoInit(_THIS, GAL_PixelFormat *vformat)
(((long)finfo.smem_start)&~(getpagesize () - 1)));
mapped_memlen = finfo.smem_len+mapped_offset;
#if defined(__TARGET_R818__) && defined(_MGSCHEMA_COMPOSITING)
if (mgIsServer) {
uintptr_t args[2] = { 1, 0 };
if (ioctl(console_fd, FBIO_ENABLE_CACHE, args) < 0) {
GAL_SetError("NEWGAL/FBCON: FBIO_ENABLE_CACHE failed\n");
return -1;
}
}
#endif
#ifdef __uClinux__
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
mapped_mem = mmap(NULL, mapped_memlen,
@@ -609,6 +585,7 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
Uint32 Amask;
char *surfaces_mem;
int surfaces_len;
BOOL dblbuff = FALSE;
#ifdef __TARGET_STB810__
bpp = 32;
@@ -793,6 +770,30 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
// allocate hardware surface first.
GAL_PublicSurface = current;
dblbuff = TRUE;
}
else {
// client never call SetVideoMode
assert (0);
}
#elif !IS_SHAREDFB_SCHEMA_PROC
{
char tmp [8];
if (GetMgEtcValue ("fbcon", "double_buffering", tmp, 8) >= 0 &&
(strcasecmp (tmp, "true") == 0 || strcasecmp (tmp, "yes") == 0)) {
dblbuff = TRUE;
}
}
#endif /* !IS_SHAREDFB_SCHEMA_PROC */
if (dblbuff) {
#if defined(__TARGET_R818__)
uintptr_t args[2] = { 1, 0 };
if (ioctl(console_fd, FBIO_ENABLE_CACHE, args) < 0) {
GAL_SetError("NEWGAL/FBCON: FBIO_ENABLE_CACHE failed\n");
}
#endif
/* create shadow screen */
this->hidden->shadow_screen = GAL_CreateRGBSurface (GAL_HWSURFACE,
current->w, current->h,
@@ -801,10 +802,12 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
current->format->Bmask, current->format->Amask);
if (this->hidden->shadow_screen) {
#if IS_COMPOSITING_SCHEMA
this->info.hw_cursor = 1;
this->hidden->cursor = NULL;
this->SetCursor = shadowScreen_SetCursor;
this->MoveCursor = shadowScreen_MoveCursor;
#endif
this->UpdateRects = shadowScreen_UpdateRects;
this->SyncUpdate = FB_SyncUpdate;
@@ -814,6 +817,7 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
GAL_SetClipRect (this->hidden->real_screen, NULL);
GAL_SetColorKey (this->hidden->shadow_screen, 0, 0);
GAL_SetAlpha (this->hidden->shadow_screen, 0, 0);
SetRectEmpty (&this->hidden->dirty_rc);
}
else {
this->hidden->real_screen = NULL;
@@ -821,10 +825,9 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
}
}
else {
// client never call SetVideoMode
assert (0);
this->hidden->real_screen = current;
this->hidden->shadow_screen = NULL;
}
#endif /* _MGSCHEMA_COMPOSITING */
/* We're done */
return (current);
@@ -1042,8 +1045,8 @@ static int FB_AllocHWSurface (_THIS, GAL_Surface *surface)
REQUEST req;
#ifdef _MGSCHEMA_COMPOSITING
if (!mgIsServer)
return -1;
if (!mgIsServer)
return -1;
#endif
req.id = REQID_HWSURFACE;
req.data = &request;
@@ -1296,11 +1299,9 @@ static void FB_VideoQuit(_THIS)
}
}
#ifdef _MGSCHEMA_COMPOSITING
if (mgIsServer && this->hidden->shadow_screen) {
if (this->hidden->shadow_screen) {
GAL_FreeSurface (this->hidden->shadow_screen);
}
#endif
/* Clean up the memory bucket list */
#ifdef _MGRM_PROCESSES
+10 -10
View File
@@ -68,19 +68,26 @@ typedef struct vidmem_bucket {
/* Private display data */
struct GAL_PrivateVideoData {
/* For compositing schema, we force to use double buffering */
#ifdef _MGSCHEMA_COMPOSITING
/* When double buffering supported, the real surface represents the ultimate
* scan-out frame buffer, and the shadow screen represents the rendering
* surface. When double buffering disabled, shadow_screen is NULL.
*
* For compositing schema, we force to use double buffering.
* For threads and standalone mode, controlled by `fbcon.double_buffering`
* run-time option. Not supported for processes mode.
*/
/* start of header for shadow screen */
int magic, version;
GAL_Surface *real_screen, *shadow_screen;
RECT dirty_rc;
#ifdef _MGSCHEMA_COMPOSITING
/* Used to simulate the hardware cursor. */
GAL_Surface *cursor;
int csr_x, csr_y;
int hot_x, hot_y;
#endif
/* end of header for shadow screen */
#endif /* _MGSCHEMA_COMPOSITING */
int console_fd;
struct fb_var_screeninfo cache_vinfo;
@@ -104,13 +111,6 @@ struct GAL_PrivateVideoData {
void (*wait_vbl)(_THIS);
void (*wait_idle)(_THIS);
#if 0 /* deprecated code */
int flip_page;
char *flip_address[2];
#define flip_page (this->hidden->flip_page)
#define flip_address (this->hidden->flip_address)
#endif
};
/* Old variable names */
+8
View File
@@ -76,6 +76,14 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
//memset(format, 0, sizeof(*format));
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 */
format->BitsPerPixel = bpp;
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 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
*
* This program is free software: you can redistribute it and/or modify
@@ -57,64 +57,55 @@ extern "C" {
#define _THIS GAL_VideoDevice *this
typedef struct _ShadowFBHeader {
unsigned int info_size;
int width;
int height;
int depth;
int pitch;
int dirty; /* true for dirty, and should reset to false after refreshing the dirty area */
RECT dirty_rect;
int palette_changed; /* true for changed, and should reset to false after reflecting the change */
int palette_offset;
int fb_offset;
Uint32 Rmask;
Uint32 Gmask;
Uint32 Bmask;
Uint32 Amask;
int firstcolor;
int ncolors;
unsigned int info_size;
int width;
int height;
int depth;
int pitch;
int dirty; /* true for dirty, and should reset to false after refreshing the dirty area */
RECT dirty_rect;
int palette_changed; /* true for changed, and should reset to false after reflecting the change */
int palette_offset;
int fb_offset;
Uint32 Rmask;
Uint32 Gmask;
Uint32 Bmask;
Uint32 Amask;
int firstcolor;
int ncolors;
} ShadowFBHeader;
#define FLAG_REALFB_PREALLOC 0x01
typedef struct _RealFBInfo {
DWORD flags;
int height, width;
int depth;
int pitch;
void* fb;
void * real_device;
DWORD flags;
int height, width;
int depth;
int pitch;
void* fb;
void * real_device;
} RealFBInfo;
/* Private display data */
struct GAL_PrivateVideoData {
RealFBInfo * realfb_info;
/*GAL_VideoDevice *_real_device ;
int w, h, pitch;
void *fb;
BOOL alloc_fb;
BOOL dirty;
RECT update;*/
pthread_t update_th;
#ifdef _MGRM_PROCESSES
int semid;
#else
pthread_mutex_t update_lock;
#endif
};
typedef struct _ShadowFBOps {
int (*init) (void);
int (*get_realfb_info) (RealFBInfo* realfb_info);
int (*release) (RealFBInfo* realfb_info);
int (*set_palette) (RealFBInfo* realfb_info, int firstcolor, int ncolors, void* colors);
void (*sleep) (void);
void (*refresh) (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb_info, void* update);
int (*init) (void);
int (*get_realfb_info) (RealFBInfo* realfb_info);
int (*release) (RealFBInfo* realfb_info);
int (*set_palette) (RealFBInfo* realfb_info, int firstcolor,
int ncolors, void* colors);
void (*refresh) (ShadowFBHeader* shadowfb_header,
RealFBInfo* realfb_info, void* update);
} ShadowFBOps;
ShadowFBOps * __mg_shadow_fb_ops;
#ifdef __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);
void GAL_VideoQuit(void);
static GAL_VideoDevice *GAL_GetVideo(const char* driver_name)
GAL_VideoDevice *GAL_GetVideo(const char* driver_name)
{
GAL_VideoDevice *video;
int index;
-2
View File
@@ -4349,8 +4349,6 @@ static void on_surface_changed_for_control (struct _travel_context* ctxt,
RECT rc_surface, rc_minimal;
PDC pdc = dc_HDC2PDC (ctrl->privCDC);
_WRN_PRINTF ("called\n");
pdc->surface = ctxt->surface;
if (pdc->surface != __gal_screen) {

Some files were not shown because too many files have changed in this diff Show More