mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-24 00:54:18 +08:00
Compare commits
33
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cc16ababb | ||
|
|
d4097b577b | ||
|
|
7ef6c14f3f | ||
|
|
cbb4e32992 | ||
|
|
6bc85062b9 | ||
|
|
b2dee57f4f | ||
|
|
a926754a6b | ||
|
|
7e470b0e78 | ||
|
|
9f81cac662 | ||
|
|
a14bdd894a | ||
|
|
7004e156b8 | ||
|
|
e293cf03ba | ||
|
|
07f226f024 | ||
|
|
4b2503e614 | ||
|
|
2df5352356 | ||
|
|
67ccb2aafd | ||
|
|
9a124dec50 | ||
|
|
d013822979 | ||
|
|
7f44e948d0 | ||
|
|
9a94fb9a7c | ||
|
|
dfc7e95fcd | ||
|
|
362b852ec2 | ||
|
|
9141e13640 | ||
|
|
4a22a38e63 | ||
|
|
c7ce12449b | ||
|
|
824557b4f1 | ||
|
|
022542ef1b | ||
|
|
3b12e71877 | ||
|
|
9593168196 | ||
|
|
b5c5c3f8ae | ||
|
|
492bd649ed | ||
|
|
bc1a880479 | ||
|
|
0748f26f42 |
@@ -29,3 +29,4 @@ Makefile.in
|
||||
/src/font/utils/ucd/
|
||||
/src/sysres/font_list
|
||||
/src/sysres/license/dat_files/
|
||||
/configure~
|
||||
|
||||
@@ -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
@@ -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
@@ -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")
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ defaultmode=800x600-16bpp
|
||||
[shadow]
|
||||
real_engine=pc_xvfb
|
||||
defaultmode=800x600-16bpp
|
||||
rotate_screen=normal
|
||||
rotate_screen=ccw
|
||||
#}}
|
||||
|
||||
#{{ifdef _MGGAL_MLSHADOW
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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 */
|
||||
|
||||
|
||||
@@ -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
@@ -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
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
#include "cliprect.h"
|
||||
#include "gal.h"
|
||||
#include "internals.h"
|
||||
#include "blockheap.h"
|
||||
#include "accelkey.h"
|
||||
|
||||
static BLOCKHEAP ACHeap;
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
#include "cliprect.h"
|
||||
#include "gal.h"
|
||||
#include "internals.h"
|
||||
#include "blockheap.h"
|
||||
#include "menu.h"
|
||||
|
||||
#define SHORTEN 0
|
||||
|
||||
+74
-33
@@ -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) {
|
||||
|
||||
@@ -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 */
|
||||
}
|
||||
|
||||
|
||||
@@ -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. */
|
||||
+13
-6
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,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
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+36
-26
@@ -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 */
|
||||
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
@@ -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)) */
|
||||
}
|
||||
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
+30
-39
@@ -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
@@ -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;
|
||||
|
||||
+4
-4
@@ -511,11 +511,11 @@ static void shape_space(const LAYOUT* layout, const LayoutRun* lrun,
|
||||
|
||||
gstr->glyphs[i].is_cluster_start = 1;
|
||||
gstr->log_clusters[i] = i;
|
||||
}
|
||||
|
||||
if (BIDI_LEVEL_IS_RTL(lrun->el) && gstr->nr_glyphs > 1) {
|
||||
__mg_reverse_shaped_glyphs(gstr->glyphs, gstr->nr_glyphs);
|
||||
__mg_reverse_log_clusters(gstr->log_clusters, gstr->nr_glyphs);
|
||||
}
|
||||
if (BIDI_LEVEL_IS_RTL(lrun->el) && gstr->nr_glyphs > 1) {
|
||||
__mg_reverse_shaped_glyphs(gstr->glyphs, gstr->nr_glyphs);
|
||||
__mg_reverse_log_clusters(gstr->log_clusters, gstr->nr_glyphs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -148,14 +148,15 @@ static BOOL find_color_key (GAL_PixelFormat* format, const MYBITMAP* my_bmp,
|
||||
goto free_and_ret;
|
||||
|
||||
color_num = 1 << my_bmp->depth;
|
||||
pixels = malloc (color_num * sizeof (Uint32));
|
||||
for (i = 0; i < color_num; i++)
|
||||
pixels = calloc (color_num, sizeof (Uint32));
|
||||
for (i = 0; i < color_num; i++) {
|
||||
pixels[i] = GAL_MapRGB (format, pal[i].r, pal[i].g, pal[i].b);
|
||||
}
|
||||
pixel_key = pixels [my_bmp->transparent];
|
||||
|
||||
for (i = 0; i < color_num; i++) {
|
||||
if (pixels[i] == pixel_key && i != my_bmp->transparent)
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == color_num)
|
||||
|
||||
@@ -140,7 +140,6 @@ SOFTWARE.
|
||||
#include "gdi.h"
|
||||
#include "cliprect.h"
|
||||
#include "gal.h"
|
||||
#include "blockheap.h"
|
||||
|
||||
typedef void (*voidProcp1)(CLIPRGN *region, const CLIPRECT *r1, const CLIPRECT *r1End,
|
||||
const CLIPRECT *r2, const CLIPRECT *r2End, int top, int bottom);
|
||||
|
||||
@@ -254,7 +254,6 @@ static BOOL shape_layout_run(SEInstance* inst,
|
||||
gs->log_clusters[j] = i;
|
||||
j++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gs->nr_glyphs = j;
|
||||
|
||||
@@ -747,6 +747,8 @@ void GUIAPI UpdateTopmostLayer (const RECT* dirty_rc)
|
||||
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)
|
||||
{
|
||||
ZORDERINFO* zi;
|
||||
@@ -774,6 +776,7 @@ int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type, int* cli)
|
||||
|
||||
return topmost;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode, int* cli)
|
||||
{
|
||||
|
||||
+1
-1
@@ -1001,7 +1001,7 @@ static inline MYBMP_WITH_PAL* new_mybmp_with_pal (void)
|
||||
MYBMP_WITH_PAL* mybmp_pal;
|
||||
|
||||
mybmp_pal = NEW(MYBMP_WITH_PAL);
|
||||
mybmp_pal->pal = malloc (sizeof (RGB) * 256);
|
||||
mybmp_pal->pal = calloc (256, sizeof (RGB));
|
||||
return mybmp_pal;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user