Compare commits

...
105 Commits
Author SHA1 Message Date
gengyue d97e922e12 Merge branch 'rel-5-0' of gitlab.fmsoft.cn:VincentWei/minigui into gengyue 2021-03-22 20:07:09 +08:00
gengyue 6ffdd98903 add on_showing_win and on_hiding_win for switching layer 2021-03-22 20:07:06 +08:00
Vincent Wei d894080582 fix bad Doxygen group name; 2021-03-22 16:00:50 +08:00
gengyue 044c82e2f3 add client id to parameters of calc_mainwin_pos 2021-03-22 10:02:06 +08:00
Vincent Wei 8bfc65f88f tune 2021-02-02 10:38:26 +08:00
Vincent Wei fbf02782a6 change version to 5.0.5 2021-01-04 10:34:26 +08:00
Vincent Wei 1e88954b79 adjust values of WS_XXX to avoid confilct 2021-01-04 10:34:14 +08:00
Vincent Wei 4e0cd74552 fix a bug of GetNextMainWindow 2020-12-15 17:02:16 +08:00
Vincent Wei 7530c4b5bd use non-blocking read and ignore EV_SYN 2020-11-10 20:34:47 +08:00
Vincent Wei b47d207bd2 fix a bug: misuse fdset in FD_SET and FD_ISSET 2020-11-10 19:49:21 +08:00
Vincent Wei 9ff29ccb94 do not return for EV_KEY 2020-11-10 18:52:44 +08:00
Vincent Wei 6da322ed49 cleanup 2020-11-10 18:32:16 +08:00
Vincent Wei 6e21fed525 tune 2020-11-10 18:28:30 +08:00
Vincent Wei 74747f383c use blocking reading 2020-11-10 18:12:35 +08:00
Vincent Wei bde7d74f02 break the loop for EV_KEY 2020-11-10 18:03:50 +08:00
Vincent Wei cdc818d936 use no blocking read 2020-11-10 17:53:00 +08:00
Vincent Wei 8694a342b9 tune 2020-11-10 17:49:18 +08:00
Vincent Wei dd9e59d82f cleanup 2020-11-10 17:28:03 +08:00
Vincent Wei 1b2b87d187 cleanup 2020-11-10 16:55:55 +08:00
Vincent Wei 36c1f15894 change version to 5.0.4 2020-11-10 16:21:56 +08:00
Vincent Wei c3877bad13 fix a compilation error: use #ifdef _MGSCHEMA_COMPOSITING 2020-11-10 16:10:48 +08:00
Vincent Wei a118a062ec use IAL_MOUSE_LEFTBUTTON instead of COMM_LBUTTON 2020-11-10 16:10:13 +08:00
Vincent Wei 5e34e98b28 fix a bug: save kbd_dev for suspend/resume 2020-11-10 16:02:28 +08:00
Vincent Wei 60ed1c9b3c Merge branch 'rel-5-0' of github.com:VincentWei/minigui into rel-5-0 2020-11-10 15:54:39 +08:00
Vincent Wei e148806743 Merge pull request #57 from ninexue/rel-5-0
Rel 5 0
2020-11-10 15:53:35 +08:00
xueshuming cd0dd795c8 add singletouchkey ial 2020-11-10 15:38:02 +08:00
xueshuming e6468d960c compile for aarch64-arm-gcc 7.5 2020-11-10 15:30:34 +08:00
Vincent Wei 219d72074d release notes for version 5.0.4 2020-11-10 11:17:31 +08:00
Vincent Wei 56779b033d tune comments 2020-11-10 11:12:20 +08:00
Vincent Wei 73dc293c76 new section for IAL engine singletouchkey 2020-11-10 11:06:46 +08:00
Vincent Wei abaee60a55 change version to 5.0.4; show includes for FreeType2 and HarfBuzz. 2020-10-19 10:41:16 +08:00
Vincent Wei 2b99ac28eb fix a potential bug: only increase nr_mask_rects for not empty mask rectangle 2020-10-13 08:15:57 +08:00
Vincent Wei f86fa9d483 fix bugs in ServerGetWinZNodeRegion: must check for possible empty mask rect; bad assignment of maskrect 2020-10-12 19:00:54 +08:00
Vincent Wei 529c78ef90 tune 2020-10-12 18:59:21 +08:00
Vincent Wei bc20a11744 use _ERR_PRINTF 2020-10-12 17:57:52 +08:00
Vincent Wei 6a2f28543d bugfixing: update surface of controls surface in travel_children_with_priv_cdc 2020-10-12 17:26:22 +08:00
Vincent Wei 79c9e16ddb update TOC 2020-09-30 08:51:55 +08:00
Vincent Wei bb62e1ff45 release nots for version 5.0.3 2020-09-30 08:16:07 +08:00
Vincent Wei 95ac2ecfce tune 2020-09-29 17:26:56 +08:00
Vincent Wei 7baf414d73 enable use_shmopen only for Linux 2020-09-29 17:26:44 +08:00
Vincent Wei 70255521f8 Merge pull request #50 from ehello/rel-5-0
chw 's change
2020-09-29 17:15:04 +08:00
Vincent Wei 3dce463697 Merge branch 'rel-5-0' into rel-5-0 2020-09-29 17:12:40 +08:00
chw 43f126635c chw 's change 2020-09-29 14:55:22 +08:00
Vincent Wei c31c970e88 rebuil the private data for all visible z-nodes after selected a new compositor 2020-09-21 08:34:34 +08:00
Vincent Wei 8dcb3349c7 always check expired timers even got EINTR 2020-09-21 08:33:34 +08:00
Vincent Wei b03bc62fef change version to 5.0.3 2020-09-21 08:33:01 +08:00
Vincent Wei a8b46e9e9c add static modifier to refresh_dirty_region method 2020-09-20 15:32:16 +08:00
Vincent Wei 4541934bd5 declare ZNOP_ICONCHANGED for future use 2020-09-07 10:30:44 +08:00
gengyue fa2382c0de modified for ServerGetTopmostZNodeOfType 2020-09-06 11:11:13 +08:00
Vincent Wei 5944085555 return client identifier if ok 2020-09-06 09:48:24 +08:00
Vincent Wei 97f4215330 add new API ServerGetTopmostZNodeOfType and implement it 2020-09-06 09:44:31 +08:00
Vincent Wei 1d81705437 add --enable-mgslicefallback 2020-08-12 20:33:35 +08:00
Vincent Wei 2f48b9df05 initial commit 2020-08-12 20:33:04 +08:00
Vincent Wei 5541ad971d #error for freertos in __mg_os_get_random_seed 2020-08-12 20:32:52 +08:00
Vincent Wei 8d4ced06d6 fix a bug of allocate_more_fd_slots 2020-08-12 20:32:12 +08:00
Vincent Wei 07ba1c50b9 make exectable 2020-08-12 18:46:23 +08:00
Vincent Wei 2f97ddc0a2 tune to use the macro HAVE_ACCESS, and use access instead of _access 2020-08-12 18:46:05 +08:00
Vincent Wei 988d1ca680 remove listenfd.c 2020-08-12 18:45:36 +08:00
Vincent Wei fec1ccef76 check function access 2020-08-12 18:45:22 +08:00
Vincent Wei 884cd66dfa add buildlib-freertos 2020-08-12 18:40:39 +08:00
Vincent Wei f41180d025 fix a bug in RegisterListenFD 2020-08-10 11:07:50 +08:00
Vincent Wei bebe28b95c disable calling of _access for FreeRTOS 2020-08-10 11:02:48 +08:00
Vincent Wei 358c940763 use hb_buffer_set_unicode_funcs 2020-07-23 16:55:01 +08:00
Vincent Wei b3d6c70a45 fix bad default harfbuzz include directory 2020-07-21 20:54:06 +08:00
Vincent Wei 5fc1c1101e fix a bug: do not call function in assert() 2020-06-06 12:04:14 +08:00
Vincent Wei f336b8401b Release notes for version 5.0.2. 2020-06-04 10:15:58 +08:00
Vincent Wei 78a0a8addf move code for initializing cfg_res_path to __sysres_get_system_res_path() 2020-06-04 09:15:15 +08:00
Vincent Wei be5f46f92d cleanup 2020-06-04 09:14:24 +08:00
Vincent Wei 07592ad802 cleanup 2020-06-04 09:13:52 +08:00
Vincent Wei 1764c47131 depress compile warnings 2020-06-03 18:07:52 +08:00
Vincent Wei f83c92d91b implement hb_ext_unicode_funcs 2020-06-03 18:07:26 +08:00
Vincent Wei bf85472935 ignore files created by automake 2020-06-03 18:06:29 +08:00
Vincent Wei ff6856ec1f change version to 5.0.2; use harfbuzz instead of harfbuzzex; set use_shmopen to yes by default 2020-06-03 18:03:16 +08:00
Vincent Wei a4d532f85e fix a bug: always retrun TRUE in subtract_rgn_by_node; change version to 5.0.1 2020-05-12 09:17:39 +08:00
Vincent Wei 18f51a113d add missed map.h file 2020-04-10 14:07:10 +08:00
Vincent Wei 12313a2646 change version of minigui-res to 5.0.0 2020-03-29 17:24:26 +08:00
Vincent Wei 3ce8e5e8af set default exdriver for DRM engine: libhidrmdrivers-0.2.so.0 2020-03-27 16:20:31 +08:00
Vincent Wei a8b54bc301 cleanup 2020-03-26 19:21:52 +08:00
Vincent Wei 7f711b383a cleanup 2020-03-26 19:09:39 +08:00
Vincent Wei bbda500121 cleanup 2020-03-26 18:10:51 +08:00
Vincent Wei deb248c96e Merge branch 'rel-5-0' of gitlab.fmsoft.cn:VincentWei/minigui into rel-5-0 2020-03-26 18:10:12 +08:00
Vincent Wei c8e9b72663 a workaround for client windows are not completely updated because of moving a window 2020-03-26 18:10:05 +08:00
Vincent Wei 0ff551a2da call SyncUpdateDC after calling FocusRect on HDC_SCREEN_SYS 2020-03-26 18:08:41 +08:00
Vincent Wei aef1e366f4 cleanup 2020-03-26 10:32:59 +08:00
Vincent Wei 41d8a80c8e bugfixing: merge global dirty rectagnle before synchronizing update 2020-03-26 10:32:33 +08:00
Vincent Wei cbd2cea0e9 remove _DEBUG 2020-03-25 20:07:09 +08:00
Vincent Wei 0c5f5115e6 fix a memory leak: free the default video surface in GAL_SetVideoModeInfo 2020-03-25 20:03:32 +08:00
Vincent Wei 86da42231c only treat ppp and wpp for topmost layer 2020-03-25 17:54:04 +08:00
Vincent Wei 20974f305a use dirty type to optimize the compositor 2020-03-25 17:31:19 +08:00
Vincent Wei 5a22e67680 bugfixing: bad implementation of generate_dirty_region; generate_dirty_region -> merge_dirty_region 2020-03-25 17:28:31 +08:00
Vincent Wei bae24f0964 tune words 2020-03-25 15:36:40 +08:00
Vincent Wei 2871657b65 fix some typos 2020-03-25 15:24:48 +08:00
Vincent Wei 767a8b088e tune URLs to release notes 2020-03-25 10:56:22 +08:00
Vincent Wei 2f77a0a8c8 Tune words 2020-03-24 22:05:07 +08:00
Vincent Wei 2900f37c23 merge from dev-4-1 for 5.0.0 2020-03-24 20:25:27 +08:00
Vincent Wei 57bdcd4754 use get_sem_key_for_layers 2020-01-22 17:03:42 +08:00
Vincent Wei b95538a415 use a small static buffer for zero size surface 2020-01-22 17:03:19 +08:00
Vincent Wei fa7c84b2b5 enhance to delete old IPC objects 2020-01-22 17:02:57 +08:00
Vincent Wei bc77048488 make lock_zi_for_xxx/unlock_zi_for_xxx static inline 2020-01-22 17:02:22 +08:00
Vincent Wei 2f21b22a49 make lock_zi_for_xxx/unlock_zi_for_xxx static inline 2020-01-22 17:02:12 +08:00
Vincent Wei ec91986854 add inline functions for get shm/sem key for system/layer 2020-01-22 17:01:42 +08:00
Vincent Wei e7b03037be notes for 4.0.5 2020-01-22 17:01:02 +08:00
Vincent Wei 9ff822c7fd change version to 4.0.5 2020-01-03 14:45:12 +08:00
Vincent Wei 239924c63e BUGFIXING: always initialize csr_bmp fields with explicit assignments 2020-01-03 14:38:28 +08:00
Vincent Wei 2f85645e9d change version to 4.0.4 2020-01-03 14:37:50 +08:00
58 changed files with 1319 additions and 411 deletions
+2 -1
View File
@@ -4,6 +4,8 @@
*.al
*.a
*.so
\#
am--include-marker
Makefile
Makefile.in
.deps/
@@ -23,7 +25,6 @@ Makefile.in
/*config.h
/*config.h.in
/*config.h.in~
/src/font/utils/emoji/
/src/font/utils/ucd/
/src/sysres/font_list
+2 -2
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Processes)"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v5.0.0
PROJECT_NUMBER = v5.0.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc-api-ref-minigui-procs-5.0.0
OUTPUT_DIRECTORY = doc-api-ref-minigui-procs-5.0.5
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
+2 -2
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Standalone)"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v5.0.0
PROJECT_NUMBER = v5.0.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc-api-ref-minigui-sa-5.0.0
OUTPUT_DIRECTORY = doc-api-ref-minigui-sa-5.0.5
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
+2 -2
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Threads)"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v5.0.0
PROJECT_NUMBER = v5.0.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc-api-ref-minigui-ths-5.0.0
OUTPUT_DIRECTORY = doc-api-ref-minigui-ths-5.0.5
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
+2 -2
View File
@@ -1,5 +1,5 @@
MAJOR_VERSION = 4
MINOR_VERSION = 1
MAJOR_VERSION = 5
MINOR_VERSION = 0
MICRO_VERSION = 0
EXTRAVERSION =
+108 -43
View File
@@ -1,23 +1,27 @@
# MiniGUI
A mature and proven cross-platform GUI system for embedded and smart IoT devices.
A mature and proven cross-platform windowing system for embedded system and smart IoT devices.
## TABLE OF CONTENTS
- [INTRODUCTION](#introduction)
+ [What's MiniGUI](#whats-minigui)
+ [MiniGUI Components](#minigui-components)
+ [Open Source Apps Based-on MiniGUI](#open-source-apps-based-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)
+ [Compositing schema](#compositing-schema)
+ [New main window types](#new-main-window-types)
+ [Virtual window](#virtual-window)
+ [Other enhancements](#other-enhancements)
+ [Compositing Schema](#compositing-schema)
+ [New Main Window Types](#new-main-window-types)
+ [Virtual Window](#virtual-window)
+ [Other Enhancements](#other-enhancements)
- [NEW FEATURES IN VERSION 4.0.x](#new-features-in-version-40x)
- [NEW FEATURES IN VERSION 3.2.x](#new-features-in-version-32x)
- [THE RUNTIME MODES OF MINIGUI](#the-runtime-modes-of-minigui)
- [A BRIEF BUILDING INSTRUCTION](#a-brief-building-instruction)
+ [Prerequisites](#prerequisites)
+ [Building Whole MiniGUI](#building-whole-minigui)
+ [Building MiniGUI Core](#building-minigui-core)
+ [Building whole MiniGUI](#building-whole-minigui)
+ [Unit Tests](#unit-tests)
- [HISTORY](#history)
- [AUTHORS AND COPYING](#authors-and-copying)
@@ -28,6 +32,8 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
## INTRODUCTION
### What's MiniGUI
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
User Interface) support system for embedded systems and smart IoT devices.
This is the version 5.0.x of MiniGUI maintained by WEI Yongming.
@@ -39,11 +45,13 @@ 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, and OSE.
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).
### MiniGUI Components
Besides MiniGUI Core, FMSoft also provides some components
for the developers to develop app much easier:
@@ -82,22 +90,80 @@ from the download zone of the site:
<http://www.minigui.com>
### Open Source Apps Based-on MiniGUI
FMSoft also releases some open source apps for MiniGUI on the site above,
for examples:
* mDolphin, licensed under Apache 2.0, is a full-featured
* `mDolphin`, licensed under Apache 2.0, is a full-featured
WEB/WAP browser, which is developed based on the open source browser
core WebKit and uses MiniGUI as its underlying graphics support system.
* mGallery, licensed under Apache 2.0, intends to
* `mGallery`, licensed under Apache 2.0, intends to
provide a total solution for PMP (Portable Multimedia Player),
which uses MiniGUI as the graphics platform.
* mSpider, licensed under GPL 3.0, intends to provide a
* `mSpider`, licensed under GPL 3.0, intends to provide a
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
* `mEagle`, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
### MiniGUI and HybridOS
[HybridOS](https://github.com/FMSoftCN/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.
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.
The following chart shows the graphics stack of HybridOS:
```
-----------------------------------------------
| MiniGUI/HybridOS Apps |
|-----------------------------------------------|
| | (Graphics Stack) |
| | ---------------------|
| | | hiMesa |
| | hiCairo | ------------------|
| | MiniGUI | | EGL for MiniGUI |
| C++ libs | hiDRMDrivers | | GL, GLES, VG |
| C libs | libDRM | | GPU drivers |
|-----------------------------------------------|
| Linux Kernel |
| -----------------------------------|
| | DRI and DRI Drivers |
-----------------------------------------------
```
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
MiniGUI DRM engine. The drivers implement the basic hardware accelerated
2D graphics operations of various GPUs for MiniGUI.
- `hiMesa` is the Mesa derivative for HybridOS, while Mesa is the open source
implementation of OpenGL and other graphics APIs, including OpenGL ES
(versions 1, 2, 3), OpenCL, OpenMAX, and Vulkan. It contains the following
components:
+ The implementation of OpenGL, OpenGL ES (v1, 2, 3), and other
graphics APIs.
+ The EGL implementation for MiniGUI platform.
+ The graphics drivers for various GPUs and a software driver called `swrast`.
- `hiCairo` is the Cairo derivative for HybridOS. Cairo is a 2D vector graphics
library for Gtk. We provide support for MiniGUI backend in `hiCairo`.
For more information about HybridOS, please refer to:
<https://hybridos.fmsoft.cn/>
### Source Code Repositories
FMSoft had created the public repositories for MiniGUI Core, MiniGUI
components, and other open source apps on GitHub. You can visit them on:
components, HybridOS, and other open source apps on GitHub. You can visit
them on:
<https://github.com/VincentWei>
@@ -114,7 +180,7 @@ We now maintain all documents about MiniGUI on the following public repo:
In version 5.0.0, we introduced some new and exciting features, and refactored
a lot basic modules of MiniGUI Core.
### Compositing schema
### Compositing Schema
In this version, we enhanced the MiniGUI-Processes runtime mode to support
the compositing schema. Under compositing schema, regardless a main window
@@ -136,7 +202,7 @@ implementation for multi-process environment:
- Better security. One client created by different user cannot
read/write contents in/to another windows owned by other clients.
### New main window types
### New Main Window Types
In this version, we also enhanced the window manager of MiniGUI Core
to support some special main window types.
@@ -162,7 +228,7 @@ There are eight levels in MiniGUI from top to bottom:
This enhancement allows us to create a special app which acts as
screen lock, docker, or launcher.
### Virtual window
### Virtual Window
You know that we can post or send a message to other windows which
may run in another thread under MiniGUI-Threads. The MiniGUI
@@ -193,7 +259,7 @@ and the new thread.
This enhancement provides a very useful facility to you in order to
develop a well-designed multithreaded application.
### Other enhancements
### Other Enhancements
We also tune or enhance the following modules of MiniGUI Core:
@@ -226,7 +292,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://github.com/VincentWei/minigui/blob/master/RELEASE-NOTES.md>
<https://github.com/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
## NEW FEATURES IN VERSION 4.0.x
@@ -257,7 +323,7 @@ in order to support [HybridOS Foundation Class Library].
For more information, please refer to `RELEASE-NOTES.md` file:
<https://github.com/VincentWei/minigui/blob/tree/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.
@@ -319,12 +385,30 @@ clients and the server.
## A BRIEF BUILDING INSTRUCTION
This instruction assumes that you are using Ubuntu Linux.
### Building Whole MiniGUI
### Prerequisites
If you are anxious to see the comprehensive demo of MiniGUI Core
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:
You should run `apt install <package_name>` to install the following packages
on your Ubuntu Linux.
<https://github.com/VincentWei/build-minigui-5.0>
or
<https://github.com/VincentWei/build-minigui-4.0>
or
<https://github.com/VincentWei/build-minigui-3.2>
### Building MiniGUI Core
We recommend that you use a latest Linux distribution with long term support,
for example, Ubuntu Linux LTS 16.04 or 18.04.
On Ubuntu Linux LTS 16.04 or 18.04, you should run `apt install <package_name>`
to install the following packages:
* Building tools:
* autoconf
@@ -333,8 +417,6 @@ on your Ubuntu Linux.
* libpng12-dev (use libpng-dev on Ubuntu Linux 18.04 LTS)
* libfreetype6-dev
### Building MiniGUI Core
MiniGUI Core uses GNU autoconf/automake scripts to configure and build the project.
Run
@@ -353,23 +435,6 @@ For more information, please run
$ ./configure --help
### Building whole MiniGUI
If you are anxious to see the comprehensive demo of MiniGUI Core
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:
<https://github.com/VincentWei/build-minigui-5.0>
or
<https://github.com/VincentWei/build-minigui-4.0>
or
<https://github.com/VincentWei/build-minigui-3.2>
### Unit Tests
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
@@ -483,7 +548,7 @@ A brief history description of the development progress is listed as follow:
1. Feb., 2018: FMSoft released MiniGUI version 3.2.0.
1. Apr., 2019: FMSoft released MiniGUI version 3.2.2.
1. Jul., 2019: FMSoft released MiniGUI version 4.0.0.
1. Apr., 2020: FMSoft released MiniGUI version 5.0.0.
1. Mar., 2020: FMSoft released MiniGUI version 5.0.0.
## AUTHORS AND COPYING
+93 -20
View File
@@ -1,7 +1,15 @@
# Release Notes
- [Version 4.9.2](#version-492)
+ [What's new in this version](#whats-new-in-this-version)
- [Version 5.0.5](#version-505)
+ [What's new in version 5.0.5](#whats-new-in-version-505)
- [Version 5.0.4](#version-504)
+ [What's new in version 5.0.4](#whats-new-in-version-504)
- [Version 5.0.3](#version-503)
+ [What's new in version 5.0.3](#whats-new-in-version-503)
- [Version 5.0.2](#version-502)
+ [What's new in version 5.0.2](#whats-new-in-version-502)
- [Version 5.0.0](#version-500)
+ [What's new in version 5.0.0](#whats-new-in-version-500)
+ [Compositing schema](#compositing-schema)
+ [New main window styles](#new-main-window-styles)
+ [Virtual window](#virtual-window)
@@ -10,25 +18,95 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis)
## Version 4.9.2
## Version 5.0.5
The MiniGUI development team announces the availability of MiniGUI 4.9.2,
which is the third preview release of MiniGUI 5.0.0.
The MiniGUI development team announces the availability of MiniGUI 5.0.5,
which is the bug fixing release of MiniGUI 5.0.x.
This is an unstable release to show you some new and exciting features.
Here `unstable` means that the new APIs we introduced in this version
may change in the official release.
### What's new in version 5.0.5
Nevertheless, we did our best to ensure backward compatibility of the
existed APIs so that the old applications can smoothly migrate to the new
version. We recommend that you test this version and report any bugs and
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Adjust the constants for `WS_XXXX` macros to avoid duplicated values.
Note that the binary backward-compatibility was broken. You should
rebuild all MiniGUI applications.
## Version 5.0.4
The MiniGUI development team announces the availability of MiniGUI 5.0.4,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.4
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Fix bugs in ServerGetWinZNodeRegion: must check for possible empty mask rect
and bad assignment of maskrect
- Fix a potential bug: only increase `nr_mask_rects` for not empty mask rectangle.
- Fix a bug: update surface of controls surface in `travel_children_with_priv_cdc`.
* ENHANCEMENTS:
- New IAL engine: `--enable-singletouchkeyial` to build the IAL engine for
single touch screen and key buttons.
## Version 5.0.3
The MiniGUI development team announces the availability of MiniGUI 5.0.3,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.3
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Always check expired timers even got `EINTR`.
- Add static modifier to `refresh_dirty_region` method of the fallback compositor.
- Fix a bug in `RegisterListenFD`.
- Fix a bug in `allocate_more_fd_slots`.
* TUNING:
- Rebuild the private data for all visible z-nodes after selected a new compositor.
* ENHANCEMENTS:
- New configuration option: `--enable-mgslicefallback` to build a fallback
implementation of mgslice.
- New API: `ServerGetTopmostZNodeOfType`.
- Merge some code by @ehello (<https://github.com/ehello>) for FreeRTOS.
## Version 5.0.2
The MiniGUI development team announces the availability of MiniGUI 5.0.2,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.2
In this version, we tuned some code for GCC 9 and fixed some bugs:
* BUGFIXING:
- Initialize `cfg_res_path` in function `__sysres_get_system_res_path()`.
- Always return TRUE in `subtract_rgn_by_node()`.
* ADJUSTMENTS:
- Use upstream Harfbuzz for glyph shaping of complex scripts instead
of the modified version.
* TUNING:
- Tune some code to depress compilation warnings.
## Version 5.0.0
The MiniGUI development team announces the availability of MiniGUI 5.0.0,
which is the first official release of MiniGUI 5.0.x.
This version brings us some new and exciting features, and we did our best
to ensure backward compatibility of the existed APIs so that the old
applications can smoothly migrate to the new version.
We recommend that you use this version and report any bugs and
incompatibilities in
<https://github.com/VincentWei/minigui/tree/dev-4-1>
<https://github.com/VincentWei/minigui/tree/rel-5-0>
### What's new in this version
### What's new in version 5.0.0
In the development of version 4.9.x, we introduced the following new and
In the development of version 5.0.x, we introduced the following new and
exciting features for MiniGUI:
* ENHANCEMENTS:
@@ -66,7 +144,7 @@ exciting features for MiniGUI:
* ADJUSTMENTS:
- `g_rcScr` now is defined a macro calling function `GetScreenRect()`.
- `mgIsServer` now is define a macro calling function `IsServer()`.
* TUNNING
* TUNING
- Tune the `drm` (DRM) engine to support MiniGUI-Processes runtime mode
and compositing schema.
- Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema.
@@ -82,11 +160,6 @@ exciting features for MiniGUI:
message queue, event/message handling, and part of graphics abstract
layer.
The following new features will be developed in the successive versions of
4.9.x:
- Enhance other frequently used GAL engines to support compositing schema.
### Compositing schema
In this version, we enhanced the MiniGUI-Processes runtime mode to support
+4 -4
View File
@@ -1,11 +1,11 @@
Version 5.0.0 (2019/03/31)
Version 5.0.5 (2021/01/31)
This is the second preview version of MiniGUI 5.0.0, an unstable version.
This is the first official release of MiniGUI 5.0.x, the stable version.
Other packages for MiniGUI resource, tools, components, and samples:
- GVFB: `gvfb-1.2.4.tar.gz`
- The resource package: `minigui-res-4.0.0.tar.gz`
- GVFB: `gvfb-1.2.5.tar.gz`
- The resource package: `minigui-res-5.0.0.tar.gz`
- mGUtils component: `libmgutils-1.5.0.tar.gz`
- mGPlus component: `libmgplus-1.5.0.tar.gz`
- mGEff component: `libmgeff-1.5.0.tar.gz`
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
rm config.cache config.status -f
./configure \
--disable-shared \
--enable-static \
--with-osname=freertos \
--with-targetname=external \
--with-runmode=sa \
--enable-mgslicefallback \
--disable-videopcxvfb \
--disable-videoqvfb \
--disable-videodrm \
--disable-videofbcon \
--enable-videocommlcd \
--enable-dummyial \
--disable-consoleial \
--disable-libinputial \
--enable-commial \
--disable-consoleimps2 \
--disable-mousecalibrate \
--enable-incoreres \
--disable-cursor \
--disable-clipboard \
--disable-adv2dapi \
--disable-savebitmap \
--disable-savescreen \
--disable-dblclk \
--disable-splash \
--disable-latin9support \
--disable-fullunicode \
--disable-rbfsupport \
--disable-vbfsupport \
--disable-upfsupport \
--disable-qpfsupport \
--disable-ttfsupport \
--disable-complexscripts \
--disable-ttfcache \
--disable-jpgsupport \
--disable-pngsupport \
--disable-flatlf \
--disable-textmode \
--disable-shmopen
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
rm config.cache config.status -f
./configure \
--disable-shared \
--enable-static \
--with-osname=linux \
--with-targetname=external \
--with-runmode=sa \
--enable-mgslicefallback \
--disable-videopcxvfb \
--disable-videoqvfb \
--disable-videodrm \
--disable-videofbcon \
--enable-videocommlcd \
--enable-dummyial \
--disable-consoleial \
--disable-libinputial \
--enable-commial \
--disable-consoleimps2 \
--disable-mousecalibrate \
--enable-incoreres \
--disable-cursor \
--disable-savebitmap \
--disable-savescreen \
--disable-dblclk \
--disable-splash \
--disable-latin9support \
--disable-fullunicode \
--disable-rbfsupport \
--disable-vbfsupport \
--disable-upfsupport \
--disable-qpfsupport \
--disable-ttfsupport \
--disable-complexscripts \
--disable-ttfcache \
--disable-jpgsupport \
--disable-pngsupport \
--disable-flatlf \
--disable-textmode
+36
View File
@@ -0,0 +1,36 @@
# set your own targaet_os
TARGET_OS=freertos
##################################################
# set your compile tool #
CC=arm-linux-gnueabihf-gcc
CXX=arm-linux-gnueabihf-g++
CPP=arm-linux-gnueabihf-g++
AR=arm-linux-gnueabihf-ar
AS=arm-linux-gnueabihf-as
RANLIB=arm-linux-gnueabihf-ranlib
MAKE=/usr/bin/make
##################################################
ARFLAGS=-rc
COFLAG=-c
OBJ=o
LIBA=a
##################################################
# if you don't want to create dynamic, delete it #
LIBSO=so
SOFLAGS=-fPIC -shared -o
##################################################
##################################################
# set your compile flags and install prefix path #
PREFIX=/usr/local
CFLAGS+=-g -Wall -fPIC
LDFLAGS+=
##################################################
+25 -10
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(libminigui, 4.9.2)
AC_INIT(libminigui, 5.0.5)
AC_CONFIG_SRCDIR(src/main/main.c)
dnl Set various version strings - taken gratefully from the SDL sources
@@ -14,9 +14,9 @@ dnl Set various version strings - taken gratefully from the SDL sources
# if backwards compatibility has been broken,
# set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0.
#
MINIGUI_MAJOR_VERSION=4
MINIGUI_MINOR_VERSION=9
MINIGUI_MICRO_VERSION=2
MINIGUI_MAJOR_VERSION=5
MINIGUI_MINOR_VERSION=0
MINIGUI_MICRO_VERSION=5
MINIGUI_INTERFACE_AGE=0
MINIGUI_BINARY_AGE=0
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
@@ -77,7 +77,7 @@ AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(time mktime localtime clock_gettime strdup strcasecmp strncasecmp strerror setlocale)
AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create poll select)
AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create access poll select)
PKG_CHECK_MODULES(UDEV, [libudev >= 200], have_udev="yes", have_udev="no; need libudev 200+")
@@ -132,6 +132,9 @@ build_console_ms3="no"
build_console_gpm="no"
build_text_mode="yes"
dnl single touch key engines
buid_singletouchkey_ial_engine="yes"
dnl the customized ial engine
build_dlcustom_ial_engine="no"
build_custom_ial_engine="no"
@@ -477,6 +480,10 @@ AC_ARG_ENABLE(libinputial,
[ --enable-libinputial build the IAL engine based on libinput <default=yes>],
build_libinput_ial_engine=$enableval)
AC_ARG_ENABLE(singletouchkey,
[ --enable-singletouchkey build the IAL engine based on single touch key <default=yes>],
buid_singletouchkey_ial_engine=$enableval)
AC_ARG_ENABLE(consoleial,
[ --enable-consoleial build the console (Linux console) IAL engine <default=yes>],
build_console_ial_engine=$enableval)
@@ -1621,6 +1628,7 @@ case "$with_osname" in
*)
with_osname="linux"
osname="Linux"
use_shmopen="yes"
AC_DEFINE(__LINUX__, 1,
[Define if compile for Linux])
;;
@@ -2014,6 +2022,11 @@ if test "x$build_libinput_ial_engine" = "xyes"; then
fi
fi
if test "x$buid_singletouchkey_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_SINGLETOUCHKEY, 1,
[Define if include single touch key IAL engine])
fi
if test "x$build_console_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_CONSOLE, 1,
[Define if include console (Linux console) IAL engine])
@@ -2143,7 +2156,7 @@ if test "x$build_ttf_support" = "xyes"; then
if test "x$build_complex_scripts" = "xyes"; then
dnl Check for HarfBuzz library
AC_CHECK_LIB(harfbuzz, hb_version,
DEP_LIBS="$DEP_LIBS -lharfbuzzex -lfreetype",
DEP_LIBS="$DEP_LIBS -lharfbuzz -lfreetype",
build_complex_scripts="no; support for complex scripts requires libharfbuzz")
else
DEP_LIBS="$DEP_LIBS -lfreetype",
@@ -2223,7 +2236,7 @@ if test "x$build_complex_scripts" = "xyes"; then
[ --with-hb-includes=DIR where the HarfBuzz includes are])
if test "x$with_hb_includes" = "x"; then
HB_INC_DIR="-I/usr/local/include/harfbuzz"
HB_INC_DIR="-I/usr/include/harfbuzz"
else
HB_INC_DIR="-I$with_hb_includes"
fi
@@ -2236,10 +2249,8 @@ if test "x$build_ttf_support" = "xyes"; then
AC_DEFINE(_MGFONT_FT2, 1,
[Define if support TrueType/OpenType fonts based on FreeType2])
with_ft2_includes=""
AC_ARG_WITH(ft2_includes,
[ --with-ft2-includes=DIR where the FreeType2 includes are],
with_ft2_includes=$withval)
[ --with-ft2-includes=DIR where the FreeType2 includes are])
if test "x$with_ft2_includes" = "x"; then
FT2_INC_DIR="-I/usr/include/freetype2"
@@ -2662,6 +2673,7 @@ AC_SUBST(MINIGUI_RUNMODE)
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")
AM_CONDITIONAL(MGIAL_NEXUS, test "x$build_nexus_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_DLCUSTOM, test "x$build_dlcustom_ial_engine" = "xyes")
@@ -2778,6 +2790,7 @@ AC_MSG_NOTICE([
* pc_xvfb: ${enable_video_pc_xvfb}
* usvfb: ${enable_video_usvfb}
* libinput: ${build_libinput_ial_engine}
* singletouchkey: ${buid_singletouchkey_ial_engine}
* console: ${build_console_ial_engine}
* comm: ${build_comm_ial_engine}
@@ -2798,6 +2811,8 @@ AC_MSG_NOTICE([
* CPP flags: ${CPPFLAGS}
* CC flags: ${CFLAGS}
* CXX flags: ${CXXFLAGS}
* FreeType2 includes: ${FT2_INC_DIR}
* HarfBuzz includes: ${HB_INC_DIR}
* Dep. libraries: ${DEP_LIBS}
])
+14 -1
View File
@@ -80,7 +80,20 @@ double_buffering=true
# The filename of the shared library for the external driver.
# The equivalent environment variable: MG_GAL_DRM_DRIVER
exdriver=libhidrmdrivers.so.0
exdriver=libhidrmdrivers-0.2.so.0
#}}
#{{ifdef _MGIAL_SINGLETOUCHKEY
[singletouchkey]
# The touch device; use none to disable touch event.
touch_dev=/dev/input/event0
# The key device; use none to disable key event.
key_dev=none
# The number of keys; only valid if the key device is not `none` and can be opened.
nr_keys=2
# The maps from Linux keycode to MiniGUI scancode; only valid if `nr_keys` > 0.
keycode2scancode0=20,1
keycode2scancode1=50,2
#}}
#{{ifdef _MGIAL_LIBINPUT
+7 -7
View File
@@ -298,7 +298,7 @@ typedef struct _DrmDriverOps {
ColorLogicalOp logic_op);
/**
* This operation blits pixles from a source buffer with the source alpha
* This operation blits pixels from a source buffer with the source alpha
* value specified to a destination buffer.
*
* \note If this operation is set as NULL, the driver does not support
@@ -310,7 +310,7 @@ typedef struct _DrmDriverOps {
uint8_t alpha);
/**
* This operation blits pixles from a source buffer to a destination buffer,
* This operation blits pixels from a source buffer to a destination buffer,
* but skipping the pixel value specified by \a color_key.
*
* \note If this operation is set as NULL, the driver does not support
@@ -322,7 +322,7 @@ typedef struct _DrmDriverOps {
uint32_t color_key);
/**
* This operation blits pixles from a source buffer with the source alpha
* This operation blits pixels from a source buffer with the source alpha
* value specified to a destination buffer, but skipping the pixel value
* specified.
*
@@ -335,7 +335,7 @@ typedef struct _DrmDriverOps {
uint8_t alpha, uint32_t color_key);
/**
* This operation blits pixles from a source buffer with the source alpha
* This operation blits pixels from a source buffer with the source alpha
* value of pixels to the destination buffer, and with the specified color
* compositing/blending method (\a ColorBlendMethod).
*
@@ -372,12 +372,12 @@ typedef struct _DrmDriverOps {
* For example, for Intel i915/i965 GPUs, the driver name will be `i915`.
* \param device_fd This argument gives the file descriptor of the
* opened DRI device.
* \param version A pointer to an integer which will contain the
* versionc of the DRM engine driver.
* \param version A pointer to an integer which will be used to return
* the interface version of the DRM engine driver.
*
* \return NULL or a valid pointer to DrmDriverOps.
*
* \note We use the version control since 4.0.7. It will be intialized
* \note We use the version control since 4.0.7. It will be initialized
* to zero by MiniGUI before calling this function. Because an old
* driver for MiniGUI 4.0.6 or earlier will not change the value,
* MiniGUI will deny to load the old driver.
+3 -3
View File
@@ -9992,7 +9992,7 @@ typedef Uint16 BreakOppo;
* allocated by this function if it allocates the buffer.
*
* \param lang_code The language code; not used so far, reserved for future.
* \param ctr The character transformation rule; see \a char_transform_rule.
* \param ctr The character transformation rule; see \a char_transform_rules.
* \param wbr The word breaking rule; see \a word_break_rules.
* \param lbp The line breaking policy; see \a line_break_policies.
* \param ucs The Uchar32 string.
@@ -10017,7 +10017,7 @@ typedef Uint16 BreakOppo;
*
* \note Only available when support for UNICODE is enabled.
*
* \sa DrawGlyphStringEx, word_break_rules, char_transform_rule,
* \sa DrawGlyphStringEx, word_break_rules, char_transform_rules,
* line_break_policies
*/
MG_EXPORT int GUIAPI UStrGetBreaks(LanguageCode lang_code,
@@ -13035,7 +13035,7 @@ MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
*
* \note Only available when support for UNICODE is enabled.
*
* \sa DrawGlyphStringEx, white_space_rules, char_transform_rule
* \sa DrawGlyphStringEx, white_space_rules, char_transform_rules
*
* Since 4.0.0
*/
+51 -17
View File
@@ -101,9 +101,9 @@ extern "C" {
#define ZOF_TYPE_NORMAL 0x30000000
#define ZOF_TYPE_HIGHER 0x40000000
#define ZOF_TYPE_DOCKER 0x50000000 // Since 5.0.0
#define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0;
#define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0
#define ZOF_TYPE_GLOBAL 0x70000000
#define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0; fixed and only one.
#define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0
#define ZOF_TYPE_POPUPMENU 0x90000000
#define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER
@@ -669,21 +669,22 @@ typedef void (* ON_NEW_DEL_CLIENT) (int op, int cli);
typedef void (* ON_CHANGE_LAYER) (int op, MG_Layer* layer,
MG_Client* client);
#define ZNOP_ALLOCATE 1
#define ZNOP_FREE 2
#define ZNOP_MOVE2TOP 3
#define ZNOP_SHOW 4
#define ZNOP_HIDE 5
#define ZNOP_MOVEWIN 6
#define ZNOP_SETACTIVE 7
#define ZNOP_ALLOCATE 1
#define ZNOP_FREE 2
#define ZNOP_MOVE2TOP 3
#define ZNOP_SHOW 4
#define ZNOP_HIDE 5
#define ZNOP_MOVEWIN 6
#define ZNOP_SETACTIVE 7
#define ZNOP_ENABLEWINDOW 11
#define ZNOP_DISABLEWINDOW 12
#define ZNOP_STARTDRAG 13
#define ZNOP_CANCELDRAG 14
#define ZNOP_CHANGECAPTION 15
#define ZNOP_REGIONCHANGED 16
#define ZNOP_COMPOSITINGCHANGED 17
#define ZNOP_ENABLEWINDOW 11
#define ZNOP_DISABLEWINDOW 12
#define ZNOP_STARTDRAG 13
#define ZNOP_CANCELDRAG 14
#define ZNOP_CHANGECAPTION 15
#define ZNOP_REGIONCHANGED 16
#define ZNOP_COMPOSITINGCHANGED 17
#define ZNOP_ICONCHANGED 18 /* reserved for future */
/**
* \var typedef void (* ON_ZNODE_OPERATION) (int op, int cli, int idx_znode)
@@ -889,6 +890,39 @@ MG_EXPORT BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer);
*/
MG_EXPORT BOOL GUIAPI ServerDeleteLayer (MG_Layer* layer);
/**
* \fn int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type,
* int* cli)
* \brief Get the topmost z-node in the specified layer for the specific
* window type from the server.
*
* This function gets the topmost z-node of the type specified by
* \a type in the specified layer \a layer from the server.
*
* \param layer The pointer to the layer, NULL for the current topmost layer.
* \param type The window type, can be one of the following values:
* - ZOF_TYPE_TOOLTIP
* - ZOF_TYPE_GLOBAL
* - ZOF_TYPE_SCREENLOCK
* - ZOF_TYPE_DOCKER
* - ZOF_TYPE_HIGHER
* - ZOF_TYPE_NORMAL
* - ZOF_TYPE_LAUNCHER
* \param cli The client identifier of the topmost z-node will be returned
* through this pointer. NULL is okay.
*
* \return The index of the topmost z-node of the specified type.
* Zero when there is no z-node in the level; < 0 when error.
*
* \note Server-only function. Note that this function will not return
* the z-node of the desktop, and the desktop always has the z-node index
* of zero.
*
* \sa ServerGetZNodeInfo
*/
MG_EXPORT int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type,
int* cli);
/**
* \fn int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode,
* int* cli)
@@ -1566,7 +1600,7 @@ typedef struct _CompositorOps {
* a main window with the extended style WS_EX_AUTOPOSITION.
*/
void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer,
DWORD zt_type, int first_for_type, CALCPOSINFO* info);
DWORD zt_type, int first_for_type, CALCPOSINFO* info, int cli);
/**
* This operation will be called when there was a layer operation.
+41 -41
View File
@@ -4280,39 +4280,62 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
*/
#define WS_DISABLED 0x04000000L
/* Main window states -- reserved for future use. */
#define WS_MINIMIZE 0x02000000L
#define WS_MAXIMIZE 0x01000000L
/**
* \def WS_VSCROLL
* \brief Creates a window with vertical scroll bar.
*/
#define WS_VSCROLL 0x02000000L
/* bits in this mask are reuse for main windows and controls;
bits have different meanings for main windows and controls.*/
#define WS_REUSE_MASK 0x00E00000L
/**
* \def WS_HSCROLL
* \brief Creates a window with horizontal scroll bar.
*/
#define WS_HSCROLL 0x01000000L
/* bits in this mask are both for main window and controls */
#define WS_BORDER_MASK 0x00F00000L
/**
* \def WS_DLGFRAME
* \brief The main window has a fixed frame, i.e. user can not
* drag the border of the window.
*/
#define WS_DLGFRAME 0x00800000L
#define WS_DLGFRAME 0x00800000L
/**
* \def WS_THICKFRAME
* \brief Creates a main window with thick frame.
*/
#define WS_THICKFRAME 0x00400000L
#define WS_THICKFRAME 0x00400000L
/**
* \def WS_THINFRAME
* \brief Creates a main window with thin frame.
*/
#define WS_THINFRAME 0x00200000L
#define WS_THINFRAME 0x00200000L
/**
* \def WS_BORDER
* \brief Creates a window with border.
*/
#define WS_BORDER 0x00100000L
/* bits in this mask are reuse for main windows and controls;
bits have different meanings for main windows and controls.*/
#define WS_MISC_MASK 0x000F0000L
/**
* \def WS_CHILD
* \brief Indicates the window is a child.
*/
#define WS_CHILD 0x00080000L
/**
* \def WS_GROUP
* \brief Indicates the control is the leader of a group.
* \note This style is valid only for controls.
*/
#define WS_GROUP 0x00800000L
#define WS_GROUP 0x00040000L
/**
* \def WS_TABSTOP
@@ -4320,7 +4343,11 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* using Tab key.
* \note This style is valid only for controls.
*/
#define WS_TABSTOP 0x00400000L
#define WS_TABSTOP 0x00020000L
/* Main window states -- reserved for future use. */
#define WS_MINIMIZE 0x00040000L
#define WS_MAXIMIZE 0x00020000L
/**
* \def WS_ALWAYSTOP
@@ -4328,38 +4355,11 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
*
* Since 5.0.0.
*/
#define WS_ALWAYSTOP 0x00100000L
/* bits in this mask are both for main windows and controls */
#define WS_MISC_MASK 0x000F0000L
/**
* \def WS_CHILD
* \brief Indicates the window is a child.
*/
#define WS_CHILD 0x00080000L
/**
* \def WS_VSCROLL
* \brief Creates a window with vertical scroll bar.
*/
#define WS_VSCROLL 0x00040000L
/**
* \def WS_HSCROLL
* \brief Creates a window with horizontal scroll bar.
*/
#define WS_HSCROLL 0x00020000L
/**
* \def WS_BORDER
* \brief Creates a window with border.
*/
#define WS_BORDER 0x00010000L
#define WS_ALWAYSTOP 0x00010000L
/* Obsolete styles, back-compatibility definitions. */
#define WS_OVERLAPPED 0x00000000L
#define WS_ABSSCRPOS 0x00000000L
#define WS_OVERLAPPED 0x00000000L
#define WS_ABSSCRPOS 0x00000000L
#define WS_MAINWIN_ONLY_MASK (WS_CAPTIONBAR_MASK | WS_ALWAYSTOP)
#define WS_CONTROL_ONLY_MASK (WS_CTRLMASK)
+4 -2
View File
@@ -1433,10 +1433,12 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
item_info->add_data = item->add_data;
if (item_info->which & MTB_WHICH_TEXT)
strncpy (item_info->text, item->text, NTB_TEXT_LEN);
//strncpy (item_info->text, item->text, NTB_TEXT_LEN);
strcpy (item_info->text, item->text);
if (item_info->which & MTB_WHICH_TIP)
strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
//strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
strcpy (item_info->tip, item->tip);
return NTB_OKAY;
}
+11 -13
View File
@@ -1012,8 +1012,9 @@ void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
{
char font_name [LEN_UNIDEVFONT_NAME + 1];
memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
//memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
//strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
strcpy(font_name, (*devfont)->name);
font_DelDevFont (font_name);
*devfont = NULL;
@@ -1069,25 +1070,22 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
added_num ++;
}
else {
/* [DK] Fix Bug #4801, which introduce a absolute path check error in Windows,
* first to load from sytem res path, else load it directly(relative or absolute path).*/
if ((add_dev_font (font_name, font_file, TRUE)) == TRUE)
/* [DK] Fix Bug #4801, which introduce an absolute path check error in Windows,
* first to load from sytem res path, else load it directly (relative or absolute path).*/
if (add_dev_font (font_name, font_file, TRUE))
added_num++;
else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1,
__sysres_get_system_res_path(), font_file))
&& ((add_dev_font (font_name, font_path, TRUE)) == TRUE))
__sysres_get_system_res_path(), font_file)) &&
add_dev_font (font_name, font_path, TRUE))
added_num++;
}
}
if (is_unload || added_num > 0 || added_num == font_num)
{
if (is_unload || added_num > 0 || added_num == font_num) {
return TRUE;
}
else
{
return FALSE;
}
return FALSE;
}
BOOL font_InitSpecificalFonts (char* etc_section)
+26 -31
View File
@@ -120,47 +120,42 @@ hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
return UCharDecompose(ab, a, b);
}
static hb_unicode_funcs_t *_funcs;
static hb_unicode_funcs_t *get_unicode_funcs(void)
{
if (_funcs)
return _funcs;
_funcs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (_funcs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (_funcs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (_funcs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (_funcs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (_funcs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (_funcs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (_funcs);
return _funcs;
}
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
/* extern hb_unicode_funcs_t *__mg_hb_unifuncs */
hb_unicode_funcs_t *__mg_hb_unifuncs;
void __mg_init_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
__hb_extern_get_unicode_funcs = get_unicode_funcs;
if (__mg_hb_unifuncs)
return;
__mg_hb_unifuncs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (__mg_hb_unifuncs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (__mg_hb_unifuncs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (__mg_hb_unifuncs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (__mg_hb_unifuncs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (__mg_hb_unifuncs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (__mg_hb_unifuncs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (__mg_hb_unifuncs);
return;
}
void __mg_term_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
if (_funcs) {
hb_unicode_funcs_destroy(_funcs);
if (__mg_hb_unifuncs) {
hb_unicode_funcs_destroy(__mg_hb_unifuncs);
}
else {
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
+3 -3
View File
@@ -3165,8 +3165,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);
@@ -5393,6 +5393,7 @@ static BOOL _wndInvalidateRect(HWND hWnd, const RECT* prc, BOOL bEraseBkgnd, int
#endif
}
else {
_WRN_PRINTF ("The invalid region is forzen\n");
return FALSE;
}
@@ -5573,7 +5574,6 @@ HDC GUIAPI BeginPaint (HWND hWnd)
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), HDC_INVALID);
pWin = MG_GET_WINDOW_PTR (hWnd);
if (pWin->pCaretInfo && pWin->pCaretInfo->fBlink) {
HideCaretEx (hWnd, FALSE);
pWin->pCaretInfo->fBlink = TRUE;
+3 -1
View File
@@ -50,6 +50,7 @@ DFB_SRCS = dfb.h dfb.c
USVFB_SRCS = usvfbinput.c usvfbinput.h
LIBINPUT_SRCS = linux-libinput.c linux-libinput.h
SINGLETOUCHKEY_SRCS = singletouchkey.c singletouchkey.h
if MGIAL_CONSOLE
native_libial_la_LIBADD = native/libnative.la
@@ -76,4 +77,5 @@ libial_la_SOURCES = $(COMMON_SRCS) $(DUMMY_SRCS) $(JZ4740_SRCS) \
$(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \
$(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \
$(TSLIB_SRCS) $(SHANDONG_LIDE_SRCS) $(CISCO_TOUCHPAD_SRCS) \
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS)
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS) \
$(SINGLETOUCHKEY_SRCS)
+7 -1
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~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
@@ -133,6 +133,9 @@
#ifdef _MGIAL_LIBINPUT
#include "linux-libinput.h"
#endif
#ifdef _MGIAL_SINGLETOUCHKEY
#include "singletouchkey.h"
#endif
static INPUT inputs [] =
{
@@ -212,6 +215,9 @@ static INPUT inputs [] =
#ifdef _MGIAL_LIBINPUT
{"libinput", ial_InitLibInput, TermLibInput},
#endif
#ifdef _MGIAL_SINGLETOUCHKEY
{"singletouchkey", ial_InitSingleTouchKey, TermSingleTouchKey},
#endif
/* ... end of general IAL engines */
};
+1 -3
View File
@@ -1243,11 +1243,9 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
break;
}
#if 0
default:
_DBG_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
_WRN_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
break;
#endif
}
libinput_event_destroy(event);
-1
View File
@@ -65,7 +65,6 @@
#include <sys/time.h>
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include "gdi.h"
#include "window.h"
+12 -6
View File
@@ -67,8 +67,6 @@
#include "gal.h"
#include "native.h"
static const char* event_dev;
static int EVENT_Open(const char *);
static void EVENT_Close(void);
static void EVENT_GetModifierInfo(int *modifiers);
@@ -85,6 +83,7 @@ KBDDEVICE kbddev_event = {
EVENT_Resume
};
static char* kbd_dev;
static int kbd_fd; /* file descriptor for keyboard */
/*
@@ -144,6 +143,7 @@ static int EVENT_Open (const char *device)
if (kbd_fd < 0)
return -1;
kbd_dev = strdup (device);
return kbd_fd;
}
@@ -153,8 +153,11 @@ static int EVENT_Open (const char *device)
*/
static void EVENT_Close(void)
{
close(kbd_fd);
close (kbd_fd);
kbd_fd = -1;
free (kbd_dev);
kbd_dev = NULL;
}
/*
@@ -203,7 +206,8 @@ static int EVENT_Read(unsigned char *buf, int *modifiers)
*/
static void EVENT_Suspend(void)
{
EVENT_Close();
close (kbd_fd);
kbd_fd = -1;
}
/* deactivate_keyboard:
@@ -211,10 +215,12 @@ static void EVENT_Suspend(void)
*/
static int EVENT_Resume(void)
{
kbd_fd = open (event_dev, O_NONBLOCK);
kbd_fd = open (kbd_dev, O_NONBLOCK);
if (kbd_fd < 0) {
return -1;
}else{
}
else {
return kbd_fd;
}
}
-1
View File
@@ -56,7 +56,6 @@
#include <sys/ioctl.h>
#include <signal.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include <errno.h>
#include "common.h"
+252
View File
@@ -0,0 +1,252 @@
//////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.cn/exception-list
//
//////////////////////////////////////////////////////////////////////////////
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include "common.h"
#ifdef _MGIAL_SINGLETOUCHKEY
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/input.h>
#include "minigui.h"
#include "misc.h"
#include "ial.h"
#include "singletouchkey.h"
#define LEN_TOUCH_DEV 127
static int sg_tp_event_fd = -1, sg_key_event_fd = -1;
static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0;
static int get_touch_data (short *x, short *y, short *button)
{
struct input_event data;
while (read (sg_tp_event_fd, &data, sizeof (data)) == sizeof (data)) {
/* do nothing for EV_SYN due to non-blocking read.
if (data.type == EV_SYN) {
if (data.code == SYN_REPORT) {
return 0;
}
else if (data.code == SYN_MT_REPORT) {
continue;
}
else {
return -1;
}
}
*/
if (data.type == EV_KEY) {
switch (data.code) {
case BTN_TOUCH:
if (data.value > 0)
*button = IAL_MOUSE_LEFTBUTTON;
else
*button = 0;
break;
default:
_WRN_PRINTF ("unknow event code for EV_KEY event: 0x%x, 0x%x\n", data.code, data.value);
return -1;
}
}
else if (data.type == EV_ABS) {
switch (data.code) {
case ABS_X:
*x = data.value;
break;
case ABS_Y:
*y = data.value;
break;
case ABS_MT_POSITION_X:
*x = data.value;
break;
case ABS_MT_POSITION_Y:
*y = data.value;
break;
case ABS_MT_TOUCH_MAJOR:
break;
case ABS_MT_WIDTH_MAJOR:
break;
case ABS_MT_TRACKING_ID:
break;
default:
_WRN_PRINTF ("unknow event code for EV_ABS event: 0x%x, 0x%x.\n", data.code, data.value);
break;
}
}
}
return 0;
}
static int mouse_update (void)
{
if (get_touch_data (&MOUSEX, &MOUSEY, &MOUSEBUTTON) == 0)
return 1;
return 0;
}
static void mouse_getxy (int *x, int* y)
{
*x = MOUSEX;
*y = MOUSEY;
}
static int mouse_getbutton (void)
{
if (MOUSEBUTTON == IAL_MOUSE_LEFTBUTTON)
return IAL_MOUSE_LEFTBUTTON;
return 0;
}
static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *except,
struct timeval *timeout)
{
fd_set rfds;
int e;
int retvalue = 0;
if (!in) {
in = &rfds;
FD_ZERO (in);
}
FD_SET (sg_tp_event_fd, in);
if (sg_tp_event_fd > maxfd)
maxfd = sg_tp_event_fd;
if (sg_key_event_fd >= 0) {
FD_SET (sg_key_event_fd, in);
if (sg_key_event_fd > maxfd)
maxfd = sg_key_event_fd;
}
e = select (maxfd + 1, in, out, except, timeout);
if (e > 0) {
if (FD_ISSET (sg_tp_event_fd, in)) {
retvalue |= IAL_MOUSEEVENT;
}
if (sg_key_event_fd >= 0 && FD_ISSET (sg_key_event_fd, in)) {
retvalue |= IAL_KEYEVENT;
}
}
else if (e < 0) {
retvalue = -1;
}
else {
retvalue = 0;
}
return retvalue;
}
BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype)
{
char touch_dev[LEN_TOUCH_DEV + 1];
if (GetMgEtcValue ("singletouchkey", "touch_dev", touch_dev, LEN_TOUCH_DEV) < 0) {
strcpy (touch_dev, "none");
}
if (strcmp (touch_dev, "none") == 0) {
_WRN_PRINTF ("no touch_dev defined.\n");
return FALSE;
}
sg_tp_event_fd = open (touch_dev, O_RDONLY | O_NONBLOCK);
if (sg_tp_event_fd < 0) {
_WRN_PRINTF ("failed when opening touch event device: %s\n", touch_dev);
return FALSE;
}
input->update_mouse = mouse_update;
input->get_mouse_xy = mouse_getxy;
input->set_mouse_xy = NULL;
input->get_mouse_button = mouse_getbutton;
input->set_mouse_range = NULL;
input->suspend_mouse= NULL;
input->resume_mouse = NULL;
input->update_keyboard = NULL;
input->get_keyboard_state = NULL;
input->suspend_keyboard = NULL;
input->resume_keyboard = NULL;
input->set_leds = NULL;
input->wait_event = wait_event;
return TRUE;
}
void TermSingleTouchKey (void)
{
if (sg_tp_event_fd >= 0)
close (sg_tp_event_fd);
if (sg_key_event_fd >= 0)
close (sg_key_event_fd);
}
#endif /* _MGIAL_SINGLETOUCHKEY */
+68
View File
@@ -0,0 +1,68 @@
///////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.cn/exception-list
//
//////////////////////////////////////////////////////////////////////////////
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
*/
/*
** linux-libinput.h: the head file of the IAL engine based on libinput.
**
** Created by Wei YongMing, 2019/06/10
*/
#ifndef GUI_IAL_SINGLETOUCHKEY_H
#define GUI_IAL_SINGLETOUCHKEY_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype);
void TermSingleTouchKey (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GUI_IAL_SINGLETOUCHKEY_H */
+1 -1
View File
@@ -7,4 +7,4 @@ noinst_HEADERS = \
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 \
linux-tty.h debug.h
linux-tty.h debug.h map.h
+34 -19
View File
@@ -77,7 +77,7 @@ struct _CompositorCtxt {
CLIPRGN wins_rgn; // visible region for all windows (subtract popup menus)
CLIPRGN dirty_rgn; // the dirty region
CLIPRGN inv_rgn; // the invalid region for a specific znode
//Uint32 dirty_types;// the dirty znode types.
Uint32 dirty_types;// the dirty znode types.
};
static CompositorCtxt* initialize (const char* name)
@@ -334,9 +334,11 @@ static void composite_ppp_znodes (CompositorCtxt* ctxt)
ClipRgnIntersect (&ctxt->inv_rgn, &ctxt->dirty_rgn, rgn);
if (IsEmptyClipRgn (&ctxt->inv_rgn)) {
ServerReleasePopupMenuZNodeHeader (zidx);
break;
_DBG_PRINTF ("ppp %d skipped\n", zidx);
continue;
}
else {
_DBG_PRINTF ("ppp %d composited\n", zidx);
// blit this popup menu to screen
SelectClipRegion (HDC_SCREEN_SYS, &ctxt->inv_rgn);
BitBlt (znode_hdr->mem_dc, 0, 0,
@@ -530,7 +532,7 @@ static void rebuild_wins_region (CompositorCtxt* ctxt)
}
static void calc_mainwin_pos (CompositorCtxt* ctxt, MG_Layer* layer,
DWORD zt_type, int first_for_type, CALCPOSINFO* info)
DWORD zt_type, int first_for_type, CALCPOSINFO* info, int cli)
{
/* give a default size first */
if (IsRectEmpty (&info->rc)) {
@@ -612,14 +614,15 @@ static BOOL reset_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
if (layer != mgTopmostLayer)
return FALSE;
//ctxt->dirty_types = 0;
ctxt->dirty_types = 0;
EmptyClipRgn (&ctxt->dirty_rgn);
return TRUE;
}
static BOOL generate_dirty_region (CompositorCtxt* ctxt,
static BOOL merge_dirty_region (CompositorCtxt* ctxt,
const ZNODEHEADER* znode_hdr, const CLIPRGN* znode_rgn)
{
EmptyClipRgn (&ctxt->inv_rgn);
if (znode_hdr && znode_hdr->dirty_rcs) {
int i;
for (i = 0; i < znode_hdr->nr_dirty_rcs; i++) {
@@ -628,16 +631,23 @@ static BOOL generate_dirty_region (CompositorCtxt* ctxt,
// device coordinates to screen coordinates
rc = znode_hdr->dirty_rcs [i];
OffsetRect (&rc, znode_hdr->rc.left, znode_hdr->rc.top);
AddClipRect (&ctxt->dirty_rgn, &rc);
AddClipRect (&ctxt->inv_rgn, &rc);
}
if (znode_rgn)
IntersectRegion (&ctxt->dirty_rgn, &ctxt->dirty_rgn, znode_rgn);
IntersectRegion (&ctxt->inv_rgn, &ctxt->inv_rgn, znode_rgn);
else
IntersectClipRect (&ctxt->dirty_rgn, &ctxt->rc_screen);
IntersectClipRect (&ctxt->inv_rgn, &ctxt->rc_screen);
}
return !IsEmptyClipRgn (&ctxt->dirty_rgn);
if (IsEmptyClipRgn (&ctxt->inv_rgn)) {
return FALSE;
}
UnionRegion (&ctxt->dirty_rgn, &ctxt->dirty_rgn, &ctxt->inv_rgn);
EmptyClipRgn (&ctxt->inv_rgn);
return TRUE;
}
static BOOL merge_dirty_ppp (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
@@ -649,15 +659,16 @@ static BOOL merge_dirty_ppp (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
_DBG_PRINTF("called: %d\n", zidx);
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer || zidx <= 0)
if (layer != mgTopmostLayer)
return rc;
znode_hdr = ServerGetPopupMenuZNodeHeader (zidx, (void**)&rgn, TRUE);
if (generate_dirty_region (ctxt, znode_hdr, rgn)) {
//ctxt->dirty_types |= DIRTY_ZT_PPP;
if (merge_dirty_region (ctxt, znode_hdr, rgn)) {
ctxt->dirty_types |= DIRTY_ZT_PPP;
rc = TRUE;
}
ServerReleasePopupMenuZNodeHeader (zidx);
return rc;
}
@@ -668,15 +679,15 @@ static BOOL merge_dirty_win (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
CLIPRGN *rgn;
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer || zidx <= 0)
if (layer != mgTopmostLayer)
return rc;
_DBG_PRINTF("called: %d\n", zidx);
/* merge the dirty region */
znode_hdr = ServerGetWinZNodeHeader (NULL, zidx, (void**)&rgn, TRUE);
if (generate_dirty_region (ctxt, znode_hdr, rgn)) {
//ctxt->dirty_types |= DIRTY_ZT_WIN;
if (merge_dirty_region (ctxt, znode_hdr, rgn)) {
ctxt->dirty_types |= DIRTY_ZT_WIN;
rc = TRUE;
}
ServerReleaseWinZNodeHeader (NULL, zidx);
@@ -689,10 +700,10 @@ static BOOL merge_dirty_wpp (CompositorCtxt* ctxt, MG_Layer* layer)
const ZNODEHEADER* znode_hdr;
znode_hdr = ServerGetWinZNodeHeader (NULL, 0, NULL, TRUE);
if (generate_dirty_region (ctxt, znode_hdr, NULL)) {
if (merge_dirty_region (ctxt, znode_hdr, NULL)) {
tile_dirty_region_for_wallpaper (ctxt);
//subtract_opaque_win_znodes_above (ctxt, 0);
//ctxt->dirty_types |= DIRTY_ZT_WPP;
ctxt->dirty_types |= DIRTY_ZT_WPP;
rc = TRUE;
}
@@ -700,16 +711,19 @@ static BOOL merge_dirty_wpp (CompositorCtxt* ctxt, MG_Layer* layer)
return rc;
}
BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
static BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
{
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer || IsEmptyClipRgn (&ctxt->dirty_rgn))
return FALSE;
composite_ppp_znodes (ctxt);
if (ctxt->dirty_types & DIRTY_ZT_PPP)
composite_ppp_znodes (ctxt);
composite_on_dirty_region (ctxt, 0);
EmptyClipRgn (&ctxt->dirty_rgn);
SyncUpdateDC (HDC_SCREEN_SYS);
return TRUE;
}
@@ -888,6 +902,7 @@ static void on_changed_rgn (CompositorCtxt* ctxt, MG_Layer* layer,
assert (znode_hdr);
if (!(znode_hdr->flags & ZNIF_VISIBLE)) {
_DBG_PRINTF("not a visible window\n");
return;
}
+71 -31
View File
@@ -270,8 +270,9 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
if (!ops->reset_dirty_region (ctxt, layer))
return;
/* travel menu znodes on the layer */
if (zi->nr_popupmenus > 0) {
/* travel menu znodes on the layer;
this will only work for topmost layer */
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc);
@@ -301,21 +302,23 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
}
}
/* check wallpaper pattern */
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
assert (pdc->surface->dirty_info);
lock_znode_surface (pdc, nodes);
changes_in_dc = pdc->surface->dirty_info->dirty_age;
if (changes_in_dc != nodes[0].changes) {
ops->merge_dirty_wpp (ctxt, layer);
/* check wallpaper pattern; only call for topmost layer */
if (layer == mgTopmostLayer) {
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
assert (pdc->surface->dirty_info);
lock_znode_surface (pdc, nodes);
changes_in_dc = pdc->surface->dirty_info->dirty_age;
if (changes_in_dc != nodes[0].changes) {
ops->merge_dirty_wpp (ctxt, layer);
}
}
}
ops->refresh_dirty_region (ctxt, layer);
/* unlock the znode surfaces for popup menus */
if (zi->nr_popupmenus > 0) {
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc);
@@ -338,12 +341,15 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
}
}
/* unlock the znode surfaces for wallpaper patter */
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
nodes[0].changes = pdc->surface->dirty_info->dirty_age;
pdc->surface->dirty_info->nr_dirty_rcs = 0;
unlock_znode_surface (pdc, nodes);
/* unlock the znode surfaces for wallpaper pattern;
only for topmost layer */
if (layer == mgTopmostLayer) {
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
nodes[0].changes = pdc->surface->dirty_info->dirty_age;
pdc->surface->dirty_info->nr_dirty_rcs = 0;
unlock_znode_surface (pdc, nodes);
}
}
}
@@ -371,16 +377,16 @@ void __mg_composite_dirty_znodes (void)
#endif /* optimized */
static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
CompositorCtxt* ctxt, MG_Layer* layer)
static void purge_all_znodes_private_data (const CompositorOps* ops,
CompositorCtxt* ctxt)
{
ZORDERINFO* zi;
ZORDERNODE* nodes;
int i, next;
MG_Layer* layer;
zi = (ZORDERINFO*)layer->zorder_info;
// travel popup menu znodes
/* travel menu znodes on the topmost layer */
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
@@ -391,25 +397,56 @@ static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
}
}
// travel window znodes
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].priv_data && ops->purge_win_data) {
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
nodes[next].priv_data = NULL;
/* travel all window znodes in all layers */
layer = mgLayers;
while (layer) {
zi = (ZORDERINFO*)layer->zorder_info;
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].priv_data && ops->purge_win_data) {
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
nodes[next].priv_data = NULL;
}
}
layer = layer->next;
}
}
static inline void purge_all_znodes_private_data (const CompositorOps* ops,
static void rebuild_all_znodes_private_data (const CompositorOps* ops,
CompositorCtxt* ctxt)
{
ZORDERINFO* zi;
ZORDERNODE* nodes;
int i, next;
MG_Layer* layer;
/* travel menu znodes on the topmost layer */
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
if (nodes[i].flags & ZOF_VISIBLE) {
ops->on_showing_ppp (ctxt, i);
}
}
}
/* travel all window znodes in all layers */
layer = mgLayers;
while (layer) {
purge_znodes_private_data_in_layer (ops, ctxt, layer);
zi = (ZORDERINFO*)layer->zorder_info;
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].flags & ZOF_VISIBLE) {
ops->on_showing_win (ctxt, layer, next);
}
}
layer = layer->next;
}
}
@@ -533,6 +570,9 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
}
curr_ops = ops;
curr_ctxt = ctxt;
/* Since 5.0.3, to rebuild the private data of visible znodes */
rebuild_all_znodes_private_data (curr_ops, curr_ctxt);
curr_ops->refresh (ctxt);
}
+2 -2
View File
@@ -48,7 +48,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
{
FILE* fp;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
int w=0, h=0, xhot=0, yhot=0, colornum=0;
#if 0
DWORD32 size;
#endif
@@ -152,7 +152,7 @@ static HCURSOR load_cursor_from_mem (const void* area)
const Uint8* p = (Uint8*)area;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
int w=0, h=0, xhot=0, yhot=0, colornum=0;
#if 0
DWORD32 size;
#endif
+44 -24
View File
@@ -298,8 +298,10 @@ static int update_client_window_rgn (int cli, HWND hwnd)
msg.lParam = MAKELONG (crc->rc.right, crc->rc.bottom);
ret = __mg_send2client (&msg, mgClients + cli);
if (ret < 0)
if (ret < 0) {
_WRN_PRINTF ("__mg_send2client failed\n");
break;
}
crc = crc->next;
}
@@ -830,7 +832,6 @@ static int srvAllocZOrderNode (int cli, HWND hwnd, HWND main_win,
if (surf) {
memdc = CreateMemDCFromSurface (surf);
_WRN_PRINTF ("surface (%p) refcount: %d\n", surf, surf->refcount);
if (memdc == HDC_INVALID) {
if (cli > 0) {
GAL_FreeSurface (surf);
@@ -867,16 +868,25 @@ static BOOL _cb_update_cli_znode (void* context,
if (znode->cli == cli && znode->flags & ZOF_VISIBLE && znode->hwnd) {
MSG msg = {znode->hwnd, MSG_UPDATECLIWIN, 0, 0, __mg_tick_counter};
if (!IsRectEmpty(&(znode->dirty_rc))) {
if (!IsRectEmpty(&znode->dirty_rc)) {
IntersectRect(&rcInv, &znode->dirty_rc, &rcScr);
if (IntersectRect(&rcScr, &znode->rc, &rcScr) &&
IntersectRect(&rcInv, &znode->dirty_rc, &rcScr)) {
rcInv = znode->dirty_rc;
msg.wParam = MAKELONG (rcInv.left, rcInv.top);
msg.lParam = MAKELONG (rcInv.right, rcInv.bottom);
msg.wParam = MAKELONG (rcInv.left, rcInv.top);
msg.lParam = MAKELONG (rcInv.right, rcInv.bottom);
_DBG_PRINTF ("Send MSG_UPDATECLIWIN to client window (%s): "
"%d, %d, %d x %d\n",
znode->caption,
rcInv.left, rcInv.top,
rcInv.right - rcInv.left,
rcInv.bottom - rcInv.top);
SetRectEmpty (&(znode->dirty_rc));
__mg_send2client (&msg, mgClients + znode->cli);
}
__mg_send2client (&msg, mgClients + znode->cli);
SetRectEmpty (&znode->dirty_rc);
return TRUE;
}
}
@@ -1201,6 +1211,7 @@ static int do_drag_drop_window (int msg, int x, int y)
#ifndef _MGSCHEMA_COMPOSITING
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
_dd_info.rc.right, _dd_info.rc.bottom);
SyncUpdateDC (HDC_SCREEN_SYS);
#else /* not defined _MGSCHEMA_COMPOSITING */
msg.wParam = MAKELONG (_dd_info.rc.left, _dd_info.rc.top);
@@ -1228,6 +1239,7 @@ static int do_drag_drop_window (int msg, int x, int y)
SetPenColor (HDC_SCREEN_SYS, PIXEL_lightwhite);
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
_dd_info.rc.right, _dd_info.rc.bottom);
SyncUpdateDC (HDC_SCREEN_SYS);
#endif /* not defined _MGSCHEMA_COMPOSITING */
/* post MSG_WINDOWDROPPED to the target window */
@@ -1344,6 +1356,10 @@ intptr_t __mg_do_zorder_maskrect_operation (int cli,
get_layer_from_client (cli), info->idx_znode, &rc_org_bound);
#endif
}
else {
_ERR_PRINTF("KERNEL: failed in __mg_do_zorder_maskrect_operation\n");
}
return ret;
}
@@ -4524,7 +4540,7 @@ BOOL GUIAPI ServerGetWinZNodeRegion (MG_Layer* layer, int idx_znode,
DWORD rgn_ops, CLIPRGN* dst_rgn)
{
RECT rc;
MASKRECT *maskrect;
MASKRECT *firstmaskrect = NULL, *maskrect;
ZORDERNODE* nodes;
ZORDERINFO* zi;
int idx, nr_mask_rects;
@@ -4556,33 +4572,37 @@ BOOL GUIAPI ServerGetWinZNodeRegion (MG_Layer* layer, int idx_znode,
nr_mask_rects = 0;
nodes = GET_ZORDERNODE(zi);
maskrect = GET_MASKRECT(zi);
firstmaskrect = GET_MASKRECT(zi);
idx = nodes [idx_znode].idx_mask_rect;
while (idx) {
maskrect = firstmaskrect + idx;
rc.left = maskrect->left;
rc.top = maskrect->top;
rc.right = maskrect->left;
rc.right = maskrect->right;
rc.bottom = maskrect->bottom;
if (rgn_ops & RGN_OP_FLAG_ABS) {
OffsetRect (&rc, nodes[idx_znode].rc.left, nodes[idx_znode].rc.top);
}
if (!IsRectEmpty (&rc)) {
if (rgn_ops & RGN_OP_FLAG_ABS) {
OffsetRect (&rc, nodes[idx_znode].rc.left, nodes[idx_znode].rc.top);
}
if ((rgn_ops & RGN_OP_MASK) == RGN_OP_EXCLUDE) {
if (!SubtractClipRect (dst_rgn, &rc)) {
nr_mask_rects = -1;
goto __mg_err_ret;
if ((rgn_ops & RGN_OP_MASK) == RGN_OP_EXCLUDE) {
if (!SubtractClipRect (dst_rgn, &rc)) {
nr_mask_rects = -1;
goto __mg_err_ret;
}
}
}
else {
if (!AddClipRect (dst_rgn, &rc)) {
nr_mask_rects = -1;
goto __mg_err_ret;
else {
if (!AddClipRect (dst_rgn, &rc)) {
nr_mask_rects = -1;
goto __mg_err_ret;
}
}
nr_mask_rects ++;
}
idx = maskrect->next;
nr_mask_rects ++;
}
if (nr_mask_rects == 0) {
+57 -36
View File
@@ -188,7 +188,7 @@ static BOOL subtract_rgn_by_node (PCLIPRGN region, const ZORDERINFO* zi,
else
SubtractClipRect(region, &(node->rc));
return TRUE;
return TRUE; // !IsEmptyClipRgn(region); We must return TRUE for this callback.
}
#else /* not defined _MGSCHEMA_COMPOSITING */
@@ -427,15 +427,18 @@ void __mg_update_window (HWND hwnd,
((pWin->WinType == TYPE_CONTROL &&
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)) ||
pWin->WinType != TYPE_CONTROL) && pWin->dwStyle & WS_VISIBLE) {
RECT invrc;
SetRect(&invrc, left, top, right, bottom);
RECT rcInv;
SetRect(&rcInv, left, top, right, bottom);
if (IsRectEmpty (&invrc)) {
_DBG_PRINTF ("Update window (%s): %d, %d, %d, %d\n",
pWin->spCaption, left, top, right, bottom);
if (IsRectEmpty (&rcInv)) {
SendAsyncMessage ((HWND)pWin, MSG_NCPAINT, 0, 0);
InvalidateRect ((HWND)pWin, NULL, TRUE);
}
else {
RECT rcTemp, rcInv, rcWin;
RECT rcTemp, rcWin;
if (pWin->WinType == TYPE_CONTROL &&
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)){
@@ -444,13 +447,18 @@ void __mg_update_window (HWND hwnd,
else
GetWindowRect(hwnd, &rcWin);
if (IntersectRect (&rcTemp,
&rcWin, &invrc)) {
/* XXX: when we move a window fast, there are some dirty rectangles
were not updated. We update whole area of the window for a work
around. */
if (IntersectRect (&rcTemp, &rcWin, &rcInv)) {
dskScreenToWindow (pWin, &rcTemp, &rcInv);
SendAsyncMessage ((HWND)pWin,
MSG_NCPAINT, 0, (LPARAM)(&rcInv));
MSG_NCPAINT, 0, 0); // (LPARAM)(&rcInv));
dskScreenToClient (pWin, &rcTemp, &rcInv);
InvalidateRect ((HWND)pWin, &rcInv, TRUE);
InvalidateRect ((HWND)pWin, NULL/*&rcInv*/, TRUE);
}
else {
_DBG_PRINTF ("IGNORED update\n");
}
}
}
@@ -465,6 +473,9 @@ static int update_client_window (ZORDERNODE* znode, const RECT* rc)
if (znode->cli != 0) {
if (rc) {
_DBG_PRINTF ("Update window (%s): %d, %d, %d x %d\n",
znode->caption, rc->left, rc->top,
RECTWP(rc), RECTHP(rc));
if (IsRectEmpty (&znode->dirty_rc)) {
SetRect (&znode->dirty_rc,
@@ -473,8 +484,8 @@ static int update_client_window (ZORDERNODE* znode, const RECT* rc)
else {
GetBoundRect (&znode->dirty_rc, &znode->dirty_rc, rc);
}
mgClients [znode->cli].has_dirty = TRUE;
}
mgClients [znode->cli].has_dirty = TRUE;
}
else
#endif /* defined _MGRM_PROCESSES */
@@ -494,7 +505,13 @@ static BOOL _cb_update_znode (void* context,
{
const RECT* rc = (RECT*)context;
if (znode->flags & ZOF_VISIBLE && znode->flags & ZOF_IF_REFERENCE) {
_DBG_PRINTF ("Checking window (%s), visibility: %s, referred: %s\n", znode->caption,
(znode->flags & ZOF_VISIBLE)? "TRUE" : "FALSE",
(znode->flags & ZOF_IF_REFERENCE)? "TRUE" : "FALSE");
if (znode->flags & ZOF_VISIBLE &&
znode->flags & ZOF_IF_REFERENCE) {
_DBG_PRINTF ("Widnow (%s) will be updated\n", znode->caption);
update_client_window (znode, rc);
znode->flags &= ~ZOF_IF_REFERENCE;
return TRUE;
@@ -2561,6 +2578,8 @@ static DWORD get_znode_flags_from_style (PMAINWIN pWin)
return zt_type;
}
/* TODO: this function should be optimized to avoid allocating space for
invalid (empty) mask rectangles */
static int AllocZOrderMaskRect (int cli, int idx_znode,
int flags, const RECT4MASK *rc, const int nr_rc)
{
@@ -2582,24 +2601,24 @@ static int AllocZOrderMaskRect (int cli, int idx_znode,
/*get mask rect number*/
idx = nodes[idx_znode].idx_mask_rect;
while(idx) {
while (idx) {
old_num++;
idx = ((MASKRECT *)(firstmaskrect+idx))->next;
idx = ((MASKRECT *)(firstmaskrect + idx))->next;
}
if (nr_rc > old_num) {
/* check the number of mask rect if enough */
int idle =
__mg_get_nr_idle_slots((unsigned char*)GET_MASKRECT_USAGEBMP(zi),
__mg_get_nr_idle_slots ((unsigned char*)GET_MASKRECT_USAGEBMP(zi),
zi->size_maskrect_usage_bmp);
if (idle < nr_rc-old_num) {
if (idle < nr_rc - old_num) {
unlock_zi_for_change (zi);
return -1;
}
/*add new space to Znode*/
idx = nodes[idx_znode].idx_mask_rect;
for(i = 0; i < nr_rc-old_num; i++) {
for (i = 0; i < nr_rc - old_num; i++) {
free_slot = __mg_lookfor_unused_slot (
(unsigned char*)GET_MASKRECT_USAGEBMP(zi),
zi->size_maskrect_usage_bmp, 1);
@@ -3235,7 +3254,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
slot = nodes [idx_znode].next;
for (; slot != 0; slot = nodes [slot].next) {
if (nodes [slot].flags & ZOF_VISIBLE &&
DoesIntersect (rcWin, &nodes [slot].rc)) {
DoesIntersect (rcWin, &nodes [slot].rc)) {
nodes [slot].age++;
}
}
@@ -3248,6 +3267,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
//SetClipRgn (&sg_UpdateRgn, rcInv + i);
SetClipRgn (&sg_UpdateRgn, &(nodes [idx_znode].rc));
/* znodes below current znode in the same level */
slot = nodes [idx_znode].next;
for (; slot > 0; slot = nodes [slot].next) {
if (nodes [slot].flags & ZOF_VISIBLE &&
@@ -3258,6 +3278,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
}
/* znodes below current level */
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
if (type > _zof_types_for_level[level]) {
slot = zi->first_in_levels[level];
@@ -3372,12 +3393,10 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
do_for_all_znodes (NULL, zi, _cb_exclude_rc, ZT_ALL);
}
while (slot && slot != idx_znode) {
#if 0
if (nodes [slot].flags & ZOF_VISIBLE) {
ExcludeClipRect (HDC_SCREEN_SYS, &nodes [slot].rc);
}
#endif
while (slot) {
if (slot == idx_znode)
break;
/* houhh 20090730, if slot window is no regular.*/
if (nodes [slot].flags & ZOF_VISIBLE) {
if (nodes[slot].idx_mask_rect == 0) {
@@ -3404,6 +3423,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
slot = nodes [slot].next;
}
BitBlt (HDC_SCREEN_SYS, rcOld.left, rcOld.top,
MIN (RECTWP (rcWin), RECTW (rcOld)),
MIN (RECTHP (rcWin), RECTH (rcOld)),
@@ -3417,17 +3437,22 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
#endif
/* unlock zi for change ... */
unlock_zi_for_change (zi);
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
/* check the invalid rect of the window */
if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
nodes [0].flags &= ~ZOF_IF_REFERENCE;
}
/* check the invalid rectangles of the being moved window */
EmptyClipRgn (&sg_UpdateRgn);
nInvCount = SubtractRect (rcInv, &rcOld, &rcScr);
for (i = 0; i < nInvCount; i++) {
AddClipRect (&sg_UpdateRgn, rcInv + i);
}
/* Since 5.0.0: handle levels */
/* Since 5.0.0: handle levels above the current level */
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
if (type < _zof_types_for_level[level]) {
slot = zi->first_in_levels[level];
@@ -3439,6 +3464,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
}
/* handle znodes above the current znode */
slot = *first;
for (; slot != idx_znode; slot = nodes [slot].next) {
if (nodes [slot].flags & ZOF_VISIBLE &&
@@ -3446,20 +3472,15 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
AddClipRect(&sg_UpdateRgn, &rcInter);
}
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
nodes [0].flags &= ~ZOF_IF_REFERENCE;
}
OffsetRegion (&sg_UpdateRgn,
rcWin->left - rcOld.left,
rcWin->top - rcOld.top);
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);
@@ -4389,7 +4410,7 @@ static int dskCalculateDefaultPosition (int cli, CALCPOSINFO* info)
#ifdef _MGSCHEMA_COMPOSITING /* not defined _MGSCHEMA_COMPOSITING */
DO_COMPSOR_OP_ARGS (calc_mainwin_pos,
__mg_get_layer_from_zi(zi), zt_type, first, info);
__mg_get_layer_from_zi(zi), zt_type, first, info, cli);
#else /* defined _MGSCHEMA_COMPOSITING */
/* give a default size first */
if (IsRectEmpty (&info->rc)) {
+4 -2
View File
@@ -478,8 +478,10 @@ int InitGUI (int argc, const char* agr[])
/* Since 5.0.0
* Copy the video engine information to the shared resource segement
*/
strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
//strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
strcpy (SHAREDRES_VIDEO_ENGINE, engine);
//strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
strcpy (SHAREDRES_VIDEO_MODE, mode);
#if 0 /* deprecated code */
// these fileds will be initialized by DRM engine.
if (GetMgEtcValue (engine, "device",
+7 -2
View File
@@ -140,6 +140,8 @@ static BOOL allocate_more_fd_slots (MSGQUEUE* msg_queue)
msg_queue->fd_slots[i] = NULL;
}
msg_queue->nr_fd_slots += MAX_NR_LISTEN_FD;
return TRUE;
}
return FALSE;
@@ -213,8 +215,11 @@ BOOL GUIAPI RegisterListenFD (int fd, int type, HWND hwnd, void* context)
}
}
if (ok && msg_queue->maxfd < fd) {
msg_queue->maxfd = fd;
if (ok) {
if (msg_queue->maxfd < fd) {
msg_queue->maxfd = fd;
}
return TRUE;
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ libkernel_la_SOURCES = timer.c \
desktop-ths.c desktop-sa.c desktop-procs.c \
cursor.c cursor-procs.c cursor-sa.c \
sharedres.c \
message.c event.c \
message.c event.c listenfd.c \
blockheap.c fixstr.c slotset.c zorder.c
endif
+1 -1
View File
@@ -362,7 +362,7 @@ static void mg_slice_init_nomessage (void)
sys_page_size = system_info.dwPageSize;
}
#else
sys_page_size = sysconf (_SC_PAGESIZE); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
sys_page_size = getpagesize(); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
#endif
mem_assert (sys_page_size >= 2 * LARGEALIGNMENT);
mem_assert ((sys_page_size & (sys_page_size - 1)) == 0);
+1
View File
@@ -13,6 +13,7 @@ MINIGUILIB=libminigui-$(MINIGUI_VER)
# specific defines
COMM_LDADD= \
standalone/libstandalone.$(LIBA) \
libc/liblibc.$(LIBA) \
misc/libmisc.$(LIBA) \
control/libcontrol.$(LIBA) \
+1 -4
View File
@@ -5,15 +5,12 @@ EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c error.c sockio.c rc4.c rc4.h \
makefile.ng makefile.msvc
LITE_SRCS=error.c sockio.c
if MG_MINIMALGDI
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
else
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c license.c anon_file.c rbtree.c map.c \
$(LITE_SRCS)
error.c sockio.c
endif
SRC_FILES = $(libmisc_la_SOURCES)
+2
View File
@@ -69,6 +69,8 @@
#include <linux/memfd.h>
#include <stdlib.h>
#else
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#endif
+4 -7
View File
@@ -4,18 +4,15 @@ INCLUDES = -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/include
noinst_LTLIBRARIES = libmisc.la
EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c error.c sockio.c listenfd.c rc4.c rc4.h \
makefile.ng makefile.msvc
LITE_SRCS=error.c sockio.c listenfd.c
math.c about.c error.c sockio.c rc4.c rc4.h \
makefile.ng makefile.msvc
ifdef MG_MINIMALGDI
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
else
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c license.c \
$(LITE_SRCS)
math.c about.c license.c anon_file.c rbtree.c map.c \
error.c sockio.c
endif
SRC_FILES = $(libmisc_la_SOURCES)
+11 -2
View File
@@ -1433,7 +1433,9 @@ char * strtrimall( char *src)
return src;
}
strcpy (src, src + nIndex1);
// VW: use memmove instead of strcpy to avoid overlapping
// strcpy (src, src + nIndex1);
memmove (src, src + nIndex1, nLen - nIndex1 + 1);
nLen = strlen (src);
nIndex1 = nLen - 1;
@@ -1468,11 +1470,18 @@ int __mg_path_joint (char* dst, int dst_size,
if (__mg_is_abs_path(abs_path) && (!__mg_is_abs_path(sub_path))) {
if (dst_size >= strlen(abs_path) + strlen(sub_path)
+ 2/* size of split '/' and terminator '\0' */) {
sprintf(dst, "%s/%s", abs_path, sub_path);
strcpy (dst, abs_path);
strcat (dst, "/");
strcat (dst, sub_path);
//sprintf(dst, "%s/%s", abs_path, sub_path);
return 0;
}
else {
_WRN_PRINTF ("The buffer space for the full path is too short: %d\n", dst_size);
}
}
}
return -1;
}
+3 -1
View File
@@ -414,6 +414,7 @@ unsigned int __mg_os_get_random_seed (void)
unsigned int rt_tick_get(void);
return rt_tick_get();
#elif defined (__FREERTOS__)
return 0; // just return zero for now.
#else
/*other os use time, for example: linux, OSE, etc.*/
return time (NULL);
@@ -451,7 +452,8 @@ void __mg_os_time_delay (int ms)
extern int rt_thread_mdelay(int ms);
rt_thread_mdelay(ms);
#elif defined (__FREERTOS__)
#error "Please implement __mg_os_time_delay for your OS"
extern void vTaskDelay(int xTicksToDelay);
vTaskDelay(ms);
#else
#error "Please implement __mg_os_time_delay for your OS"
#endif
-1
View File
@@ -47,7 +47,6 @@
#include <stdlib.h>
#include <string.h>
#define _DEBUG
#include "common.h"
#ifdef _MGGAL_DRM
+10 -6
View File
@@ -59,7 +59,6 @@
#include <linux/version.h>
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include "common.h"
#include "minigui.h"
@@ -257,9 +256,11 @@ static int FB_EnterGraphicsMode (_THIS)
_WRN_PRINTF ("Can't open %s: %m\n", tty_dev);
goto fail;
}
if (ioctl (ttyfd, KDSETMODE, KD_GRAPHICS) == -1) {
_WRN_PRINTF ("Error when setting the terminal to graphics mode: %m\n");
_WRN_PRINTF ("Maybe is not a console.\n");
_WRN_PRINTF ("Error when setting the terminal (%s) "
"to graphics mode: %m\n", tty_dev);
_WRN_PRINTF ("It might is not a console.\n");
goto fail;
}
#ifdef _MGRM_PROCESSES
@@ -864,7 +865,8 @@ static void FB_FreeHWSurfaces(_THIS)
surfaces.next = NULL;
}
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURFACE* reply)
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request,
REP_HWSURFACE* reply)
{
if (request->bucket == NULL) { /* alloc hw surface */
vidmem_bucket *bucket;
@@ -954,9 +956,9 @@ static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURF
break;
}
}
if (bucket && bucket->used) {
/* Add the memory back to the total */
_DBG_PRINTF ("Freeing bucket of %d bytes\n", bucket->size);
surfaces_memleft += bucket->size;
/* Can we merge the space with surrounding buckets? */
@@ -1015,12 +1017,14 @@ static int FB_AllocHWSurface (_THIS, GAL_Surface *surface)
surface->pitch = reply.pitch;
surface->pixels = mapped_mem + reply.offset;
surface->hwdata = (struct private_hwdata *)reply.bucket;
return 0;
}
static void FB_FreeHWSurface(_THIS, GAL_Surface *surface)
{
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0, surface->hwdata};
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0,
surface->hwdata};
REP_HWSURFACE reply = {0, 0};
request.offset = (char*)surface->pixels - (char*)mapped_mem;
+2 -2
View File
@@ -219,7 +219,7 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
screen->format->BitsPerPixel,
screen->format->Rmask, screen->format->Gmask,
screen->format->Bmask, screen->format->Amask);
_WRN_PRINTF ("GAL_CreateSharedRGBSurface: map size: %lu, fd: %d, RGBAmasks: %x, %x, %x, %x\n",
_DBG_PRINTF ("GAL_CreateSharedRGBSurface: map size: %lu, fd: %d, RGBAmasks: %x, %x, %x, %x\n",
wp_surf->shared_header->map_size, wp_surf->shared_header->fd,
wp_surf->format->Rmask, wp_surf->format->Gmask,
wp_surf->format->Bmask, wp_surf->format->Amask);
@@ -243,7 +243,7 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
&info, sizeof (SHAREDSURFINFO), &fd) < 0) || (fd < 0))
goto empty;
_WRN_PRINTF ("REQID_GETSHAREDSURFACE: size (%lu), flags (0x%x), fd: %d\n",
_DBG_PRINTF ("REQID_GETSHAREDSURFACE: size (%lu), flags (0x%x), fd: %d\n",
info.size, info.flags, fd);
wp_surf = GAL_AttachSharedRGBSurface (fd, info.size,
info.flags, TRUE);
+12
View File
@@ -269,6 +269,8 @@ static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
static BOOL PCXVFB_SyncUpdate (_THIS)
{
RECT dirty_rc;
if (IsRectEmpty (&this->hidden->dirty_rc))
return FALSE;
@@ -278,6 +280,16 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
shm_lock(semid);
#endif
dirty_rc.left = this->hidden->hdr->dirty_rc_l;
dirty_rc.top = this->hidden->hdr->dirty_rc_t;
dirty_rc.right = this->hidden->hdr->dirty_rc_r;
dirty_rc.bottom = this->hidden->hdr->dirty_rc_b;
if (dirty_rc.right == -1) dirty_rc.right = 0;
if (dirty_rc.bottom == -1) dirty_rc.bottom = 0;
GetBoundRect (&this->hidden->dirty_rc, &dirty_rc,
&this->hidden->dirty_rc);
shadowScreen_BlitToReal (this);
this->hidden->hdr->dirty_rc_l = this->hidden->dirty_rc.left;
+8 -2
View File
@@ -628,6 +628,13 @@ void GAL_SetVideoModeInfo(GAL_Surface* screen)
{
assert(screen);
if (GAL_VideoSurface) {
GAL_Surface *ready_to_go;
ready_to_go = GAL_VideoSurface;
GAL_VideoSurface = NULL;
GAL_FreeSurface (ready_to_go);
}
GAL_VideoSurface = screen;
__mg_current_video->info.vfmt = __gal_screen->format;
__mg_current_video->offset_x = 0;
@@ -817,6 +824,7 @@ static inline void add_rects_to_update_region (CLIPRGN* region,
rc.bottom = rects[i].y + rects[i].h;
AddClipRect (region, &rc);
}
}
void GAL_UpdateRects (GAL_Surface *surface, int numrects, GAL_Rect *rects)
@@ -922,8 +930,6 @@ BOOL GAL_SyncUpdate (GAL_Surface *surface)
if (this->SyncUpdate) {
rc = this->SyncUpdate (this);
}
_DBG_PRINTF ("%d rects updated\n", numrects);
}
EmptyClipRgn (&surface->update_region);

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