Compare commits

..
Author SHA1 Message Date
gengyue d68561769d modified for cross compile 2020-04-12 21:26:40 +08:00
102 changed files with 2973 additions and 6545 deletions
+1 -2
View File
@@ -4,8 +4,6 @@
*.al *.al
*.a *.a
*.so *.so
\#
am--include-marker
Makefile Makefile
Makefile.in Makefile.in
.deps/ .deps/
@@ -25,6 +23,7 @@ Makefile.in
/*config.h /*config.h
/*config.h.in /*config.h.in
/*config.h.in~ /*config.h.in~
/src/font/utils/emoji/ /src/font/utils/emoji/
/src/font/utils/ucd/ /src/font/utils/ucd/
/src/sysres/font_list /src/sysres/font_list
+78 -174
View File
File diff suppressed because it is too large Load Diff
+78 -174
View File
File diff suppressed because it is too large Load Diff
+78 -174
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,5 +1,5 @@
MAJOR_VERSION = 5 MAJOR_VERSION = 4
MINOR_VERSION = 0 MINOR_VERSION = 1
MICRO_VERSION = 0 MICRO_VERSION = 0
EXTRAVERSION = EXTRAVERSION =
+102 -184
View File
@@ -1,31 +1,24 @@
# MiniGUI # MiniGUI
A modern and proven cross-platform window system for embedded systems or smart IoT devices. A mature and proven cross-platform GUI system for embedded and smart IoT devices.
_TABLE OF CONTENTS_ ## TABLE OF CONTENTS
- [TABLE OF CONTENTS](#table-of-contents)
- [INTRODUCTION](#introduction) - [INTRODUCTION](#introduction)
+ [What's MiniGUI](#whats-minigui)
+ [App Frameworks on MiniGUI](#app-frameworks-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) - [NEW FEATURES IN VERSION 5.0.x](#new-features-in-version-50x)
+ [Compositing Schema](#compositing-schema) + [Compositing schema](#compositing-schema)
+ [New Main Window Types](#new-main-window-types) + [New main window types](#new-main-window-types)
+ [Virtual Window](#virtual-window) + [Virtual window](#virtual-window)
+ [Other Enhancements](#other-enhancements) + [Other enhancements](#other-enhancements)
- [NEW FEATURES IN VERSION 4.0.x](#new-features-in-version-40x) - [NEW FEATURES IN VERSION 4.0.x](#new-features-in-version-40x)
- [NEW FEATURES IN VERSION 3.2.x](#new-features-in-version-32x) - [NEW FEATURES IN VERSION 3.2.x](#new-features-in-version-32x)
- [THE RUNTIME MODES OF MINIGUI](#the-runtime-modes-of-minigui) - [THE RUNTIME MODES OF MINIGUI](#the-runtime-modes-of-minigui)
- [A BRIEF BUILDING INSTRUCTION](#a-brief-building-instruction) - [A BRIEF BUILDING INSTRUCTION](#a-brief-building-instruction)
+ [Building Whole MiniGUI](#building-whole-minigui) + [Prerequisites](#prerequisites)
+ [Building MiniGUI Core](#building-minigui-core) + [Building MiniGUI Core](#building-minigui-core)
+ [Building whole MiniGUI](#building-whole-minigui)
+ [Unit Tests](#unit-tests) + [Unit Tests](#unit-tests)
- [Othere Resources](#othere-resources)
+ [MiniGUI Components](#minigui-components)
+ [Open Source Apps Based-on MiniGUI](#open-source-apps-based-on-minigui)
- [HISTORY](#history) - [HISTORY](#history)
- [AUTHORS AND COPYING](#authors-and-copying) - [AUTHORS AND COPYING](#authors-and-copying)
+ [Special Statement](#special-statement) + [Special Statement](#special-statement)
@@ -35,121 +28,93 @@ _TABLE OF CONTENTS_
## INTRODUCTION ## 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.
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial
use.
MiniGUI aims to provide a fast, stable, full-featured, and cross-platform MiniGUI aims to provide a fast, stable, full-featured, and cross-platform
windowing and GUI support system, which is especially fit for windowing and GUI support system, which is especially fit for
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX, traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX,
Nucleus, pSOS, uC/OS-II, OSE, and others. Nucleus, pSOS, uC/OS-II, and OSE.
This is the source tree of MiniGUI Core, which provides the windowing This is the source tree of MiniGUI Core, which provides the windowing
and graphics interfaces as well as a lot of standard controls (toolkit). and graphics interfaces as well as a lot of standard controls (toolkit).
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial Besides MiniGUI Core, FMSoft also provides some components
use. In December 1998, the initiator of FMSoft, Wei Yongming, began to develop for the developers to develop app much easier:
MiniGUI under the GNU General Public License (GPL). In September 2002, the core
developers of MiniGUI founded [FMSoft](https://www.fmsoft.cn) and started the
commercial marketing with the free software. By now, FMSoft still continues to
release MiniGUI as a free software project.
For the live demos, source tarballs, and cases of MiniGUI, you can refer * mGUtils: A MiniGUI component which contains miscellaneous utilities
to the following website: like `ColorSelectionDialogBox`, `FileOpenDialogBox`, and so on.
* mGPlus: A MiniGUI component which provides support for advanced graphics
functions like path, gradient, anti-aliased stretch, and color combination.
* mGEff: mGEff provides an animation framework for MiniGUI app.
It also provides some popular UI/UE special effects.
* mGNCS: This component provides a new control set for MiniGUI app.
* mGNCS4Touch: This component provides some new controls, which are
compliant to the new control API spec of mGNCS, for devices with
touch screens.
There are also some legacy MiniGUI components. But we will not maintain these
components since MiniGUI v3.2.0:
* mGi: An input method component for MiniGUI. This component provides
some typical input methods (such as soft keyboard, hand-writing, and predict
text input for mobile phone) for MiniGUI apps.
* mGp: A printing component for MiniGUI. By using mGp, you can print
out the graphics created by MiniGUI app to general-purpose printers.
* mG3d: A simple three-dimension component for MiniGUI. This component
provides a simple 3D API for app. You can use mG3d to create simple
3D UI.
MiniGUI is a free software project. In December 1998, the initiator of
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
License (GPL). In September 2002, the core developers of
MiniGUI founded FMSoft and started the commercial marketing with
the free software. By now, FMSoft still continues to release MiniGUI
as a free software project.
You can download the source code tarball of MiniGUI and the dependent libraries
from the download zone of the site:
<http://www.minigui.com> <http://www.minigui.com>
### App Frameworks on MiniGUI FMSoft also releases some open source apps for MiniGUI on the site above,
for examples:
MiniGUI and its components provides a lot of controls/widgets to * mDolphin, licensed under Apache 2.0, is a full-featured
help your develop GUI apps in C/C++ programming language. However, WEB/WAP browser, which is developed based on the open source browser
alternatively, you can choose one of the following frameworks to core WebKit and uses MiniGUI as its underlying graphics support system.
develop your apps in a easy-to-use programming language other than C/C++. * mGallery, licensed under Apache 2.0, intends to
provide a total solution for PMP (Portable Multimedia Player),
* [HybridOS](https://gitlab.fmsoft.cn/HybridOS/hybridos) provides which uses MiniGUI as the graphics platform.
a complete software stack to develop an app which have rich functions * mSpider, licensed under GPL 3.0, intends to provide a
and excellent expressive in HTML5, CSS3, and JavaScript. light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* [hiACEJS](https://gitlab.fmsoft.cn/HybridOS/hiACEJS) provides * mEagle, licensed under GPL 3.0, is an embedded GIS development platform
a light-weight app framework in JavaScript. which addresses the needs of map browse, query, analysis, etc
You can also choose [HybridOS Lite](https://gitlab.fmsoft.cn/HybridOS/hybridos-lite)
to develop apps with excellent expressive for cost-sensitive devices in C/C++ language.
### MiniGUI and HybridOS
[HybridOS](https://gitlab.fmsoft.cn/HybridOS/hybridos) is another large open source project
initiated by FMSoft. It is a totally new open source operating system designed for
embedded and smart IoT devices and cloud computing environment.
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 FMSoft had created the public repositories for MiniGUI Core, MiniGUI
components, HybridOS, and other open source apps on GitHub. You can visit components, and other open source apps on GitHub. You can visit them on:
them on:
<https://gitlab.fmsoft.cn/VincentWei> <https://github.com/VincentWei>
and
<https://github.com/FMSoftCN>
We now maintain all documents about MiniGUI on the following public repo: We now maintain all documents about MiniGUI on the following public repo:
<https://gitlab.fmsoft.cn/VincentWei/minigui-docs> <https://github.com/VincentWei/minigui-docs>
You can download the source code tarballs of MiniGUI Core, MiniGUI
components, and the dependent libraries from the download zone of the site:
<http://www.minigui.com/download>
## NEW FEATURES IN VERSION 5.0.x ## NEW FEATURES IN VERSION 5.0.x
In version 5.0.0, we introduced some exciting new features, and refactored In version 5.0.0, we introduced some new and exciting features, and refactored
a lot basic modules of MiniGUI Core. a lot basic modules of MiniGUI Core.
### Compositing Schema ### Compositing schema
In this version, we enhanced the MiniGUI-Processes runtime mode to support In this version, we enhanced the MiniGUI-Processes runtime mode to support
the compositing schema. Under compositing schema, regardless a main window the compositing schema. Under compositing schema, regardless a main window
@@ -171,7 +136,7 @@ implementation for multi-process environment:
- Better security. One client created by different user cannot - Better security. One client created by different user cannot
read/write contents in/to another windows owned by other clients. 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 In this version, we also enhanced the window manager of MiniGUI Core
to support some special main window types. to support some special main window types.
@@ -197,7 +162,7 @@ There are eight levels in MiniGUI from top to bottom:
This enhancement allows us to create a special app which acts as This enhancement allows us to create a special app which acts as
screen lock, docker, or launcher. screen lock, docker, or launcher.
### Virtual Window ### Virtual window
You know that we can post or send a message to other windows which You know that we can post or send a message to other windows which
may run in another thread under MiniGUI-Threads. The MiniGUI may run in another thread under MiniGUI-Threads. The MiniGUI
@@ -228,7 +193,7 @@ and the new thread.
This enhancement provides a very useful facility to you in order to This enhancement provides a very useful facility to you in order to
develop a well-designed multithreaded application. develop a well-designed multithreaded application.
### Other Enhancements ### Other enhancements
We also tune or enhance the following modules of MiniGUI Core: We also tune or enhance the following modules of MiniGUI Core:
@@ -261,7 +226,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. version. However, there are still some slight changes you need to take care.
For more information, please refer to `RELEASE-NOTES.md` file: For more information, please refer to `RELEASE-NOTES.md` file:
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md> <https://github.com/VincentWei/minigui/blob/master/RELEASE-NOTES.md>
## NEW FEATURES IN VERSION 4.0.x ## NEW FEATURES IN VERSION 4.0.x
@@ -292,7 +257,7 @@ in order to support [HybridOS Foundation Class Library].
For more information, please refer to `RELEASE-NOTES.md` file: For more information, please refer to `RELEASE-NOTES.md` file:
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md> <https://github.com/VincentWei/minigui/blob/tree/rel-4-0/RELEASE-NOTES.md>
Because of the changes of some APIs, we recommended strongly that you Because of the changes of some APIs, we recommended strongly that you
use this version for new projects. use this version for new projects.
@@ -307,7 +272,7 @@ We introduce some new features in MiniGUI Version 3.2.x:
For more information, please refer to `RELEASE-NOTES.md` file: For more information, please refer to `RELEASE-NOTES.md` file:
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md> <https://github.com/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md>
## THE RUNTIME MODES OF MINIGUI ## THE RUNTIME MODES OF MINIGUI
@@ -354,31 +319,12 @@ clients and the server.
## A BRIEF BUILDING INSTRUCTION ## A BRIEF BUILDING INSTRUCTION
### Building Whole MiniGUI This instruction assumes that you are using Ubuntu Linux.
If you are anxious to see the comprehensive demo of MiniGUI Core ### Prerequisites
and MiniGUI components, please fetch one of the following repositories
from GitHub and follow the instructions to build MiniGUI Core,
MiniGUI components, the samples, and the demonstration programs:
[Build MiniGUI 5.0](https://gitlab.fmsoft.cn/VincentWei/build-minigui-5.0) You should run `apt install <package_name>` to install the following packages
on your Ubuntu Linux.
or
[Build MiniGUI 4.0](https://gitlab.fmsoft.cn/VincentWei/build-minigui-4.0)
or
[Build MiniGUI 3.2](https://gitlab.fmsoft.cn/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: * Building tools:
* autoconf * autoconf
@@ -387,6 +333,8 @@ to install the following packages:
* libpng12-dev (use libpng-dev on Ubuntu Linux 18.04 LTS) * libpng12-dev (use libpng-dev on Ubuntu Linux 18.04 LTS)
* libfreetype6-dev * libfreetype6-dev
### Building MiniGUI Core
MiniGUI Core uses GNU autoconf/automake scripts to configure and build the project. MiniGUI Core uses GNU autoconf/automake scripts to configure and build the project.
Run Run
@@ -405,62 +353,33 @@ For more information, please run
$ ./configure --help $ ./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 ### Unit Tests
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
following repository: following repository:
<https://gitlab.fmsoft.cn/VincentWei/mg-tests> <https://github.com/VincentWei/mg-tests>
If you are interested in hacking the MiniGUI code, please visit this repository. If you are interested in hacking the MiniGUI code, please visit this repository.
## Othere Resources
### MiniGUI Components
Besides MiniGUI Core, FMSoft also provides some components
for the developers to develop app much easier:
* mGUtils: A MiniGUI component which contains miscellaneous utilities
like `ColorSelectionDialogBox`, `FileOpenDialogBox`, and so on.
* mGPlus: A MiniGUI component which provides support for advanced graphics
functions like path, gradient, anti-aliased stretch, and color combination.
* mGEff: mGEff provides an animation framework for MiniGUI app.
It also provides some popular UI/UE special effects.
* mGNCS: This component provides a new control set for MiniGUI app.
* mGNCS4Touch: This component provides some new controls, which are
compliant to the new control API spec of mGNCS, for devices with
touch screens.
There are also some legacy MiniGUI components. But we will not maintain these
components since MiniGUI v3.2.0:
* mGi: An input method component for MiniGUI. This component provides
some typical input methods (such as soft keyboard, hand-writing, and predict
text input for mobile phone) for MiniGUI apps.
* mGp: A printing component for MiniGUI. By using mGp, you can print
out the graphics created by MiniGUI app to general-purpose printers.
* mG3d: A simple three-dimension component for MiniGUI. This component
provides a simple 3D API for app. You can use mG3d to create simple
3D UI.
### 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
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
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
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* `mEagle`, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
## HISTORY ## HISTORY
21 years have pasted since MiniGUI was initially created at 21 years have pasted since MiniGUI was initially created at
@@ -564,8 +483,7 @@ A brief history description of the development progress is listed as follow:
1. Feb., 2018: FMSoft released MiniGUI version 3.2.0. 1. Feb., 2018: FMSoft released MiniGUI version 3.2.0.
1. Apr., 2019: FMSoft released MiniGUI version 3.2.2. 1. Apr., 2019: FMSoft released MiniGUI version 3.2.2.
1. Jul., 2019: FMSoft released MiniGUI version 4.0.0. 1. Jul., 2019: FMSoft released MiniGUI version 4.0.0.
1. Mar., 2020: FMSoft released MiniGUI version 5.0.0. 1. Apr., 2020: FMSoft released MiniGUI version 5.0.0.
1. May., 2021: FMSoft released MiniGUI version 5.0.6.
## AUTHORS AND COPYING ## AUTHORS AND COPYING
@@ -573,7 +491,7 @@ The original author of MiniGUI is WEI Yongming, and now MiniGUI is
maintained by FMSoft. For more information, please refer to maintained by FMSoft. For more information, please refer to
<http://www.fmsoft.cn>. <http://www.fmsoft.cn>.
Copyright (C) 2002 ~ 2021, Beijing FMSoft Technologies Co., Ltd. Copyright (C) 2002 ~ 2020, Beijing FMSoft Technologies Co., Ltd.
Copyright (C) 1998 ~ 2002, WEI Yongming Copyright (C) 1998 ~ 2002, WEI Yongming
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
+20 -130
View File
@@ -1,17 +1,7 @@
# Release Notes # Release Notes
- [Version 5.0.6](#version-506) - [Version 4.9.2](#version-492)
+ [What's new in version 5.0.6](#whats-new-in-version-506) + [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) + [Compositing schema](#compositing-schema)
+ [New main window styles](#new-main-window-styles) + [New main window styles](#new-main-window-styles)
+ [Virtual window](#virtual-window) + [Virtual window](#virtual-window)
@@ -20,130 +10,25 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility) + [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis) + [Deprecated APIs](#deprecated-apis)
## Version 5.0.6 ## Version 4.9.2
The MiniGUI development team announces the availability of MiniGUI 5.0.6, The MiniGUI development team announces the availability of MiniGUI 4.9.2,
which is the bug fixing release of MiniGUI 5.0.x. which is the third preview release of MiniGUI 5.0.0.
### What's new in version 5.0.6 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.
In this version, we fixed some bugs and made some optimizations and enhancements: Nevertheless, we did our best to ensure backward compatibility of the
existed APIs so that the old applications can smoothly migrate to the new
* BUGFIXING: version. We recommend that you test this version and report any bugs and
- Fix bugs of switching layers under MiniGUI-Processes.
- Fix bugs of `FBCon` and `PC_XVFB` engines: the dirty rectangles are
not set empty after calling `SyncUpdate`.
- Fix memory leaks when using block heap.
- Fix a bug in ServerGetWinZNodeRegion.
* ENHANCEMENTS:
- Enhance `GetGlyphInfo` to return the FreeType face, font file path, and glyph
index.
- NEW API `StretchBltEx` to support different scaling filters and rotation.
- Use Pixman to support color blending methods for `BitBlt` and `StretchBlt`.
- Enhance fallback compositor to support animation when switching among layers.
- New API `SetMainWindowGestureFlags` and `MSG_GESTURETEST` message for
gesture test and setting the gesture flags of a specific main window.
- Tune implementation of Tooltip window.
* OPTIMIZATIONS:
- Optimize the fallback compositor for lucent windows.
- Use Pixman to optimize `FillBox`, `BitBlt`, and `StretchBlt`.
- Optimize the management of BLOCKHEAP.
- Optimize the `__mg_lookfor_unused_slot`.
Note that the binary backward-compatibility was broken, two operations added to
`CompositorOps`. You should rebuild all MiniGUI applications.
Also note that the compositing schema is now enabled by default.
## Version 5.0.5
The MiniGUI development team announces the availability of MiniGUI 5.0.5,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.5
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 incompatibilities in
<https://github.com/VincentWei/minigui/tree/rel-5-0> <https://github.com/VincentWei/minigui/tree/dev-4-1>
### What's new in version 5.0.0 ### What's new in this version
In the development of version 5.0.x, we introduced the following new and In the development of version 4.9.x, we introduced the following new and
exciting features for MiniGUI: exciting features for MiniGUI:
* ENHANCEMENTS: * ENHANCEMENTS:
@@ -181,7 +66,7 @@ exciting features for MiniGUI:
* ADJUSTMENTS: * ADJUSTMENTS:
- `g_rcScr` now is defined a macro calling function `GetScreenRect()`. - `g_rcScr` now is defined a macro calling function `GetScreenRect()`.
- `mgIsServer` now is define a macro calling function `IsServer()`. - `mgIsServer` now is define a macro calling function `IsServer()`.
* TUNING * TUNNING
- Tune the `drm` (DRM) engine to support MiniGUI-Processes runtime mode - Tune the `drm` (DRM) engine to support MiniGUI-Processes runtime mode
and compositing schema. and compositing schema.
- Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema. - Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema.
@@ -197,6 +82,11 @@ exciting features for MiniGUI:
message queue, event/message handling, and part of graphics abstract message queue, event/message handling, and part of graphics abstract
layer. 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 ### Compositing schema
In this version, we enhanced the MiniGUI-Processes runtime mode to support In this version, we enhanced the MiniGUI-Processes runtime mode to support
+4 -4
View File
@@ -1,11 +1,11 @@
Version 5.0.6 (2021/05/20) Version 5.0.0 (2019/03/31)
This is the first official release of MiniGUI 5.0.x, the stable version. This is the second preview version of MiniGUI 5.0.0, an unstable version.
Other packages for MiniGUI resource, tools, components, and samples: Other packages for MiniGUI resource, tools, components, and samples:
- GVFB: `gvfb-1.2.5.tar.gz` - GVFB: `gvfb-1.2.4.tar.gz`
- The resource package: `minigui-res-5.0.6.tar.gz` - The resource package: `minigui-res-4.0.0.tar.gz`
- mGUtils component: `libmgutils-1.5.0.tar.gz` - mGUtils component: `libmgutils-1.5.0.tar.gz`
- mGPlus component: `libmgplus-1.5.0.tar.gz` - mGPlus component: `libmgplus-1.5.0.tar.gz`
- mGEff component: `libmgeff-1.5.0.tar.gz` - mGEff component: `libmgeff-1.5.0.tar.gz`
-44
View File
@@ -1,44 +0,0 @@
#!/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
@@ -1,41 +0,0 @@
#!/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
@@ -1,36 +0,0 @@
# 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+=
##################################################
+21 -90
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60) AC_PREREQ(2.60)
AC_INIT(libminigui, 5.0.6) AC_INIT(libminigui, 4.9.2)
AC_CONFIG_SRCDIR(src/main/main.c) AC_CONFIG_SRCDIR(src/main/main.c)
dnl Set various version strings - taken gratefully from the SDL sources dnl Set various version strings - taken gratefully from the SDL sources
@@ -14,9 +14,9 @@ dnl Set various version strings - taken gratefully from the SDL sources
# if backwards compatibility has been broken, # if backwards compatibility has been broken,
# set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0. # set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0.
# #
MINIGUI_MAJOR_VERSION=5 MINIGUI_MAJOR_VERSION=4
MINIGUI_MINOR_VERSION=0 MINIGUI_MINOR_VERSION=9
MINIGUI_MICRO_VERSION=6 MINIGUI_MICRO_VERSION=2
MINIGUI_INTERFACE_AGE=0 MINIGUI_INTERFACE_AGE=0
MINIGUI_BINARY_AGE=0 MINIGUI_BINARY_AGE=0
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
@@ -77,12 +77,10 @@ AC_FUNC_MEMCMP
AC_FUNC_MMAP AC_FUNC_MMAP
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS(time mktime localtime clock_gettime strdup strcasecmp strncasecmp strerror setlocale) AC_CHECK_FUNCS(time mktime localtime clock_gettime strdup strcasecmp strncasecmp strerror setlocale)
AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create access poll select) AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create poll select)
PKG_CHECK_MODULES(UDEV, [libudev >= 200], have_udev="yes", have_udev="no; need libudev 200+") PKG_CHECK_MODULES(UDEV, [libudev >= 200], have_udev="yes", have_udev="no; need libudev 200+")
DEP_LIBS=""
dnl ======================================================================== dnl ========================================================================
dnl User selectable options dnl User selectable options
@@ -94,8 +92,7 @@ message_string="no"
osname="unspecified" osname="unspecified"
runtime_mode="procs" runtime_mode="procs"
compositing_schema="yes" compositing_schema="no"
nr_concurrent_tasks=0
virtual_window="no" virtual_window="no"
use_shmopen="no" use_shmopen="no"
mgslice_use_fallback="no" mgslice_use_fallback="no"
@@ -110,7 +107,6 @@ use_own_stdio="no"
use_own_malloc="no" use_own_malloc="no"
use_own_pthread="no" use_own_pthread="no"
build_adv2dapi="yes" build_adv2dapi="yes"
use_pixman="yes"
build_updateregion="yes" build_updateregion="yes"
build_minimalgdi="no" build_minimalgdi="no"
@@ -136,9 +132,6 @@ build_console_ms3="no"
build_console_gpm="no" build_console_gpm="no"
build_text_mode="yes" build_text_mode="yes"
dnl single touch key engines
buid_singletouchkey_ial_engine="yes"
dnl the customized ial engine dnl the customized ial engine
build_dlcustom_ial_engine="no" build_dlcustom_ial_engine="no"
build_custom_ial_engine="no" build_custom_ial_engine="no"
@@ -368,10 +361,6 @@ AC_ARG_ENABLE(adv2dapi,
[ --enable-adv2dapi include advanced 2D graphics APIs <default=yes>], [ --enable-adv2dapi include advanced 2D graphics APIs <default=yes>],
build_adv2dapi=$enableval) build_adv2dapi=$enableval)
AC_ARG_ENABLE(pixman,
[ --enable-pixman use pixman to optimmize pixle operations <default=yes>],
use_pixman=$enableval)
AC_ARG_ENABLE(updateregion, AC_ARG_ENABLE(updateregion,
[ --enable-updateregion Use update region for cumulative updating surfaces <default=yes>], [ --enable-updateregion Use update region for cumulative updating surfaces <default=yes>],
build_updateregion=$enableval) build_updateregion=$enableval)
@@ -488,10 +477,6 @@ AC_ARG_ENABLE(libinputial,
[ --enable-libinputial build the IAL engine based on libinput <default=yes>], [ --enable-libinputial build the IAL engine based on libinput <default=yes>],
build_libinput_ial_engine=$enableval) 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, AC_ARG_ENABLE(consoleial,
[ --enable-consoleial build the console (Linux console) IAL engine <default=yes>], [ --enable-consoleial build the console (Linux console) IAL engine <default=yes>],
build_console_ial_engine=$enableval) build_console_ial_engine=$enableval)
@@ -854,16 +839,12 @@ build_ctrl_animation=$enableval)
if test "x$runtime_mode" == "xprocs"; then if test "x$runtime_mode" == "xprocs"; then
AC_ARG_ENABLE(compositing, AC_ARG_ENABLE(compositing,
[ --enable-compositing enable compositing schema (MiniGUI-Processes runmode only) <default=yes>], [ --enable-compositing enable compositing schema (MiniGUI-Processes runmode only) <default=no>],
compositing_schema=$enableval) compositing_schema=$enableval)
AC_ARG_ENABLE(shmopen, AC_ARG_ENABLE(shmopen,
[ --enable-shmopen use shm_open <default=no>], [ --enable-shmopen use shm_open <default=no>],
use_shmopen=$enableval) use_shmopen=$enableval)
AC_ARG_WITH(concurrent_tasks,
[ --with-concurrent-tasks=[0/1/3/7]],
nr_concurrent_tasks=$withval)
fi fi
if test "x$runtime_mode" != "xths"; then if test "x$runtime_mode" != "xths"; then
@@ -918,6 +899,8 @@ CheckFBCON()
if test "x$have_pciaccess" = "xyes"; then if test "x$have_pciaccess" = "xyes"; then
AC_DEFINE(_MGHAVE_PCIACCESS, 1, AC_DEFINE(_MGHAVE_PCIACCESS, 1,
[Define if PCIAccess lib is available]) [Define if PCIAccess lib is available])
LDFLAGS="$LDFLAGS -lpciaccess"
fi fi
fi fi
fi fi
@@ -937,7 +920,7 @@ CheckDRM()
[Define if include Linux DRM NEWGAL engine]) [Define if include Linux DRM NEWGAL engine])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS drm" VIDEO_SUBDIRS="$VIDEO_SUBDIRS drm"
VIDEO_DRIVERS="$VIDEO_DRIVERS drm/libvideo_drm.la" VIDEO_DRIVERS="$VIDEO_DRIVERS drm/libvideo_drm.la"
DEP_LIBS="$DEP_LIBS -ldrm" DEP_LIBS="$DEP_LIBS -ldrm -ldl"
DRM_INC_DIR="`$PKG_CONFIG --variable includedir libdrm`/libdrm" DRM_INC_DIR="`$PKG_CONFIG --variable includedir libdrm`/libdrm"
AC_SUBST(DRM_INC_DIR) AC_SUBST(DRM_INC_DIR)
else else
@@ -1475,6 +1458,7 @@ fi
if test "x$build_dlcustom_ial_engine" = "xyes"; then if test "x$build_dlcustom_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_DLCUSTOM, 1, [Define if include dlcustom IAL engine]) AC_DEFINE(_MGIAL_DLCUSTOM, 1, [Define if include dlcustom IAL engine])
DEP_LIBS="$DEP_LIBS -ldl"
fi fi
if test "x$build_sef_support" = "xyes"; then if test "x$build_sef_support" = "xyes"; then
@@ -1637,10 +1621,8 @@ case "$with_osname" in
*) *)
with_osname="linux" with_osname="linux"
osname="Linux" osname="Linux"
use_shmopen="yes"
AC_DEFINE(__LINUX__, 1, AC_DEFINE(__LINUX__, 1,
[Define if compile for Linux]) [Define if compile for Linux])
DEP_LIBS="$DEP_LIBS -ldl"
;; ;;
esac esac
@@ -1760,7 +1742,7 @@ case "$runtime_mode" in
[Define if build MiniGUI-Processes]) [Define if build MiniGUI-Processes])
MINIGUI_RUNMODE="procs" MINIGUI_RUNMODE="procs"
if test "x$compositing_schema" = "xyes"; then if test "x$compositing_schema" = "xyes"; then
surface_schema="compositing" surface_schema="compositing"
fi fi
if test "x$use_shmopen" = "xyes"; then if test "x$use_shmopen" = "xyes"; then
@@ -1782,30 +1764,9 @@ esac
if test "x$surface_schema" = "xcompositing"; then if test "x$surface_schema" = "xcompositing"; then
AC_DEFINE(_MGSCHEMA_COMPOSITING, 1, AC_DEFINE(_MGSCHEMA_COMPOSITING, 1,
[Define if use compositing schema for the current runmode]) [Define if use compositing schema for the current runmode])
case "$nr_concurrent_tasks" in
1)
AC_DEFINE(_MGNR_CONCURRENT_TASKS, 1,
[The number of concurrent threads.])
;;
3)
AC_DEFINE(_MGNR_CONCURRENT_TASKS, 3,
[The number of concurrent threads.])
;;
7)
AC_DEFINE(_MGNR_CONCURRENT_TASKS, 7,
[The number of concurrent threads.])
;;
*)
AC_DEFINE(_MGNR_CONCURRENT_TASKS, 0,
[The number of concurrent threads.])
;;
esac
else else
AC_DEFINE(_MGSCHEMA_SHAREDFB, 1, AC_DEFINE(_MGSCHEMA_SHAREDFB, 1,
[Define if use legacy schema (shared frame buffer) for the current runmode]) [Define if use legacy schema (shared frame buffer) for the current runmode])
AC_DEFINE(_MGNR_CONCURRENT_TASKS, 0,
[The number of concurrent threads.])
fi fi
if test "x$virtual_window" = "xyes"; then if test "x$virtual_window" = "xyes"; then
@@ -2000,7 +1961,7 @@ fi
if test "x$build_net_ial_engine" = "xyes"; then if test "x$build_net_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_NET, 1, AC_DEFINE(_MGIAL_NET, 1,
[Define if include IAL engine for network input]) [Define if include IAL engine for net's board])
fi fi
if test "x$build_comm_ial_engine" = "xyes"; then if test "x$build_comm_ial_engine" = "xyes"; then
@@ -2053,11 +2014,6 @@ if test "x$build_libinput_ial_engine" = "xyes"; then
fi fi
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 if test "x$build_console_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_CONSOLE, 1, AC_DEFINE(_MGIAL_CONSOLE, 1,
[Define if include console (Linux console) IAL engine]) [Define if include console (Linux console) IAL engine])
@@ -2187,7 +2143,7 @@ if test "x$build_ttf_support" = "xyes"; then
if test "x$build_complex_scripts" = "xyes"; then if test "x$build_complex_scripts" = "xyes"; then
dnl Check for HarfBuzz library dnl Check for HarfBuzz library
AC_CHECK_LIB(harfbuzz, hb_version, AC_CHECK_LIB(harfbuzz, hb_version,
DEP_LIBS="$DEP_LIBS -lharfbuzz -lfreetype", DEP_LIBS="$DEP_LIBS -lharfbuzzex -lfreetype",
build_complex_scripts="no; support for complex scripts requires libharfbuzz") build_complex_scripts="no; support for complex scripts requires libharfbuzz")
else else
DEP_LIBS="$DEP_LIBS -lfreetype", DEP_LIBS="$DEP_LIBS -lfreetype",
@@ -2267,7 +2223,7 @@ if test "x$build_complex_scripts" = "xyes"; then
[ --with-hb-includes=DIR where the HarfBuzz includes are]) [ --with-hb-includes=DIR where the HarfBuzz includes are])
if test "x$with_hb_includes" = "x"; then if test "x$with_hb_includes" = "x"; then
HB_INC_DIR="-I/usr/include/harfbuzz" HB_INC_DIR="-I/usr/local/include/harfbuzz"
else else
HB_INC_DIR="-I$with_hb_includes" HB_INC_DIR="-I$with_hb_includes"
fi fi
@@ -2280,8 +2236,10 @@ if test "x$build_ttf_support" = "xyes"; then
AC_DEFINE(_MGFONT_FT2, 1, AC_DEFINE(_MGFONT_FT2, 1,
[Define if support TrueType/OpenType fonts based on FreeType2]) [Define if support TrueType/OpenType fonts based on FreeType2])
with_ft2_includes=""
AC_ARG_WITH(ft2_includes, AC_ARG_WITH(ft2_includes,
[ --with-ft2-includes=DIR where the FreeType2 includes are]) [ --with-ft2-includes=DIR where the FreeType2 includes are],
with_ft2_includes=$withval)
if test "x$with_ft2_includes" = "x"; then if test "x$with_ft2_includes" = "x"; then
FT2_INC_DIR="-I/usr/include/freetype2" FT2_INC_DIR="-I/usr/include/freetype2"
@@ -2292,26 +2250,6 @@ if test "x$build_ttf_support" = "xyes"; then
AC_SUBST(FT2_INC_DIR) AC_SUBST(FT2_INC_DIR)
fi fi
dnl Check Pixman lib
if test "x$use_pixman" = "xyes"; then
PKG_CHECK_MODULES([PIXMAN], [pixman-1 >= 0.34.0], [foo=bar],
[use_pixman="no; not found pixman."])
fi
if test "x$use_pixman" = "xyes"; then
AC_DEFINE(_MGUSE_PIXMAN, 1,
[Define if use libpixman for optimized pixel operations])
AC_ARG_WITH(pixman_includes,
[ --with-pixman-includes=DIR where the libpixman includes are])
if test "x$with_pixman_includes" != "x"; then
PIXMAN_CFLAGS="-I$with_pixman_includes"
fi
DEP_LIBS="$DEP_LIBS $PIXMAN_LIBS"
AC_SUBST(PIXMAN_CFLAGS)
fi
if test "x$build_bmpf_support" = "xyes"; then if test "x$build_bmpf_support" = "xyes"; then
AC_DEFINE(_MGFONT_BMPF, 1, AC_DEFINE(_MGFONT_BMPF, 1,
[Define if support Bitmap fonts]) [Define if support Bitmap fonts])
@@ -2724,7 +2662,6 @@ AC_SUBST(MINIGUI_RUNMODE)
AM_CONDITIONAL(MGRM_PROCESSES, test "x$runtime_mode" = "xprocs") AM_CONDITIONAL(MGRM_PROCESSES, test "x$runtime_mode" = "xprocs")
AM_CONDITIONAL(MGRM_STANDALONE, test "x$runtime_mode" = "xsa") AM_CONDITIONAL(MGRM_STANDALONE, test "x$runtime_mode" = "xsa")
AM_CONDITIONAL(MGIAL_LIBINPUT, test "x$build_libinput_ial_engine" = "xyes") AM_CONDITIONAL(MGIAL_LIBINPUT, test "x$build_libinput_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_SINGLETOUCHKEY, test "x$buid_singletouchkey_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_CONSOLE, test "x$build_console_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_NEXUS, test "x$build_nexus_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_DLCUSTOM, test "x$build_dlcustom_ial_engine" = "xyes") AM_CONDITIONAL(MGIAL_DLCUSTOM, test "x$build_dlcustom_ial_engine" = "xyes")
@@ -2820,7 +2757,6 @@ AC_MSG_NOTICE([
* Runtime mode: ${runtime_mode} * Runtime mode: ${runtime_mode}
* Virtual Window: ${virtual_window} * Virtual Window: ${virtual_window}
* Surface schema: ${surface_schema} * Surface schema: ${surface_schema}
* Concurrent Tasks: ${nr_concurrent_tasks}
* Use shm_open: ${use_shmopen} * Use shm_open: ${use_shmopen}
* Incore resource: ${incore_res} * Incore resource: ${incore_res}
* Fallback mgslice: ${mgslice_use_fallback} * Fallback mgslice: ${mgslice_use_fallback}
@@ -2828,7 +2764,6 @@ AC_MSG_NOTICE([
* Target name: ${with_targetname} * Target name: ${with_targetname}
* Cursor: ${build_cursor_support} * Cursor: ${build_cursor_support}
* Update Region: ${build_updateregion} * Update Region: ${build_updateregion}
* Pixman: ${use_pixman}
## NEWGAL Engines: ## NEWGAL Engines:
* dummy: ${enable_video_dummy} * dummy: ${enable_video_dummy}
@@ -2843,7 +2778,6 @@ AC_MSG_NOTICE([
* pc_xvfb: ${enable_video_pc_xvfb} * pc_xvfb: ${enable_video_pc_xvfb}
* usvfb: ${enable_video_usvfb} * usvfb: ${enable_video_usvfb}
* libinput: ${build_libinput_ial_engine} * libinput: ${build_libinput_ial_engine}
* singletouchkey: ${buid_singletouchkey_ial_engine}
* console: ${build_console_ial_engine} * console: ${build_console_ial_engine}
* comm: ${build_comm_ial_engine} * comm: ${build_comm_ial_engine}
@@ -2864,9 +2798,6 @@ AC_MSG_NOTICE([
* CPP flags: ${CPPFLAGS} * CPP flags: ${CPPFLAGS}
* CC flags: ${CFLAGS} * CC flags: ${CFLAGS}
* CXX flags: ${CXXFLAGS} * CXX flags: ${CXXFLAGS}
* Pixman includes: ${PIXMAN_CFLAGS}
* FreeType2 includes: ${FT2_INC_DIR}
* HarfBuzz includes: ${HB_INC_DIR}
* Dep. libraries: ${DEP_LIBS} * Dep. libraries: ${DEP_LIBS}
]) ])
+1 -14
View File
@@ -80,20 +80,7 @@ double_buffering=true
# The filename of the shared library for the external driver. # The filename of the shared library for the external driver.
# The equivalent environment variable: MG_GAL_DRM_DRIVER # The equivalent environment variable: MG_GAL_DRM_DRIVER
exdriver=libhidrmdrivers-0.2.so.0 exdriver=libhidrmdrivers.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 #{{ifdef _MGIAL_LIBINPUT
+1
View File
@@ -237,6 +237,7 @@ MG_EXPORT void GUIAPI NotifyParentEx (HWND hwnd, LINT id, int code,
NotifyParentEx(hwnd, id, code, 0) NotifyParentEx(hwnd, id, code, 0)
/** /**
* \var typedef int (*STRCMP) (const char* s1, const char* s2, size_t n)
* \brief Type of general strncmp function. * \brief Type of general strncmp function.
* *
* The function compares the two strings \a s1 and \a s2. It returns * The function compares the two strings \a s1 and \a s2. It returns
+1
View File
@@ -698,6 +698,7 @@ extern "C" {
#define EM_SETREADONLY 0xF0CF #define EM_SETREADONLY 0xF0CF
/** /**
* \var typedef int (*ED_DRAWSEL_FUNC) (HWND hWnd, HDC hdc, int startx, int starty, const char* content, int len, int selout)
* \brief Type of the edit control callback function on drawing selected strings. * \brief Type of the edit control callback function on drawing selected strings.
* *
* \param hWnd Handle of the edit control. * \param hWnd Handle of the edit control.
+7 -7
View File
@@ -298,7 +298,7 @@ typedef struct _DrmDriverOps {
ColorLogicalOp logic_op); ColorLogicalOp logic_op);
/** /**
* This operation blits pixels from a source buffer with the source alpha * This operation blits pixles from a source buffer with the source alpha
* value specified to a destination buffer. * value specified to a destination buffer.
* *
* \note If this operation is set as NULL, the driver does not support * \note If this operation is set as NULL, the driver does not support
@@ -310,7 +310,7 @@ typedef struct _DrmDriverOps {
uint8_t alpha); uint8_t alpha);
/** /**
* This operation blits pixels from a source buffer to a destination buffer, * This operation blits pixles from a source buffer to a destination buffer,
* but skipping the pixel value specified by \a color_key. * but skipping the pixel value specified by \a color_key.
* *
* \note If this operation is set as NULL, the driver does not support * \note If this operation is set as NULL, the driver does not support
@@ -322,7 +322,7 @@ typedef struct _DrmDriverOps {
uint32_t color_key); uint32_t color_key);
/** /**
* This operation blits pixels from a source buffer with the source alpha * This operation blits pixles from a source buffer with the source alpha
* value specified to a destination buffer, but skipping the pixel value * value specified to a destination buffer, but skipping the pixel value
* specified. * specified.
* *
@@ -335,7 +335,7 @@ typedef struct _DrmDriverOps {
uint8_t alpha, uint32_t color_key); uint8_t alpha, uint32_t color_key);
/** /**
* This operation blits pixels from a source buffer with the source alpha * This operation blits pixles from a source buffer with the source alpha
* value of pixels to the destination buffer, and with the specified color * value of pixels to the destination buffer, and with the specified color
* compositing/blending method (\a ColorBlendMethod). * 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`. * For example, for Intel i915/i965 GPUs, the driver name will be `i915`.
* \param device_fd This argument gives the file descriptor of the * \param device_fd This argument gives the file descriptor of the
* opened DRI device. * opened DRI device.
* \param version A pointer to an integer which will be used to return * \param version A pointer to an integer which will contain the
* the interface version of the DRM engine driver. * versionc of the DRM engine driver.
* *
* \return NULL or a valid pointer to DrmDriverOps. * \return NULL or a valid pointer to DrmDriverOps.
* *
* \note We use the version control since 4.0.7. It will be initialized * \note We use the version control since 4.0.7. It will be intialized
* to zero by MiniGUI before calling this function. Because an old * to zero by MiniGUI before calling this function. Because an old
* driver for MiniGUI 4.0.6 or earlier will not change the value, * driver for MiniGUI 4.0.6 or earlier will not change the value,
* MiniGUI will deny to load the old driver. * MiniGUI will deny to load the old driver.
+88 -199
View File
@@ -586,23 +586,27 @@ enum {
* *
* \sa InitBlockDataHeap, DestroyBlockDataHeap * \sa InitBlockDataHeap, DestroyBlockDataHeap
*/ */
typedef struct _BLOCKHEAP { typedef struct _BLOCKHEAP
{
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
/** Size of one block element in bytes. */ /**
size_t sz_block; * Size of one block element.
/** Size of the heap in blocks. */ */
size_t sz_heap; size_t bd_size;
/** The number of blocks extra allocated. */ /**
size_t nr_alloc; * Size of the heap in blocks.
/** The size of usage bitmap in bytes. */ */
size_t sz_usage_bmp; size_t heap_size;
/**
/** The pointer to the pre-allocated heap. */ * The first free element in the heap.
unsigned char* heap; */
/** The pointer to the usage bitmap. */ int free;
unsigned char* usage_bmp; /**
* Pointer to the pre-allocated heap.
*/
void* heap;
} BLOCKHEAP; } BLOCKHEAP;
/** /**
@@ -614,7 +618,7 @@ typedef struct _BLOCKHEAP {
typedef BLOCKHEAP* PBLOCKHEAP; typedef BLOCKHEAP* PBLOCKHEAP;
/** /**
* \fn BOOL InitBlockDataHeap (PBLOCKHEAP heap, * \fn void InitBlockDataHeap (PBLOCKHEAP heap, \
size_t bd_size, size_t heap_size) size_t bd_size, size_t heap_size)
* \brief Initializes a private block data heap. * \brief Initializes a private block data heap.
* *
@@ -627,11 +631,15 @@ typedef BLOCKHEAP* PBLOCKHEAP;
* \param bd_size The size of one block in bytes. * \param bd_size The size of one block in bytes.
* \param heap_size The size of the heap in blocks. * \param heap_size The size of the heap in blocks.
* *
* \return TRUE on success, FALSE on error. * \return \a heap->heap will contains a valid pointer on success,
* NULL on error.
*
* \note This function does not return anything. You should check the \a heap
* field of the \a heap structure.
* *
* \sa BLOCKHEAP * \sa BLOCKHEAP
*/ */
MG_EXPORT BOOL InitBlockDataHeap (PBLOCKHEAP heap, MG_EXPORT extern void InitBlockDataHeap (PBLOCKHEAP heap,
size_t bd_size, size_t heap_size); size_t bd_size, size_t heap_size);
/** /**
@@ -649,7 +657,7 @@ MG_EXPORT BOOL InitBlockDataHeap (PBLOCKHEAP heap,
* \sa InitBlockDataHeap, BlockDataFree * \sa InitBlockDataHeap, BlockDataFree
*/ */
MG_EXPORT void* BlockDataAlloc (PBLOCKHEAP heap); MG_EXPORT extern void* BlockDataAlloc (PBLOCKHEAP heap);
/** /**
* \fn void BlockDataFree (PBLOCKHEAP heap, void* data) * \fn void BlockDataFree (PBLOCKHEAP heap, void* data)
@@ -664,7 +672,7 @@ MG_EXPORT void* BlockDataAlloc (PBLOCKHEAP heap);
* *
* \sa InitBlockDataHeap, BlockDataAlloc * \sa InitBlockDataHeap, BlockDataAlloc
*/ */
MG_EXPORT void BlockDataFree (PBLOCKHEAP heap, void* data); MG_EXPORT extern void BlockDataFree (PBLOCKHEAP heap, void* data);
/** /**
* \fn void DestroyBlockDataHeap (PBLOCKHEAP heap) * \fn void DestroyBlockDataHeap (PBLOCKHEAP heap)
@@ -674,7 +682,7 @@ MG_EXPORT void BlockDataFree (PBLOCKHEAP heap, void* data);
* *
* \sa InitBlockDataHeap, BLOCKHEAP * \sa InitBlockDataHeap, BLOCKHEAP
*/ */
MG_EXPORT void DestroyBlockDataHeap (PBLOCKHEAP heap); MG_EXPORT extern void DestroyBlockDataHeap (PBLOCKHEAP heap);
/** @} end of block_heap_fns */ /** @} end of block_heap_fns */
@@ -3713,8 +3721,7 @@ MG_EXPORT BOOL GUIAPI FloodFillGenerator (void* context,
* \brief Set bitmap scaler algorithm callback of DC according by scaler_type. * \brief Set bitmap scaler algorithm callback of DC according by scaler_type.
* *
* This function sets the bitmap scaler with DDA or bilinear interpolation * This function sets the bitmap scaler with DDA or bilinear interpolation
* algorithm. MiniGUI implements \a StretchBlt functions by using this scaler * algorithm. MiniGUI implements StretchBlt functions by using this scaler.
* (when not using Pixman).
* *
* \param hdc The device context. * \param hdc The device context.
* \param scaler_type The type of scaler algorithm, use BITMAP_SCALER_DDA * \param scaler_type The type of scaler algorithm, use BITMAP_SCALER_DDA
@@ -5166,142 +5173,131 @@ MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y,
* The color blend mothed. * The color blend mothed.
* *
* See [Compositing and Blending Level 1](https://www.w3.org/TR/compositing-1/) * See [Compositing and Blending Level 1](https://www.w3.org/TR/compositing-1/)
* Note: we define the same values with Pixman.
*/ */
typedef enum { typedef enum {
COLOR_BLEND_LEGACY = 0,
COLOR_BLEND_FLAGS_MASK = 0x00FF,
/** Porter Duff rule: clear */
COLOR_BLEND_PD_CLEAR = 0x0100, // PIXMAN_OP_CLEAR = 0x00
/** Porter Duff rule: source */
COLOR_BLEND_PD_SRC = 0x0101, // PIXMAN_OP_SRC = 0x01
/** Porter Duff rule: destination */
COLOR_BLEND_PD_DST = 0x0102, // PIXMAN_OP_DST = 0x02
/** Porter Duff rule: source over destination */ /** Porter Duff rule: source over destination */
COLOR_BLEND_PD_SRC_OVER = 0x0103, // PIXMAN_OP_OVER = 0x03 COLOR_BLEND_PD_SRC_OVER = 0,
/** Porter Duff rule: destination over source */ /** Porter Duff rule: destination over source */
COLOR_BLEND_PD_DST_OVER = 0x0104, // PIXMAN_OP_OVER_REVERSE = 0x04 COLOR_BLEND_PD_DST_OVER,
/** Porter Duff rule: clear */
COLOR_BLEND_PD_CLEAR,
/** Porter Duff rule: source */
COLOR_BLEND_PD_SRC,
/** Porter Duff rule: destination */
COLOR_BLEND_PD_DST,
/** Porter Duff rule: souorce in destination */ /** Porter Duff rule: souorce in destination */
COLOR_BLEND_PD_SRC_IN = 0x0105, // PIXMAN_OP_IN = 0x05 COLOR_BLEND_PD_SRC_IN,
/** Porter Duff rule: destination in souorce */ /** Porter Duff rule: destination in souorce */
COLOR_BLEND_PD_DST_IN = 0x0106, // PIXMAN_OP_IN_REVERSE = 0x06 COLOR_BLEND_PD_DST_IN,
/** Porter Duff rule: source held out by destination */ /** Porter Duff rule: source held out by destination */
COLOR_BLEND_PD_SRC_OUT = 0x0107, // PIXMAN_OP_OUT = 0x07 COLOR_BLEND_PD_SRC_OUT,
/** Porter Duff rule: destination held out by source */ /** Porter Duff rule: destination held out by source */
COLOR_BLEND_PD_DST_OUT = 0x0108, // PIXMAN_OP_OUT_REVERSE = 0x08 COLOR_BLEND_PD_DST_OUT,
/** Porter Duff rule: source atop destination */ /** Porter Duff rule: source atop destination */
COLOR_BLEND_PD_SRC_ATOP = 0x0109, // PIXMAN_OP_ATOP = 0x09 COLOR_BLEND_PD_SRC_ATOP,
/** Porter Duff rule: destination atop source */ /** Porter Duff rule: destination atop source */
COLOR_BLEND_PD_DST_ATOP = 0x010a, // PIXMAN_OP_ATOP_REVERSE = 0x0a COLOR_BLEND_PD_DST_ATOP,
/** Porter Duff rule: source xor destination */ /** Porter Duff rule: source xor destination */
COLOR_BLEND_PD_XOR = 0x010b, // PIXMAN_OP_XOR = 0x0b COLOR_BLEND_PD_XOR,
/** Porter Duff rule: plus */ /** Porter Duff rule: plus */
COLOR_BLEND_PD_PLUS = 0x010c, // PIXMAN_OP_ADD = 0x0c COLOR_BLEND_PD_PLUS,
/** Porter Duff rule: modulate */ /** Porter Duff rule: modulate */
COLOR_BLEND_PD_MODULATE = 0x010d, // PIXMAN_OP_SATURATE = 0x0d COLOR_BLEND_PD_MODULATE,
COLOR_BLEND_PD_FLAG = 0x0100, COLOR_BLEND_PD_FIRST = COLOR_BLEND_PD_SRC_OVER,
COLOR_BLEND_PD_FIRST = COLOR_BLEND_PD_CLEAR, COLOR_BLEND_PD_LAST = COLOR_BLEND_PD_MODULATE,
COLOR_BLEND_PD_LAST = COLOR_BLEND_PD_MODULATE,
/** /**
* Separable blend mode: normal * Separable blend mode: normal
* The blending formula simply selects the source color. * The blending formula simply selects the source color.
*/ */
COLOR_BLEND_SP_NORMAL = 0x0801, COLOR_BLEND_SP_NORMAL,
/** /**
* Separable blend mode: multiply * Separable blend mode: multiply
* Darkens by multiplying colors: Sc·Dc. * Darkens by multiplying colors: Sc·Dc.
*/ */
COLOR_BLEND_SP_MULTIPLY = 0x0830, // PIXMAN_OP_MULTIPLY = 0x30 COLOR_BLEND_SP_MULTIPLY,
/** /**
* Separable blend mode: screen * Separable blend mode: screen
* Complements product of complements: Sc + Dc - Sc·Dc. * Complements product of complements: Sc + Dc - Sc·Dc.
*/ */
COLOR_BLEND_SP_SCREEN = 0x0831, // PIXMAN_OP_SCREEN = 0x31 COLOR_BLEND_SP_SCREEN,
/** /**
* Separable blend mode: overlay * Separable blend mode: overlay
* Inverse of hard-light. * Inverse of hard-light.
*/ */
COLOR_BLEND_SP_OVERLAY = 0x0832, // PIXMAN_OP_OVERLAY = 0x32 COLOR_BLEND_SP_OVERLAY,
/** /**
* Separable blend mode: darken * Separable blend mode: darken
* Minimum of colors: min(Sc, Dc). * Minimum of colors: min(Sc, Dc).
*/ */
COLOR_BLEND_SP_DARKEN = 0x0833, // PIXMAN_OP_DARKEN = 0x33 COLOR_BLEND_SP_DARKEN,
/** /**
* Separable blend mode: lighten * Separable blend mode: lighten
* Maximum of colors: max(Sc, Dc). * Maximum of colors: max(Sc, Dc).
*/ */
COLOR_BLEND_SP_LIGHTEN = 0x0834, // PIXMAN_OP_LIGHTEN = 0x34 COLOR_BLEND_SP_LIGHTEN,
/** /**
* Separable blend mode: color-dodge * Separable blend mode: color-dodge
* Brightens destination based on source. * Brightens destination based on source.
*/ */
COLOR_BLEND_SP_COLOR_DODGE = 0x0835, // PIXMAN_OP_COLOR_DODGE = 0x35, COLOR_BLEND_SP_COLOR_DODGE,
/** /**
* Separable blend mode: color-burn * Separable blend mode: color-burn
* Darkens destination based on source. * Darkens destination based on source.
*/ */
COLOR_BLEND_SP_COLOR_BURN = 0x0836, // PIXMAN_OP_COLOR_BURN = 0x36, COLOR_BLEND_SP_COLOR_BURN,
/** /**
* Separable blend mode: hard-light * Separable blend mode: hard-light
* Similar to effect of harsh spotlight. * Similar to effect of harsh spotlight.
*/ */
COLOR_BLEND_SP_HARD_LIGHT = 0x0837, // PIXMAN_OP_HARD_LIGHT = 0x37, COLOR_BLEND_SP_HARD_LIGHT,
/** /**
* Separable blend mode: soft-light * Separable blend mode: soft-light
* Similar to effect of soft spotlight. * Similar to effect of soft spotlight.
*/ */
COLOR_BLEND_SP_SOFT_LIGHT = 0x0838, // PIXMAN_OP_SOFT_LIGHT = 0x38 COLOR_BLEND_SP_SOFT_LIGHT,
/** /**
* Separable blend mode: difference * Separable blend mode: difference
* Subtracts the darker from the lighter: Abs(Dc - Sc). * Subtracts the darker from the lighter: Abs(Dc - Sc).
*/ */
COLOR_BLEND_SP_DIFFERENCE = 0x0839, // PIXMAN_OP_DIFFERENCE = 0x39 COLOR_BLEND_SP_DIFFERENCE,
/** /**
* Separable blend mode: exclusion * Separable blend mode: exclusion
* Similar to Difference but lower contrast. * Similar to Difference but lower contrast.
*/ */
COLOR_BLEND_SP_EXCLUSION = 0x083a, // PIXMAN_OP_EXCLUSION = 0x3a COLOR_BLEND_SP_EXCLUSION,
COLOR_BLEND_SP_FLAG = 0x0800, COLOR_BLEND_SP_FIRST = COLOR_BLEND_SP_NORMAL,
COLOR_BLEND_SP_FIRST = COLOR_BLEND_SP_NORMAL, COLOR_BLEND_SP_LAST = COLOR_BLEND_SP_EXCLUSION,
COLOR_BLEND_SP_LAST = COLOR_BLEND_SP_EXCLUSION,
/** /**
* Non-Separable blend mode: hue * Non-Separable blend mode: hue
* Creates a color with the hue of the source color and * Creates a color with the hue of the source color and
* the saturation and luminosity of the backdrop color. * the saturation and luminosity of the backdrop color.
*/ */
COLOR_BLEND_NS_HUE = 0x103b, // PIXMAN_OP_HSL_HUE = 0x3b COLOR_BLEND_NS_HUE,
/** /**
* Non-Separable blend mode: saturation * Non-Separable blend mode: saturation
* Creates a color with the saturation of the source color and * Creates a color with the saturation of the source color and
* the hue and luminosity of the backdrop color. * the hue and luminosity of the backdrop color.
*/ */
COLOR_BLEND_NS_SATURATION = 0x103c, // PIXMAN_OP_HSL_SATURATION = 0x3c COLOR_BLEND_NS_SATURATION,
/** /**
* Non-Separable blend mode: color * Non-Separable blend mode: color
* Creates a color with the hue and saturation of the source color * Creates a color with the hue and saturation of the source color
* and the luminosity of the backdrop color. * and the luminosity of the backdrop color.
*/ */
COLOR_BLEND_NS_COLOR = 0x103d, // PIXMAN_OP_HSL_COLOR = 0x3d COLOR_BLEND_NS_COLOR,
/** /**
* Non-Separable blend mode: luminosity * Non-Separable blend mode: luminosity
* Creates a color with the luminosity of the source color and * Creates a color with the luminosity of the source color and
* the hue and saturation of the backdrop color. * the hue and saturation of the backdrop color.
*/ */
COLOR_BLEND_NS_LUMINOSITY = 0x103e, // PIXMAN_OP_HSL_LUMINOSITY = 0x3e COLOR_BLEND_NS_LUMINOSITY,
COLOR_BLEND_NS_FLAG = 0x1000, COLOR_BLEND_NS_FIRST = COLOR_BLEND_NS_HUE,
COLOR_BLEND_NS_FIRST = COLOR_BLEND_NS_HUE, COLOR_BLEND_NS_LAST = COLOR_BLEND_NS_LUMINOSITY,
COLOR_BLEND_NS_LAST = COLOR_BLEND_NS_LUMINOSITY,
COLOR_BLEND_FIRST = COLOR_BLEND_PD_CLEAR,
COLOR_BLEND_LAST = COLOR_BLEND_NS_LAST,
} ColorBlendMethod; } ColorBlendMethod;
/** /**
@@ -5353,107 +5349,16 @@ typedef enum {
* in the destination DC. * in the destination DC.
* \param dy The y coordinate of the upper-left corner of the rectangle * \param dy The y coordinate of the upper-left corner of the rectangle
* in the destination DC. * in the destination DC.
* \param dwRop The color blending method, see \a ColorBlendMethod. * \param dwRop The raster logical operation, see \a ColorLogicalOp.
* This argument is only valid when Pixman is used. * this argument is reserved for future use, currently ignored.
* *
* \note When the source color key is specified for the blitting operation, * \note The alpha and color key settings of the source DC will come into play.
* or the formats of the device contexts are not supported by Pixman,
* this function will use the legacy implementation. In this situation,
* the color blending method will be ignored.
* *
* \sa StretchBlt, SetMemDCAlpha, SetMemDCColorKey, ColorBlendMethod * \sa StretchBlt, SetMemDCAlpha, SetMemDCColorKey, ColorLogicalOp
*/ */
MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh, MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
HDC hddc, int dx, int dy, DWORD dwRop); HDC hddc, int dx, int dy, DWORD dwRop);
/**
* The scaling filter for StretchBlt.
*/
typedef enum {
/** The fast filter (DDA scaler) */
SCALING_FILTER_FAST = 0x00000000,
/** The good filter */
SCALING_FILTER_GOOD = 0x00010000,
/** The best filter */
SCALING_FILTER_BEST = 0x00020000,
/** The filter using nearest algorithm */
SCALING_FILTER_NEAREST = 0x00020000,
/** The filter using bi-linear algorithm */
SCALING_FILTER_BILINEAR = 0x00040000,
/** The filter using convolution algorithm */
SCALING_FILTER_CONVOLUTION = 0x00050000,
SCALING_FILTER_SHIFT = 16,
} ScalingFilter;
/**
* The stretch extra information for \a StretchBltEx.
*
* \sa StretchBltEx
*/
typedef struct _STRETCH_EXTRA_INFO {
/** The version code; reserved for future, must set zero */
int version;
/** The rotation of the source bitmap in 1/64ths of a degree. */
int rotation;
/** The x-coordinate of the rotation center in the destination rectangle,
* relative to the uppper-left corner of the rectangle. */
int cx;
/** The y-coordinate of the rotation center in the destination rectangle,
* relative to the uppper-left corner of the rectangle. */
int cy;
} STRETCH_EXTRA_INFO;
/**
* \fn BOOL GUIAPI StretchBltEx (HDC hsdc, int sx, int sy, int sw, int sh,
* HDC hddc, int dx, int dy, int dw, int dh, int rotation, DWORD dwRop)
* \brief Copies a bitmap from a source rectangle into a destination
* rectangle, streches and rotates the bitmap if necessary.
*
* This function copies a bitmap from a source rectangle into a destination
* rectangle, streching or compressing the bitmap to fit the dimension of
* the destination rectangle, if necessary. This function is similar with
* \sa BitBlt function except the former scaling the bitmap. \a (dw,dh)
* specifies the size of the destination rectangle.
*
* \param hsdc The source device context.
* \param sx The x coordinate of the upper-left corner of the rectangle
* in the source DC.
* \param sy The y coordinate of the upper-left corner of the rectangle
* in the source DC.
* \param sw The width of the source rectangle.
* \param sh The height of the source rectangle.
* \param hddc The destination device context \a hddc.
* \param dx The x coordinate of the upper-left corner of the rectangle
* in the destination DC.
* \param dy The y coordinate of the upper-left corner of the rectangle
* in the destination DC.
* \param dw The width of the destination rectangle.
* \param dh The height of the destination rectangle.
* \param sei The pointer to a stretch extra information strucure;
* can be NULL. Note this only works when Pixman is used.
* \param dwRop The color blending method, see \a ColorBlendMethod, OR'd
* with a fiter of the scaling, see \a ScalingFilter.
* This argument only works when Pixman is used.
*
* \return TRUE for success, FALSE for bad arguments and there is no any
* drawing occurred.
*
* \note When the source color key is specified for the blitting operation,
* or the formats of the device contexts are not supported by Pixman,
* this function will use the legacy implementation. In this situation,
* the color blending method, the scaling filter, and the rotation
* will be ignored.
*
* \sa BitBlt, SetMemDCAlpha, SetMemDCColorKey, STRETCH_EXTRA_INFO,
* ColorBlendMethod, ScalingFilter
*/
MG_EXPORT BOOL GUIAPI StretchBltEx (HDC hsdc, int sx, int sy, int sw, int sh,
HDC hddc, int dx, int dy, int dw, int dh,
const STRETCH_EXTRA_INFO *sei, DWORD dwRop);
/** /**
* \fn void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh, \ * \fn void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh, \
HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop) HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop)
@@ -5463,7 +5368,7 @@ MG_EXPORT BOOL GUIAPI StretchBltEx (HDC hsdc, int sx, int sy, int sw, int sh,
* This function copies a bitmap from a source rectangle into a destination * This function copies a bitmap from a source rectangle into a destination
* rectangle, streching or compressing the bitmap to fit the dimension of * rectangle, streching or compressing the bitmap to fit the dimension of
* the destination rectangle, if necessary. This function is similar with * the destination rectangle, if necessary. This function is similar with
* \sa BitBlt function except the former scaling the bitmap. \a (dw,dh) * \sa BitBlt function except the former scaling the bitmap. \a (dw,dh)
* specifies the size of the destination rectangle. * specifies the size of the destination rectangle.
* *
* \param hsdc The source device context. * \param hsdc The source device context.
@@ -5480,25 +5385,21 @@ MG_EXPORT BOOL GUIAPI StretchBltEx (HDC hsdc, int sx, int sy, int sw, int sh,
* in the destination DC. * in the destination DC.
* \param dw The width of the destination rectangle. * \param dw The width of the destination rectangle.
* \param dh The height of the destination rectangle. * \param dh The height of the destination rectangle.
* \param dwRop The color blending method, see \a ColorBlendMethod. * \param dwRop The raster logical operation, see \a ColorLogicalOp.
* This argument is only valid when Pixman is used. * this argument is reserved for future use, currently ignored.
* *
* \note When color key is specified for the blitting operation, or the * \note The source rect should be contained in the device space entirely,
* formats of the device contexts are not supported by Pixman, * and all coordinates should be in the device space.
* this function will use the legacy implementation. In this situation,
* the color blending method and the scaling filter will be ignored.
* *
* \sa BitBlt, SetMemDCAlpha, SetMemDCColorKey, ColorBlendMethod * \note The source DC and dest DC must compatible, else will do nothing.
*
* \note The alpha and color key settings of the source DC will not come
* into play.
*
* \sa BitBlt, SetMemDCAlpha, SetMemDCColorKey
*/ */
static inline void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh, MG_EXPORT void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh,
HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop) HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop);
{
StretchBltEx (hsdc, sx, sy, sw, sh, hddc, dx, dy, dw, dh, NULL, dwRop);
}
/* Use this if you want to have the legacy manner of StretchBlt */
MG_EXPORT void GUIAPI StretchBltLegacy (HDC hsdc, int sx, int sy, int sw, int sh,
HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop);
/** /**
* \fn BOOL GUIAPI ScaleBitmapEx (BITMAP* dst, const BITMAP* src, \ * \fn BOOL GUIAPI ScaleBitmapEx (BITMAP* dst, const BITMAP* src, \
@@ -10091,7 +9992,7 @@ typedef Uint16 BreakOppo;
* allocated by this function if it allocates the buffer. * allocated by this function if it allocates the buffer.
* *
* \param lang_code The language code; not used so far, reserved for future. * \param lang_code The language code; not used so far, reserved for future.
* \param ctr The character transformation rule; see \a char_transform_rules. * \param ctr The character transformation rule; see \a char_transform_rule.
* \param wbr The word breaking rule; see \a word_break_rules. * \param wbr The word breaking rule; see \a word_break_rules.
* \param lbp The line breaking policy; see \a line_break_policies. * \param lbp The line breaking policy; see \a line_break_policies.
* \param ucs The Uchar32 string. * \param ucs The Uchar32 string.
@@ -10116,7 +10017,7 @@ typedef Uint16 BreakOppo;
* *
* \note Only available when support for UNICODE is enabled. * \note Only available when support for UNICODE is enabled.
* *
* \sa DrawGlyphStringEx, word_break_rules, char_transform_rules, * \sa DrawGlyphStringEx, word_break_rules, char_transform_rule,
* line_break_policies * line_break_policies
*/ */
MG_EXPORT int GUIAPI UStrGetBreaks(LanguageCode lang_code, MG_EXPORT int GUIAPI UStrGetBreaks(LanguageCode lang_code,
@@ -12951,7 +12852,6 @@ MG_EXPORT int GUIAPI GetGlyphsExtentPoint (HDC hdc, Glyph32* glyphs,
#define GLYPH_INFO_METRICS 0x01 #define GLYPH_INFO_METRICS 0x01
#define GLYPH_INFO_BMP 0x02 #define GLYPH_INFO_BMP 0x02
#define GLYPH_INFO_FACE 0x04
/** The type of glyph bitmap: monochrome */ /** The type of glyph bitmap: monochrome */
#define GLYPHBMP_TYPE_MONO 0x00 #define GLYPHBMP_TYPE_MONO 0x00
@@ -12974,7 +12874,6 @@ typedef struct _GLYPHINFO {
* or bitmap infomation. Or'ed with the following values: * or bitmap infomation. Or'ed with the following values:
* - GLYPH_INFO_METRICS * - GLYPH_INFO_METRICS
* - GLYPH_INFO_BMP * - GLYPH_INFO_BMP
* - GLYPH_INFO_FACE
*/ */
Uint32 mask; Uint32 mask;
@@ -13007,16 +12906,6 @@ typedef struct _GLYPHINFO {
* It is only valid if bmp_type is GLYPHBMP_TYPE_PRERENDER * It is only valid if bmp_type is GLYPHBMP_TYPE_PRERENDER
*/ */
BITMAP prbitmap; BITMAP prbitmap;
/**
* The FreeType face, font file path, and the glyph index
* (when mask has GLYPH_INFO_FACE set).
* You can use these information to render the glyph by yourself.
* Only available if the device font is a TrueType/OpenType font.
*/
void* ft_face;
const char* file_path;
Uint32 index;
} GLYPHINFO; } GLYPHINFO;
/** /**
@@ -13146,7 +13035,7 @@ MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
* *
* \note Only available when support for UNICODE is enabled. * \note Only available when support for UNICODE is enabled.
* *
* \sa DrawGlyphStringEx, white_space_rules, char_transform_rules * \sa DrawGlyphStringEx, white_space_rules, char_transform_rule
* *
* Since 4.0.0 * Since 4.0.0
*/ */
+22 -129
View File
@@ -82,16 +82,10 @@ extern "C" {
#define ZOF_MAXIMIZED 0x00000004 // Since 5.0.0 #define ZOF_MAXIMIZED 0x00000004 // Since 5.0.0
#define ZOF_MINIMIZED 0x00000008 // Since 5.0.0 #define ZOF_MINIMIZED 0x00000008 // Since 5.0.0
/* Since 5.0.6 */
#define ZOF_GESTURE_FLAGS_MASK 0X000000F0
#define ZOF_GF_SWIPE_HORZ 0x00000010
#define ZOF_GF_SWIPE_VERT 0x00000020
/* Since 5.0.0 */ /* Since 5.0.0 */
#define ZOF_INTERNAL_FLAGS_MASK 0X000F0000 #define ZOF_INTERNAL_FLAGS_MASK 0X000F0000
#define ZOF_IF_REFERENCE 0x00010000 #define ZOF_IF_REFERENCE 0x00010000
#define ZOF_IF_ALWAYSTOP 0x00020000 #define ZOF_IF_ALWAYSTOP 0x00020000
#define ZOF_IF_SPECIAL 0x00040000 // Since 5.0.6
#define ZOF_TW_FLAG_MASK 0x00F00000 #define ZOF_TW_FLAG_MASK 0x00F00000
#define ZOF_TW_TROUNDCNS 0x00100000 #define ZOF_TW_TROUNDCNS 0x00100000
@@ -107,9 +101,9 @@ extern "C" {
#define ZOF_TYPE_NORMAL 0x30000000 #define ZOF_TYPE_NORMAL 0x30000000
#define ZOF_TYPE_HIGHER 0x40000000 #define ZOF_TYPE_HIGHER 0x40000000
#define ZOF_TYPE_DOCKER 0x50000000 // Since 5.0.0 #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_GLOBAL 0x70000000
#define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0 #define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0; fixed and only one.
#define ZOF_TYPE_POPUPMENU 0x90000000 #define ZOF_TYPE_POPUPMENU 0x90000000
#define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER #define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER
@@ -357,17 +351,9 @@ extern MG_EXPORT MG_Client* mgClients;
*/ */
extern MG_EXPORT MG_Layer* mgTopmostLayer; extern MG_EXPORT MG_Layer* mgTopmostLayer;
/**
* \var MG_Layer* mgDefaultLayer
* \brief The pointer to the default layer.
*
* \sa MG_Layer
*/
extern MG_EXPORT MG_Layer* mgDefaultLayer;
/** /**
* \var MG_Layer* mgLayers * \var MG_Layer* mgLayers
* \brief The pointer to the layer list. * \brief The pointer to the array of layers.
* *
* \sa MG_Layer * \sa MG_Layer
*/ */
@@ -576,8 +562,6 @@ MG_EXPORT BOOL GUIAPI DeleteLayer (BOOL handle_name,
* *
* \return TRUE on success, otherwise FALSE. * \return TRUE on success, otherwise FALSE.
* *
* \note Only one client which has no any window can be moved.
*
* \note The client which created a fixed main window * \note The client which created a fixed main window
* (a main window acts as the screen lock, the docker, or the launcher) will * (a main window acts as the screen lock, the docker, or the launcher) will
* be moved to the topmost layer automatically. * be moved to the topmost layer automatically.
@@ -685,22 +669,21 @@ typedef void (* ON_NEW_DEL_CLIENT) (int op, int cli);
typedef void (* ON_CHANGE_LAYER) (int op, MG_Layer* layer, typedef void (* ON_CHANGE_LAYER) (int op, MG_Layer* layer,
MG_Client* client); MG_Client* client);
#define ZNOP_ALLOCATE 1 #define ZNOP_ALLOCATE 1
#define ZNOP_FREE 2 #define ZNOP_FREE 2
#define ZNOP_MOVE2TOP 3 #define ZNOP_MOVE2TOP 3
#define ZNOP_SHOW 4 #define ZNOP_SHOW 4
#define ZNOP_HIDE 5 #define ZNOP_HIDE 5
#define ZNOP_MOVEWIN 6 #define ZNOP_MOVEWIN 6
#define ZNOP_SETACTIVE 7 #define ZNOP_SETACTIVE 7
#define ZNOP_ENABLEWINDOW 11 #define ZNOP_ENABLEWINDOW 11
#define ZNOP_DISABLEWINDOW 12 #define ZNOP_DISABLEWINDOW 12
#define ZNOP_STARTDRAG 13 #define ZNOP_STARTDRAG 13
#define ZNOP_CANCELDRAG 14 #define ZNOP_CANCELDRAG 14
#define ZNOP_CHANGECAPTION 15 #define ZNOP_CHANGECAPTION 15
#define ZNOP_REGIONCHANGED 16 #define ZNOP_REGIONCHANGED 16
#define ZNOP_COMPOSITINGCHANGED 17 #define ZNOP_COMPOSITINGCHANGED 17
#define ZNOP_ICONCHANGED 18 /* reserved for future */
/** /**
* \var typedef void (* ON_ZNODE_OPERATION) (int op, int cli, int idx_znode) * \var typedef void (* ON_ZNODE_OPERATION) (int op, int cli, int idx_znode)
@@ -906,39 +889,6 @@ MG_EXPORT BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer);
*/ */
MG_EXPORT BOOL GUIAPI ServerDeleteLayer (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, * \fn int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode,
* int* cli) * int* cli)
@@ -1507,9 +1457,7 @@ MG_EXPORT BOOL GUIAPI ServerDoZNodeOperation (MG_Layer* layer, int idx_znode,
* *
* \return TRUE on success, otherwise FALSE. * \return TRUE on success, otherwise FALSE.
* *
* \note Server-only function. Only one client which has no any window can be moved. * \note Server-only function. The client which created a fixed main window
*
* \note The client which created a fixed main window
* (a main window acts as the screen lock, the docker, or the launcher) will * (a main window acts as the screen lock, the docker, or the launcher) will
* be moved to the topmost layer automatically. * be moved to the topmost layer automatically.
* *
@@ -1618,7 +1566,7 @@ typedef struct _CompositorOps {
* a main window with the extended style WS_EX_AUTOPOSITION. * a main window with the extended style WS_EX_AUTOPOSITION.
*/ */
void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer, void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer,
DWORD zt_type, int first_for_type, int cli, CALCPOSINFO* info); DWORD zt_type, int first_for_type, CALCPOSINFO* info);
/** /**
* This operation will be called when there was a layer operation. * This operation will be called when there was a layer operation.
@@ -1747,20 +1695,6 @@ typedef struct _CompositorOps {
void (*on_moved_win) (CompositorCtxt* ctxt, MG_Layer* layer, void (*on_moved_win) (CompositorCtxt* ctxt, MG_Layer* layer,
int zidx, const RECT* rc_org); int zidx, const RECT* rc_org);
/**
* This operation will composite multiple layers on the screen at the same
* time by using the combining paramemters.
*/
unsigned int (*composite_layers) (CompositorCtxt* ctxt, MG_Layer* layers[],
int nr_layers, void* combine_param);
/**
* This operation will be called when transiting to a new topmost layer.
* The compositor can play an animation to transit from the current
* topmost layer to the new topmost layer.
*/
void (*transit_to_layer) (CompositorCtxt* ctxt, MG_Layer* to_layer);
/** /**
* This operation will be called when the system is maximizing a window. * This operation will be called when the system is maximizing a window.
* The compositor can play an animation in this operation. * The compositor can play an animation in this operation.
@@ -1775,35 +1709,12 @@ typedef struct _CompositorOps {
} CompositorOps; } CompositorOps;
#define FCM_HORIZONTAL 0x0000
#define FCM_VERTICAL 0x0001
#define FCM_METHOD_MASK 0x00FF
#define FCM_SCALE 0x0100
/** The combining parameters for the callback compositor. */
typedef struct _CombParamsFallback {
/**
* The combining method, can be one of the following values:
* - FCM_HORIZONTAL
* - FCM_VERTICAL
* and/or OR'd with the following value:
* - FCM_SCALE
*/
unsigned int method;
/** The percentage of the screen occupied by the first layer. */
float percent;
/** The scale factor of non-global z-nodes. */
float scale;
} COMBPARAMS_FALLBACK;
/** /**
* \brief Get the operations of a specific compositor. * \brief Get the operations of a specific compositor.
* *
* This function gets the operations of a specific compositor. * This function gets the operations of a specific compositor.
* *
* \param name The name of the compositor. MiniGUI reserved `fallback` * \param name The name of the compositor. MiniGUI reserved `default`
* as the default compositor which is implemented in MiniGUI Core. * as the default compositor which is implemented in MiniGUI Core.
* You can use some operations of the default compositor as the * You can use some operations of the default compositor as the
* corresponding operations for your own compositor. * corresponding operations for your own compositor.
@@ -1863,7 +1774,7 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
* \brief Select a compositor as the current compositor. * \brief Select a compositor as the current compositor.
* *
* This function selects a compositor as the current compositor * This function selects a compositor as the current compositor
* and returns the compositor operations. * and returns the compositor object.
* It also destroies the old compositor object if there is old one. * It also destroies the old compositor object if there is old one.
* *
* \param name The name of the compositor. If the argument is NULL, * \param name The name of the compositor. If the argument is NULL,
@@ -1881,25 +1792,7 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor ( MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
const char* name, CompositorCtxt** ctxt); const char* name, CompositorCtxt** ctxt);
/** #define COMPSOR_OPS_VERSION 1
* \brief Get the name and the context of the current compositor.
*
* This function gets the name and the context of the current
* compositor.
*
* \param ops The buffer used to return the compositor operations.
* \param ctxt The buffer used to return the compositor context.
*
* \return The name of the current compositor; NULL for error.
*
* \note Only called by the server.
*
* Since 5.0.6.
*/
MG_EXPORT const char* GUIAPI ServerGetCurrentCompositor (
const CompositorOps** ops, CompositorCtxt** ctxt);
#define COMPSOR_OPS_VERSION 2
/** /**
* Implement this stub to return the compositor operations * Implement this stub to return the compositor operations
+73 -139
View File
@@ -1448,17 +1448,6 @@ extern DWORD __mg_interval_time;
*/ */
#define MSG_HELP 0x006A #define MSG_HELP 0x006A
/**
* \def MSG_GESTURETEST
* \brief This message will be sent to a main window for gesture test.
*
* The client should call \a SetMainWindowGestureFlags to set the gesture flags
* for a main window after got this message.
*
* Since 5.0.6.
*/
#define MSG_GESTURETEST 0x006B
#define MSG_LASTCREATEMSG 0x006F #define MSG_LASTCREATEMSG 0x006F
/** @} end of creation_msgs */ /** @} end of creation_msgs */
@@ -2474,9 +2463,6 @@ typedef struct _COMPOSITINGINFO {
/* Since 5.0.0 */ /* Since 5.0.0 */
#define MSG_SETAUTOREPEAT 0x0107 #define MSG_SETAUTOREPEAT 0x0107
/* Since 5.0.6 */
#define MSG_SETGESTUREFLAGS 0x0108
#define MSG_SHOWGLOBALCTRL 0x010A #define MSG_SHOWGLOBALCTRL 0x010A
#define MSG_HIDEGLOBALCTRL 0x010B #define MSG_HIDEGLOBALCTRL 0x010B
@@ -2997,9 +2983,6 @@ typedef struct _WINMASKINFO {
/* Since 5.0.0: for calculating the default position */ /* Since 5.0.0: for calculating the default position */
#define MSG_CALC_POSITION 0x014B #define MSG_CALC_POSITION 0x014B
/* Since 5.0.6: for waking up the client */
#define MSG_WAKEUP_CLIENT 0x014C
/** /**
* \def MSG_DOESNEEDIME * \def MSG_DOESNEEDIME
* \brief Send to a window to query whether the window needs to open * \brief Send to a window to query whether the window needs to open
@@ -4297,62 +4280,39 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
*/ */
#define WS_DISABLED 0x04000000L #define WS_DISABLED 0x04000000L
/** /* Main window states -- reserved for future use. */
* \def WS_VSCROLL #define WS_MINIMIZE 0x02000000L
* \brief Creates a window with vertical scroll bar. #define WS_MAXIMIZE 0x01000000L
*/
#define WS_VSCROLL 0x02000000L
/** /* bits in this mask are reuse for main windows and controls;
* \def WS_HSCROLL bits have different meanings for main windows and controls.*/
* \brief Creates a window with horizontal scroll bar. #define WS_REUSE_MASK 0x00E00000L
*/
#define WS_HSCROLL 0x01000000L
/* bits in this mask are both for main window and controls */
#define WS_BORDER_MASK 0x00F00000L
/** /**
* \def WS_DLGFRAME * \def WS_DLGFRAME
* \brief The main window has a fixed frame, i.e. user can not * \brief The main window has a fixed frame, i.e. user can not
* drag the border of the window. * drag the border of the window.
*/ */
#define WS_DLGFRAME 0x00800000L #define WS_DLGFRAME 0x00800000L
/** /**
* \def WS_THICKFRAME * \def WS_THICKFRAME
* \brief Creates a main window with thick frame. * \brief Creates a main window with thick frame.
*/ */
#define WS_THICKFRAME 0x00400000L #define WS_THICKFRAME 0x00400000L
/** /**
* \def WS_THINFRAME * \def WS_THINFRAME
* \brief Creates a main window with thin frame. * \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 * \def WS_GROUP
* \brief Indicates the control is the leader of a group. * \brief Indicates the control is the leader of a group.
* \note This style is valid only for controls. * \note This style is valid only for controls.
*/ */
#define WS_GROUP 0x00040000L #define WS_GROUP 0x00800000L
/** /**
* \def WS_TABSTOP * \def WS_TABSTOP
@@ -4360,11 +4320,7 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* using Tab key. * using Tab key.
* \note This style is valid only for controls. * \note This style is valid only for controls.
*/ */
#define WS_TABSTOP 0x00020000L #define WS_TABSTOP 0x00400000L
/* Main window states -- reserved for future use. */
#define WS_MINIMIZE 0x00040000L
#define WS_MAXIMIZE 0x00020000L
/** /**
* \def WS_ALWAYSTOP * \def WS_ALWAYSTOP
@@ -4372,11 +4328,38 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* *
* Since 5.0.0. * Since 5.0.0.
*/ */
#define WS_ALWAYSTOP 0x00010000L #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
/* Obsolete styles, back-compatibility definitions. */ /* Obsolete styles, back-compatibility definitions. */
#define WS_OVERLAPPED 0x00000000L #define WS_OVERLAPPED 0x00000000L
#define WS_ABSSCRPOS 0x00000000L #define WS_ABSSCRPOS 0x00000000L
#define WS_MAINWIN_ONLY_MASK (WS_CAPTIONBAR_MASK | WS_ALWAYSTOP) #define WS_MAINWIN_ONLY_MASK (WS_CAPTIONBAR_MASK | WS_ALWAYSTOP)
#define WS_CONTROL_ONLY_MASK (WS_CTRLMASK) #define WS_CONTROL_ONLY_MASK (WS_CTRLMASK)
@@ -4450,12 +4433,16 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
/** /**
* \def WS_EX_WINTYPE_TOOLTIP * \def WS_EX_WINTYPE_TOOLTIP
* \brief The type for a tooltip main window. * \brief The type for a system/global main window.
* *
* Use this style when you want to create a tooltip main window. * Use this style when you want to create a tooltip main window.
* A tooltip main window will be shown above other types of main windows. * A tooltip main window will be shown above other types of main windows.
* *
* \note The maximal number of all main windows in the tooltip level is 16. * \note Under MiniGUI-Processes runtime mode, only the client which creates
* the first main window in the tooltip level can create other main
* windows in this level. For other clients, a main window in the higher
* level will be created.
* \note The maximal number of all main windows in the tooltip level is 8.
* MiniGUI will create a main windows in higher level if there is no room * MiniGUI will create a main windows in higher level if there is no room
* in the tooltip level. * in the tooltip level.
* *
@@ -4471,12 +4458,8 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* A system/global main window will be shown above other types of main windows. * A system/global main window will be shown above other types of main windows.
* *
* \note Under MiniGUI-Processes runtime mode, only the server (`mginit`) can * \note Under MiniGUI-Processes runtime mode, only the server (`mginit`) can
* create main windows in the system level, and any main windows created * create main windows in the system level, and any main windows created
* by the server is a system main window. * by the server is a system main window.
*
*
* \note Under MiniGUI-Processes runtime mode, the windows in this level will be kept
* visible on all layers.
* *
* Since 5.0.0. * Since 5.0.0.
*/ */
@@ -4490,18 +4473,13 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* screen lock level. A main window in the screen lock level will * screen lock level. A main window in the screen lock level will
* be shown below the system main windows and above the other main windows. * be shown below the system main windows and above the other main windows.
* *
* \note Under MiniGUI-Processes runtime mode, only clients on the default (`mginit`) * \note Under MiniGUI-Processes runtime mode, only the client which creates
* layer can create a main window in this level, and only the client which creates * the first main window in the screen lock level can create other
* the first main window in the screen lock level can create other * main windows in the this level. For other clients, a main window in
* main windows in the this level. For other clients, a main window in * the higher level will be created.
* the higher level will be created.
*
* \note Under MiniGUI-Processes runtime mode, the windows in this level will be kept
* visible on all layers.
*
* \note The maximal number of all main windows in the screen lock level is 8. * \note The maximal number of all main windows in the screen lock level is 8.
* MiniGUI will create a main windows in higher level if there is no room * MiniGUI will create a main windows in higher level if there is no room
* in the screen lock level. * in the screen lock level.
* *
* Since 5.0.0. * Since 5.0.0.
*/ */
@@ -4516,18 +4494,13 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* be shown below the main windows in the screen lock level and * be shown below the main windows in the screen lock level and
* above the main windows in the higher level. * above the main windows in the higher level.
* *
* \note Under MiniGUI-Processes runtime mode, only clients on the default (`mginit`) * \note Under MiniGUI-Processes runtime mode, only the client which creates
* layer can create a main window in this levele, and only the client which creates * the first main window in the docker level can create other main windows
* the first main window in the docker level can create other main windows * in the docker level. For other clients, a main window in the higher
* in the docker level. For other clients, a main window in the higher * level will be created.
* level will be created.
*
* \note Under MiniGUI-Processes runtime mode, the windows in this level will be kept
* visible on all layers.
*
* \note The maximal number of all main windows in the docker level is 8. * \note The maximal number of all main windows in the docker level is 8.
* MiniGUI will create a main windows in higher level if there is no room * MiniGUI will create a main windows in higher level if there is no room
* in the docker level. * in the docker level.
* *
* Since 5.0.0. * Since 5.0.0.
*/ */
@@ -4576,18 +4549,13 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* be shown below the main windows in the normal level and * be shown below the main windows in the normal level and
* above the wallpaper. * above the wallpaper.
* *
* \note Under MiniGUI-Processes runtime mode, only clients on the default (`mginit`) * \note Under MiniGUI-Processes runtime mode, only the client which creates
* layer can create a main window in this levele, and only the client which creates * the first main window in the launcher level can create other
* the first main window in the launcher level can create other * main windows in the launcher level. For other clients, a main window
* main windows in the launcher level. For other clients, a main window * in the normal level will be created.
* in the normal level will be created.
*
* \note Under MiniGUI-Processes runtime mode, the windows in this level will be kept
* visible on all layers.
*
* \note The maximal number of all main windows in the launcher level is 8. * \note The maximal number of all main windows in the launcher level is 8.
* MiniGUI will create a main windows in normal level if there is no room * MiniGUI will create a main windows in normal level if there is no room
* in the launcher level. * in the launcher level.
* *
* Since 5.0.0. * Since 5.0.0.
*/ */
@@ -6455,7 +6423,7 @@ MG_EXPORT RES_KEY Str2Key (const char* str);
* \fn int GUIAPI GetWindowZOrder(HWND hWnd); * \fn int GUIAPI GetWindowZOrder(HWND hWnd);
* \brief Get The Control ZOrder in the parent window * \brief Get The Control ZOrder in the parent window
* *
* \param hWnd Handle of a control * \param hWnd Handler of a control
* *
* \return return index of ZOrder or 0 if hWnd is a MainWindow or -1 if error * \return return index of ZOrder or 0 if hWnd is a MainWindow or -1 if error
* *
@@ -6916,14 +6884,13 @@ static inline BOOL MainWindowThreadCleanup (HWND hMainWnd)
#define ST_PIXEL_ARGB4444 0x0001 #define ST_PIXEL_ARGB4444 0x0001
#define ST_PIXEL_ARGB1555 0x0002 #define ST_PIXEL_ARGB1555 0x0002
#define ST_PIXEL_ARGB8888 0x0003 #define ST_PIXEL_ARGB8888 0x0003
#define ST_PIXEL_XRGB565 0x0004
/* other flags for future use */ /* other flags for future use */
/* for default surface flags */ /* for default surface flags */
#define ST_DEFAULT (ST_PIXEL_DEFAULT) #define ST_DEFAULT (ST_PIXEL_DEFAULT)
#define CT_SYSTEM_MASK 0x0000FF #define CT_SYSTEM_MASK 0X0000FF
#define CT_OPAQUE 0x000000 #define CT_OPAQUE 0x000000
#define CT_COLORKEY 0x000001 #define CT_COLORKEY 0x000001
#define CT_ALPHACHANNEL 0x000002 #define CT_ALPHACHANNEL 0x000002
@@ -7191,7 +7158,7 @@ MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
* \param hWnd The handle to the window. * \param hWnd The handle to the window.
* \param fSet Set or cancel the always top style; TRUE to set, FALSE to cancel. * \param fSet Set or cancel the always top style; TRUE to set, FALSE to cancel.
* *
* \return TRUE on success, otherwise FALSE. * \return return TRUE on success, otherwise FALSE.
* *
* \sa GetWindowStyle, WS_ALWAYSTOP * \sa GetWindowStyle, WS_ALWAYSTOP
* *
@@ -7199,39 +7166,6 @@ MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
*/ */
MG_EXPORT BOOL GUIAPI SetMainWindowAlwaysTop (HWND hWnd, BOOL fSet); MG_EXPORT BOOL GUIAPI SetMainWindowAlwaysTop (HWND hWnd, BOOL fSet);
#define GF_SWIPE_HORZ ZOF_GF_SWIPE_HORZ
#define GF_SWIPE_VERT ZOF_GF_SWIPE_VERT
/**
* \fn BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags)
* \brief Set the gesture flags of a main window.
*
* This function sets the gesture flags of a specific main window.
*
* Generally, a main window which needs a specific gesture should handle
* \a MSG_GESTURETEST and call this function to set the correct gesture flags for
* the main window.
*
* The MiniGUI Core will send the MSG_GESTURETEST message as a notification
* to a main window when it tries to handle a gesture globally. If the main window
* sets the flag of the gesture in a specific time, e.g. 100ms, MiniGUI Core will
* pass the gesture events to the main window other than handle the gesture by itself.
*
* \param hWnd The handle to the main window.
* \param dwFlags The new gesture flags, can be OR'd with the following values:
* - GF_SWIPE_HORZ\n
* The main window handles horizontal swipe gesture.
* - GF_SWIPE_VERT\n
* The main window handles vertical swipe gesture.
*
* \return TRUE on success, otherwise FALSE.
*
* \sa MSG_GESTURETEST
*
* Since 5.0.6
*/
MG_EXPORT BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags);
#ifdef _MGSCHEMA_COMPOSITING #ifdef _MGSCHEMA_COMPOSITING
/** /**
@@ -7255,14 +7189,14 @@ MG_EXPORT BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags);
* the alpha channel value (0~255) along with the parameter \a arg. * the alpha channel value (0~255) along with the parameter \a arg.
* - CT_LOGICALPIXEL\n * - CT_LOGICALPIXEL\n
* Do the given color logical operation. You should specify the color * Do the given color logical operation. You should specify the color
* logical raster operation along with the pararmeter \a arg. See \a ColorLogicalOp. * logical raster operation along with the pararmeter \a arg. See \a BitBlt.
* - CT_ALPHAPIXEL\n * - CT_ALPHAPIXEL\n
* The alpha component value of the source and/or the destination pixel go * The alpha component value of the source and/or the destination pixel go
* into effect. You can specify the color blend method along * into effect. You can specify the color blend method along
* with the pararmeter \a arg. See \a ColorBlendMethod. Note that a specific * with the pararmeter \a arg. See \a ColorBlendMethod. Note that a specific
* compositor may not support this compositing type. The built-in `fallback` * compositor may not support this compositing type. The built-in `fallback`
* compositor uses the blend mode argument when using Pixman, otherwise, * compositor ignores the blend mode argument and only always uses the
* uses the Porter Duff blend mode: source over destination (COLOR_BLEND_PD_SRC_OVER). * Porter Duff blend mode: source over destination (COLOR_BLEND_PD_SRC_OVER).
* - CT_BLURRED\n * - CT_BLURRED\n
* Apply a Gaussian blur to the background of the main window. You should * Apply a Gaussian blur to the background of the main window. You should
* also specify the radius of the blur (0 ~ 255) in pixles along with the * also specify the radius of the blur (0 ~ 255) in pixles along with the
+1 -1
View File
@@ -50,7 +50,7 @@ MGLIBADD = $(COMMON_LADD) \
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD) @DEP_LIBS@ libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD)
libminigui_@MGLIB_SUFFIX@_la_SOURCES=$(MGSOURCES) libminigui_@MGLIB_SUFFIX@_la_SOURCES=$(MGSOURCES)
libminigui_@MGLIB_SUFFIX@_la_LDFLAGS=$(MGLDFLAGS) libminigui_@MGLIB_SUFFIX@_la_LDFLAGS=$(MGLDFLAGS)
+27 -72
View File
@@ -154,31 +154,9 @@ int GUIAPI GetSockFD2Server (void)
#include "debug.h" #include "debug.h"
static void check_live (BOOL woken)
{
static DWORD last_ticks;
REQUEST req;
__mg_update_tick_count (NULL);
// Since 5.0.6, only send IAMLIVE if the current ticks > (last_ticks + 100)
if (woken || __mg_tick_counter > last_ticks + 100) {
last_ticks = __mg_tick_counter;
/* Tell server that I am live */
req.id = REQID_IAMLIVE;
req.data = &__mg_tick_counter;
req.len_data = sizeof (unsigned int);
ClientRequest (&req, NULL, 0);
}
}
static void process_socket_message (MSG *msg) static void process_socket_message (MSG *msg)
{ {
if (msg->message == MSG_WAKEUP_CLIENT) { if (msg->message == MSG_UPDATECLIWIN &&
check_live (TRUE);
}
else if (msg->message == MSG_UPDATECLIWIN &&
__mg_client_check_hwnd (msg->hwnd, __mg_client_id)) { __mg_client_check_hwnd (msg->hwnd, __mg_client_id)) {
__mg_update_window (msg->hwnd, __mg_update_window (msg->hwnd,
LOSWORD(msg->wParam), HISWORD(msg->wParam), LOSWORD(msg->wParam), HISWORD(msg->wParam),
@@ -388,6 +366,27 @@ sock_error:
return -1; return -1;
} }
static void check_live (void)
{
REQUEST req;
#if 0 /* deprecated code */
/* Since 5.0.0, call __mg_update_tick_count instead */
if (__mg_tick_counter != SHAREDRES_TIMER_COUNTER) {
AlertDesktopTimerEvent ();
__mg_tick_counter = SHAREDRES_TIMER_COUNTER;
}
#endif /* deprecated code */
__mg_update_tick_count (NULL);
/* Tell server that I am live */
req.id = REQID_IAMLIVE;
req.data = &__mg_tick_counter;
req.len_data = sizeof (unsigned int);
ClientRequest (&req, NULL, 0);
}
BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait) BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
{ {
static DWORD old_timer; static DWORD old_timer;
@@ -399,7 +398,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
struct timeval sel_timeout; struct timeval sel_timeout;
MSG Msg; MSG Msg;
check_live (FALSE); check_live ();
/* rset gets modified each time around */ /* rset gets modified each time around */
rset = msg_queue->rfdset; rset = msg_queue->rfdset;
@@ -434,14 +433,14 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
static unsigned int old_mouse_move_serial = 0xdeadbeef; static unsigned int old_mouse_move_serial = 0xdeadbeef;
int flag = 0, mouse_x = -1, mouse_y = -1, buttons = -1; int flag = 0, mouse_x = -1, mouse_y = -1, buttons = -1;
check_live (FALSE); check_live ();
if (wait && (__mg_tick_counter - old_timer) >= repeat_timeout) { if (wait && (__mg_tick_counter - old_timer) >= repeat_timeout) {
Msg.hwnd = HWND_DESKTOP; Msg.hwnd = HWND_DESKTOP;
Msg.message = MSG_TIMEOUT; Msg.message = MSG_TIMEOUT;
Msg.wParam = (WPARAM)__mg_tick_counter; Msg.wParam = (WPARAM)__mg_tick_counter;
Msg.lParam = 0; Msg.lParam = 0;
Msg.time = __mg_tick_counter; Msg.time = __mg_tick_counter;
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here. // Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
// kernel_QueueMessage (msg_queue, &Msg); // kernel_QueueMessage (msg_queue, &Msg);
old_timer = __mg_tick_counter; old_timer = __mg_tick_counter;
@@ -508,7 +507,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
/* go through registered listen fds */ /* go through registered listen fds */
n += __mg_kernel_check_listen_fds (msg_queue, &rset, wsetptr, esetptr); n += __mg_kernel_check_listen_fds (msg_queue, &rset, wsetptr, esetptr);
check_live (FALSE); check_live ();
if (n > 0) { if (n > 0) {
old_timer = __mg_tick_counter; old_timer = __mg_tick_counter;
@@ -570,23 +569,12 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
__mg_layer = layer_handle; __mg_layer = layer_handle;
zi = (ZORDERINFO*) shmat (joined_info.zi_shmid, 0, SHM_RDONLY); zi = (ZORDERINFO*) shmat (joined_info.zo_shmid, 0, SHM_RDONLY);
if (zi == (void*)-1) { if (zi == (void*)-1) {
return INV_LAYER_HANDLE; return INV_LAYER_HANDLE;
} }
__mg_zorder_info = zi; __mg_zorder_info = zi;
if (joined_info.zi_shmid == joined_info.def_zi_shmid) {
__mg_def_zorder_info = zi;
}
else {
zi = (ZORDERINFO*) shmat (joined_info.def_zi_shmid, 0, SHM_RDONLY);
if (zi == (void*)-1) {
return INV_LAYER_HANDLE;
}
__mg_def_zorder_info = zi;
}
} }
__mg_tick_counter = SHAREDRES_TIMER_COUNTER; __mg_tick_counter = SHAREDRES_TIMER_COUNTER;
@@ -723,39 +711,6 @@ BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid)
__mg_layer = layer_handle; __mg_layer = layer_handle;
__mg_zorder_info = zi; __mg_zorder_info = zi;
#if 0 /* obsolete */
ZORDERNODE* nodes;
int slot;
nodes = GET_ZORDERNODE(zi);
slot = zi->first_tooltip;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
slot = zi->first_topmost;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
slot = zi->first_normal;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
#endif /* obsolete */
return TRUE; return TRUE;
} }
+9 -7
View File
@@ -63,17 +63,21 @@
#include "ctrlmisc.h" #include "ctrlmisc.h"
#define _ID_TIMER 100 #define _ID_TIMER 100
#define _MARGIN 10
static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
static int iBorder;
switch (message) { switch (message) {
case MSG_CREATE: case MSG_CREATE:
{ {
const WINDOWINFO *info;
int timeout = (int)GetWindowAdditionalData (hWnd); int timeout = (int)GetWindowAdditionalData (hWnd);
if (timeout >= 10) if (timeout >= 10)
SetTimer (hWnd, _ID_TIMER, timeout / 10); SetTimer (hWnd, _ID_TIMER, timeout / 10);
info = GetWindowInfo (hWnd);
iBorder =
info->we_rdr->calc_we_area (hWnd, LFRDR_METRICS_BORDER, NULL);
SetWindowFont (hWnd, SetWindowFont (hWnd,
(PLOGFONT)GetWindowElementAttr(hWnd, WE_FONT_TOOLTIP)); (PLOGFONT)GetWindowElementAttr(hWnd, WE_FONT_TOOLTIP));
break; break;
@@ -98,7 +102,7 @@ static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
SetTextColor (hdc, SetTextColor (hdc,
GetWindowElementPixelEx(hWnd, hdc, WE_FGC_TOOLTIP)); GetWindowElementPixelEx(hWnd, hdc, WE_FGC_TOOLTIP));
TabbedTextOut (hdc, _MARGIN, _MARGIN, text); TabbedTextOut (hdc, iBorder, iBorder, text);
EndPaint (hWnd, hdc); EndPaint (hWnd, hdc);
return 0; return 0;
@@ -160,7 +164,6 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
CreateInfo.dwStyle = WS_VISIBLE; CreateInfo.dwStyle = WS_VISIBLE;
CreateInfo.dwExStyle = WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_USEPARENTRDR; CreateInfo.dwExStyle = WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_USEPARENTRDR;
CreateInfo.dwExStyle |= WS_EX_WINTYPE_TOOLTIP | WS_EX_TROUNDCNS | WS_EX_BROUNDCNS;
CreateInfo.spCaption = buf ? buf : text; CreateInfo.spCaption = buf ? buf : text;
CreateInfo.hMenu = 0; CreateInfo.hMenu = 0;
CreateInfo.hCursor = GetSystemCursor (IDC_ARROW); CreateInfo.hCursor = GetSystemCursor (IDC_ARROW);
@@ -168,8 +171,8 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
CreateInfo.MainWindowProc = ToolTipWinProc; CreateInfo.MainWindowProc = ToolTipWinProc;
CreateInfo.lx = x; CreateInfo.lx = x;
CreateInfo.ty = y; CreateInfo.ty = y;
CreateInfo.rx = CreateInfo.lx + text_size.cx + _MARGIN * 2; CreateInfo.rx = CreateInfo.lx + text_size.cx;
CreateInfo.by = CreateInfo.ty + text_size.cy + _MARGIN * 2; CreateInfo.by = CreateInfo.ty + text_size.cy;
CreateInfo.iBkColor = CreateInfo.iBkColor =
GetWindowElementPixelEx (hParentWnd, HDC_SCREEN, WE_BGC_TOOLTIP); GetWindowElementPixelEx (hParentWnd, HDC_SCREEN, WE_BGC_TOOLTIP);
CreateInfo.dwAddData = (DWORD) timeout_ms; CreateInfo.dwAddData = (DWORD) timeout_ms;
@@ -215,8 +218,7 @@ void ResetToolTipWin (HWND hwnd, int x, int y, const char* text, ...)
if (y + text_size.cy > g_rcScr.bottom) if (y + text_size.cy > g_rcScr.bottom)
y = g_rcScr.bottom - text_size.cy; y = g_rcScr.bottom - text_size.cy;
MoveWindow (hwnd, x, y, MoveWindow (hwnd, x, y, text_size.cx, text_size.cy, TRUE);
text_size.cx + _MARGIN * 2, text_size.cy + _MARGIN * 2, TRUE);
ShowWindow (hwnd, SW_SHOWNORMAL); ShowWindow (hwnd, SW_SHOWNORMAL);
} }
+2 -4
View File
@@ -1433,12 +1433,10 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
item_info->add_data = item->add_data; item_info->add_data = item->add_data;
if (item_info->which & MTB_WHICH_TEXT) 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) 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; return NTB_OKAY;
} }
+13 -11
View File
@@ -1012,9 +1012,8 @@ void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
{ {
char font_name [LEN_UNIDEVFONT_NAME + 1]; char font_name [LEN_UNIDEVFONT_NAME + 1];
//memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1); memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
//strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME); strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
strcpy(font_name, (*devfont)->name);
font_DelDevFont (font_name); font_DelDevFont (font_name);
*devfont = NULL; *devfont = NULL;
@@ -1070,22 +1069,25 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
added_num ++; added_num ++;
} }
else { else {
/* [DK] Fix Bug #4801, which introduce an absolute path check error in Windows, /* [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).*/ * first to load from sytem res path, else load it directly(relative or absolute path).*/
if (add_dev_font (font_name, font_file, TRUE)) if ((add_dev_font (font_name, font_file, TRUE)) == TRUE)
added_num++; added_num++;
else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1, else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1,
__sysres_get_system_res_path(), font_file)) && __sysres_get_system_res_path(), font_file))
add_dev_font (font_name, font_path, TRUE)) && ((add_dev_font (font_name, font_path, TRUE)) == TRUE))
added_num++; added_num++;
} }
} }
if (is_unload || added_num > 0 || added_num == font_num) { if (is_unload || added_num > 0 || added_num == font_num)
{
return TRUE; return TRUE;
} }
else
return FALSE; {
return FALSE;
}
} }
BOOL font_InitSpecificalFonts (char* etc_section) BOOL font_InitSpecificalFonts (char* etc_section)
+1 -1
View File
@@ -735,9 +735,9 @@ get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
pcache->valid_advance = 1; pcache->valid_advance = 1;
} }
} }
done:
#endif #endif
done:
FT_UNLOCK(&ft_lock); FT_UNLOCK(&ft_lock);
if (px) { if (px) {
+3 -2
View File
@@ -88,6 +88,7 @@ typedef int (* MakeHashKeyFunc)(Glyph32 gv);
typedef struct tagFTFACEINFO { typedef struct tagFTFACEINFO {
char* filepathname; char* filepathname;
FT_Face face; FT_Face face;
BOOL valid;
#ifdef _MGFONT_TTF_CACHE #ifdef _MGFONT_TTF_CACHE
int face_index; int face_index;
int cmap_index; int cmap_index;
@@ -162,13 +163,13 @@ extern void __mg_ttc_sys_deinit(void);
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size); extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
extern void __mg_ttc_refer(HCACHE hCache); extern void __mg_ttc_refer(HCACHE hCache);
#endif /* _MGFONT_TTF_CACHE */
#ifdef _MGCOMPLEX_SCRIPTS #ifdef _MGCOMPLEX_SCRIPTS
extern void __mg_init_harzbuff_funcs(void); extern void __mg_init_harzbuff_funcs(void);
extern void __mg_term_harzbuff_funcs(void); extern void __mg_term_harzbuff_funcs(void);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
+31 -26
View File
@@ -120,42 +120,47 @@ hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
return UCharDecompose(ab, a, b); return UCharDecompose(ab, a, b);
} }
/* extern hb_unicode_funcs_t *__mg_hb_unifuncs */ static hb_unicode_funcs_t *_funcs;
hb_unicode_funcs_t *__mg_hb_unifuncs; 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;
void __mg_init_harzbuff_funcs(void) void __mg_init_harzbuff_funcs(void)
{ {
_DBG_PRINTF("%s: called\n", __FUNCTION__); _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) void __mg_term_harzbuff_funcs(void)
{ {
_DBG_PRINTF("%s: called\n", __FUNCTION__); _DBG_PRINTF("%s: called\n", __FUNCTION__);
if (__mg_hb_unifuncs) { if (_funcs) {
hb_unicode_funcs_destroy(__mg_hb_unifuncs); hb_unicode_funcs_destroy(_funcs);
} }
else { else {
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n", _ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
+13 -28
View File
@@ -2401,9 +2401,8 @@ static void wndDrawNCFrame(MAINWIN* pWin, HDC hdc, const RECT* prcInvalid)
} }
#endif #endif
if (fGetDC) { if (fGetDC)
release_effective_dc (pWin, hdc); release_effective_dc (pWin, hdc);
}
} }
/* this function is CONTROL safe. */ /* this function is CONTROL safe. */
@@ -3040,6 +3039,11 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
while (hosted) { while (hosted) {
PMAINWIN found; PMAINWIN found;
ctxt->hosting = hosted;
if ((found = search_win_tree_dfs (ctxt))) {
return found;
}
if (hosted->id == ctxt->id && if (hosted->id == ctxt->id &&
(((ctxt->flags & WIN_SEARCH_FILTER_MAIN) && (((ctxt->flags & WIN_SEARCH_FILTER_MAIN) &&
hosted->WinType == TYPE_MAINWIN) || hosted->WinType == TYPE_MAINWIN) ||
@@ -3048,11 +3052,6 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
return hosted; return hosted;
} }
ctxt->hosting = hosted;
if ((found = search_win_tree_dfs (ctxt))) {
return found;
}
hosted = GetNextHosted (hosting, hosted); hosted = GetNextHosted (hosting, hosted);
} }
@@ -3075,13 +3074,12 @@ static PMAINWIN search_win_tree_bfs (struct _search_context *ctxt)
return hosted; return hosted;
} }
if ((ctxt->hosting = GetNextHosted (hosting, hosted))) { ctxt->hosting = hosted;
if ((found = search_win_tree_bfs (ctxt))) { if ((found = search_win_tree_bfs (ctxt))) {
return found; return found;
}
} }
hosted = GetFirstHosted (hosted); hosted = GetNextHosted (hosting, hosted);
} }
return NULL; return NULL;
@@ -3167,8 +3165,8 @@ HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild)
HWND GUIAPI GetNextMainWindow (HWND hMainWnd) HWND GUIAPI GetNextMainWindow (HWND hMainWnd)
{ {
MG_CHECK_RET (hMainWnd != HWND_NULL && MG_CHECK_RET (hMainWnd == HWND_NULL || MG_IS_NORMAL_MAIN_WINDOW (hMainWnd),
!MG_IS_NORMAL_MAIN_WINDOW (hMainWnd), HWND_INVALID); HWND_INVALID);
return (HWND)SendMessage (HWND_DESKTOP, return (HWND)SendMessage (HWND_DESKTOP,
MSG_GETNEXTMAINWIN, (WPARAM)hMainWnd, 0L); MSG_GETNEXTMAINWIN, (WPARAM)hMainWnd, 0L);
@@ -5395,7 +5393,6 @@ static BOOL _wndInvalidateRect(HWND hWnd, const RECT* prc, BOOL bEraseBkgnd, int
#endif #endif
} }
else { else {
_WRN_PRINTF ("The invalid region is forzen\n");
return FALSE; return FALSE;
} }
@@ -5576,6 +5573,7 @@ HDC GUIAPI BeginPaint (HWND hWnd)
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), HDC_INVALID); MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), HDC_INVALID);
pWin = MG_GET_WINDOW_PTR (hWnd); pWin = MG_GET_WINDOW_PTR (hWnd);
if (pWin->pCaretInfo && pWin->pCaretInfo->fBlink) { if (pWin->pCaretInfo && pWin->pCaretInfo->fBlink) {
HideCaretEx (hWnd, FALSE); HideCaretEx (hWnd, FALSE);
pWin->pCaretInfo->fBlink = TRUE; pWin->pCaretInfo->fBlink = TRUE;
@@ -7028,19 +7026,6 @@ BOOL GUIAPI SetMainWindowAlwaysTop (HWND hMainWnd, BOOL fSet)
MSG_SETALWAYSTOP, (WPARAM)pMainWin, (LPARAM)fSet); MSG_SETALWAYSTOP, (WPARAM)pMainWin, (LPARAM)fSet);
} }
/* Since 5.0.6 */
BOOL GUIAPI SetMainWindowGestureFlags (HWND hMainWnd, DWORD dwFlags)
{
PMAINWIN pMainWin;
if (!(pMainWin = checkAndGetMainWinIfMainWin (hMainWnd))) {
return FALSE;
}
return (BOOL)SendMessage (HWND_DESKTOP,
MSG_SETGESTUREFLAGS, (WPARAM)pMainWin, (LPARAM)dwFlags);
}
#ifdef _MGSCHEMA_COMPOSITING #ifdef _MGSCHEMA_COMPOSITING
BOOL GUIAPI SetMainWindowCompositing (HWND hMainWnd, int type, DWORD arg) BOOL GUIAPI SetMainWindowCompositing (HWND hMainWnd, int type, DWORD arg)
{ {
+1 -3
View File
@@ -50,7 +50,6 @@ DFB_SRCS = dfb.h dfb.c
USVFB_SRCS = usvfbinput.c usvfbinput.h USVFB_SRCS = usvfbinput.c usvfbinput.h
LIBINPUT_SRCS = linux-libinput.c linux-libinput.h LIBINPUT_SRCS = linux-libinput.c linux-libinput.h
SINGLETOUCHKEY_SRCS = singletouchkey.c singletouchkey.h
if MGIAL_CONSOLE if MGIAL_CONSOLE
native_libial_la_LIBADD = native/libnative.la native_libial_la_LIBADD = native/libnative.la
@@ -77,5 +76,4 @@ libial_la_SOURCES = $(COMMON_SRCS) $(DUMMY_SRCS) $(JZ4740_SRCS) \
$(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \ $(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \
$(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \ $(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \
$(TSLIB_SRCS) $(SHANDONG_LIDE_SRCS) $(CISCO_TOUCHPAD_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)
+1 -7
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -133,9 +133,6 @@
#ifdef _MGIAL_LIBINPUT #ifdef _MGIAL_LIBINPUT
#include "linux-libinput.h" #include "linux-libinput.h"
#endif #endif
#ifdef _MGIAL_SINGLETOUCHKEY
#include "singletouchkey.h"
#endif
static INPUT inputs [] = static INPUT inputs [] =
{ {
@@ -215,9 +212,6 @@ static INPUT inputs [] =
#ifdef _MGIAL_LIBINPUT #ifdef _MGIAL_LIBINPUT
{"libinput", ial_InitLibInput, TermLibInput}, {"libinput", ial_InitLibInput, TermLibInput},
#endif #endif
#ifdef _MGIAL_SINGLETOUCHKEY
{"singletouchkey", ial_InitSingleTouchKey, TermSingleTouchKey},
#endif
/* ... end of general IAL engines */ /* ... end of general IAL engines */
}; };
+3 -1
View File
@@ -1243,9 +1243,11 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
break; break;
} }
#if 0
default: default:
_WRN_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type); _DBG_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
break; break;
#endif
} }
libinput_event_destroy(event); libinput_event_destroy(event);
+1
View File
@@ -65,6 +65,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <linux/vt.h> #include <linux/vt.h>
#include <linux/kd.h> #include <linux/kd.h>
#include <linux/keyboard.h>
#include "gdi.h" #include "gdi.h"
#include "window.h" #include "window.h"
+6 -12
View File
@@ -67,6 +67,8 @@
#include "gal.h" #include "gal.h"
#include "native.h" #include "native.h"
static const char* event_dev;
static int EVENT_Open(const char *); static int EVENT_Open(const char *);
static void EVENT_Close(void); static void EVENT_Close(void);
static void EVENT_GetModifierInfo(int *modifiers); static void EVENT_GetModifierInfo(int *modifiers);
@@ -83,7 +85,6 @@ KBDDEVICE kbddev_event = {
EVENT_Resume EVENT_Resume
}; };
static char* kbd_dev;
static int kbd_fd; /* file descriptor for keyboard */ static int kbd_fd; /* file descriptor for keyboard */
/* /*
@@ -143,7 +144,6 @@ static int EVENT_Open (const char *device)
if (kbd_fd < 0) if (kbd_fd < 0)
return -1; return -1;
kbd_dev = strdup (device);
return kbd_fd; return kbd_fd;
} }
@@ -153,11 +153,8 @@ static int EVENT_Open (const char *device)
*/ */
static void EVENT_Close(void) static void EVENT_Close(void)
{ {
close (kbd_fd); close(kbd_fd);
kbd_fd = -1; kbd_fd = -1;
free (kbd_dev);
kbd_dev = NULL;
} }
/* /*
@@ -206,8 +203,7 @@ static int EVENT_Read(unsigned char *buf, int *modifiers)
*/ */
static void EVENT_Suspend(void) static void EVENT_Suspend(void)
{ {
close (kbd_fd); EVENT_Close();
kbd_fd = -1;
} }
/* deactivate_keyboard: /* deactivate_keyboard:
@@ -215,12 +211,10 @@ static void EVENT_Suspend(void)
*/ */
static int EVENT_Resume(void) static int EVENT_Resume(void)
{ {
kbd_fd = open (kbd_dev, O_NONBLOCK); kbd_fd = open (event_dev, O_NONBLOCK);
if (kbd_fd < 0) { if (kbd_fd < 0) {
return -1; return -1;
} }else{
else {
return kbd_fd; return kbd_fd;
} }
} }
+1
View File
@@ -56,6 +56,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <signal.h> #include <signal.h>
#include <linux/kd.h> #include <linux/kd.h>
#include <linux/keyboard.h>
#include <errno.h> #include <errno.h>
#include "common.h" #include "common.h"
-252
View File
@@ -1,252 +0,0 @@
//////////////////////////////////////////////////////////////////////////////
//
// 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
@@ -1,68 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
// 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 \ ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \ gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
glyph.h license.h mgsock.h unicode-ops.h \ glyph.h license.h mgsock.h unicode-ops.h \
linux-tty.h debug.h map.h linux-tty.h debug.h
+10 -17
View File
@@ -52,28 +52,21 @@
#ifndef GUI_BLOCKHEAP_H #ifndef GUI_BLOCKHEAP_H
#define GUI_BLOCKHEAP_H #define GUI_BLOCKHEAP_H
#define BDS_FREE 0x0000
#define BDS_SPECIAL 0x0001
#define BDS_USED 0x0002
#ifndef _MGUI_GDI_H /* included in include/gdi.h */ #ifndef _MGUI_GDI_H /* included in include/gdi.h */
struct _BLOCKHEAP { typedef struct tagBLOCKHEAP {
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
/* Size of one block element. */ size_t bd_size;
size_t sz_block; size_t heap_size;
/* Size of the heap in blocks. */ int free;
size_t sz_heap; void* heap;
/* The first free element in the heap. */ } BLOCKHEAP;
size_t sz_usage_bmp;
/* The number of blocks extra allocated. */
size_t nr_alloc;
/* Pointer to the pre-allocated heap. */
unsigned char* heap;
/* Pointer to the usage bitmap. */
unsigned char* usage_bmp;
};
typedef struct _BLOCKHEAP BLOCKHEAP;
typedef BLOCKHEAP* PBLOCKHEAP; typedef BLOCKHEAP* PBLOCKHEAP;
#ifdef __cplusplus #ifdef __cplusplus
+1 -4
View File
@@ -164,8 +164,7 @@ typedef struct JoinLayerInfo {
typedef struct JoinedClientInfo { typedef struct JoinedClientInfo {
GHANDLE layer; GHANDLE layer;
int cli_id; int cli_id;
int def_zi_shmid; int zo_shmid;
int zi_shmid;
} JOINEDCLIENTINFO; } JOINEDCLIENTINFO;
typedef struct LayerInfo { typedef struct LayerInfo {
@@ -223,8 +222,6 @@ typedef struct _MovedClientInfo {
#define ID_ZOOP_MASKRECT_SET 17 #define ID_ZOOP_MASKRECT_SET 17
#define ID_ZOOP_MASKRECT_FREE 18 #define ID_ZOOP_MASKRECT_FREE 18
#define ID_ZOOP_SETGESTUREFLAGS 19 /* since 5.0.6 */
#ifndef MAX_CAPTION_LEN #ifndef MAX_CAPTION_LEN
#define MAX_CAPTION_LEN 39 //40 #define MAX_CAPTION_LEN 39 //40
#endif #endif
+22 -15
View File
@@ -71,24 +71,19 @@
#define NR_DIRTY_RECTS 16 #define NR_DIRTY_RECTS 16
/* constants for layers and z-order nodes */ /* constants for layers and z-order nodes */
#define MAX_NR_LAYERS 16 #define MAX_NR_LAYERS 8
/* Since 5.0.0: the number of the fixed znodes - DONOT adjust */ /* Since 5.0.0: the number of the fixed znodes - DONOT adjust */
#define NR_FIXED_ZNODES 1 #define NR_FIXED_ZNODES 1
/* the numbers of znodes in different levels - should be mulitples of 8 */ /* the numbers of znodes in different levels - should be mulitples of 8 */
#define DEF_NR_POPUPMENUS 16 #define DEF_NR_POPUPMENUS 16
#define DEF_NR_TOOLTIPS 16 #define DEF_NR_TOOLTIPS 8
#define DEF_NR_GLOBALS 15 // reserve one slot for fixed znode #define DEF_NR_GLOBALS 15 // reserve slots for fixed znodes
#define DEF_NR_SCREENLOCKS 8 #define DEF_NR_SCREENLOCKS 8
#define DEF_NR_DOCKERS 8 #define DEF_NR_DOCKERS 8
#ifdef _MGRM_PROCESSES // per layer basis #define DEF_NR_TOPMOSTS 16
# define DEF_NR_TOPMOSTS 8 #define DEF_NR_NORMALS 128
# define DEF_NR_NORMALS 32
#else
# define DEF_NR_TOPMOSTS 16
# define DEF_NR_NORMALS 128
#endif
#define DEF_NR_LAUNCHERS 8 #define DEF_NR_LAUNCHERS 8
/* Since 5.0.0: the number of the zorder levels - DONOT adjust */ /* Since 5.0.0: the number of the zorder levels - DONOT adjust */
@@ -107,10 +102,10 @@ enum {
#define ZNIDX_DESKTOP 0 #define ZNIDX_DESKTOP 0
/* The heap size for mask rectangles */ /* The heap size for mask rectangles */
#define DEF_NR_MASKRECTS 1024 #define DEF_NR_MASKRECT 1024
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
/* max number of shared surfaces (512) */ /* max number of shared surfaces */
# define MAX_NR_SHARED_SURF (DEF_NR_NORMALS * (MAX_NR_LAYERS >> 1)) # define MAX_NR_SHARED_SURF (DEF_NR_NORMALS * (MAX_NR_LAYERS >> 1))
#endif #endif
@@ -155,9 +150,21 @@ enum {
#endif #endif
/* constants for fix string module */ /* constants for fix string module */
#define MAX_LEN_FIXSTR 64 #if defined (__NOUNIX__) || defined (__uClinux__)
#define NR_HEAP 5 #define MAX_LEN_FIXSTR 64
#define LEN_BITMAP (1+2+4+8+16) #define NR_HEAP 5
#define LEN_BITMAP (1+2+4+8+16)
#else
#ifdef _MGRM_THREADS
#define MAX_LEN_FIXSTR 2048
#define NR_HEAP 10
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256+512)
#else
#define MAX_LEN_FIXSTR 1024
#define NR_HEAP 9
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256)
#endif
#endif
/* constants for engine name and video mode */ /* constants for engine name and video mode */
#define LEN_SO_NAME 127 // name length of a shared object (library) #define LEN_SO_NAME 127 // name length of a shared object (library)
-2
View File
@@ -713,8 +713,6 @@ void __mg_update_secondary_dc (PMAINWIN pWin, HDC secondary_dc,
HDC __mg_get_common_rgba8888_dc (void); HDC __mg_get_common_rgba8888_dc (void);
BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch, BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch,
void* pixels); void* pixels);
/* Since 5.0.6 */
void __mg_destroy_common_rgba8888_dc (void);
/* Since 5.0.0. /* Since 5.0.0.
helpers to update the private client DC of window and it's descendants */ helpers to update the private client DC of window and it's descendants */
+1 -4
View File
@@ -527,10 +527,7 @@ int __mg_free_hook_wins (int cli);
/************************* Initialization/Termination ************************/ /************************* Initialization/Termination ************************/
void __mg_init_local_sys_text (void); void __mg_init_local_sys_text (void);
/* the zorder information for the default layer */ /* the zorder information of the server */
extern ZORDERINFO* __mg_def_zorder_info;
/* the zorder information for the current layer */
extern ZORDERINFO* __mg_zorder_info; extern ZORDERINFO* __mg_zorder_info;
#ifdef _MGRM_STANDALONE #ifdef _MGRM_STANDALONE
+11 -34
View File
@@ -120,60 +120,37 @@ int __mg_alloc_sem_for_shared_surf (void);
int __mg_free_sem_for_shared_surf (int sem_num); int __mg_free_sem_for_shared_surf (int sem_num);
#endif /* _MGSCHEMA_COMPOSITING */ #endif /* _MGSCHEMA_COMPOSITING */
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set); int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set);
static inline static inline
void __mg_slot_set_use (unsigned char* bitmap, size_t index) { void __mg_slot_set_use (unsigned char* bitmap, int index) {
bitmap += index >> 3; bitmap += index >> 3;
*bitmap &= (~(0x80 >> (index % 8))); *bitmap &= (~(0x80 >> (index % 8)));
} }
static inline static inline
int __mg_slot_clear_use (unsigned char* bitmap, size_t index) { int __mg_slot_clear_use (unsigned char* bitmap, int index) {
bitmap += index >> 3;
*bitmap |= (0x80 >> (index % 8));
return 1;
}
static inline
int __mg_slot_is_used (unsigned char* bitmap, size_t index) {
bitmap += index >> 3; bitmap += index >> 3;
if (*bitmap & (0x80 >> (index % 8))) if (*bitmap & (0x80 >> (index % 8)))
return 0; return 0;
*bitmap |= (0x80 >> (index % 8));
return 1; return 1;
} }
/* get the number of idle mask rectangles */ /* get the number of idle mask rectangles */
static inline static inline
size_t __mg_get_nr_idle_slots (unsigned char* bitmap, size_t len_bmp) int __mg_get_nr_idle_slots (unsigned char* bitmap, int len_bmp)
{ {
size_t idle = 0; int idle = 0;
size_t i, j; int i, j;
for (i = 0; i < len_bmp; i++) { for (i = 0; i < len_bmp; i++) {
if (*bitmap) { for (j = 0; j < 8; j++) {
if (*bitmap == 0xFF) { if (*bitmap & (0x80 >> j))
idle += 8; idle++;
}
else {
if (*bitmap & 0xF0) {
for (j = 0; j < 4; j++) {
if (*bitmap & (0x80 >> j))
idle++;
}
}
if (*bitmap & 0x0F) {
for (j = 0; j < 4; j++) {
if (*bitmap & (0x08 >> j))
idle++;
}
}
}
} }
bitmap++; bitmap++;
} }
return idle; return idle;
} }
+30 -118
View File
@@ -57,7 +57,6 @@
#include "gdi.h" #include "gdi.h"
#include "constants.h" #include "constants.h"
#include "blockheap.h"
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
#include <sys/types.h> #include <sys/types.h>
@@ -70,7 +69,6 @@
#endif #endif
#define DISABLE_THREADS #define DISABLE_THREADS
#define GAL_mutex int #define GAL_mutex int
#define GAL_bool BOOL #define GAL_bool BOOL
@@ -173,10 +171,6 @@ typedef struct _ShadowSurfaceHeader {
RECT dirty_rc; RECT dirty_rc;
} GAL_ShadowSurfaceHeader; } GAL_ShadowSurfaceHeader;
#ifdef _MGUSE_PIXMAN
typedef union pixman_image pixman_image_t;
#endif
/* /*
* This structure should be treated as read-only, except for 'pixels', * This structure should be treated as read-only, except for 'pixels',
* which, if not NULL, contains the raw pixel data for the surface. * which, if not NULL, contains the raw pixel data for the surface.
@@ -212,12 +206,7 @@ typedef struct GAL_Surface {
unsigned int format_version; /* Private */ unsigned int format_version; /* Private */
/* reference count -- used when freeing surface */ /* reference count -- used when freeing surface */
unsigned int refcount; /* Read-mostly */ int refcount; /* Read-mostly */
#ifdef _MGUSE_PIXMAN
pixman_image_t *pix_img; /* The pixman image object for this surface */
void *blit_ctxt; /* blitting context */
#endif
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
/* The pointer to GAL_SharedSurfaceHeader if the surface /* The pointer to GAL_SharedSurfaceHeader if the surface
@@ -230,42 +219,22 @@ typedef struct GAL_Surface {
/* These are the currently supported flags for the GAL_surface */ /* These are the currently supported flags for the GAL_surface */
/* Available for GAL_CreateRGBSurface() or GAL_SetVideoMode() */ /* Available for GAL_CreateRGBSurface() or GAL_SetVideoMode() */
#define GAL_SWSURFACE MEMDC_FLAG_SWSURFACE /* Surface is in system memory */
#define GAL_SWSURFACE 0x00000000 /* Surface is in system memory */ #define GAL_HWSURFACE MEMDC_FLAG_HWSURFACE /* Surface is in video memory */
#define GAL_HWSURFACE 0x00000001 /* Surface is in video memory */ #define GAL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
#define GAL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
#define GAL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
#define GAL_RLEACCELOK 0x00002000 /* Private flag */
#define GAL_RLEACCEL 0x00004000 /* Surface is RLE encoded */
#define GAL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */
#define GAL_SRCPIXELALPHA 0x00020000 /* Blit uses source per-pixel alpha blending */
/* Used internally (read-only) */
#define GAL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
#define GAL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
#define GAL_FORMAT_CHECKED 0x02000000 /* Pixman format checked */
/* Available for GAL_SetVideoMode() */ /* Available for GAL_SetVideoMode() */
#define GAL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */ #define GAL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
#define GAL_HWPALETTE 0x20000000 /* Surface has exclusive palette */ #define GAL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
#define GAL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */ #define GAL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
#define GAL_FULLSCREEN 0x80000000 /* Surface is a full screen display */ #define GAL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
/* Used internally (read-only) */
/* Make sure the macros are ok */ #define GAL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
#define MGUI_COMPILE_TIME_ASSERT(name, x) \ #define GAL_SRCCOLORKEY MEMDC_FLAG_SRCCOLORKEY /* Blit uses a source color key */
typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1] #define GAL_RLEACCELOK 0x00002000 /* Private flag */
#define GAL_RLEACCEL MEMDC_FLAG_RLEACCEL /* Surface is RLE encoded */
MGUI_COMPILE_TIME_ASSERT(swsurface, GAL_SWSURFACE == MEMDC_FLAG_SWSURFACE); #define GAL_SRCALPHA MEMDC_FLAG_SRCALPHA /* Blit uses source alpha blending */
MGUI_COMPILE_TIME_ASSERT(hwsurface, GAL_HWSURFACE == MEMDC_FLAG_HWSURFACE); #define GAL_SRCPIXELALPHA MEMDC_FLAG_SRCPIXELALPHA /* Blit uses source per-pixel alpha blending */
MGUI_COMPILE_TIME_ASSERT(colorkey, GAL_SRCCOLORKEY == MEMDC_FLAG_SRCCOLORKEY); #define GAL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
MGUI_COMPILE_TIME_ASSERT(rleaccel, GAL_RLEACCEL == MEMDC_FLAG_RLEACCEL);
MGUI_COMPILE_TIME_ASSERT(srcalpha, GAL_SRCALPHA == MEMDC_FLAG_SRCALPHA);
MGUI_COMPILE_TIME_ASSERT(srcpixelapha, GAL_SRCPIXELALPHA == MEMDC_FLAG_SRCPIXELALPHA);
#undef MGUI_COMPILE_TIME_ASSERT
/* Evaluates to true if the surface needs to be locked before access */ /* Evaluates to true if the surface needs to be locked before access */
#define GAL_MUSTLOCK(surface) \ #define GAL_MUSTLOCK(surface) \
@@ -438,7 +407,7 @@ void GAL_UpdateRect
(GAL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); (GAL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
#ifdef _MGUSE_UPDATE_REGION #ifdef _MGUSE_UPDATE_REGION
extern BLOCKHEAP __mg_free_update_region_list; BLOCKHEAP __mg_free_update_region_list;
#endif #endif
BOOL GAL_SyncUpdate (GAL_Surface *screen); BOOL GAL_SyncUpdate (GAL_Surface *screen);
@@ -631,7 +600,6 @@ GAL_Surface *GAL_CreateSharedRGBSurface (GAL_VideoDevice* video,
#define ST_PIXEL_ARGB4444 0x0001 #define ST_PIXEL_ARGB4444 0x0001
#define ST_PIXEL_ARGB1555 0x0002 #define ST_PIXEL_ARGB1555 0x0002
#define ST_PIXEL_ARGB8888 0x0003 #define ST_PIXEL_ARGB8888 0x0003
#define ST_PIXEL_XRGB565 0x0004
#endif /* not define ST_PIXEL_MASK */ #endif /* not define ST_PIXEL_MASK */
/* Allocate a shared RGB surface from the current video device. */ /* Allocate a shared RGB surface from the current video device. */
@@ -805,58 +773,6 @@ void GAL_GetClipRect (GAL_Surface *surface, GAL_Rect *rect);
GAL_Surface *GAL_ConvertSurface GAL_Surface *GAL_ConvertSurface
(GAL_Surface *src, GAL_PixelFormat *fmt, Uint32 flags); (GAL_Surface *src, GAL_PixelFormat *fmt, Uint32 flags);
#ifdef _MGUSE_PIXMAN
BOOL GAL_CreatePixmanImage (GAL_Surface *surface);
static inline BOOL GAL_CheckPixmanFormats (GAL_Surface *src, GAL_Surface *dst)
{
if (GAL_CreatePixmanImage (src)) {
if (dst != NULL && dst != src)
return GAL_CreatePixmanImage (dst);
return TRUE;
}
return FALSE;
}
typedef struct GAL_BlittingContext {
uint16_t op;
uint16_t filter;
uint32_t alpha_bits;
pixman_image_t *msk_img;
} GAL_BlittingContext;
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops);
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst);
int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect,
const STRETCH_EXTRA_INFO *sei, DWORD ops);
int GAL_CleanupStretchBlit (GAL_Surface *src, GAL_Surface *dst);
#else /* defined _MGUSE_PIXMAN */
static inline int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops) {
return 0;
}
static inline int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst) {
return 0;
}
static inline int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect,
const STRETCH_EXTRA_INFO *sei, DWORD ops) {
return 0;
}
static inline int GAL_CleanupStretchBlit (GAL_Surface *src, GAL_Surface *dst) {
return 0;
}
#endif /* not defined _MGUSE_PIXMAN */
/* /*
* This performs a fast blit from the source surface to the destination * This performs a fast blit from the source surface to the destination
* surface. It assumes that the source and destination rectangles are * surface. It assumes that the source and destination rectangles are
@@ -923,26 +839,21 @@ static inline int GAL_CleanupStretchBlit (GAL_Surface *src, GAL_Surface *dst) {
* fullscreen application. The lock will also fail until you have access * fullscreen application. The lock will also fail until you have access
* to the video memory again. * to the video memory again.
*/ */
/* You should call GAL_BlitSurface() unless you know exactly how GAL
blitting works internally and how to use the other blit functions.
*/
#define GAL_BlitSurface GAL_UpperBlit
/* This is the public blit function, GAL_BlitSurface(), and it performs /* This is the public blit function, GAL_BlitSurface(), and it performs
rectangle validation and clipping before passing it to GAL_LowerBlit() rectangle validation and clipping before passing it to GAL_LowerBlit()
*/ */
int GAL_UpperBlit (GAL_Surface *src, GAL_Rect *srcrect, int GAL_UpperBlit (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect, DWORD op); GAL_Surface *dst, GAL_Rect *dstrect);
/* This is a semi-private blit function and it performs low-level surface /* This is a semi-private blit function and it performs low-level surface
blitting only. blitting only.
*/ */
int GAL_LowerBlit (GAL_Surface *src, GAL_Rect *srcrect, int GAL_LowerBlit (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect, DWORD op); GAL_Surface *dst, GAL_Rect *dstrect);
/* You should call GAL_BlitSurface() unless you know exactly how GAL
blitting works internally and how to use the other blit functions.
*/
static inline int GAL_BlitSurface (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect)
{
return GAL_UpperBlit (src, srcrect, dst, dstrect, 0);
}
/* /*
* This function performs a fast fill of the given rectangle with 'color' * This function performs a fast fill of the given rectangle with 'color'
@@ -953,12 +864,14 @@ static inline int GAL_BlitSurface (GAL_Surface *src, GAL_Rect *srcrect,
* can be generated by the GAL_MapRGB() function. * can be generated by the GAL_MapRGB() function.
* This function returns 0 on success, or -1 on error. * This function returns 0 on success, or -1 on error.
*/ */
int GAL_FillRect (GAL_Surface *dst, const GAL_Rect *dstrect, Uint32 color); int GAL_FillRect
(GAL_Surface *dst, const GAL_Rect *dstrect, Uint32 color);
/* /*
* This function returns the size of pad-aligned box bitmap. * This function returns the size of pad-aligned box bitmap.
*/ */
Uint32 GAL_GetBoxSize (GAL_Surface *src, Uint32 w, Uint32 h, Uint32* pitch_p); Uint32 GAL_GetBoxSize
(GAL_Surface *src, Uint32 w, Uint32 h, Uint32* pitch_p);
/* /*
* This function copies pixels in a rect from the surface to a box. * This function copies pixels in a rect from the surface to a box.
@@ -1006,9 +919,8 @@ GAL_Surface * GAL_DisplayFormat (GAL_Surface *surface);
*/ */
GAL_Surface * GAL_DisplayFormatAlpha (GAL_Surface *surface); GAL_Surface * GAL_DisplayFormatAlpha (GAL_Surface *surface);
int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect, int GAL_SoftStretch (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect, GAL_Surface *dst, GAL_Rect *dstrect);
const STRETCH_EXTRA_INFO *sei, DWORD ops);
#ifdef _MGSCHEMA_COMPOSITING #ifdef _MGSCHEMA_COMPOSITING
extern GAL_Surface* __gal_screen; extern GAL_Surface* __gal_screen;
+1 -6
View File
@@ -154,12 +154,7 @@ int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd);
int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info); int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info);
int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam); int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
#ifdef _MGSCHEMA_COMPOSITING int __mg_do_change_topmost_layer (void);
int __mg_prepare_layer_for_compositing (MG_Layer* layer);
int __mg_end_up_layer_for_compositing (MG_Layer* layer);
#endif
int __mg_do_change_topmost_layer (MG_Layer* new_topmost);
MG_Layer* __mg_find_layer_by_name (const char* name); MG_Layer* __mg_find_layer_by_name (const char* name);
+17 -22
View File
@@ -87,7 +87,7 @@ typedef struct _ZORDERNODE {
int nr_dirty_rcs; /* the number of dirty rects */ int nr_dirty_rcs; /* the number of dirty rects */
const RECT* dirty_rcs; /* the pointer to the dirty rectangles */ const RECT* dirty_rcs; /* the pointer to the dirty rectangles */
#else /* defined _MGSCHEMA_COMPOSITING */ #else /* defined _MGSCHEMA_COMPOSITING */
DWORD age; /* znode age */ unsigned int age; /* znode age */
RECT dirty_rc; /* dirty rectangle */ RECT dirty_rc; /* dirty rectangle */
#endif /* not defined _MGSCHEMA_COMPOSITING */ #endif /* not defined _MGSCHEMA_COMPOSITING */
@@ -133,8 +133,6 @@ typedef struct _ZORDERINFO {
int first_launcher; int first_launcher;
int active_win; int active_win;
int old_active;
int next_active;
int cli_trackmenu; int cli_trackmenu;
@@ -158,13 +156,12 @@ typedef struct _ZORDERINFO {
typedef ZORDERINFO* PZORDERINFO; typedef ZORDERINFO* PZORDERINFO;
#define MAX_NR_SPECIAL_ZNODES(zi) \ #define MAX_NR_SPECIAL_ZNODES(zi) \
(zi->max_nr_globals + \ (zi->max_nr_tooltips + zi->max_nr_globals + \
zi->max_nr_screenlocks + zi->max_nr_dockers + \ zi->max_nr_screenlocks + zi->max_nr_dockers + \
zi->max_nr_launchers + NR_FIXED_ZNODES) zi->max_nr_launchers + NR_FIXED_ZNODES)
#define MAX_NR_GENERAL_ZNODES(zi) \ #define MAX_NR_GENERAL_ZNODES(zi) \
(zi->max_nr_tooltips + zi->max_nr_topmosts + \ (zi->max_nr_topmosts + zi->max_nr_normals)
zi->max_nr_normals)
#define MAX_NR_ZNODES(zi) \ #define MAX_NR_ZNODES(zi) \
MAX_NR_SPECIAL_ZNODES(zi) + MAX_NR_GENERAL_ZNODES(zi) MAX_NR_SPECIAL_ZNODES(zi) + MAX_NR_GENERAL_ZNODES(zi)
@@ -181,7 +178,7 @@ typedef ZORDERINFO* PZORDERINFO;
(ZORDERNODE*)((char*)((zi)+1)+ (zi)->size_usage_bmp) (ZORDERNODE*)((char*)((zi)+1)+ (zi)->size_usage_bmp)
#define GET_MASKRECT_USAGEBMP(zi) \ #define GET_MASKRECT_USAGEBMP(zi) \
((unsigned char *)((zi) + 1) + (zi)->size_usage_bmp + \ ((char *)((zi) + 1) + (zi)->size_usage_bmp + \
sizeof (ZORDERNODE) * (MAX_NR_ZNODES_WITH_PPP(zi))) sizeof (ZORDERNODE) * (MAX_NR_ZNODES_WITH_PPP(zi)))
#define GET_MASKRECT(zi) \ #define GET_MASKRECT(zi) \
@@ -190,25 +187,25 @@ typedef ZORDERINFO* PZORDERINFO;
/* round to multiple of 8 to aoivd alignment issue */ /* round to multiple of 8 to aoivd alignment issue */
#define SIZE_MASKRECT_USAGE_BMP \ #define SIZE_MASKRECT_USAGE_BMP \
ROUND_TO_MULTIPLE((DEF_NR_MASKRECTS >> 3), 8) ROUND_TO_MULTIPLE((DEF_NR_MASKRECT >> 3), 8)
#define NR_SPECIAL_ZNODES(zi) \ #define NR_SPECIAL_ZNODES(zi) \
(zi->nr_globals + \ (zi->nr_tooltips + zi->nr_globals + \
zi->nr_screenlocks + zi->nr_dockers + \ zi->nr_screenlocks + zi->nr_dockers + \
zi->nr_launchers + NR_FIXED_ZNODES) zi->nr_launchers + NR_FIXED_ZNODES)
#define NR_GENERAL_ZNODES(zi) \ #define NR_GENERAL_ZNODES(zi) \
(zi->nr_tooltips + zi->nr_topmosts + zi->nr_normals) (zi->nr_topmosts + zi->nr_normals)
#define NR_ZNODES(zi) \ #define NR_ZNODES(zi) \
NR_SPECIAL_ZNODES(zi) + NR_GENERAL_ZNODES(zi) NR_SPECIAL_ZNODES(zi) + NR_GENERAL_ZNODES(zi)
/* Since 5.0.0: more levels */ /* Since 5.0.0: more levels */
#define SIZE_USAGE_BMP_GENERAL(max_nr_t, max_nr_n) \ #define SIZE_USAGE_BMP_GENERAL(max_nr_t, max_nr_n) \
((7 + DEF_NR_TOOLTIPS + (max_nr_t) + (max_nr_n)) >> 3) ((7 + (max_nr_t) + (max_nr_n)) >> 3)
#define SIZE_USAGE_BMP_SPECIAL(max_nr_g) \ #define SIZE_USAGE_BMP_SPECIAL(max_nr_g) \
((7 + max_nr_g + \ ((7 + DEF_NR_TOOLTIPS + max_nr_g + \
DEF_NR_SCREENLOCKS + DEF_NR_DOCKERS + \ DEF_NR_SCREENLOCKS + DEF_NR_DOCKERS + \
DEF_NR_LAUNCHERS + NR_FIXED_ZNODES) >> 3) DEF_NR_LAUNCHERS + NR_FIXED_ZNODES) >> 3)
@@ -237,15 +234,15 @@ typedef ZORDERINFO* PZORDERINFO;
MG_UNLIKELY ((idx) > MAX_NR_ZNODES(zi)) MG_UNLIKELY ((idx) > MAX_NR_ZNODES(zi))
#define IS_TYPE_GENERAL(type) \ #define IS_TYPE_GENERAL(type) \
((type) == ZOF_TYPE_TOOLTIP || \ (type == ZOF_TYPE_HIGHER || \
(type) == ZOF_TYPE_HIGHER || \ type == ZOF_TYPE_NORMAL)
(type) == ZOF_TYPE_NORMAL)
#define IS_TYPE_SPECIAL(type) \ #define IS_TYPE_SPECIAL(type) \
((type) == ZOF_TYPE_GLOBAL || \ (type == ZOF_TYPE_TOOLTIP || \
(type) == ZOF_TYPE_SCREENLOCK || \ type == ZOF_TYPE_GLOBAL || \
(type) == ZOF_TYPE_DOCKER || \ type == ZOF_TYPE_SCREENLOCK || \
(type) == ZOF_TYPE_LAUNCHER) type == ZOF_TYPE_DOCKER || \
type == ZOF_TYPE_LAUNCHER)
#define ZOF_TYPE_TO_LEVEL_IDX(type) ((int)(8 - ((type) >> 28))) #define ZOF_TYPE_TO_LEVEL_IDX(type) ((int)(8 - ((type) >> 28)))
@@ -253,14 +250,12 @@ typedef ZORDERINFO* PZORDERINFO;
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_maskrc_heap); int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals);
void __kernel_free_z_order_info (ZORDERINFO* zi); void __kernel_free_z_order_info (ZORDERINFO* zi);
int __kernel_get_window_region (HWND pWin, CLIPRGN* region); int __kernel_get_window_region (HWND pWin, CLIPRGN* region);
int __kernel_get_next_znode (const ZORDERINFO* zi, int from); int __kernel_get_next_znode (const ZORDERINFO* zi, int from);
int __kernel_get_prev_znode (const ZORDERINFO* zi, int from); int __kernel_get_prev_znode (const ZORDERINFO* zi, int from);
void __mg_sync_special_nodes (ZORDERINFO* from, ZORDERINFO* to);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
+63 -86
View File
@@ -59,91 +59,103 @@
#include "common.h" #include "common.h"
#include "minigui.h" #include "minigui.h"
#include "gdi.h" #include "gdi.h"
#include "constants.h"
#include "blockheap.h" #include "blockheap.h"
#include "misc.h"
BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap) void InitBlockDataHeap (PBLOCKHEAP heap, size_t bd_size, size_t heap_size)
{ {
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
pthread_mutex_init (&heap->lock, NULL); pthread_mutex_init (&heap->lock, NULL);
#endif #endif
heap->sz_usage_bmp = (sz_heap + 7) >> 3;
heap->sz_block = ROUND_TO_MULTIPLE (sz_block, SIZEOF_PTR);
heap->sz_heap = heap->sz_usage_bmp << 3;
heap->nr_alloc = 0;
if (heap->sz_heap == 0 || heap->sz_block == 0)
goto failed;
if ((heap->heap = calloc (heap->sz_heap, heap->sz_block)) == NULL)
goto failed;
if ((heap->usage_bmp = calloc (heap->sz_usage_bmp, sizeof (char))) == NULL) {
free (heap->heap);
goto failed;
}
memset (heap->usage_bmp, 0xFF, heap->sz_usage_bmp);
return TRUE;
failed:
heap->heap = NULL; heap->heap = NULL;
heap->usage_bmp = NULL; heap->bd_size = bd_size + sizeof (DWORD);
return FALSE; heap->heap_size = heap_size;
} }
void* BlockDataAlloc (PBLOCKHEAP heap) void* BlockDataAlloc (PBLOCKHEAP heap)
{ {
int free_slot; int i;
unsigned char* block_data = NULL; char* block_data = NULL;
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
pthread_mutex_lock (&heap->lock); pthread_mutex_lock (&heap->lock);
#endif #endif
free_slot = __mg_lookfor_unused_slot (heap->usage_bmp, heap->sz_usage_bmp, 1); if (heap->heap == NULL) {
if (free_slot >= 0) { if (!(heap->heap = calloc (heap->heap_size, heap->bd_size)))
block_data = heap->heap + heap->sz_block * free_slot; goto ret;
_DBG_PRINTF ("Allocated one block in the block heap: %p (%d)\n", heap->free = 0;
heap, free_slot);
goto ret;
} }
if ((block_data = calloc (1, heap->sz_block)) == NULL) block_data = (char*) heap->heap + heap->bd_size*heap->free;
goto ret; for (i = heap->free; i < heap->heap_size; i++) {
heap->nr_alloc++; if (*((DWORD*)block_data) == BDS_FREE) {
heap->free = i + 1;
*((DWORD*)block_data) = BDS_USED;
#if 0
fprintf (stderr, "heap: %p, Allocated: %d, free: %d.\n", heap, i, heap->free);
fprintf (stderr, "Heap: (bd_size: %d, heap_size: %d, heap: %p).\n",
heap->bd_size, heap->heap_size, heap->heap);
#endif
goto ret;
}
block_data += heap->bd_size;
}
#if 0
if (!(block_data = calloc (1, heap->bd_size)))
goto ret;
#else
if (!(block_data = mg_slice_alloc0 (heap->bd_size)))
goto ret;
#endif
*((DWORD*)block_data) = BDS_SPECIAL;
ret: ret:
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
pthread_mutex_unlock (&heap->lock); pthread_mutex_unlock (&heap->lock);
#endif #endif
return block_data;
if (block_data)
return block_data + sizeof (DWORD);
return NULL;
} }
void BlockDataFree (PBLOCKHEAP heap, void* data) void BlockDataFree (PBLOCKHEAP heap, void* data)
{ {
unsigned char* block_data = data; int i;
char* block_data;
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
pthread_mutex_lock (&heap->lock); pthread_mutex_lock (&heap->lock);
#endif #endif
if (block_data < heap->heap || block_data = (char*) data - sizeof (DWORD);
block_data > (heap->heap + heap->sz_block * heap->sz_heap)) { if (*((DWORD*)block_data) == BDS_SPECIAL) {
#if 0
free (block_data); free (block_data);
heap->nr_alloc--; #else
mg_slice_free (heap->bd_size, block_data);
#endif
} }
else { else if (*((DWORD*)block_data) == BDS_USED) {
int slot; *((DWORD*)block_data) = BDS_FREE;
slot = (block_data - heap->heap) / heap->sz_block;
__mg_slot_clear_use (heap->usage_bmp, slot);
_DBG_PRINTF ("Freed one block in the block heap: %p (%d)\n", i = (block_data - (char*)heap->heap)/heap->bd_size;
heap, slot); if (heap->free > i)
heap->free = i;
#if 0
fprintf (stderr, "Heap: %p: Freed: %d, free: %d.\n", heap, i, heap->free);
fprintf (stderr, "Heap: (bd_size: %d, heap_size: %d, heap: %p).\n",
heap->bd_size, heap->heap_size, heap->heap);
#endif
} }
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
@@ -153,48 +165,13 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
void DestroyBlockDataHeap (PBLOCKHEAP heap) void DestroyBlockDataHeap (PBLOCKHEAP heap)
{ {
int nr_free_slots; #if 0
fprintf (stderr, "Heap: (bd_size: %d, heap_size: %d, heap: %p).\n",
if (heap->nr_alloc > 0) { heap->bd_size, heap->heap_size, heap->heap);
_WRN_PRINTF ("There are still not freed extra blocks in the block heap: %p (%zu)\n",
heap, heap->nr_alloc);
}
nr_free_slots = __mg_get_nr_idle_slots (heap->usage_bmp, heap->sz_usage_bmp);
if (nr_free_slots != heap->sz_heap) {
_WRN_PRINTF ("There are still not freed blocks in the block heap: %p (%zu)\n",
heap, heap->sz_heap - nr_free_slots);
#ifdef _DEBUG
{
unsigned char* bitmap = heap->usage_bmp;
int slot = 0;
int i, j;
for (i = 0; i < heap->sz_usage_bmp; i++) {
for (j = 0; j < 8; j++) {
if (!(*bitmap & (0x80 >> j))) {
_WRN_PRINTF ("Still used slot in the block heap: %p (%d)\n",
heap, slot);
}
slot++;
}
bitmap++;
}
}
assert (0);
#endif #endif
}
free (heap->heap);
heap->heap = NULL;
free (heap->usage_bmp);
heap->usage_bmp = NULL;
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
pthread_mutex_destroy (&heap->lock); pthread_mutex_destroy (&heap->lock);
#endif #endif
free (heap->heap);
} }
File diff suppressed because it is too large Load Diff
+33 -92
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2021, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -270,9 +270,8 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
if (!ops->reset_dirty_region (ctxt, layer)) if (!ops->reset_dirty_region (ctxt, layer))
return; return;
/* travel menu znodes on the layer; /* travel menu znodes on the layer */
this will only work for topmost layer */ if (zi->nr_popupmenus > 0) {
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi); nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) { for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc); pdc = dc_HDC2PDC (nodes[i].mem_dc);
@@ -302,23 +301,21 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
} }
} }
/* check wallpaper pattern; only call for topmost layer */ /* check wallpaper pattern */
if (layer == mgTopmostLayer) { pdc = dc_HDC2PDC (HDC_SCREEN);
pdc = dc_HDC2PDC (HDC_SCREEN); if (pdc->surface->w > 0 && pdc->surface->h > 0) {
if (pdc->surface->w > 0 && pdc->surface->h > 0) { assert (pdc->surface->dirty_info);
assert (pdc->surface->dirty_info); lock_znode_surface (pdc, nodes);
lock_znode_surface (pdc, nodes); changes_in_dc = pdc->surface->dirty_info->dirty_age;
changes_in_dc = pdc->surface->dirty_info->dirty_age; if (changes_in_dc != nodes[0].changes) {
if (changes_in_dc != nodes[0].changes) { ops->merge_dirty_wpp (ctxt, layer);
ops->merge_dirty_wpp (ctxt, layer);
}
} }
} }
ops->refresh_dirty_region (ctxt, layer); ops->refresh_dirty_region (ctxt, layer);
/* unlock the znode surfaces for popup menus */ /* unlock the znode surfaces for popup menus */
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) { if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi); nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) { for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc); pdc = dc_HDC2PDC (nodes[i].mem_dc);
@@ -341,15 +338,12 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
} }
} }
/* unlock the znode surfaces for wallpaper pattern; /* unlock the znode surfaces for wallpaper patter */
only for topmost layer */ pdc = dc_HDC2PDC (HDC_SCREEN);
if (layer == mgTopmostLayer) { if (pdc->surface->w > 0 && pdc->surface->h > 0) {
pdc = dc_HDC2PDC (HDC_SCREEN); nodes[0].changes = pdc->surface->dirty_info->dirty_age;
if (pdc->surface->w > 0 && pdc->surface->h > 0) { pdc->surface->dirty_info->nr_dirty_rcs = 0;
nodes[0].changes = pdc->surface->dirty_info->dirty_age; unlock_znode_surface (pdc, nodes);
pdc->surface->dirty_info->nr_dirty_rcs = 0;
unlock_znode_surface (pdc, nodes);
}
} }
} }
@@ -377,16 +371,16 @@ void __mg_composite_dirty_znodes (void)
#endif /* optimized */ #endif /* optimized */
static void purge_all_znodes_private_data (const CompositorOps* ops, static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
CompositorCtxt* ctxt) CompositorCtxt* ctxt, MG_Layer* layer)
{ {
ZORDERINFO* zi; ZORDERINFO* zi;
ZORDERNODE* nodes; ZORDERNODE* nodes;
int i, next; int i, next;
MG_Layer* layer;
/* travel menu znodes on the topmost layer */ zi = (ZORDERINFO*)layer->zorder_info;
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
// travel popup menu znodes
if (zi->nr_popupmenus > 0) { if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi); nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) { for (i = 0; i < zi->nr_popupmenus; i++) {
@@ -397,56 +391,25 @@ static void purge_all_znodes_private_data (const CompositorOps* ops,
} }
} }
/* travel all window znodes in all layers */ // travel window znodes
layer = mgLayers; nodes = GET_ZORDERNODE(zi);
while (layer) { next = 0;
zi = (ZORDERINFO*)layer->zorder_info; while ((next = __kernel_get_next_znode (zi, next)) > 0) {
nodes = GET_ZORDERNODE(zi); if (nodes[next].priv_data && ops->purge_win_data) {
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
next = 0; nodes[next].priv_data = NULL;
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 void rebuild_all_znodes_private_data (const CompositorOps* ops, static inline void purge_all_znodes_private_data (const CompositorOps* ops,
CompositorCtxt* ctxt) CompositorCtxt* ctxt)
{ {
ZORDERINFO* zi;
ZORDERNODE* nodes;
int i, next;
MG_Layer* layer; 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; layer = mgLayers;
while (layer) { while (layer) {
zi = (ZORDERINFO*)layer->zorder_info; purge_znodes_private_data_in_layer (ops, ctxt, layer);
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; layer = layer->next;
} }
} }
@@ -489,7 +452,7 @@ const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name)
return NULL; return NULL;
for (i = 0; i < MAX_NR_COMPOSITORS; i++) { for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
if (compositors [i].name && strcmp (compositors [i].name, name) == 0) { if (strcmp (compositors [i].name, name) == 0) {
return compositors [i].ops; return compositors [i].ops;
} }
} }
@@ -570,9 +533,6 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
} }
curr_ops = ops; curr_ops = ops;
curr_ctxt = ctxt; 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); curr_ops->refresh (ctxt);
} }
@@ -583,24 +543,5 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
return NULL; return NULL;
} }
const char* GUIAPI ServerGetCurrentCompositor (
const CompositorOps** ops, CompositorCtxt** ctxt)
{
int i;
const CompositorOps* the_ops;
the_ops = ServerSelectCompositor (NULL, ctxt);
if (ops) {
*ops = the_ops;
}
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
if (compositors [i].ops == the_ops)
return compositors [i].name;
}
return NULL;
}
#endif /* defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING) */ #endif /* defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING) */
+2 -2
View File
@@ -48,7 +48,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
{ {
FILE* fp; FILE* fp;
WORD16 wTemp; WORD16 wTemp;
int w=0, h=0, xhot=0, yhot=0, colornum=0; int w, h, xhot, yhot, colornum;
#if 0 #if 0
DWORD32 size; DWORD32 size;
#endif #endif
@@ -152,7 +152,7 @@ static HCURSOR load_cursor_from_mem (const void* area)
const Uint8* p = (Uint8*)area; const Uint8* p = (Uint8*)area;
WORD16 wTemp; WORD16 wTemp;
int w=0, h=0, xhot=0, yhot=0, colornum=0; int w = 0, h = 0, xhot = 0, yhot = 0, colornum = 0;
#if 0 #if 0
DWORD32 size; DWORD32 size;
#endif #endif

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