mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-24 17:34:55 +08:00
Compare commits
164
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22bbe8e709 | ||
|
|
2fe23fa95b | ||
|
|
a6eb81e916 | ||
|
|
93ec7e48b6 | ||
|
|
956003092e | ||
|
|
96b75c41c1 | ||
|
|
d6933b83e3 | ||
|
|
e2ba3681a1 | ||
|
|
0b47b83849 | ||
|
|
08419c0c95 | ||
|
|
03bc5befd5 | ||
|
|
ed37fa4fc2 | ||
|
|
7268bcf92e | ||
|
|
2d462ec749 | ||
|
|
11a4941dc7 | ||
|
|
d6281fd804 | ||
|
|
550fb04731 | ||
|
|
e08a87fc93 | ||
|
|
cac16f1324 | ||
|
|
2efb66cae0 | ||
|
|
ad49fe0e0e | ||
|
|
ed0521df84 | ||
|
|
002a03c087 | ||
|
|
70535c6cb4 | ||
|
|
4013dbf70a | ||
|
|
b288e29eef | ||
|
|
871a99e22b | ||
|
|
a965f1023c | ||
|
|
a6af326b48 | ||
|
|
754b8f3014 | ||
|
|
a85386499e | ||
|
|
fe48d1cc64 | ||
|
|
c1aab8bf69 | ||
|
|
65d8a31a35 | ||
|
|
e97ae8bcdb | ||
|
|
883410eb14 | ||
|
|
0cb72162e4 | ||
|
|
2cb6c4bc9c | ||
|
|
5b111d3300 | ||
|
|
820689f5f9 | ||
|
|
2ae51d70fb | ||
|
|
86158f938d | ||
|
|
3f99c7b960 | ||
|
|
b266bd8e0a | ||
|
|
f6d25f58aa | ||
|
|
ccbccc2020 | ||
|
|
736193d355 | ||
|
|
47e32a812e | ||
|
|
ac769be3cb | ||
|
|
4de7e09c22 | ||
|
|
e787c6fbde | ||
|
|
a0a0330a6c | ||
|
|
46854579be | ||
|
|
d31af448ff | ||
|
|
91062be2ac | ||
|
|
6907dba86d | ||
|
|
d4cadc47e0 | ||
|
|
0904ae5dc7 | ||
|
|
a431b2ae56 | ||
|
|
4c7e1bcecf | ||
|
|
7364a960bc | ||
|
|
77bb2f4433 | ||
|
|
75077509d6 | ||
|
|
9ebf59e4ad | ||
|
|
20a50bc094 | ||
|
|
180bd4480f | ||
|
|
947ce61805 | ||
|
|
270648fc73 | ||
|
|
4ebd23bf56 | ||
|
|
0ea195a7a2 | ||
|
|
5978175ef8 | ||
|
|
f8e144d1f2 | ||
|
|
8c92b16d04 | ||
|
|
a9129c5772 | ||
|
|
72551be6b0 | ||
|
|
7d4cf8a47d | ||
|
|
b967f2f18f | ||
|
|
af3ff13513 | ||
|
|
d543f17606 | ||
|
|
e3e79aaf86 | ||
|
|
44bb22925f | ||
|
|
e88a3cd3d8 | ||
|
|
1340a8b81e | ||
|
|
d07e797f92 | ||
|
|
cdf4ca3612 | ||
|
|
ac50ae71c4 | ||
|
|
88ec285dc5 | ||
|
|
d5f637f206 | ||
|
|
f35c63482f | ||
|
|
940060c724 | ||
|
|
2466167c93 | ||
|
|
8e556e6ce1 | ||
|
|
9c44c1eccb | ||
|
|
70aa7516fc | ||
|
|
fcdeea30d9 | ||
|
|
b4fb53b3c3 | ||
|
|
4e752a6f8b | ||
|
|
a2183ed53a | ||
|
|
182f195a57 | ||
|
|
a0214a2956 | ||
|
|
51da6b7204 | ||
|
|
285a8e1101 | ||
|
|
de315cf780 | ||
|
|
7642ead8ce | ||
|
|
666fba74cd | ||
|
|
4d1077b759 | ||
|
|
561b4c3ffc | ||
|
|
f970fd377e | ||
|
|
383d70b446 | ||
|
|
82edb53d22 | ||
|
|
bf127a3f4d | ||
|
|
c089adf2b7 | ||
|
|
6a5c9ba048 | ||
|
|
c9c55c74bf | ||
|
|
5f854d75c7 | ||
|
|
3a3d77042a | ||
|
|
49e714431a | ||
|
|
f64680082c | ||
|
|
f3c1ea0bc4 | ||
|
|
31a2d3c185 | ||
|
|
1621cb7bf5 | ||
|
|
89fcfe3979 | ||
|
|
5dd702017f | ||
|
|
0f1b251c91 | ||
|
|
1fab00bf85 | ||
|
|
c8fcbd1864 | ||
|
|
7802d000fe | ||
|
|
9978a89991 | ||
|
|
87637f68dd | ||
|
|
727f4ad5c5 | ||
|
|
30f1488c5c | ||
|
|
28b04af4f5 | ||
|
|
62cb29a435 | ||
|
|
86d6e12f9e | ||
|
|
30147e9e01 | ||
|
|
a966689e88 | ||
|
|
42e1d5db2c | ||
|
|
877ed4c382 | ||
|
|
5ccb57c19d | ||
|
|
80d03b2f6f | ||
|
|
b31d3860e6 | ||
|
|
697177266b | ||
|
|
48b84e3100 | ||
|
|
27122b421d | ||
|
|
a305dd85da | ||
|
|
7bc4ae81dc | ||
|
|
8675244823 | ||
|
|
af7df5bcea | ||
|
|
0ceee74091 | ||
|
|
0b023c27de | ||
|
|
e1ea9b7209 | ||
|
|
9fa7401542 | ||
|
|
df65816504 | ||
|
|
62bcaebe14 | ||
|
|
d88d508180 | ||
|
|
0178f28f66 | ||
|
|
c226242d6d | ||
|
|
9a09deee91 | ||
|
|
2190256165 | ||
|
|
cdba9dbd17 | ||
|
|
df3be3bde0 | ||
|
|
4e43c9cfee | ||
|
|
a2d733392f | ||
|
|
7a5ad30a92 |
+174
-78
File diff suppressed because it is too large
Load Diff
+174
-78
File diff suppressed because it is too large
Load Diff
+174
-78
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,14 @@
|
||||
# MiniGUI
|
||||
|
||||
A mature and proven cross-platform windowing system for embedded system and smart IoT devices.
|
||||
A modern and proven cross-platform window system for embedded systems or smart IoT devices.
|
||||
|
||||
|
||||
## TABLE OF CONTENTS
|
||||
_TABLE OF CONTENTS_
|
||||
|
||||
- [TABLE OF CONTENTS](#table-of-contents)
|
||||
- [INTRODUCTION](#introduction)
|
||||
+ [What's MiniGUI](#whats-minigui)
|
||||
+ [MiniGUI Components](#minigui-components)
|
||||
+ [Open Source Apps Based-on MiniGUI](#open-source-apps-based-on-minigui)
|
||||
+ [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)
|
||||
@@ -23,6 +23,9 @@ A mature and proven cross-platform windowing system for embedded system and smar
|
||||
+ [Building Whole MiniGUI](#building-whole-minigui)
|
||||
+ [Building MiniGUI Core](#building-minigui-core)
|
||||
+ [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)
|
||||
- [AUTHORS AND COPYING](#authors-and-copying)
|
||||
+ [Special Statement](#special-statement)
|
||||
@@ -34,13 +37,6 @@ A mature and proven cross-platform windowing system for embedded system and smar
|
||||
|
||||
### 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
|
||||
windowing and GUI support system, which is especially fit for
|
||||
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
|
||||
@@ -50,65 +46,37 @@ Nucleus, pSOS, uC/OS-II, OSE, and others.
|
||||
This is the source tree of MiniGUI Core, which provides the windowing
|
||||
and graphics interfaces as well as a lot of standard controls (toolkit).
|
||||
|
||||
### MiniGUI Components
|
||||
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial
|
||||
use. In December 1998, the initiator of FMSoft, Wei Yongming, began to develop
|
||||
MiniGUI under the GNU General Public License (GPL). In September 2002, the core
|
||||
developers of MiniGUI founded [FMSoft](https://www.fmsoft.cn) and started the
|
||||
commercial marketing with the free software. By now, FMSoft still continues to
|
||||
release MiniGUI as a free software project.
|
||||
|
||||
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.
|
||||
|
||||
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:
|
||||
For the live demos, source tarballs, and cases of MiniGUI, you can refer
|
||||
to the following website:
|
||||
|
||||
<http://www.minigui.com>
|
||||
|
||||
### Open Source Apps Based-on MiniGUI
|
||||
### 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
|
||||
help your develop GUI apps in C/C++ programming language. However,
|
||||
alternatively, you can choose one of the following frameworks to
|
||||
develop your apps in a easy-to-use programming language other than C/C++.
|
||||
|
||||
* `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
|
||||
* [HybridOS](https://gitlab.fmsoft.cn/HybridOS/hybridos) provides
|
||||
a complete software stack to develop an app which have rich functions
|
||||
and excellent expressive in HTML5, CSS3, and JavaScript.
|
||||
* [hiACEJS](https://gitlab.fmsoft.cn/HybridOS/hiACEJS) provides
|
||||
a light-weight app framework in JavaScript.
|
||||
|
||||
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://github.com/FMSoftCN/hybridos) is another large open source project
|
||||
[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.
|
||||
|
||||
@@ -165,19 +133,20 @@ FMSoft had created the public repositories for MiniGUI Core, MiniGUI
|
||||
components, HybridOS, and other open source apps on GitHub. You can visit
|
||||
them on:
|
||||
|
||||
<https://github.com/VincentWei>
|
||||
|
||||
and
|
||||
|
||||
<https://github.com/FMSoftCN>
|
||||
<https://gitlab.fmsoft.cn/VincentWei>
|
||||
|
||||
We now maintain all documents about MiniGUI on the following public repo:
|
||||
|
||||
<https://github.com/VincentWei/minigui-docs>
|
||||
<https://gitlab.fmsoft.cn/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
|
||||
|
||||
In version 5.0.0, we introduced some new and exciting features, and refactored
|
||||
In version 5.0.0, we introduced some exciting new features, and refactored
|
||||
a lot basic modules of MiniGUI Core.
|
||||
|
||||
### Compositing Schema
|
||||
@@ -292,7 +261,7 @@ so that the old applications can smoothly migrate to the new
|
||||
version. However, there are still some slight changes you need to take care.
|
||||
For more information, please refer to `RELEASE-NOTES.md` file:
|
||||
|
||||
<https://github.com/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
|
||||
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
|
||||
|
||||
## NEW FEATURES IN VERSION 4.0.x
|
||||
|
||||
@@ -323,7 +292,7 @@ in order to support [HybridOS Foundation Class Library].
|
||||
|
||||
For more information, please refer to `RELEASE-NOTES.md` file:
|
||||
|
||||
<https://github.com/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md>
|
||||
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md>
|
||||
|
||||
Because of the changes of some APIs, we recommended strongly that you
|
||||
use this version for new projects.
|
||||
@@ -338,7 +307,7 @@ We introduce some new features in MiniGUI Version 3.2.x:
|
||||
|
||||
For more information, please refer to `RELEASE-NOTES.md` file:
|
||||
|
||||
<https://github.com/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md>
|
||||
<https://gitlab.fmsoft.cn/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md>
|
||||
|
||||
## THE RUNTIME MODES OF MINIGUI
|
||||
|
||||
@@ -392,15 +361,16 @@ 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>
|
||||
[Build MiniGUI 5.0](https://gitlab.fmsoft.cn/VincentWei/build-minigui-5.0)
|
||||
|
||||
or
|
||||
|
||||
<https://github.com/VincentWei/build-minigui-4.0>
|
||||
[Build MiniGUI 4.0](https://gitlab.fmsoft.cn/VincentWei/build-minigui-4.0)
|
||||
|
||||
or
|
||||
|
||||
<https://github.com/VincentWei/build-minigui-3.2>
|
||||
[Build MiniGUI 3.2](https://gitlab.fmsoft.cn/VincentWei/build-minigui-3.2)
|
||||
|
||||
|
||||
### Building MiniGUI Core
|
||||
|
||||
@@ -440,11 +410,57 @@ For more information, please run
|
||||
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
|
||||
following repository:
|
||||
|
||||
<https://github.com/VincentWei/mg-tests>
|
||||
<https://gitlab.fmsoft.cn/VincentWei/mg-tests>
|
||||
|
||||
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
|
||||
|
||||
21 years have pasted since MiniGUI was initially created at
|
||||
@@ -549,6 +565,7 @@ A brief history description of the development progress is listed as follow:
|
||||
1. Apr., 2019: FMSoft released MiniGUI version 3.2.2.
|
||||
1. Jul., 2019: FMSoft released MiniGUI version 4.0.0.
|
||||
1. Mar., 2020: FMSoft released MiniGUI version 5.0.0.
|
||||
1. May., 2021: FMSoft released MiniGUI version 5.0.6.
|
||||
|
||||
## AUTHORS AND COPYING
|
||||
|
||||
@@ -556,7 +573,7 @@ The original author of MiniGUI is WEI Yongming, and now MiniGUI is
|
||||
maintained by FMSoft. For more information, please refer to
|
||||
<http://www.fmsoft.cn>.
|
||||
|
||||
Copyright (C) 2002 ~ 2020, Beijing FMSoft Technologies Co., Ltd.
|
||||
Copyright (C) 2002 ~ 2021, Beijing FMSoft Technologies Co., Ltd.
|
||||
Copyright (C) 1998 ~ 2002, WEI Yongming
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Release Notes
|
||||
|
||||
- [Version 5.0.6](#version-506)
|
||||
+ [What's new in version 5.0.6](#whats-new-in-version-506)
|
||||
- [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)
|
||||
@@ -18,6 +20,41 @@
|
||||
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
||||
+ [Deprecated APIs](#deprecated-apis)
|
||||
|
||||
## Version 5.0.6
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 5.0.6,
|
||||
which is the bug fixing release of MiniGUI 5.0.x.
|
||||
|
||||
### What's new in version 5.0.6
|
||||
|
||||
In this version, we fixed some bugs and made some optimizations and enhancements:
|
||||
|
||||
* BUGFIXING:
|
||||
- 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,
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
Version 5.0.5 (2021/01/31)
|
||||
Version 5.0.7 (2021/06/30)
|
||||
|
||||
This is the first official release of MiniGUI 5.0.x, the stable version.
|
||||
This is a bugfix release of MiniGUI 5.0.x, the stable version.
|
||||
|
||||
Other packages for MiniGUI resource, tools, components, and samples:
|
||||
|
||||
- GVFB: `gvfb-1.2.5.tar.gz`
|
||||
- The resource package: `minigui-res-5.0.0.tar.gz`
|
||||
- The resource package: `minigui-res-5.0.6.tar.gz`
|
||||
- mGUtils component: `libmgutils-1.5.0.tar.gz`
|
||||
- mGPlus component: `libmgplus-1.5.0.tar.gz`
|
||||
- mGEff component: `libmgeff-1.5.0.tar.gz`
|
||||
|
||||
+130
-158
File diff suppressed because it is too large
Load Diff
@@ -237,7 +237,6 @@ MG_EXPORT void GUIAPI NotifyParentEx (HWND hwnd, LINT id, int code,
|
||||
NotifyParentEx(hwnd, id, code, 0)
|
||||
|
||||
/**
|
||||
* \var typedef int (*STRCMP) (const char* s1, const char* s2, size_t n)
|
||||
* \brief Type of general strncmp function.
|
||||
*
|
||||
* The function compares the two strings \a s1 and \a s2. It returns
|
||||
|
||||
@@ -698,7 +698,6 @@ extern "C" {
|
||||
#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.
|
||||
*
|
||||
* \param hWnd Handle of the edit control.
|
||||
|
||||
+209
-98
@@ -586,27 +586,23 @@ enum {
|
||||
*
|
||||
* \sa InitBlockDataHeap, DestroyBlockDataHeap
|
||||
*/
|
||||
typedef struct _BLOCKHEAP
|
||||
{
|
||||
typedef struct _BLOCKHEAP {
|
||||
#ifdef _MGRM_THREADS
|
||||
pthread_mutex_t lock;
|
||||
#endif
|
||||
/**
|
||||
* Size of one block element.
|
||||
*/
|
||||
size_t bd_size;
|
||||
/**
|
||||
* Size of the heap in blocks.
|
||||
*/
|
||||
size_t heap_size;
|
||||
/**
|
||||
* The first free element in the heap.
|
||||
*/
|
||||
int free;
|
||||
/**
|
||||
* Pointer to the pre-allocated heap.
|
||||
*/
|
||||
void* heap;
|
||||
/** Size of one block element in bytes. */
|
||||
size_t sz_block;
|
||||
/** Size of the heap in blocks. */
|
||||
size_t sz_heap;
|
||||
/** The number of blocks extra allocated. */
|
||||
size_t nr_alloc;
|
||||
/** The size of usage bitmap in bytes. */
|
||||
size_t sz_usage_bmp;
|
||||
|
||||
/** The pointer to the pre-allocated heap. */
|
||||
unsigned char* heap;
|
||||
/** The pointer to the usage bitmap. */
|
||||
unsigned char* usage_bmp;
|
||||
} BLOCKHEAP;
|
||||
|
||||
/**
|
||||
@@ -618,7 +614,7 @@ typedef struct _BLOCKHEAP
|
||||
typedef BLOCKHEAP* PBLOCKHEAP;
|
||||
|
||||
/**
|
||||
* \fn void InitBlockDataHeap (PBLOCKHEAP heap, \
|
||||
* \fn BOOL InitBlockDataHeap (PBLOCKHEAP heap,
|
||||
size_t bd_size, size_t heap_size)
|
||||
* \brief Initializes a private block data heap.
|
||||
*
|
||||
@@ -631,15 +627,11 @@ typedef BLOCKHEAP* PBLOCKHEAP;
|
||||
* \param bd_size The size of one block in bytes.
|
||||
* \param heap_size The size of the heap in blocks.
|
||||
*
|
||||
* \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.
|
||||
* \return TRUE on success, FALSE on error.
|
||||
*
|
||||
* \sa BLOCKHEAP
|
||||
*/
|
||||
MG_EXPORT extern void InitBlockDataHeap (PBLOCKHEAP heap,
|
||||
MG_EXPORT BOOL InitBlockDataHeap (PBLOCKHEAP heap,
|
||||
size_t bd_size, size_t heap_size);
|
||||
|
||||
/**
|
||||
@@ -657,7 +649,7 @@ MG_EXPORT extern void InitBlockDataHeap (PBLOCKHEAP heap,
|
||||
* \sa InitBlockDataHeap, BlockDataFree
|
||||
*/
|
||||
|
||||
MG_EXPORT extern void* BlockDataAlloc (PBLOCKHEAP heap);
|
||||
MG_EXPORT void* BlockDataAlloc (PBLOCKHEAP heap);
|
||||
|
||||
/**
|
||||
* \fn void BlockDataFree (PBLOCKHEAP heap, void* data)
|
||||
@@ -672,7 +664,7 @@ MG_EXPORT extern void* BlockDataAlloc (PBLOCKHEAP heap);
|
||||
*
|
||||
* \sa InitBlockDataHeap, BlockDataAlloc
|
||||
*/
|
||||
MG_EXPORT extern void BlockDataFree (PBLOCKHEAP heap, void* data);
|
||||
MG_EXPORT void BlockDataFree (PBLOCKHEAP heap, void* data);
|
||||
|
||||
/**
|
||||
* \fn void DestroyBlockDataHeap (PBLOCKHEAP heap)
|
||||
@@ -682,7 +674,7 @@ MG_EXPORT extern void BlockDataFree (PBLOCKHEAP heap, void* data);
|
||||
*
|
||||
* \sa InitBlockDataHeap, BLOCKHEAP
|
||||
*/
|
||||
MG_EXPORT extern void DestroyBlockDataHeap (PBLOCKHEAP heap);
|
||||
MG_EXPORT void DestroyBlockDataHeap (PBLOCKHEAP heap);
|
||||
|
||||
/** @} end of block_heap_fns */
|
||||
|
||||
@@ -3721,7 +3713,8 @@ MG_EXPORT BOOL GUIAPI FloodFillGenerator (void* context,
|
||||
* \brief Set bitmap scaler algorithm callback of DC according by scaler_type.
|
||||
*
|
||||
* This function sets the bitmap scaler with DDA or bilinear interpolation
|
||||
* algorithm. MiniGUI implements StretchBlt functions by using this scaler.
|
||||
* algorithm. MiniGUI implements \a StretchBlt functions by using this scaler
|
||||
* (when not using Pixman).
|
||||
*
|
||||
* \param hdc The device context.
|
||||
* \param scaler_type The type of scaler algorithm, use BITMAP_SCALER_DDA
|
||||
@@ -5173,131 +5166,142 @@ MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y,
|
||||
* The color blend mothed.
|
||||
*
|
||||
* See [Compositing and Blending Level 1](https://www.w3.org/TR/compositing-1/)
|
||||
* Note: we define the same values with Pixman.
|
||||
*/
|
||||
typedef enum {
|
||||
/** Porter Duff rule: source over destination */
|
||||
COLOR_BLEND_PD_SRC_OVER = 0,
|
||||
/** Porter Duff rule: destination over source */
|
||||
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 */
|
||||
COLOR_BLEND_PD_SRC_IN,
|
||||
/** Porter Duff rule: destination in souorce */
|
||||
COLOR_BLEND_PD_DST_IN,
|
||||
/** Porter Duff rule: source held out by destination */
|
||||
COLOR_BLEND_PD_SRC_OUT,
|
||||
/** Porter Duff rule: destination held out by source */
|
||||
COLOR_BLEND_PD_DST_OUT,
|
||||
/** Porter Duff rule: source atop destination */
|
||||
COLOR_BLEND_PD_SRC_ATOP,
|
||||
/** Porter Duff rule: destination atop source */
|
||||
COLOR_BLEND_PD_DST_ATOP,
|
||||
/** Porter Duff rule: source xor destination */
|
||||
COLOR_BLEND_PD_XOR,
|
||||
/** Porter Duff rule: plus */
|
||||
COLOR_BLEND_PD_PLUS,
|
||||
/** Porter Duff rule: modulate */
|
||||
COLOR_BLEND_PD_MODULATE,
|
||||
COLOR_BLEND_LEGACY = 0,
|
||||
COLOR_BLEND_FLAGS_MASK = 0x00FF,
|
||||
|
||||
COLOR_BLEND_PD_FIRST = COLOR_BLEND_PD_SRC_OVER,
|
||||
COLOR_BLEND_PD_LAST = COLOR_BLEND_PD_MODULATE,
|
||||
/** 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 */
|
||||
COLOR_BLEND_PD_SRC_OVER = 0x0103, // PIXMAN_OP_OVER = 0x03
|
||||
/** Porter Duff rule: destination over source */
|
||||
COLOR_BLEND_PD_DST_OVER = 0x0104, // PIXMAN_OP_OVER_REVERSE = 0x04
|
||||
/** Porter Duff rule: souorce in destination */
|
||||
COLOR_BLEND_PD_SRC_IN = 0x0105, // PIXMAN_OP_IN = 0x05
|
||||
/** Porter Duff rule: destination in souorce */
|
||||
COLOR_BLEND_PD_DST_IN = 0x0106, // PIXMAN_OP_IN_REVERSE = 0x06
|
||||
/** Porter Duff rule: source held out by destination */
|
||||
COLOR_BLEND_PD_SRC_OUT = 0x0107, // PIXMAN_OP_OUT = 0x07
|
||||
/** Porter Duff rule: destination held out by source */
|
||||
COLOR_BLEND_PD_DST_OUT = 0x0108, // PIXMAN_OP_OUT_REVERSE = 0x08
|
||||
/** Porter Duff rule: source atop destination */
|
||||
COLOR_BLEND_PD_SRC_ATOP = 0x0109, // PIXMAN_OP_ATOP = 0x09
|
||||
/** Porter Duff rule: destination atop source */
|
||||
COLOR_BLEND_PD_DST_ATOP = 0x010a, // PIXMAN_OP_ATOP_REVERSE = 0x0a
|
||||
/** Porter Duff rule: source xor destination */
|
||||
COLOR_BLEND_PD_XOR = 0x010b, // PIXMAN_OP_XOR = 0x0b
|
||||
/** Porter Duff rule: plus */
|
||||
COLOR_BLEND_PD_PLUS = 0x010c, // PIXMAN_OP_ADD = 0x0c
|
||||
/** Porter Duff rule: modulate */
|
||||
COLOR_BLEND_PD_MODULATE = 0x010d, // PIXMAN_OP_SATURATE = 0x0d
|
||||
|
||||
COLOR_BLEND_PD_FLAG = 0x0100,
|
||||
COLOR_BLEND_PD_FIRST = COLOR_BLEND_PD_CLEAR,
|
||||
COLOR_BLEND_PD_LAST = COLOR_BLEND_PD_MODULATE,
|
||||
|
||||
/**
|
||||
* Separable blend mode: normal
|
||||
* The blending formula simply selects the source color.
|
||||
*/
|
||||
COLOR_BLEND_SP_NORMAL,
|
||||
COLOR_BLEND_SP_NORMAL = 0x0801,
|
||||
/**
|
||||
* Separable blend mode: multiply
|
||||
* Darkens by multiplying colors: Sc·Dc.
|
||||
*/
|
||||
COLOR_BLEND_SP_MULTIPLY,
|
||||
COLOR_BLEND_SP_MULTIPLY = 0x0830, // PIXMAN_OP_MULTIPLY = 0x30
|
||||
/**
|
||||
* Separable blend mode: screen
|
||||
* Complements product of complements: Sc + Dc - Sc·Dc.
|
||||
*/
|
||||
COLOR_BLEND_SP_SCREEN,
|
||||
COLOR_BLEND_SP_SCREEN = 0x0831, // PIXMAN_OP_SCREEN = 0x31
|
||||
/**
|
||||
* Separable blend mode: overlay
|
||||
* Inverse of hard-light.
|
||||
*/
|
||||
COLOR_BLEND_SP_OVERLAY,
|
||||
COLOR_BLEND_SP_OVERLAY = 0x0832, // PIXMAN_OP_OVERLAY = 0x32
|
||||
/**
|
||||
* Separable blend mode: darken
|
||||
* Minimum of colors: min(Sc, Dc).
|
||||
*/
|
||||
COLOR_BLEND_SP_DARKEN,
|
||||
COLOR_BLEND_SP_DARKEN = 0x0833, // PIXMAN_OP_DARKEN = 0x33
|
||||
/**
|
||||
* Separable blend mode: lighten
|
||||
* Maximum of colors: max(Sc, Dc).
|
||||
*/
|
||||
COLOR_BLEND_SP_LIGHTEN,
|
||||
COLOR_BLEND_SP_LIGHTEN = 0x0834, // PIXMAN_OP_LIGHTEN = 0x34
|
||||
/**
|
||||
* Separable blend mode: color-dodge
|
||||
* Brightens destination based on source.
|
||||
*/
|
||||
COLOR_BLEND_SP_COLOR_DODGE,
|
||||
COLOR_BLEND_SP_COLOR_DODGE = 0x0835, // PIXMAN_OP_COLOR_DODGE = 0x35,
|
||||
/**
|
||||
* Separable blend mode: color-burn
|
||||
* Darkens destination based on source.
|
||||
*/
|
||||
COLOR_BLEND_SP_COLOR_BURN,
|
||||
COLOR_BLEND_SP_COLOR_BURN = 0x0836, // PIXMAN_OP_COLOR_BURN = 0x36,
|
||||
/**
|
||||
* Separable blend mode: hard-light
|
||||
* Similar to effect of harsh spotlight.
|
||||
*/
|
||||
COLOR_BLEND_SP_HARD_LIGHT,
|
||||
COLOR_BLEND_SP_HARD_LIGHT = 0x0837, // PIXMAN_OP_HARD_LIGHT = 0x37,
|
||||
/**
|
||||
* Separable blend mode: soft-light
|
||||
* Similar to effect of soft spotlight.
|
||||
*/
|
||||
COLOR_BLEND_SP_SOFT_LIGHT,
|
||||
COLOR_BLEND_SP_SOFT_LIGHT = 0x0838, // PIXMAN_OP_SOFT_LIGHT = 0x38
|
||||
/**
|
||||
* Separable blend mode: difference
|
||||
* Subtracts the darker from the lighter: Abs(Dc - Sc).
|
||||
*/
|
||||
COLOR_BLEND_SP_DIFFERENCE,
|
||||
COLOR_BLEND_SP_DIFFERENCE = 0x0839, // PIXMAN_OP_DIFFERENCE = 0x39
|
||||
/**
|
||||
* Separable blend mode: exclusion
|
||||
* Similar to Difference but lower contrast.
|
||||
*/
|
||||
COLOR_BLEND_SP_EXCLUSION,
|
||||
COLOR_BLEND_SP_EXCLUSION = 0x083a, // PIXMAN_OP_EXCLUSION = 0x3a
|
||||
|
||||
COLOR_BLEND_SP_FIRST = COLOR_BLEND_SP_NORMAL,
|
||||
COLOR_BLEND_SP_LAST = COLOR_BLEND_SP_EXCLUSION,
|
||||
COLOR_BLEND_SP_FLAG = 0x0800,
|
||||
COLOR_BLEND_SP_FIRST = COLOR_BLEND_SP_NORMAL,
|
||||
COLOR_BLEND_SP_LAST = COLOR_BLEND_SP_EXCLUSION,
|
||||
|
||||
/**
|
||||
* Non-Separable blend mode: hue
|
||||
* Creates a color with the hue of the source color and
|
||||
* the saturation and luminosity of the backdrop color.
|
||||
*/
|
||||
COLOR_BLEND_NS_HUE,
|
||||
COLOR_BLEND_NS_HUE = 0x103b, // PIXMAN_OP_HSL_HUE = 0x3b
|
||||
/**
|
||||
* Non-Separable blend mode: saturation
|
||||
* Creates a color with the saturation of the source color and
|
||||
* the hue and luminosity of the backdrop color.
|
||||
*/
|
||||
COLOR_BLEND_NS_SATURATION,
|
||||
COLOR_BLEND_NS_SATURATION = 0x103c, // PIXMAN_OP_HSL_SATURATION = 0x3c
|
||||
/**
|
||||
* Non-Separable blend mode: color
|
||||
* Creates a color with the hue and saturation of the source color
|
||||
* and the luminosity of the backdrop color.
|
||||
*/
|
||||
COLOR_BLEND_NS_COLOR,
|
||||
COLOR_BLEND_NS_COLOR = 0x103d, // PIXMAN_OP_HSL_COLOR = 0x3d
|
||||
|
||||
/**
|
||||
* Non-Separable blend mode: luminosity
|
||||
* Creates a color with the luminosity of the source color and
|
||||
* the hue and saturation of the backdrop color.
|
||||
*/
|
||||
COLOR_BLEND_NS_LUMINOSITY,
|
||||
COLOR_BLEND_NS_LUMINOSITY = 0x103e, // PIXMAN_OP_HSL_LUMINOSITY = 0x3e
|
||||
|
||||
COLOR_BLEND_NS_FIRST = COLOR_BLEND_NS_HUE,
|
||||
COLOR_BLEND_NS_LAST = COLOR_BLEND_NS_LUMINOSITY,
|
||||
COLOR_BLEND_NS_FLAG = 0x1000,
|
||||
COLOR_BLEND_NS_FIRST = COLOR_BLEND_NS_HUE,
|
||||
COLOR_BLEND_NS_LAST = COLOR_BLEND_NS_LUMINOSITY,
|
||||
|
||||
COLOR_BLEND_FIRST = COLOR_BLEND_PD_CLEAR,
|
||||
COLOR_BLEND_LAST = COLOR_BLEND_NS_LAST,
|
||||
} ColorBlendMethod;
|
||||
|
||||
/**
|
||||
@@ -5349,26 +5353,69 @@ typedef enum {
|
||||
* in the destination DC.
|
||||
* \param dy The y coordinate of the upper-left corner of the rectangle
|
||||
* in the destination DC.
|
||||
* \param dwRop The raster logical operation, see \a ColorLogicalOp.
|
||||
* this argument is reserved for future use, currently ignored.
|
||||
* \param dwRop The color blending method, see \a ColorBlendMethod.
|
||||
* This argument is only valid when Pixman is used.
|
||||
*
|
||||
* \note The alpha and color key settings of the source DC will come into play.
|
||||
* \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 will be ignored.
|
||||
*
|
||||
* \sa StretchBlt, SetMemDCAlpha, SetMemDCColorKey, ColorLogicalOp
|
||||
* \sa StretchBlt, SetMemDCAlpha, SetMemDCColorKey, ColorBlendMethod
|
||||
*/
|
||||
MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
|
||||
HDC hddc, int dx, int dy, DWORD dwRop);
|
||||
|
||||
/**
|
||||
* \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)
|
||||
* 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 the bitmap if necessary.
|
||||
* 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)
|
||||
* \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.
|
||||
@@ -5385,21 +5432,73 @@ MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
|
||||
* in the destination DC.
|
||||
* \param dw The width of the destination rectangle.
|
||||
* \param dh The height of the destination rectangle.
|
||||
* \param dwRop The raster logical operation, see \a ColorLogicalOp.
|
||||
* this argument is reserved for future use, currently ignored.
|
||||
* \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.
|
||||
*
|
||||
* \note The source rect should be contained in the device space entirely,
|
||||
* and all coordinates should be in the device space.
|
||||
* \return TRUE for success, FALSE for bad arguments and there is no any
|
||||
* drawing occurred.
|
||||
*
|
||||
* \note The source DC and dest DC must compatible, else will do nothing.
|
||||
* \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.
|
||||
*
|
||||
* \note The alpha and color key settings of the source DC will not come
|
||||
* into play.
|
||||
*
|
||||
* \sa BitBlt, SetMemDCAlpha, SetMemDCColorKey
|
||||
* \sa BitBlt, SetMemDCAlpha, SetMemDCColorKey, STRETCH_EXTRA_INFO,
|
||||
* ColorBlendMethod, ScalingFilter
|
||||
*/
|
||||
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);
|
||||
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, \
|
||||
HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop)
|
||||
* \brief Copies a bitmap from a source rectangle into a destination
|
||||
* rectangle, streches 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 dwRop The color blending method, see \a ColorBlendMethod.
|
||||
* This argument is only valid when Pixman is used.
|
||||
*
|
||||
* \note When 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 and the scaling filter will be ignored.
|
||||
*
|
||||
* \sa BitBlt, SetMemDCAlpha, SetMemDCColorKey, ColorBlendMethod
|
||||
*/
|
||||
static inline 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)
|
||||
{
|
||||
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, \
|
||||
@@ -12852,6 +12951,7 @@ MG_EXPORT int GUIAPI GetGlyphsExtentPoint (HDC hdc, Glyph32* glyphs,
|
||||
|
||||
#define GLYPH_INFO_METRICS 0x01
|
||||
#define GLYPH_INFO_BMP 0x02
|
||||
#define GLYPH_INFO_FACE 0x04
|
||||
|
||||
/** The type of glyph bitmap: monochrome */
|
||||
#define GLYPHBMP_TYPE_MONO 0x00
|
||||
@@ -12874,6 +12974,7 @@ typedef struct _GLYPHINFO {
|
||||
* or bitmap infomation. Or'ed with the following values:
|
||||
* - GLYPH_INFO_METRICS
|
||||
* - GLYPH_INFO_BMP
|
||||
* - GLYPH_INFO_FACE
|
||||
*/
|
||||
Uint32 mask;
|
||||
|
||||
@@ -12906,6 +13007,16 @@ typedef struct _GLYPHINFO {
|
||||
* It is only valid if bmp_type is GLYPHBMP_TYPE_PRERENDER
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
|
||||
+79
-6
@@ -82,10 +82,16 @@ extern "C" {
|
||||
#define ZOF_MAXIMIZED 0x00000004 // 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 */
|
||||
#define ZOF_INTERNAL_FLAGS_MASK 0X000F0000
|
||||
#define ZOF_IF_REFERENCE 0x00010000
|
||||
#define ZOF_IF_ALWAYSTOP 0x00020000
|
||||
#define ZOF_IF_SPECIAL 0x00040000 // Since 5.0.6
|
||||
|
||||
#define ZOF_TW_FLAG_MASK 0x00F00000
|
||||
#define ZOF_TW_TROUNDCNS 0x00100000
|
||||
@@ -351,9 +357,17 @@ extern MG_EXPORT MG_Client* mgClients;
|
||||
*/
|
||||
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
|
||||
* \brief The pointer to the array of layers.
|
||||
* \brief The pointer to the layer list.
|
||||
*
|
||||
* \sa MG_Layer
|
||||
*/
|
||||
@@ -562,6 +576,8 @@ MG_EXPORT BOOL GUIAPI DeleteLayer (BOOL handle_name,
|
||||
*
|
||||
* \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
|
||||
* (a main window acts as the screen lock, the docker, or the launcher) will
|
||||
* be moved to the topmost layer automatically.
|
||||
@@ -1491,7 +1507,9 @@ MG_EXPORT BOOL GUIAPI ServerDoZNodeOperation (MG_Layer* layer, int idx_znode,
|
||||
*
|
||||
* \return TRUE on success, otherwise FALSE.
|
||||
*
|
||||
* \note Server-only function. The client which created a fixed main window
|
||||
* \note Server-only function. Only one client which has no any window can be moved.
|
||||
*
|
||||
* \note The client which created a fixed main window
|
||||
* (a main window acts as the screen lock, the docker, or the launcher) will
|
||||
* be moved to the topmost layer automatically.
|
||||
*
|
||||
@@ -1600,7 +1618,7 @@ typedef struct _CompositorOps {
|
||||
* a main window with the extended style WS_EX_AUTOPOSITION.
|
||||
*/
|
||||
void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer,
|
||||
DWORD zt_type, int first_for_type, CALCPOSINFO* info, int cli);
|
||||
DWORD zt_type, int first_for_type, int cli, CALCPOSINFO* info);
|
||||
|
||||
/**
|
||||
* This operation will be called when there was a layer operation.
|
||||
@@ -1729,6 +1747,20 @@ typedef struct _CompositorOps {
|
||||
void (*on_moved_win) (CompositorCtxt* ctxt, MG_Layer* layer,
|
||||
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.
|
||||
* The compositor can play an animation in this operation.
|
||||
@@ -1743,12 +1775,35 @@ typedef struct _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.
|
||||
*
|
||||
* This function gets the operations of a specific compositor.
|
||||
*
|
||||
* \param name The name of the compositor. MiniGUI reserved `default`
|
||||
* \param name The name of the compositor. MiniGUI reserved `fallback`
|
||||
* as the default compositor which is implemented in MiniGUI Core.
|
||||
* You can use some operations of the default compositor as the
|
||||
* corresponding operations for your own compositor.
|
||||
@@ -1808,7 +1863,7 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
|
||||
* \brief Select a compositor as the current compositor.
|
||||
*
|
||||
* This function selects a compositor as the current compositor
|
||||
* and returns the compositor object.
|
||||
* and returns the compositor operations.
|
||||
* It also destroies the old compositor object if there is old one.
|
||||
*
|
||||
* \param name The name of the compositor. If the argument is NULL,
|
||||
@@ -1826,7 +1881,25 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
|
||||
MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
|
||||
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
|
||||
|
||||
+97
-31
@@ -1448,6 +1448,17 @@ extern DWORD __mg_interval_time;
|
||||
*/
|
||||
#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
|
||||
|
||||
/** @} end of creation_msgs */
|
||||
@@ -2463,6 +2474,9 @@ typedef struct _COMPOSITINGINFO {
|
||||
/* Since 5.0.0 */
|
||||
#define MSG_SETAUTOREPEAT 0x0107
|
||||
|
||||
/* Since 5.0.6 */
|
||||
#define MSG_SETGESTUREFLAGS 0x0108
|
||||
|
||||
#define MSG_SHOWGLOBALCTRL 0x010A
|
||||
#define MSG_HIDEGLOBALCTRL 0x010B
|
||||
|
||||
@@ -2983,6 +2997,9 @@ typedef struct _WINMASKINFO {
|
||||
/* Since 5.0.0: for calculating the default position */
|
||||
#define MSG_CALC_POSITION 0x014B
|
||||
|
||||
/* Since 5.0.6: for waking up the client */
|
||||
#define MSG_WAKEUP_CLIENT 0x014C
|
||||
|
||||
/**
|
||||
* \def MSG_DOESNEEDIME
|
||||
* \brief Send to a window to query whether the window needs to open
|
||||
@@ -4433,16 +4450,12 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
|
||||
|
||||
/**
|
||||
* \def WS_EX_WINTYPE_TOOLTIP
|
||||
* \brief The type for a system/global main window.
|
||||
* \brief The type for 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.
|
||||
*
|
||||
* \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.
|
||||
* \note The maximal number of all main windows in the tooltip level is 16.
|
||||
* MiniGUI will create a main windows in higher level if there is no room
|
||||
* in the tooltip level.
|
||||
*
|
||||
@@ -4458,8 +4471,12 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
|
||||
* 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
|
||||
* create main windows in the system level, and any main windows created
|
||||
* by the server is a system main window.
|
||||
* create main windows in the system level, and any main windows created
|
||||
* 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.
|
||||
*/
|
||||
@@ -4473,13 +4490,18 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
|
||||
* 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.
|
||||
*
|
||||
* \note Under MiniGUI-Processes runtime mode, only the client which creates
|
||||
* 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
|
||||
* the higher level will be created.
|
||||
* \note Under MiniGUI-Processes runtime mode, only clients on the default (`mginit`)
|
||||
* 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
|
||||
* main windows in the this level. For other clients, a main window in
|
||||
* 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.
|
||||
* MiniGUI will create a main windows in higher level if there is no room
|
||||
* in the screen lock level.
|
||||
* MiniGUI will create a main windows in higher level if there is no room
|
||||
* in the screen lock level.
|
||||
*
|
||||
* Since 5.0.0.
|
||||
*/
|
||||
@@ -4494,13 +4516,18 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
|
||||
* be shown below the main windows in the screen lock level and
|
||||
* above the main windows in the higher level.
|
||||
*
|
||||
* \note Under MiniGUI-Processes runtime mode, only the client which creates
|
||||
* 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
|
||||
* level will be created.
|
||||
* \note Under MiniGUI-Processes runtime mode, only clients on the default (`mginit`)
|
||||
* 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
|
||||
* in the docker level. For other clients, a main window in 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 docker level is 8.
|
||||
* MiniGUI will create a main windows in higher level if there is no room
|
||||
* in the docker level.
|
||||
* MiniGUI will create a main windows in higher level if there is no room
|
||||
* in the docker level.
|
||||
*
|
||||
* Since 5.0.0.
|
||||
*/
|
||||
@@ -4549,13 +4576,18 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
|
||||
* be shown below the main windows in the normal level and
|
||||
* above the wallpaper.
|
||||
*
|
||||
* \note Under MiniGUI-Processes runtime mode, only the client which creates
|
||||
* the first main window in the launcher level can create other
|
||||
* main windows in the launcher level. For other clients, a main window
|
||||
* in the normal level will be created.
|
||||
* \note Under MiniGUI-Processes runtime mode, only clients on the default (`mginit`)
|
||||
* 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
|
||||
* main windows in the launcher level. For other clients, a main window
|
||||
* 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.
|
||||
* MiniGUI will create a main windows in normal level if there is no room
|
||||
* in the launcher level.
|
||||
* MiniGUI will create a main windows in normal level if there is no room
|
||||
* in the launcher level.
|
||||
*
|
||||
* Since 5.0.0.
|
||||
*/
|
||||
@@ -6884,13 +6916,14 @@ static inline BOOL MainWindowThreadCleanup (HWND hMainWnd)
|
||||
#define ST_PIXEL_ARGB4444 0x0001
|
||||
#define ST_PIXEL_ARGB1555 0x0002
|
||||
#define ST_PIXEL_ARGB8888 0x0003
|
||||
#define ST_PIXEL_XRGB565 0x0004
|
||||
|
||||
/* other flags for future use */
|
||||
|
||||
/* for default surface flags */
|
||||
#define ST_DEFAULT (ST_PIXEL_DEFAULT)
|
||||
|
||||
#define CT_SYSTEM_MASK 0X0000FF
|
||||
#define CT_SYSTEM_MASK 0x0000FF
|
||||
#define CT_OPAQUE 0x000000
|
||||
#define CT_COLORKEY 0x000001
|
||||
#define CT_ALPHACHANNEL 0x000002
|
||||
@@ -7158,7 +7191,7 @@ MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
|
||||
* \param hWnd The handle to the window.
|
||||
* \param fSet Set or cancel the always top style; TRUE to set, FALSE to cancel.
|
||||
*
|
||||
* \return return TRUE on success, otherwise FALSE.
|
||||
* \return TRUE on success, otherwise FALSE.
|
||||
*
|
||||
* \sa GetWindowStyle, WS_ALWAYSTOP
|
||||
*
|
||||
@@ -7166,6 +7199,39 @@ MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
|
||||
*/
|
||||
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
|
||||
|
||||
/**
|
||||
@@ -7189,14 +7255,14 @@ MG_EXPORT BOOL GUIAPI SetMainWindowAlwaysTop (HWND hWnd, BOOL fSet);
|
||||
* the alpha channel value (0~255) along with the parameter \a arg.
|
||||
* - CT_LOGICALPIXEL\n
|
||||
* Do the given color logical operation. You should specify the color
|
||||
* logical raster operation along with the pararmeter \a arg. See \a BitBlt.
|
||||
* logical raster operation along with the pararmeter \a arg. See \a ColorLogicalOp.
|
||||
* - CT_ALPHAPIXEL\n
|
||||
* The alpha component value of the source and/or the destination pixel go
|
||||
* into effect. You can specify the color blend method along
|
||||
* with the pararmeter \a arg. See \a ColorBlendMethod. Note that a specific
|
||||
* compositor may not support this compositing type. The built-in `fallback`
|
||||
* compositor ignores the blend mode argument and only always uses the
|
||||
* Porter Duff blend mode: source over destination (COLOR_BLEND_PD_SRC_OVER).
|
||||
* compositor uses the blend mode argument when using Pixman, otherwise,
|
||||
* uses the Porter Duff blend mode: source over destination (COLOR_BLEND_PD_SRC_OVER).
|
||||
* - CT_BLURRED\n
|
||||
* 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
|
||||
|
||||
+15
-24
@@ -1,28 +1,19 @@
|
||||
if MG_MINIMALGDI
|
||||
COMMON_SUBDIRS = misc kernel sysres include
|
||||
|
||||
COMMON_LADD = \
|
||||
kernel/libkernel.la \
|
||||
sysres/libsysres.la \
|
||||
misc/libmisc.la
|
||||
else
|
||||
COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit
|
||||
|
||||
COMMON_LADD = \
|
||||
libc/liblibc.la \
|
||||
misc/libmisc.la \
|
||||
control/libcontrol.la \
|
||||
ex_ctrl/libexctrl.la \
|
||||
font/libfont.la \
|
||||
COMMON_LADD = \
|
||||
libc/liblibc.la \
|
||||
misc/libmisc.la \
|
||||
control/libcontrol.la \
|
||||
ex_ctrl/libexctrl.la \
|
||||
font/libfont.la \
|
||||
font/in-core/libincore.la \
|
||||
ial/libial.la \
|
||||
gui/libgui.la \
|
||||
main/libmain.la \
|
||||
mybmp/libmybmp.la \
|
||||
kernel/libkernel.la \
|
||||
ial/libial.la \
|
||||
gui/libgui.la \
|
||||
main/libmain.la \
|
||||
mybmp/libmybmp.la \
|
||||
kernel/libkernel.la \
|
||||
sysres/libsysres.la \
|
||||
textedit/libtextedit.la
|
||||
endif
|
||||
textedit/libtextedit.la
|
||||
|
||||
if MGRM_STANDALONE
|
||||
LITE_LADD = standalone/libstandalone.la
|
||||
@@ -45,12 +36,12 @@ SUBDIRS = $(COMMON_SUBDIRS) $(NEWGAL_SUBDIRS) $(LITE_SUBDIRS)
|
||||
|
||||
MGSOURCES = template.c template.h
|
||||
MGLIBADD = $(COMMON_LADD) \
|
||||
$(LITE_LADD) \
|
||||
$(NEWGAL_LADD)
|
||||
$(LITE_LADD) \
|
||||
$(NEWGAL_LADD)
|
||||
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
|
||||
lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la
|
||||
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD)
|
||||
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD) @DEP_LIBS@
|
||||
libminigui_@MGLIB_SUFFIX@_la_SOURCES=$(MGSOURCES)
|
||||
libminigui_@MGLIB_SUFFIX@_la_LDFLAGS=$(MGLDFLAGS)
|
||||
|
||||
|
||||
+72
-27
@@ -154,9 +154,31 @@ int GUIAPI GetSockFD2Server (void)
|
||||
|
||||
#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)
|
||||
{
|
||||
if (msg->message == MSG_UPDATECLIWIN &&
|
||||
if (msg->message == MSG_WAKEUP_CLIENT) {
|
||||
check_live (TRUE);
|
||||
}
|
||||
else if (msg->message == MSG_UPDATECLIWIN &&
|
||||
__mg_client_check_hwnd (msg->hwnd, __mg_client_id)) {
|
||||
__mg_update_window (msg->hwnd,
|
||||
LOSWORD(msg->wParam), HISWORD(msg->wParam),
|
||||
@@ -366,27 +388,6 @@ sock_error:
|
||||
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)
|
||||
{
|
||||
static DWORD old_timer;
|
||||
@@ -398,7 +399,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
|
||||
struct timeval sel_timeout;
|
||||
MSG Msg;
|
||||
|
||||
check_live ();
|
||||
check_live (FALSE);
|
||||
|
||||
/* rset gets modified each time around */
|
||||
rset = msg_queue->rfdset;
|
||||
@@ -433,14 +434,14 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
|
||||
static unsigned int old_mouse_move_serial = 0xdeadbeef;
|
||||
int flag = 0, mouse_x = -1, mouse_y = -1, buttons = -1;
|
||||
|
||||
check_live ();
|
||||
check_live (FALSE);
|
||||
if (wait && (__mg_tick_counter - old_timer) >= repeat_timeout) {
|
||||
Msg.hwnd = HWND_DESKTOP;
|
||||
Msg.message = MSG_TIMEOUT;
|
||||
Msg.wParam = (WPARAM)__mg_tick_counter;
|
||||
Msg.lParam = 0;
|
||||
Msg.time = __mg_tick_counter;
|
||||
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
|
||||
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
|
||||
// kernel_QueueMessage (msg_queue, &Msg);
|
||||
|
||||
old_timer = __mg_tick_counter;
|
||||
@@ -507,7 +508,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
|
||||
/* go through registered listen fds */
|
||||
n += __mg_kernel_check_listen_fds (msg_queue, &rset, wsetptr, esetptr);
|
||||
|
||||
check_live ();
|
||||
check_live (FALSE);
|
||||
|
||||
if (n > 0) {
|
||||
old_timer = __mg_tick_counter;
|
||||
@@ -569,12 +570,23 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
|
||||
|
||||
__mg_layer = layer_handle;
|
||||
|
||||
zi = (ZORDERINFO*) shmat (joined_info.zo_shmid, 0, SHM_RDONLY);
|
||||
zi = (ZORDERINFO*) shmat (joined_info.zi_shmid, 0, SHM_RDONLY);
|
||||
if (zi == (void*)-1) {
|
||||
return INV_LAYER_HANDLE;
|
||||
}
|
||||
|
||||
__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;
|
||||
@@ -711,6 +723,39 @@ BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid)
|
||||
|
||||
__mg_layer = layer_handle;
|
||||
__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;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,21 +63,17 @@
|
||||
#include "ctrlmisc.h"
|
||||
|
||||
#define _ID_TIMER 100
|
||||
#define _MARGIN 10
|
||||
|
||||
static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static int iBorder;
|
||||
switch (message) {
|
||||
case MSG_CREATE:
|
||||
{
|
||||
const WINDOWINFO *info;
|
||||
int timeout = (int)GetWindowAdditionalData (hWnd);
|
||||
if (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,
|
||||
(PLOGFONT)GetWindowElementAttr(hWnd, WE_FONT_TOOLTIP));
|
||||
break;
|
||||
@@ -102,7 +98,7 @@ static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
|
||||
|
||||
SetTextColor (hdc,
|
||||
GetWindowElementPixelEx(hWnd, hdc, WE_FGC_TOOLTIP));
|
||||
TabbedTextOut (hdc, iBorder, iBorder, text);
|
||||
TabbedTextOut (hdc, _MARGIN, _MARGIN, text);
|
||||
|
||||
EndPaint (hWnd, hdc);
|
||||
return 0;
|
||||
@@ -164,6 +160,7 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
|
||||
|
||||
CreateInfo.dwStyle = WS_VISIBLE;
|
||||
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.hMenu = 0;
|
||||
CreateInfo.hCursor = GetSystemCursor (IDC_ARROW);
|
||||
@@ -171,8 +168,8 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
|
||||
CreateInfo.MainWindowProc = ToolTipWinProc;
|
||||
CreateInfo.lx = x;
|
||||
CreateInfo.ty = y;
|
||||
CreateInfo.rx = CreateInfo.lx + text_size.cx;
|
||||
CreateInfo.by = CreateInfo.ty + text_size.cy;
|
||||
CreateInfo.rx = CreateInfo.lx + text_size.cx + _MARGIN * 2;
|
||||
CreateInfo.by = CreateInfo.ty + text_size.cy + _MARGIN * 2;
|
||||
CreateInfo.iBkColor =
|
||||
GetWindowElementPixelEx (hParentWnd, HDC_SCREEN, WE_BGC_TOOLTIP);
|
||||
CreateInfo.dwAddData = (DWORD) timeout_ms;
|
||||
@@ -218,7 +215,8 @@ void ResetToolTipWin (HWND hwnd, int x, int y, const char* text, ...)
|
||||
if (y + text_size.cy > g_rcScr.bottom)
|
||||
y = g_rcScr.bottom - text_size.cy;
|
||||
|
||||
MoveWindow (hwnd, x, y, text_size.cx, text_size.cy, TRUE);
|
||||
MoveWindow (hwnd, x, y,
|
||||
text_size.cx + _MARGIN * 2, text_size.cy + _MARGIN * 2, TRUE);
|
||||
ShowWindow (hwnd, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
|
||||
@@ -735,9 +735,9 @@ get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
pcache->valid_advance = 1;
|
||||
}
|
||||
}
|
||||
done:
|
||||
#endif
|
||||
|
||||
done:
|
||||
FT_UNLOCK(&ft_lock);
|
||||
|
||||
if (px) {
|
||||
|
||||
@@ -88,7 +88,6 @@ typedef int (* MakeHashKeyFunc)(Glyph32 gv);
|
||||
typedef struct tagFTFACEINFO {
|
||||
char* filepathname;
|
||||
FT_Face face;
|
||||
BOOL valid;
|
||||
#ifdef _MGFONT_TTF_CACHE
|
||||
int face_index;
|
||||
int cmap_index;
|
||||
@@ -163,13 +162,13 @@ extern void __mg_ttc_sys_deinit(void);
|
||||
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
|
||||
extern void __mg_ttc_refer(HCACHE hCache);
|
||||
|
||||
#endif /* _MGFONT_TTF_CACHE */
|
||||
|
||||
#ifdef _MGCOMPLEX_SCRIPTS
|
||||
extern void __mg_init_harzbuff_funcs(void);
|
||||
extern void __mg_term_harzbuff_funcs(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
+25
-13
@@ -75,9 +75,6 @@
|
||||
#ifdef _MG_ENABLE_LICENSE
|
||||
# include "../sysres/license/c_files/04_progressbar-bk.dat.c"
|
||||
#endif
|
||||
#ifndef __TARGET_UNKNOWN__
|
||||
unsigned int g_license_processor_id;
|
||||
#endif
|
||||
|
||||
#ifdef _MGHAVE_MENU
|
||||
/* function defined in menu module. */
|
||||
@@ -2401,8 +2398,9 @@ static void wndDrawNCFrame(MAINWIN* pWin, HDC hdc, const RECT* prcInvalid)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fGetDC)
|
||||
if (fGetDC) {
|
||||
release_effective_dc (pWin, hdc);
|
||||
}
|
||||
}
|
||||
|
||||
/* this function is CONTROL safe. */
|
||||
@@ -3039,11 +3037,6 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
|
||||
while (hosted) {
|
||||
PMAINWIN found;
|
||||
|
||||
ctxt->hosting = hosted;
|
||||
if ((found = search_win_tree_dfs (ctxt))) {
|
||||
return found;
|
||||
}
|
||||
|
||||
if (hosted->id == ctxt->id &&
|
||||
(((ctxt->flags & WIN_SEARCH_FILTER_MAIN) &&
|
||||
hosted->WinType == TYPE_MAINWIN) ||
|
||||
@@ -3052,6 +3045,11 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
|
||||
return hosted;
|
||||
}
|
||||
|
||||
ctxt->hosting = hosted;
|
||||
if ((found = search_win_tree_dfs (ctxt))) {
|
||||
return found;
|
||||
}
|
||||
|
||||
hosted = GetNextHosted (hosting, hosted);
|
||||
}
|
||||
|
||||
@@ -3074,12 +3072,13 @@ static PMAINWIN search_win_tree_bfs (struct _search_context *ctxt)
|
||||
return hosted;
|
||||
}
|
||||
|
||||
ctxt->hosting = hosted;
|
||||
if ((found = search_win_tree_bfs (ctxt))) {
|
||||
return found;
|
||||
if ((ctxt->hosting = GetNextHosted (hosting, hosted))) {
|
||||
if ((found = search_win_tree_bfs (ctxt))) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
|
||||
hosted = GetNextHosted (hosting, hosted);
|
||||
hosted = GetFirstHosted (hosted);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -7026,6 +7025,19 @@ BOOL GUIAPI SetMainWindowAlwaysTop (HWND hMainWnd, BOOL 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
|
||||
BOOL GUIAPI SetMainWindowCompositing (HWND hMainWnd, int type, DWORD arg)
|
||||
{
|
||||
|
||||
+17
-10
@@ -52,21 +52,28 @@
|
||||
#ifndef 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 */
|
||||
|
||||
typedef struct tagBLOCKHEAP {
|
||||
struct _BLOCKHEAP {
|
||||
#ifdef _MGRM_THREADS
|
||||
pthread_mutex_t lock;
|
||||
#endif
|
||||
size_t bd_size;
|
||||
size_t heap_size;
|
||||
int free;
|
||||
void* heap;
|
||||
} BLOCKHEAP;
|
||||
/* Size of one block element. */
|
||||
size_t sz_block;
|
||||
/* Size of the heap in blocks. */
|
||||
size_t sz_heap;
|
||||
/* The first free element in the heap. */
|
||||
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;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -164,7 +164,8 @@ typedef struct JoinLayerInfo {
|
||||
typedef struct JoinedClientInfo {
|
||||
GHANDLE layer;
|
||||
int cli_id;
|
||||
int zo_shmid;
|
||||
int def_zi_shmid;
|
||||
int zi_shmid;
|
||||
} JOINEDCLIENTINFO;
|
||||
|
||||
typedef struct LayerInfo {
|
||||
@@ -222,6 +223,8 @@ typedef struct _MovedClientInfo {
|
||||
#define ID_ZOOP_MASKRECT_SET 17
|
||||
#define ID_ZOOP_MASKRECT_FREE 18
|
||||
|
||||
#define ID_ZOOP_SETGESTUREFLAGS 19 /* since 5.0.6 */
|
||||
|
||||
#ifndef MAX_CAPTION_LEN
|
||||
#define MAX_CAPTION_LEN 39 //40
|
||||
#endif
|
||||
|
||||
+15
-22
@@ -71,19 +71,24 @@
|
||||
#define NR_DIRTY_RECTS 16
|
||||
|
||||
/* constants for layers and z-order nodes */
|
||||
#define MAX_NR_LAYERS 8
|
||||
#define MAX_NR_LAYERS 16
|
||||
|
||||
/* Since 5.0.0: the number of the fixed znodes - DONOT adjust */
|
||||
#define NR_FIXED_ZNODES 1
|
||||
|
||||
/* the numbers of znodes in different levels - should be mulitples of 8 */
|
||||
#define DEF_NR_POPUPMENUS 16
|
||||
#define DEF_NR_TOOLTIPS 8
|
||||
#define DEF_NR_GLOBALS 15 // reserve slots for fixed znodes
|
||||
#define DEF_NR_TOOLTIPS 16
|
||||
#define DEF_NR_GLOBALS 15 // reserve one slot for fixed znode
|
||||
#define DEF_NR_SCREENLOCKS 8
|
||||
#define DEF_NR_DOCKERS 8
|
||||
#define DEF_NR_TOPMOSTS 16
|
||||
#define DEF_NR_NORMALS 128
|
||||
#ifdef _MGRM_PROCESSES // per layer basis
|
||||
# define DEF_NR_TOPMOSTS 8
|
||||
# define DEF_NR_NORMALS 32
|
||||
#else
|
||||
# define DEF_NR_TOPMOSTS 16
|
||||
# define DEF_NR_NORMALS 128
|
||||
#endif
|
||||
#define DEF_NR_LAUNCHERS 8
|
||||
|
||||
/* Since 5.0.0: the number of the zorder levels - DONOT adjust */
|
||||
@@ -102,10 +107,10 @@ enum {
|
||||
#define ZNIDX_DESKTOP 0
|
||||
|
||||
/* The heap size for mask rectangles */
|
||||
#define DEF_NR_MASKRECT 1024
|
||||
#define DEF_NR_MASKRECTS 1024
|
||||
|
||||
#if IS_COMPOSITING_SCHEMA
|
||||
/* max number of shared surfaces */
|
||||
/* max number of shared surfaces (512) */
|
||||
# define MAX_NR_SHARED_SURF (DEF_NR_NORMALS * (MAX_NR_LAYERS >> 1))
|
||||
#endif
|
||||
|
||||
@@ -150,21 +155,9 @@ enum {
|
||||
#endif
|
||||
|
||||
/* constants for fix string module */
|
||||
#if defined (__NOUNIX__) || defined (__uClinux__)
|
||||
#define MAX_LEN_FIXSTR 64
|
||||
#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
|
||||
#define MAX_LEN_FIXSTR 64
|
||||
#define NR_HEAP 5
|
||||
#define LEN_BITMAP (1+2+4+8+16)
|
||||
|
||||
/* constants for engine name and video mode */
|
||||
#define LEN_SO_NAME 127 // name length of a shared object (library)
|
||||
|
||||
@@ -713,6 +713,8 @@ void __mg_update_secondary_dc (PMAINWIN pWin, HDC secondary_dc,
|
||||
HDC __mg_get_common_rgba8888_dc (void);
|
||||
BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch,
|
||||
void* pixels);
|
||||
/* Since 5.0.6 */
|
||||
void __mg_destroy_common_rgba8888_dc (void);
|
||||
|
||||
/* Since 5.0.0.
|
||||
helpers to update the private client DC of window and it's descendants */
|
||||
|
||||
@@ -527,7 +527,10 @@ int __mg_free_hook_wins (int cli);
|
||||
/************************* Initialization/Termination ************************/
|
||||
void __mg_init_local_sys_text (void);
|
||||
|
||||
/* the zorder information of the server */
|
||||
/* the zorder information for the default layer */
|
||||
extern ZORDERINFO* __mg_def_zorder_info;
|
||||
|
||||
/* the zorder information for the current layer */
|
||||
extern ZORDERINFO* __mg_zorder_info;
|
||||
|
||||
#ifdef _MGRM_STANDALONE
|
||||
|
||||
+9
-111
@@ -54,26 +54,12 @@
|
||||
# define MG_LOCAL /* NULL */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Common
|
||||
*/
|
||||
#if defined(_MG_ENABLE_SPLASH) || \
|
||||
defined(_MG_ENABLE_SCREENSAVER) || \
|
||||
defined(_MG_ENABLE_WATERMARK)
|
||||
|
||||
#define _MG_ENABLE_LICENSE 1
|
||||
|
||||
enum {
|
||||
SPLASH_MINIGUI,
|
||||
SPLASH_FMSOFT,
|
||||
SPLASH_FEIMAN,
|
||||
SPLASH_PROGRESSBAR,
|
||||
SPLASH_PROGRESSBAR_BK,
|
||||
#if 0
|
||||
WATERMARK_1,
|
||||
WATERMARK_2,
|
||||
WATERMARK_3,
|
||||
#endif /* _MG_ENABLE_WATERMARK */
|
||||
LICENSE_BITMAP_NR
|
||||
};
|
||||
|
||||
@@ -85,14 +71,14 @@ extern MG_LOCAL BITMAP g_license_bitmaps[];
|
||||
#define g_bitmap_progressbar g_license_bitmaps[SPLASH_PROGRESSBAR]
|
||||
#define g_bitmap_progressbar_bk g_license_bitmaps[SPLASH_PROGRESSBAR_BK]
|
||||
|
||||
#if defined(_MG_ENABLE_SPLASH) || defined(_MG_ENABLE_SCREENSAVER)
|
||||
# define _MG_ENABLE_LICENSE 1
|
||||
MG_LOCAL void __mg_license_create(void);
|
||||
MG_LOCAL void __mg_license_destroy(void);
|
||||
|
||||
#else
|
||||
# define __mg_license_create() /* NULL */
|
||||
# define __mg_license_destroy() /* NULL */
|
||||
#endif /* endif _MG_ENABLE_SPLASH or _MG_ENABLE_SCREENSAVER or _MG_ENABLE_WATERMARK*/
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _MG_ENABLE_SCREENSAVER
|
||||
MG_LOCAL void __mg_screensaver_create(void);
|
||||
@@ -102,9 +88,6 @@ MG_LOCAL void __mg_screensaver_destroy(void);
|
||||
# define __mg_screensaver_destroy() /* NULL */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Splash
|
||||
*/
|
||||
#ifdef _MG_ENABLE_SPLASH
|
||||
MG_LOCAL void __mg_splash_draw_framework(void);
|
||||
MG_LOCAL void __mg_splash_progress(void);
|
||||
@@ -115,96 +98,11 @@ MG_LOCAL void __mg_splash_delay(void);
|
||||
# define __mg_splash_delay() /* NULL */
|
||||
#endif /* endif _MG_ENABLE_SPLASH */
|
||||
|
||||
/*
|
||||
* ScreenSaver & Watermark
|
||||
*/
|
||||
#if defined(_MG_ENABLE_SCREENSAVER) || defined(_MG_ENABLE_WATERMARK)
|
||||
MG_LOCAL void __mg_license_on_input(void);
|
||||
MG_LOCAL void __mg_license_on_timeout(void);
|
||||
#else
|
||||
# define __mg_license_on_input() /* NULL */
|
||||
# define __mg_license_on_timeout() /* NULL */
|
||||
#endif /* _MG_ENABLE_SCREENSAVER || _MG_ENABLE_WATERMARK */
|
||||
|
||||
/*
|
||||
* Product ID
|
||||
*/
|
||||
#ifdef _MG_PRODUCTID
|
||||
typedef struct _product_id {
|
||||
/* Fixed 8-byte code, help us to locate the struct in .so file */
|
||||
unsigned char prefix[8];
|
||||
/* the ID of the customer */
|
||||
int customer_id;
|
||||
/* svn version */
|
||||
int version;
|
||||
/* When does we compile the .so, in seconds */
|
||||
int compile_date;
|
||||
/* The size of the .so file */
|
||||
int file_size;
|
||||
/* The check sum of the .so file */
|
||||
unsigned char checksum[16];
|
||||
} product_id_t;
|
||||
|
||||
#define PRODUCT_ID_PREFIX 0xca, 0x3f, 0x2b, 0x43, 0x00, 0x33, 0xb0, 0xc3
|
||||
|
||||
MG_LOCAL int license_get_customer_id(void);
|
||||
|
||||
#endif /* _MG_PRODUCTID */
|
||||
|
||||
/*
|
||||
* Tools to encrypt const variables
|
||||
*/
|
||||
MG_LOCAL unsigned int LICENSE_ENCRYPTED_CONST_INT(unsigned int);
|
||||
MG_LOCAL char *LICENSE_ENCRYPTED_CONST_STRING(unsigned char *, int);
|
||||
|
||||
/*
|
||||
* Processor ID
|
||||
*/
|
||||
#ifdef _MG_PRODUCTID
|
||||
# define LICENSE_CHECK_CUSTIMER_ID() \
|
||||
do { \
|
||||
if (! license_get_customer_id()) { \
|
||||
return ERR_INVALID_ARGS; \
|
||||
} \
|
||||
} while(0)
|
||||
#else
|
||||
# define LICENSE_CHECK_CUSTIMER_ID() /* NULL */
|
||||
#endif
|
||||
|
||||
#ifdef __TARGET_UNKNOWN__
|
||||
|
||||
# define license_get_processor_id() /* NULL */
|
||||
# define LICENSE_SET_MESSAGE_OFFSET() /* NULL */
|
||||
# define LICENSE_MODIFY_MESSAGE(x) /* NULL */
|
||||
|
||||
#else /* not __TARGET_UNKNOWN__ */
|
||||
|
||||
extern MG_LOCAL unsigned int g_license_processor_id; /* window.c */
|
||||
MG_LOCAL void license_get_processor_id (void);
|
||||
#define LICENSE_PROCESSOR_ID_NONE (0xFC1D8B2A)
|
||||
|
||||
extern MG_LOCAL unsigned int g_license_message_offset; /* zorder.c */
|
||||
|
||||
#if defined (_WITH_TARGET_S3C6410)
|
||||
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x1AE2FDFD /* 0x36410101 */)
|
||||
#elif defined (_WITH_TARGET_S3C2440)
|
||||
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x3AA4FDFD /* 0x32440101 */)
|
||||
#elif defined (_WITH_TARGET_S3C2410)
|
||||
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x3AE2FDFD /* 0x32410101 */)
|
||||
#elif defined (_WITH_TARGET_HI3560A)
|
||||
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0xFC38C9AD /* 0x35600200 */)
|
||||
#else
|
||||
# define REAL_PROCESSOR_ID LICENSE_PROCESSOR_ID_NONE
|
||||
#endif
|
||||
|
||||
#define LICENSE_SET_MESSAGE_OFFSET() do {g_license_message_offset=g_license_processor_id-(REAL_PROCESSOR_ID);}while (0)
|
||||
|
||||
#define LICENSE_MODIFY_MESSAGE(pMsg) \
|
||||
do { \
|
||||
pMsg->message += g_license_message_offset; \
|
||||
pMsg->hwnd -= g_license_message_offset / 2; \
|
||||
} while (0)
|
||||
|
||||
#endif /* __TARGET_UNKNOWN__ */
|
||||
#define __mg_license_on_input() /* NULL */
|
||||
#define __mg_license_on_timeout() /* NULL */
|
||||
#define LICENSE_CHECK_CUSTIMER_ID() /* NULL */
|
||||
#define license_get_processor_id() /* NULL */
|
||||
#define LICENSE_SET_MESSAGE_OFFSET() /* NULL */
|
||||
#define LICENSE_MODIFY_MESSAGE(x) /* NULL */
|
||||
|
||||
#endif /* LICENSE_H */
|
||||
|
||||
+34
-11
@@ -120,37 +120,60 @@ int __mg_alloc_sem_for_shared_surf (void);
|
||||
int __mg_free_sem_for_shared_surf (int sem_num);
|
||||
#endif /* _MGSCHEMA_COMPOSITING */
|
||||
|
||||
int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set);
|
||||
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set);
|
||||
|
||||
static inline
|
||||
void __mg_slot_set_use (unsigned char* bitmap, int index) {
|
||||
void __mg_slot_set_use (unsigned char* bitmap, size_t index) {
|
||||
bitmap += index >> 3;
|
||||
*bitmap &= (~(0x80 >> (index % 8)));
|
||||
}
|
||||
|
||||
static inline
|
||||
int __mg_slot_clear_use (unsigned char* bitmap, int index) {
|
||||
int __mg_slot_clear_use (unsigned char* bitmap, size_t 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;
|
||||
if (*bitmap & (0x80 >> (index % 8)))
|
||||
return 0;
|
||||
|
||||
*bitmap |= (0x80 >> (index % 8));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* get the number of idle mask rectangles */
|
||||
static inline
|
||||
int __mg_get_nr_idle_slots (unsigned char* bitmap, int len_bmp)
|
||||
size_t __mg_get_nr_idle_slots (unsigned char* bitmap, size_t len_bmp)
|
||||
{
|
||||
int idle = 0;
|
||||
int i, j;
|
||||
size_t idle = 0;
|
||||
size_t i, j;
|
||||
|
||||
for (i = 0; i < len_bmp; i++) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
if (*bitmap & (0x80 >> j))
|
||||
idle++;
|
||||
if (*bitmap) {
|
||||
if (*bitmap == 0xFF) {
|
||||
idle += 8;
|
||||
}
|
||||
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++;
|
||||
}
|
||||
|
||||
return idle;
|
||||
}
|
||||
|
||||
|
||||
+114
-30
@@ -57,6 +57,7 @@
|
||||
|
||||
#include "gdi.h"
|
||||
#include "constants.h"
|
||||
#include "blockheap.h"
|
||||
|
||||
#if IS_COMPOSITING_SCHEMA
|
||||
#include <sys/types.h>
|
||||
@@ -69,6 +70,7 @@
|
||||
#endif
|
||||
|
||||
#define DISABLE_THREADS
|
||||
|
||||
#define GAL_mutex int
|
||||
|
||||
#define GAL_bool BOOL
|
||||
@@ -171,6 +173,10 @@ typedef struct _ShadowSurfaceHeader {
|
||||
RECT dirty_rc;
|
||||
} GAL_ShadowSurfaceHeader;
|
||||
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
typedef union pixman_image pixman_image_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This structure should be treated as read-only, except for 'pixels',
|
||||
* which, if not NULL, contains the raw pixel data for the surface.
|
||||
@@ -206,7 +212,15 @@ typedef struct GAL_Surface {
|
||||
unsigned int format_version; /* Private */
|
||||
|
||||
/* reference count -- used when freeing surface */
|
||||
int refcount; /* Read-mostly */
|
||||
unsigned int refcount; /* Read-mostly */
|
||||
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
pixman_image_t *pix_img; /* The pixman image object for this surface */
|
||||
pixman_image_t *msk_img;
|
||||
uint16_t pix_op;
|
||||
uint16_t pix_filter;
|
||||
uint32_t pix_alpha_bits;
|
||||
#endif
|
||||
|
||||
#if IS_COMPOSITING_SCHEMA
|
||||
/* The pointer to GAL_SharedSurfaceHeader if the surface
|
||||
@@ -219,22 +233,42 @@ typedef struct GAL_Surface {
|
||||
|
||||
/* These are the currently supported flags for the GAL_surface */
|
||||
/* Available for GAL_CreateRGBSurface() or GAL_SetVideoMode() */
|
||||
#define GAL_SWSURFACE MEMDC_FLAG_SWSURFACE /* Surface is in system memory */
|
||||
#define GAL_HWSURFACE MEMDC_FLAG_HWSURFACE /* Surface is in video memory */
|
||||
#define GAL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
|
||||
/* Available for GAL_SetVideoMode() */
|
||||
#define GAL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
|
||||
#define GAL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
|
||||
#define GAL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
|
||||
#define GAL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
|
||||
|
||||
#define GAL_SWSURFACE 0x00000000 /* Surface is in system memory */
|
||||
#define GAL_HWSURFACE 0x00000001 /* Surface is in video memory */
|
||||
#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_SRCCOLORKEY MEMDC_FLAG_SRCCOLORKEY /* Blit uses a source color key */
|
||||
#define GAL_RLEACCELOK 0x00002000 /* Private flag */
|
||||
#define GAL_RLEACCEL MEMDC_FLAG_RLEACCEL /* Surface is RLE encoded */
|
||||
#define GAL_SRCALPHA MEMDC_FLAG_SRCALPHA /* Blit uses source alpha blending */
|
||||
#define GAL_SRCPIXELALPHA MEMDC_FLAG_SRCPIXELALPHA /* Blit uses source per-pixel alpha blending */
|
||||
#define GAL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
|
||||
#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() */
|
||||
#define GAL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
|
||||
#define GAL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
|
||||
#define GAL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
|
||||
#define GAL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
|
||||
|
||||
/* Make sure the macros are ok */
|
||||
#define MGUI_COMPILE_TIME_ASSERT(name, x) \
|
||||
typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1]
|
||||
|
||||
MGUI_COMPILE_TIME_ASSERT(swsurface, GAL_SWSURFACE == MEMDC_FLAG_SWSURFACE);
|
||||
MGUI_COMPILE_TIME_ASSERT(hwsurface, GAL_HWSURFACE == MEMDC_FLAG_HWSURFACE);
|
||||
MGUI_COMPILE_TIME_ASSERT(colorkey, GAL_SRCCOLORKEY == MEMDC_FLAG_SRCCOLORKEY);
|
||||
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 */
|
||||
#define GAL_MUSTLOCK(surface) \
|
||||
@@ -407,7 +441,7 @@ void GAL_UpdateRect
|
||||
(GAL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
|
||||
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
BLOCKHEAP __mg_free_update_region_list;
|
||||
extern BLOCKHEAP __mg_free_update_region_list;
|
||||
#endif
|
||||
|
||||
BOOL GAL_SyncUpdate (GAL_Surface *screen);
|
||||
@@ -600,6 +634,7 @@ GAL_Surface *GAL_CreateSharedRGBSurface (GAL_VideoDevice* video,
|
||||
#define ST_PIXEL_ARGB4444 0x0001
|
||||
#define ST_PIXEL_ARGB1555 0x0002
|
||||
#define ST_PIXEL_ARGB8888 0x0003
|
||||
#define ST_PIXEL_XRGB565 0x0004
|
||||
#endif /* not define ST_PIXEL_MASK */
|
||||
|
||||
/* Allocate a shared RGB surface from the current video device. */
|
||||
@@ -773,6 +808,51 @@ void GAL_GetClipRect (GAL_Surface *surface, GAL_Rect *rect);
|
||||
GAL_Surface *GAL_ConvertSurface
|
||||
(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;
|
||||
}
|
||||
|
||||
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
|
||||
* surface. It assumes that the source and destination rectangles are
|
||||
@@ -839,21 +919,26 @@ GAL_Surface *GAL_ConvertSurface
|
||||
* fullscreen application. The lock will also fail until you have access
|
||||
* 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
|
||||
rectangle validation and clipping before passing it to GAL_LowerBlit()
|
||||
*/
|
||||
int GAL_UpperBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
GAL_Surface *dst, GAL_Rect *dstrect);
|
||||
GAL_Surface *dst, GAL_Rect *dstrect, DWORD op);
|
||||
|
||||
/* This is a semi-private blit function and it performs low-level surface
|
||||
blitting only.
|
||||
*/
|
||||
int GAL_LowerBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
GAL_Surface *dst, GAL_Rect *dstrect);
|
||||
GAL_Surface *dst, GAL_Rect *dstrect, DWORD op);
|
||||
|
||||
/* 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'
|
||||
@@ -864,14 +949,12 @@ int GAL_LowerBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
* can be generated by the GAL_MapRGB() function.
|
||||
* 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.
|
||||
*/
|
||||
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.
|
||||
@@ -919,8 +1002,9 @@ GAL_Surface * GAL_DisplayFormat (GAL_Surface *surface);
|
||||
*/
|
||||
GAL_Surface * GAL_DisplayFormatAlpha (GAL_Surface *surface);
|
||||
|
||||
int GAL_SoftStretch (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
GAL_Surface *dst, GAL_Rect *dstrect);
|
||||
int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
GAL_Surface *dst, GAL_Rect *dstrect,
|
||||
const STRETCH_EXTRA_INFO *sei, DWORD ops);
|
||||
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
extern GAL_Surface* __gal_screen;
|
||||
|
||||
@@ -154,7 +154,12 @@ 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_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
int __mg_do_change_topmost_layer (void);
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
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);
|
||||
|
||||
|
||||
+22
-17
@@ -87,7 +87,7 @@ typedef struct _ZORDERNODE {
|
||||
int nr_dirty_rcs; /* the number of dirty rects */
|
||||
const RECT* dirty_rcs; /* the pointer to the dirty rectangles */
|
||||
#else /* defined _MGSCHEMA_COMPOSITING */
|
||||
unsigned int age; /* znode age */
|
||||
DWORD age; /* znode age */
|
||||
RECT dirty_rc; /* dirty rectangle */
|
||||
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||
|
||||
@@ -133,6 +133,8 @@ typedef struct _ZORDERINFO {
|
||||
int first_launcher;
|
||||
|
||||
int active_win;
|
||||
int old_active;
|
||||
int next_active;
|
||||
|
||||
int cli_trackmenu;
|
||||
|
||||
@@ -156,12 +158,13 @@ typedef struct _ZORDERINFO {
|
||||
typedef ZORDERINFO* PZORDERINFO;
|
||||
|
||||
#define MAX_NR_SPECIAL_ZNODES(zi) \
|
||||
(zi->max_nr_tooltips + zi->max_nr_globals + \
|
||||
(zi->max_nr_globals + \
|
||||
zi->max_nr_screenlocks + zi->max_nr_dockers + \
|
||||
zi->max_nr_launchers + NR_FIXED_ZNODES)
|
||||
|
||||
#define MAX_NR_GENERAL_ZNODES(zi) \
|
||||
(zi->max_nr_topmosts + zi->max_nr_normals)
|
||||
(zi->max_nr_tooltips + zi->max_nr_topmosts + \
|
||||
zi->max_nr_normals)
|
||||
|
||||
#define MAX_NR_ZNODES(zi) \
|
||||
MAX_NR_SPECIAL_ZNODES(zi) + MAX_NR_GENERAL_ZNODES(zi)
|
||||
@@ -178,7 +181,7 @@ typedef ZORDERINFO* PZORDERINFO;
|
||||
(ZORDERNODE*)((char*)((zi)+1)+ (zi)->size_usage_bmp)
|
||||
|
||||
#define GET_MASKRECT_USAGEBMP(zi) \
|
||||
((char *)((zi) + 1) + (zi)->size_usage_bmp + \
|
||||
((unsigned char *)((zi) + 1) + (zi)->size_usage_bmp + \
|
||||
sizeof (ZORDERNODE) * (MAX_NR_ZNODES_WITH_PPP(zi)))
|
||||
|
||||
#define GET_MASKRECT(zi) \
|
||||
@@ -187,25 +190,25 @@ typedef ZORDERINFO* PZORDERINFO;
|
||||
|
||||
/* round to multiple of 8 to aoivd alignment issue */
|
||||
#define SIZE_MASKRECT_USAGE_BMP \
|
||||
ROUND_TO_MULTIPLE((DEF_NR_MASKRECT >> 3), 8)
|
||||
ROUND_TO_MULTIPLE((DEF_NR_MASKRECTS >> 3), 8)
|
||||
|
||||
#define NR_SPECIAL_ZNODES(zi) \
|
||||
(zi->nr_tooltips + zi->nr_globals + \
|
||||
(zi->nr_globals + \
|
||||
zi->nr_screenlocks + zi->nr_dockers + \
|
||||
zi->nr_launchers + NR_FIXED_ZNODES)
|
||||
|
||||
#define NR_GENERAL_ZNODES(zi) \
|
||||
(zi->nr_topmosts + zi->nr_normals)
|
||||
(zi->nr_tooltips + zi->nr_topmosts + zi->nr_normals)
|
||||
|
||||
#define NR_ZNODES(zi) \
|
||||
NR_SPECIAL_ZNODES(zi) + NR_GENERAL_ZNODES(zi)
|
||||
|
||||
/* Since 5.0.0: more levels */
|
||||
#define SIZE_USAGE_BMP_GENERAL(max_nr_t, max_nr_n) \
|
||||
((7 + (max_nr_t) + (max_nr_n)) >> 3)
|
||||
((7 + DEF_NR_TOOLTIPS + (max_nr_t) + (max_nr_n)) >> 3)
|
||||
|
||||
#define SIZE_USAGE_BMP_SPECIAL(max_nr_g) \
|
||||
((7 + DEF_NR_TOOLTIPS + max_nr_g + \
|
||||
((7 + max_nr_g + \
|
||||
DEF_NR_SCREENLOCKS + DEF_NR_DOCKERS + \
|
||||
DEF_NR_LAUNCHERS + NR_FIXED_ZNODES) >> 3)
|
||||
|
||||
@@ -234,15 +237,15 @@ typedef ZORDERINFO* PZORDERINFO;
|
||||
MG_UNLIKELY ((idx) > MAX_NR_ZNODES(zi))
|
||||
|
||||
#define IS_TYPE_GENERAL(type) \
|
||||
(type == ZOF_TYPE_HIGHER || \
|
||||
type == ZOF_TYPE_NORMAL)
|
||||
((type) == ZOF_TYPE_TOOLTIP || \
|
||||
(type) == ZOF_TYPE_HIGHER || \
|
||||
(type) == ZOF_TYPE_NORMAL)
|
||||
|
||||
#define IS_TYPE_SPECIAL(type) \
|
||||
(type == ZOF_TYPE_TOOLTIP || \
|
||||
type == ZOF_TYPE_GLOBAL || \
|
||||
type == ZOF_TYPE_SCREENLOCK || \
|
||||
type == ZOF_TYPE_DOCKER || \
|
||||
type == ZOF_TYPE_LAUNCHER)
|
||||
((type) == ZOF_TYPE_GLOBAL || \
|
||||
(type) == ZOF_TYPE_SCREENLOCK || \
|
||||
(type) == ZOF_TYPE_DOCKER || \
|
||||
(type) == ZOF_TYPE_LAUNCHER)
|
||||
|
||||
#define ZOF_TYPE_TO_LEVEL_IDX(type) ((int)(8 - ((type) >> 28)))
|
||||
|
||||
@@ -250,12 +253,14 @@ typedef ZORDERINFO* PZORDERINFO;
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals);
|
||||
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_maskrc_heap);
|
||||
void __kernel_free_z_order_info (ZORDERINFO* zi);
|
||||
int __kernel_get_window_region (HWND pWin, CLIPRGN* region);
|
||||
int __kernel_get_next_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
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -3,17 +3,12 @@ AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
||||
|
||||
noinst_LTLIBRARIES = libkernel.la
|
||||
|
||||
if MG_MINIMALGDI
|
||||
libkernel_la_SOURCES = init-lite.c fixstr.c \
|
||||
blockheap.c
|
||||
else
|
||||
libkernel_la_SOURCES = timer.c init.c init-lite.c \
|
||||
desktop-ths.c desktop-sa.c desktop-procs.c \
|
||||
cursor.c cursor-procs.c cursor-sa.c \
|
||||
sharedres.c message.c event.c listenfd.c \
|
||||
blockheap.c fixstr.c slotset.c zorder.c sem-manager.c \
|
||||
compsor-manager.c compsor-fallback.c
|
||||
endif
|
||||
|
||||
EXTRA_DIST= desktop.c desktop-comm.c cursor-comm.c makefile.ng makefile.msvc
|
||||
|
||||
|
||||
+85
-62
@@ -59,103 +59,91 @@
|
||||
#include "common.h"
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
#include "constants.h"
|
||||
#include "blockheap.h"
|
||||
#include "misc.h"
|
||||
|
||||
void InitBlockDataHeap (PBLOCKHEAP heap, size_t bd_size, size_t heap_size)
|
||||
BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap)
|
||||
{
|
||||
#ifdef _MGRM_THREADS
|
||||
pthread_mutex_init (&heap->lock, NULL);
|
||||
#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->bd_size = bd_size + sizeof (DWORD);
|
||||
heap->heap_size = heap_size;
|
||||
heap->usage_bmp = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void* BlockDataAlloc (PBLOCKHEAP heap)
|
||||
{
|
||||
int i;
|
||||
char* block_data = NULL;
|
||||
int free_slot;
|
||||
unsigned char* block_data = NULL;
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
pthread_mutex_lock (&heap->lock);
|
||||
#endif
|
||||
|
||||
if (heap->heap == NULL) {
|
||||
if (!(heap->heap = calloc (heap->heap_size, heap->bd_size)))
|
||||
goto ret;
|
||||
heap->free = 0;
|
||||
free_slot = __mg_lookfor_unused_slot (heap->usage_bmp, heap->sz_usage_bmp, 1);
|
||||
if (free_slot >= 0) {
|
||||
block_data = heap->heap + heap->sz_block * free_slot;
|
||||
_DBG_PRINTF ("Allocated one block in the block heap: %p (%d)\n",
|
||||
heap, free_slot);
|
||||
goto ret;
|
||||
}
|
||||
|
||||
block_data = (char*) heap->heap + heap->bd_size*heap->free;
|
||||
for (i = heap->free; i < heap->heap_size; i++) {
|
||||
|
||||
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)))
|
||||
if ((block_data = calloc (1, heap->sz_block)) == NULL)
|
||||
goto ret;
|
||||
#else
|
||||
if (!(block_data = mg_slice_alloc0 (heap->bd_size)))
|
||||
goto ret;
|
||||
#endif
|
||||
|
||||
*((DWORD*)block_data) = BDS_SPECIAL;
|
||||
heap->nr_alloc++;
|
||||
|
||||
ret:
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
pthread_mutex_unlock (&heap->lock);
|
||||
#endif
|
||||
|
||||
if (block_data)
|
||||
return block_data + sizeof (DWORD);
|
||||
return NULL;
|
||||
return block_data;
|
||||
}
|
||||
|
||||
void BlockDataFree (PBLOCKHEAP heap, void* data)
|
||||
{
|
||||
int i;
|
||||
char* block_data;
|
||||
unsigned char* block_data = data;
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
pthread_mutex_lock (&heap->lock);
|
||||
#endif
|
||||
|
||||
block_data = (char*) data - sizeof (DWORD);
|
||||
if (*((DWORD*)block_data) == BDS_SPECIAL) {
|
||||
#if 0
|
||||
if (block_data < heap->heap ||
|
||||
block_data > (heap->heap + heap->sz_block * heap->sz_heap)) {
|
||||
free (block_data);
|
||||
#else
|
||||
mg_slice_free (heap->bd_size, block_data);
|
||||
#endif
|
||||
heap->nr_alloc--;
|
||||
}
|
||||
else if (*((DWORD*)block_data) == BDS_USED) {
|
||||
*((DWORD*)block_data) = BDS_FREE;
|
||||
else {
|
||||
int slot;
|
||||
slot = (block_data - heap->heap) / heap->sz_block;
|
||||
__mg_slot_clear_use (heap->usage_bmp, slot);
|
||||
|
||||
i = (block_data - (char*)heap->heap)/heap->bd_size;
|
||||
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
|
||||
_DBG_PRINTF ("Freed one block in the block heap: %p (%d)\n",
|
||||
heap, slot);
|
||||
}
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
@@ -165,13 +153,48 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
|
||||
|
||||
void DestroyBlockDataHeap (PBLOCKHEAP heap)
|
||||
{
|
||||
#if 0
|
||||
fprintf (stderr, "Heap: (bd_size: %d, heap_size: %d, heap: %p).\n",
|
||||
heap->bd_size, heap->heap_size, heap->heap);
|
||||
int nr_free_slots;
|
||||
|
||||
if (heap->nr_alloc > 0) {
|
||||
_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
|
||||
}
|
||||
|
||||
free (heap->heap);
|
||||
heap->heap = NULL;
|
||||
|
||||
free (heap->usage_bmp);
|
||||
heap->usage_bmp = NULL;
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
pthread_mutex_destroy (&heap->lock);
|
||||
#endif
|
||||
free (heap->heap);
|
||||
}
|
||||
|
||||
|
||||
+1207
-733
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
||||
* 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) 2002~2021, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -489,7 +489,7 @@ const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
|
||||
if (strcmp (compositors [i].name, name) == 0) {
|
||||
if (compositors [i].name && strcmp (compositors [i].name, name) == 0) {
|
||||
return compositors [i].ops;
|
||||
}
|
||||
}
|
||||
@@ -583,5 +583,24 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
|
||||
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) */
|
||||
|
||||
|
||||
+20
-10
@@ -104,7 +104,7 @@ static PMAINWIN dskSetActiveWindow (PMAINWIN pWin)
|
||||
if (pWin == pOldActive)
|
||||
return pOldActive;
|
||||
|
||||
pOldActive = (PMAINWIN) dskSetActiveZOrderNode (0, pWin?pWin->idx_znode:0);
|
||||
pOldActive = (PMAINWIN) dskSetActiveZOrderNode (__mg_zorder_info, 0, pWin?pWin->idx_znode:0);
|
||||
|
||||
#ifndef _MGRM_PROCESSES /*for MiniGUI-Threads, not for MiniGUI-StandAlone*/
|
||||
if (pOldActive != (PMAINWIN)HWND_INVALID && __mg_ime_wnd)
|
||||
@@ -368,6 +368,15 @@ static BOOL dskSetMainWindowAlwaysTop (PMAINWIN pWin, BOOL fSet)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Since 5.0.6 */
|
||||
static inline int dskSetMainWindowGestureFlags (PMAINWIN pWin, DWORD dwFlags)
|
||||
{
|
||||
if (dskSetZNodeGestureFlags (0, pWin->idx_znode, dwFlags))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Since 5.0.0 */
|
||||
static int dskSetWindowMask (HWND pWin, const WINMASKINFO* mask_info)
|
||||
{
|
||||
@@ -667,7 +676,7 @@ static LRESULT KeyMessageHandler (UINT message, int scancode, DWORD status)
|
||||
|
||||
if (next_node) {
|
||||
dskMove2Top (0, next_node);
|
||||
dskSetActiveZOrderNode (0, next_node);
|
||||
dskSetActiveZOrderNode (__mg_zorder_info, 0, next_node);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1424,7 +1433,11 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
|
||||
|
||||
/* Since 5.0.0 */
|
||||
case MSG_SETALWAYSTOP:
|
||||
return dskSetMainWindowAlwaysTop(pWin, (BOOL)lParam);
|
||||
return dskSetMainWindowAlwaysTop (pWin, (BOOL)lParam);
|
||||
|
||||
/* Since 5.0.6 */
|
||||
case MSG_SETGESTUREFLAGS:
|
||||
return dskSetMainWindowGestureFlags (pWin, (DWORD)lParam);
|
||||
|
||||
/* Since 5.0.0 */
|
||||
case MSG_SETWINDOWMASK:
|
||||
@@ -1855,7 +1868,7 @@ void GUIAPI DesktopUpdateAllWindow(void)
|
||||
SendMessage(HWND_DESKTOP, MSG_PAINT, 0, 0);
|
||||
}
|
||||
|
||||
static void dskOnTimer (void)
|
||||
static void dskOnTimeout (void)
|
||||
{
|
||||
static DWORD uCounter = 0;
|
||||
static DWORD blink_counter = 0;
|
||||
@@ -2137,7 +2150,10 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
|
||||
break;
|
||||
#endif
|
||||
|
||||
/* Since 5.0.6, the desktop handles caret blinking in MSG_TIMEOUT
|
||||
message, and the interval for this message changes to about 0.05s. */
|
||||
case MSG_TIMEOUT:
|
||||
dskOnTimeout ();
|
||||
// Since 5.0.0: MSG_IDLE messages will be generated by PeekMessage.
|
||||
// BroadcastMessageInThisThread (MSG_IDLE, wParam, 0);
|
||||
break;
|
||||
@@ -2171,12 +2187,6 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
|
||||
dsk_ops->mouse_handler(dt_context, message, wParam, lParam);
|
||||
break;
|
||||
|
||||
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
|
||||
message, and the interval for this MSG_TIMER changes to about 0.05s. */
|
||||
case MSG_TIMER:
|
||||
dskOnTimer ();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+461
-172
File diff suppressed because it is too large
Load Diff
@@ -113,7 +113,8 @@ BOOL mg_InitDesktop (void)
|
||||
/*
|
||||
* Init ZOrderInfo here.
|
||||
*/
|
||||
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
|
||||
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS,
|
||||
TRUE);
|
||||
if (ret < 0) {
|
||||
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
|
||||
return FALSE;
|
||||
|
||||
@@ -112,7 +112,8 @@ BOOL mg_InitDesktop (void)
|
||||
/*
|
||||
* Init ZOrderInfo here.
|
||||
*/
|
||||
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
|
||||
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS,
|
||||
TRUE);
|
||||
if (ret < 0) {
|
||||
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
|
||||
return FALSE;
|
||||
|
||||
+452
-225
File diff suppressed because it is too large
Load Diff
@@ -611,6 +611,10 @@ void TerminateGUI (int rcByGUI)
|
||||
if (_is_server) {
|
||||
mg_TerminateDesktop ();
|
||||
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
mg_TerminateCompositor ();
|
||||
#endif
|
||||
|
||||
/* Cleanup UNIX domain socket and other IPC objects. */
|
||||
server_ServerCleanup ();
|
||||
}
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ static void ParseEvent (PLWEVENT lwe)
|
||||
Msg.message = MSG_TIMEOUT;
|
||||
Msg.wParam = (WPARAM)lwe->count;
|
||||
Msg.lParam = 0;
|
||||
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
|
||||
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
|
||||
// QueueDeskMessage (&Msg);
|
||||
}
|
||||
else if (lwe->type == LWETYPE_KEY) {
|
||||
|
||||
@@ -860,7 +860,7 @@ checkagain:
|
||||
/* handle desktop timer here */
|
||||
if (pMsgQueue == __mg_dsk_msg_queue && pMsgQueue->dwState & QS_DESKTIMER) {
|
||||
pMsg->hwnd = HWND_DESKTOP;
|
||||
pMsg->message = MSG_TIMER;
|
||||
pMsg->message = MSG_TIMEOUT;
|
||||
pMsg->wParam = 0;
|
||||
pMsg->lParam = 0;
|
||||
|
||||
|
||||
+31
-8
@@ -51,17 +51,40 @@
|
||||
** Create date: 2005/08/16
|
||||
*/
|
||||
|
||||
int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set)
|
||||
#include <stdlib.h>
|
||||
|
||||
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set)
|
||||
{
|
||||
int unused = 0;
|
||||
int i, j;
|
||||
size_t unused = 0;
|
||||
size_t i, j;
|
||||
|
||||
for (i = 0; i < len_bmp; i++) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
if (*bitmap & (0x80 >> j)) {
|
||||
if (set)
|
||||
*bitmap &= (~(0x80 >> j));
|
||||
return unused + j;
|
||||
if (*bitmap) {
|
||||
unsigned char half_byte = *bitmap & 0xF0;
|
||||
unsigned char test_byte = 0x80;
|
||||
|
||||
if (half_byte) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (half_byte & test_byte) {
|
||||
if (set)
|
||||
*bitmap ^= test_byte;
|
||||
return unused + j;
|
||||
}
|
||||
|
||||
test_byte = test_byte >> 1;
|
||||
}
|
||||
}
|
||||
|
||||
half_byte = *bitmap & 0x0F;
|
||||
test_byte = 0x08;
|
||||
for (j = 4; j < 8; j++) {
|
||||
if (half_byte & test_byte) {
|
||||
if (set)
|
||||
*bitmap ^= test_byte;
|
||||
return unused + j;
|
||||
}
|
||||
|
||||
test_byte = test_byte >> 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -94,7 +94,7 @@ void __mg_update_tick_count (void *data)
|
||||
__mg_tick_counter = __mg_os_get_time_ticks ();
|
||||
#endif /* not defined _MGRM_PROCESSES */
|
||||
|
||||
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
|
||||
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
|
||||
message, and the interval for the timer of desktop changes to 0.05s. */
|
||||
if (__mg_tick_counter >
|
||||
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
|
||||
@@ -129,7 +129,7 @@ void __mg_update_tick_count (void *data)
|
||||
__mg_tick_counter += elapsed_ticks;
|
||||
#endif /* not defined _MGRM_PROCESSES */
|
||||
|
||||
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
|
||||
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
|
||||
message, and the interval for the timer of desktop changes to 0.05s. */
|
||||
if (__mg_tick_counter >
|
||||
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
|
||||
|
||||
+7
-135
@@ -67,9 +67,6 @@
|
||||
#ifdef _MG_ENABLE_LICENSE
|
||||
# include "../sysres/license/c_files/03_progressbar.dat.c"
|
||||
#endif
|
||||
#ifndef __TARGET_UNKNOWN__
|
||||
unsigned int g_license_message_offset;
|
||||
#endif
|
||||
|
||||
#ifdef _MGRM_PROCESSES
|
||||
# include "ourhdr.h"
|
||||
@@ -100,7 +97,7 @@ inline static key_t get_layer_shm_key (void)
|
||||
}
|
||||
#endif /* defined _MGRM_PROCESSES */
|
||||
|
||||
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
||||
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_maskrc_heap)
|
||||
{
|
||||
#ifdef _MGRM_PROCESSES
|
||||
int size_usage_bmp = SIZE_USAGE_BMP (SHAREDRES_NR_GLOBALS,
|
||||
@@ -125,8 +122,8 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
||||
nr_normals + /* for the normal windows */
|
||||
DEF_NR_LAUNCHERS + /* for the launcher ones */
|
||||
NR_FIXED_ZNODES) + /* for the fixed znodes */
|
||||
SIZE_MASKRECT_USAGE_BMP +
|
||||
sizeof (MASKRECT) * DEF_NR_MASKRECT,
|
||||
with_maskrc_heap ? (SIZE_MASKRECT_USAGE_BMP +
|
||||
sizeof (MASKRECT) * DEF_NR_MASKRECTS) : 0,
|
||||
SHM_PARAM | IPC_CREAT | IPC_EXCL);
|
||||
|
||||
return zorder_shmid;
|
||||
@@ -150,7 +147,7 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
||||
DEF_NR_LAUNCHERS + /* for the launcher ones */
|
||||
NR_FIXED_ZNODES) + /* for the fixed znodes */
|
||||
SIZE_MASKRECT_USAGE_BMP +
|
||||
sizeof (MASKRECT) * DEF_NR_MASKRECT);
|
||||
sizeof (MASKRECT) * DEF_NR_MASKRECTS);
|
||||
|
||||
if (!__mg_zorder_info) {
|
||||
_MG_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
|
||||
@@ -214,6 +211,8 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
||||
__mg_slot_set_use ((unsigned char*)(__mg_zorder_info + 1), 0);
|
||||
__mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0);
|
||||
|
||||
__mg_def_zorder_info = __mg_zorder_info;
|
||||
|
||||
#if 0 /* deprecated code */
|
||||
/* Since 5.0.0; allocate znodes for other fixed main windows */
|
||||
{
|
||||
@@ -270,134 +269,7 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
|
||||
#endif
|
||||
free (zi);
|
||||
__mg_zorder_info = NULL;
|
||||
__mg_def_zorder_info = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0 /* deprecated code */
|
||||
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||
|
||||
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
||||
{
|
||||
key_t shm_key;
|
||||
int zorder_shmid;
|
||||
|
||||
if ((shm_key = get_layer_shm_key ()) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
zorder_shmid = shmget (shm_key,
|
||||
sizeof (ZORDERINFO) + SIZE_USAGE_BMP +
|
||||
sizeof (ZORDERNODE) *
|
||||
(DEF_NR_POPUPMENUS + /* for the popup menus */
|
||||
SHAREDRES_NR_GLOBALS + /* for the global windows */
|
||||
nr_topmosts + /* for the topmost windows */
|
||||
nr_normals)+ /* for the normal windows */
|
||||
SIZE_MASKRECT_USAGE_BMP +
|
||||
sizeof (MASKRECT) * DEF_NR_MASKRECT,
|
||||
SHM_PARAM | IPC_CREAT | IPC_EXCL);
|
||||
|
||||
return zorder_shmid;
|
||||
}
|
||||
|
||||
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
|
||||
|
||||
ZORDERINFO* __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
||||
{
|
||||
ZORDERINFO* zi;
|
||||
ZORDERNODE* znodes;
|
||||
void* maskrect_usage_bmp;
|
||||
|
||||
zi = (PZORDERINFO) calloc (1,
|
||||
sizeof (ZORDERINFO) + SIZE_USAGE_BMP +
|
||||
sizeof (ZORDERNODE) *
|
||||
(DEF_NR_POPUPMENUS + /* for the popup menus */
|
||||
SHAREDRES_NR_GLOBALS + /* for global window: 0 */
|
||||
nr_topmosts + /* for the topmost windows */
|
||||
nr_normals)+ /* for the normal windows */
|
||||
SIZE_MASKRECT_USAGE_BMP +
|
||||
sizeof (MASKRECT) * DEF_NR_MASKRECT);
|
||||
|
||||
if (!zi) {
|
||||
_WRN_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
zi->size_usage_bmp = SIZE_USAGE_BMP;
|
||||
zi->size_maskrect_usage_bmp = SIZE_MASKRECT_USAGE_BMP;
|
||||
|
||||
zi->max_nr_popupmenus = DEF_NR_POPUPMENUS;
|
||||
zi->max_nr_globals = 0;
|
||||
zi->max_nr_topmosts = nr_topmosts;
|
||||
zi->max_nr_normals = nr_normals;
|
||||
|
||||
zi->nr_popupmenus = 0;
|
||||
zi->nr_globals = 0;
|
||||
zi->nr_topmosts = 0;
|
||||
zi->nr_normals = 0;
|
||||
|
||||
zi->first_global = 0;
|
||||
zi->first_topmost = 0;
|
||||
zi->first_normal = 0;
|
||||
|
||||
zi->active_win = 0;
|
||||
|
||||
zi->cli_trackmenu = -1;
|
||||
zi->ptmi_in_cli = (HWND)-1;
|
||||
|
||||
/* Set zorder node usage map. */
|
||||
memset (zi + 1, 0xFF, SIZE_USAGE_BMP);
|
||||
|
||||
/* Set zorder mask rect usage map. */
|
||||
maskrect_usage_bmp = GET_MASKRECT_USAGEBMP(zi);
|
||||
memset (maskrect_usage_bmp, 0xFF,
|
||||
zi->size_maskrect_usage_bmp);
|
||||
|
||||
/* init z-order node for desktop */
|
||||
znodes = GET_ZORDERNODE(zi);
|
||||
|
||||
znodes [0].flags = ZOF_TYPE_DESKTOP | ZOF_VISIBLE;
|
||||
znodes [0].rc = g_rcScr;
|
||||
znodes [0].age = 0;
|
||||
znodes [0].cli = 0;
|
||||
znodes [0].hwnd = HWND_DESKTOP;
|
||||
znodes [0].next = 0;
|
||||
znodes [0].prev = 0;
|
||||
znodes [0].idx_mask_rect = 0;
|
||||
|
||||
__mg_slot_set_use ((unsigned char*)(zi + 1), 0);
|
||||
__mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0);
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifndef __NOUNIX__
|
||||
pthread_rwlock_init(&zi->rwlock, NULL);
|
||||
#else
|
||||
pthread_mutex_init(&zi->rwlock, NULL);
|
||||
#endif
|
||||
#endif /* _MGRM_THREADS */
|
||||
|
||||
return zi;
|
||||
}
|
||||
|
||||
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
|
||||
|
||||
void __kernel_free_z_order_info (ZORDERINFO* zi)
|
||||
{
|
||||
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||
if (shmdt (zi) < 0)
|
||||
perror ("Detaches shared zorder nodes");
|
||||
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifndef __NOUNIX__
|
||||
pthread_rwlock_destroy(&zi->rwlock);
|
||||
#else
|
||||
pthread_mutex_destroy(&zi->rwlock);
|
||||
#endif
|
||||
#endif /* _MGRM_THREADS */
|
||||
|
||||
free (zi);
|
||||
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
|
||||
}
|
||||
|
||||
#endif /* deprecated code */
|
||||
|
||||
|
||||
+1
-1
@@ -1472,7 +1472,7 @@ void mg_slice_debug_tree_statistics (void)
|
||||
su / bf, en, ex);
|
||||
}
|
||||
else
|
||||
_MG_PRINTF("MGSlice: MemChecker: root=NULL\n");
|
||||
_DBG_PRINTF("MGSlice: MemChecker: root=NULL\n");
|
||||
|
||||
pthread_mutex_unlock (&smc_tree_mutex);
|
||||
|
||||
|
||||
@@ -5,13 +5,9 @@ EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||
math.c about.c error.c sockio.c rc4.c rc4.h \
|
||||
makefile.ng makefile.msvc
|
||||
|
||||
if MG_MINIMALGDI
|
||||
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
|
||||
else
|
||||
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||
math.c about.c license.c anon_file.c rbtree.c map.c \
|
||||
error.c sockio.c
|
||||
endif
|
||||
|
||||
SRC_FILES = $(libmisc_la_SOURCES)
|
||||
LIB_NAME=libmisc
|
||||
|
||||
+1
-1
@@ -228,7 +228,7 @@ HWND GUIAPI OpenAboutDialog (HWND hHosting)
|
||||
SysPixelColor[IDX_COLOR_darkgray].g,
|
||||
SysPixelColor[IDX_COLOR_darkgray].b,
|
||||
0xA0),
|
||||
CT_ALPHAPIXEL, 0x80);
|
||||
CT_ALPHAPIXEL, COLOR_BLEND_LEGACY);
|
||||
|
||||
if (hMainWnd == HWND_INVALID)
|
||||
return HWND_INVALID;
|
||||
|
||||
+8
-339
@@ -69,11 +69,7 @@
|
||||
|
||||
#include "license.h"
|
||||
|
||||
#undef _MG_ENABLE_WATERMARK /* XXX: Always disable watermark */
|
||||
|
||||
#if defined(_MG_ENABLE_SPLASH) || \
|
||||
defined(_MG_ENABLE_SCREENSAVER) || \
|
||||
defined(_MG_ENABLE_WATERMARK)
|
||||
#if defined(_MG_ENABLE_SPLASH) || defined(_MG_ENABLE_SCREENSAVER)
|
||||
BITMAP g_license_bitmaps[LICENSE_BITMAP_NR];
|
||||
|
||||
#ifndef _MG_LICENSE_SCREENSAVER_TIMEOUT
|
||||
@@ -94,90 +90,16 @@ BITMAP g_license_bitmaps[LICENSE_BITMAP_NR];
|
||||
#define _MG_LICENSE_SPLASH_MSEC (40)
|
||||
#endif
|
||||
|
||||
#if defined(_MG_ENABLE_SCREENSAVER) || \
|
||||
defined(_MG_ENABLE_WATERMARK)
|
||||
#if defined(_MG_ENABLE_SCREENSAVER)
|
||||
static int s_tick_last_input;
|
||||
static BOOL screensaver_running;
|
||||
extern int dskCreateTopZOrderNode (int cli, const RECT *rc);
|
||||
extern int dskDestroyTopZOrderNode (int cli, int idx_znode);
|
||||
extern void dskRefreshAllClient (const RECT* invrc);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/***********************************************************
|
||||
* Product ID
|
||||
***********************************************************/
|
||||
#ifdef _MG_PRODUCTID
|
||||
|
||||
static unsigned char product_id_buffer[40] = {
|
||||
PRODUCT_ID_PREFIX,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
/* use this for splash display customer id by humingming 2010.8.12 */
|
||||
int license_get_customer_id(void) {
|
||||
return ((product_id_t*)product_id_buffer)->customer_id;
|
||||
}
|
||||
|
||||
#else
|
||||
//# warning PRODUCT_ID_is_DISABLED
|
||||
#endif
|
||||
|
||||
/***********************************************************
|
||||
* Watermark
|
||||
***********************************************************/
|
||||
#ifdef _MG_ENABLE_WATERMARK
|
||||
|
||||
#define MARGINSPACE 5
|
||||
|
||||
typedef struct _CornerInfo{
|
||||
POINT pos;
|
||||
HWND hwnd;
|
||||
BITMAP* bmp;
|
||||
}CornerInfo;
|
||||
|
||||
static CornerInfo fourcorner_info[4] = {
|
||||
{{MARGINSPACE, MARGINSPACE} },
|
||||
{{-MARGINSPACE, MARGINSPACE} },
|
||||
{{MARGINSPACE, -MARGINSPACE} },
|
||||
{{-MARGINSPACE, -MARGINSPACE} }
|
||||
};
|
||||
|
||||
static void watermark_update(void)
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 0; i < TABLESIZE(fourcorner_info); i++)
|
||||
FillBoxWithBitmap (HDC_SCREEN_SYS,
|
||||
fourcorner_info[i].pos.x, fourcorner_info[i].pos.y,
|
||||
0, 0, fourcorner_info[i].bmp);
|
||||
}
|
||||
|
||||
static void watermark_init(void)
|
||||
{
|
||||
RECT rcScr = GetScreenRect();
|
||||
|
||||
fourcorner_info[0].bmp = &g_license_bitmaps[WATERMARK_1];
|
||||
fourcorner_info[1].bmp = &g_license_bitmaps[WATERMARK_2];
|
||||
fourcorner_info[2].bmp = &g_license_bitmaps[WATERMARK_3];
|
||||
fourcorner_info[3].bmp = &g_license_bitmaps[WATERMARK_3];
|
||||
|
||||
/* right-top.*/
|
||||
fourcorner_info[1].pos.x += RECTW(rcScr) - fourcorner_info[1].bmp->bmWidth;
|
||||
/* left-bottom.*/
|
||||
fourcorner_info[2].pos.y += RECTH(rcScr) - fourcorner_info[2].bmp->bmHeight;
|
||||
/* right-bottom.*/
|
||||
fourcorner_info[3].pos.x += RECTW(rcScr) - fourcorner_info[3].bmp->bmWidth;
|
||||
fourcorner_info[3].pos.y += RECTH(rcScr) - fourcorner_info[3].bmp->bmHeight;
|
||||
}
|
||||
|
||||
#else
|
||||
# define watermark_update() /* NULL */
|
||||
# define watermark_init() /* NULL */
|
||||
#endif /* _MG_ENABLE_WATERMARK */
|
||||
|
||||
/***********************************************************
|
||||
* Screensaver
|
||||
***********************************************************/
|
||||
@@ -291,16 +213,7 @@ void __mg_splash_draw_framework (void)
|
||||
memset(text, 0, sizeof(text));
|
||||
SetRect(&rc_text, SPLASH_ID_X, SPLASH_ID_Y, SPLASH_ID_X+SPLASH_ID_W, RECTH(rcScr));
|
||||
|
||||
#ifdef _MG_PRODUCTID
|
||||
int customer_id = license_get_customer_id();
|
||||
if (customer_id <= 0) {
|
||||
sprintf(text, "SN: N/A");
|
||||
} else {
|
||||
sprintf(text, "SN: %d", customer_id);
|
||||
}
|
||||
#else
|
||||
sprintf(text, "SN: N/A");
|
||||
#endif
|
||||
|
||||
SetBkMode(HDC_SCREEN_SYS, BM_TRANSPARENT);
|
||||
DrawText(HDC_SCREEN_SYS, text, -1, &rc_text, DT_TOP | DT_RIGHT | DT_SINGLELINE);
|
||||
@@ -310,6 +223,7 @@ void __mg_splash_draw_framework (void)
|
||||
|
||||
SetBrushColor(HDC_SCREEN_SYS, old_brush);
|
||||
SetTextColor(HDC_SCREEN_SYS, old_text);
|
||||
SetBkMode(HDC_SCREEN_SYS, BM_OPAQUE);
|
||||
SyncUpdateDC(HDC_SCREEN_SYS);
|
||||
}
|
||||
|
||||
@@ -350,133 +264,9 @@ void __mg_splash_delay (void)
|
||||
# define splash_init() /* NULL */
|
||||
#endif /* _MG_ENABLE_SPLASH.*/
|
||||
|
||||
/***********************************************************
|
||||
* License common
|
||||
***********************************************************/
|
||||
static unsigned char const_trans_table[] = {
|
||||
0x16, 0xfe, 0xaf, 0x06, 0xd6, 0x9d, 0x54, 0x98,
|
||||
0x77, 0x36, 0xc1, 0xc7, 0x29, 0xf8, 0x64, 0x93,
|
||||
0x2e, 0x6b, 0x2a, 0x3c, 0x12, 0x13, 0x23, 0xc9,
|
||||
0xe2, 0xa3, 0xbd, 0xbe, 0xac, 0xdf, 0x91, 0xe5,
|
||||
0xdc, 0x4a, 0xc0, 0xb8, 0xd3, 0x2c, 0x61, 0x60,
|
||||
0x5b, 0x32, 0x37, 0x7e, 0xb7, 0x8e, 0x2b, 0x0b,
|
||||
0x19, 0x50, 0x40, 0xf3, 0x5f, 0x5d, 0x0d, 0x59,
|
||||
0x21, 0xb1, 0xf6, 0xb5, 0xe3, 0xb3, 0x94, 0xa6,
|
||||
0x31, 0x78, 0x84, 0xcc, 0x9c, 0x1b, 0x7b, 0x2f,
|
||||
0x46, 0xa9, 0x9b, 0xda, 0xee, 0xd0, 0xc5, 0x7f,
|
||||
0x4f, 0xc2, 0xa0, 0x9f, 0xe8, 0xb6, 0x3e, 0xbc,
|
||||
0xf5, 0xae, 0x1c, 0x7d, 0xca, 0xf2, 0x65, 0xe0,
|
||||
0x5a, 0x33, 0xfc, 0x3f, 0x49, 0x6d, 0xa1, 0x83,
|
||||
0xcb, 0x4d, 0x0f, 0xf4, 0x55, 0xec, 0x8a, 0x04,
|
||||
0x03, 0x7c, 0x86, 0x0e, 0xe4, 0xb4, 0x30, 0x99,
|
||||
0xa2, 0xdb, 0x43, 0x8d, 0x92, 0x11, 0xef, 0x8f,
|
||||
0x3a, 0xfb, 0xc6, 0x74, 0x0c, 0xb2, 0x97, 0x57,
|
||||
0x48, 0x69, 0x70, 0x15, 0x22, 0x67, 0x18, 0x24,
|
||||
0xf0, 0x82, 0xe7, 0x44, 0x9e, 0x53, 0x26, 0x81,
|
||||
0x1f, 0xc8, 0x63, 0x96, 0x00, 0x20, 0x4e, 0xe1,
|
||||
0x45, 0xd2, 0x75, 0x4c, 0x1d, 0x95, 0xbf, 0x52,
|
||||
0x05, 0xd8, 0x09, 0x1e, 0x73, 0x1a, 0xd5, 0xab,
|
||||
0x76, 0x08, 0xaa, 0xc4, 0x85, 0xb9, 0xd7, 0x8c,
|
||||
0x02, 0x58, 0x4b, 0x47, 0x89, 0xdd, 0x62, 0xa5,
|
||||
0xbb, 0x51, 0x10, 0xeb, 0x80, 0x79, 0xce, 0xfa,
|
||||
0x87, 0xf1, 0xcf, 0xfd, 0x6a, 0x07, 0x2d, 0x38,
|
||||
0xde, 0x41, 0x90, 0xb0, 0x25, 0x5e, 0xf7, 0xe6,
|
||||
0x42, 0x9a, 0xe9, 0xed, 0x6c, 0xc3, 0x88, 0xd1,
|
||||
0x6f, 0xd9, 0x7a, 0x0a, 0x68, 0x3d, 0x34, 0xcd,
|
||||
0xff, 0x28, 0x3b, 0x35, 0x01, 0xea, 0x39, 0x8b,
|
||||
0x14, 0x27, 0x56, 0xd4, 0x17, 0x72, 0xad, 0xa4,
|
||||
0xf9, 0x5c, 0x66, 0xa8, 0x6e, 0xba, 0xa7, 0x71,
|
||||
};
|
||||
|
||||
static unsigned char decrypt_byte(unsigned int ch) {
|
||||
return const_trans_table[(ch-17)%256];
|
||||
}
|
||||
|
||||
static void decrypt_mem(void *_data, int len) {
|
||||
unsigned char *data = (unsigned char *)_data;
|
||||
int i;
|
||||
for (i=0; i<len; ++i) {
|
||||
data[i] = decrypt_byte(data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int LICENSE_ENCRYPTED_CONST_INT(unsigned int src){
|
||||
decrypt_mem(&src, sizeof(src));
|
||||
return src;
|
||||
}
|
||||
|
||||
char *LICENSE_ENCRYPTED_CONST_STRING(unsigned char *src, int len){
|
||||
decrypt_mem(src, len);
|
||||
src[len] = 0;
|
||||
return (char *)src;
|
||||
}
|
||||
|
||||
#if defined(_MG_ENABLE_SPLASH) || \
|
||||
defined(_MG_ENABLE_SCREENSAVER) || \
|
||||
defined(_MG_ENABLE_WATERMARK)
|
||||
|
||||
/* disable cryptool */
|
||||
#undef ENCRYPTED
|
||||
|
||||
#ifdef ENCRYPTED
|
||||
# include "../sysres/license/c_files/key.c"
|
||||
#endif
|
||||
#if defined(_MG_ENABLE_SPLASH) || defined(_MG_ENABLE_SCREENSAVER)
|
||||
|
||||
#include "../sysres/license/c_files/_splash_inner_res.c"
|
||||
/* XXX: Other resource files are included in desktop.c event.c message.c zorder.c and window.c */
|
||||
#if 0 /* XXX: WaterMark is REMOVED */
|
||||
#ifdef _MG_ENABLE_LICENSE
|
||||
# include "../sysres/license/c_files/05_watermark-fmsoft.dat.c"
|
||||
# include "../sysres/license/c_files/06_watermark-minigui.dat.c"
|
||||
# include "../sysres/license/c_files/07_watermark-evaluation.dat.c"
|
||||
#endif /* _MG_ENABLE_SPLASH */
|
||||
#endif
|
||||
|
||||
#ifdef ENCRYPTED
|
||||
# include "rc4.c"
|
||||
# define FRAGMENT_SIZE 512
|
||||
static unsigned char calc_sum(int len, const unsigned char *data) {
|
||||
unsigned char sum;
|
||||
int i;
|
||||
|
||||
for (i=0, sum=0; i<len; ++i) {
|
||||
sum -= data[i];
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
static int decrypted_len(int len) {
|
||||
return len - ((len-1) / FRAGMENT_SIZE + 1) * sizeof(unsigned char);
|
||||
}
|
||||
|
||||
static int my_decrypt(RC4_KEY *key, int in_len, unsigned char *in) {
|
||||
int out_len = 0;
|
||||
int i;
|
||||
unsigned char sum;
|
||||
|
||||
for (i=0; i<in_len; /* NULL */) {
|
||||
int n;
|
||||
|
||||
RC4(key, sizeof(unsigned char), &in[i], (unsigned char *)&sum);
|
||||
i += sizeof(unsigned char);
|
||||
|
||||
n = (in_len - i > FRAGMENT_SIZE - sizeof(unsigned char)) ? (FRAGMENT_SIZE - sizeof(unsigned char)) : (in_len - i);
|
||||
RC4(key, n, &in[i], &in[out_len]);
|
||||
|
||||
if (calc_sum(n, &in[out_len]) != sum) {
|
||||
assert(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
i += n;
|
||||
out_len += n;
|
||||
}
|
||||
|
||||
assert(out_len == decrypted_len(in_len));
|
||||
return out_len;
|
||||
}
|
||||
#endif /* ENCRYPTED */
|
||||
|
||||
void __mg_license_create(void) {
|
||||
int i;
|
||||
@@ -484,26 +274,20 @@ void __mg_license_create(void) {
|
||||
for (i=0; i<LICENSE_BITMAP_NR; ++i) {
|
||||
unsigned char *data;
|
||||
int len;
|
||||
#ifdef ENCRYPTED
|
||||
RC4_KEY rc4key;
|
||||
#endif
|
||||
|
||||
data = (unsigned char *)malloc(__mg_splash_splash_inner_res[i].data_len);
|
||||
memcpy(data, __mg_splash_splash_inner_res[i].data, __mg_splash_splash_inner_res[i].data_len);
|
||||
len = __mg_splash_splash_inner_res[i].data_len;
|
||||
|
||||
#ifdef ENCRYPTED
|
||||
RC4_set_key(&rc4key, sizeof(splash_crypto_key), splash_crypto_key);
|
||||
len = my_decrypt(&rc4key, len, data);
|
||||
#endif
|
||||
|
||||
LoadBitmapFromMem(HDC_SCREEN_SYS, &g_license_bitmaps[i], data, len, "png");
|
||||
free(data);
|
||||
}
|
||||
|
||||
splash_init();
|
||||
|
||||
#ifdef _MG_ENABLE_SCREENSAVER
|
||||
watermark_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
void __mg_license_destroy (void) {
|
||||
@@ -513,120 +297,5 @@ void __mg_license_destroy (void) {
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _MG_ENABLE_SPLASH || _MG_ENABLE_SCREENSAVER || _MG_ENABLE_WATERMARK */
|
||||
#endif /* defined(_MG_ENABLE_SPLASH) || defined(_MG_ENABLE_SCREENSAVER) */
|
||||
|
||||
#if defined(_MG_ENABLE_SCREENSAVER) || defined(_MG_ENABLE_WATERMARK)
|
||||
void __mg_license_on_input(void)
|
||||
{
|
||||
#ifdef _MGRM_PROCESSES
|
||||
RECT rcScr = GetScreenRect();
|
||||
#endif
|
||||
|
||||
s_tick_last_input = GetTickCount();
|
||||
|
||||
if (screensaver_running == TRUE) {
|
||||
screensaver_running = FALSE;
|
||||
|
||||
#if defined(_MGRM_THREADS)
|
||||
{
|
||||
HWND activeWnd = GetActiveWindow();
|
||||
if (activeWnd) {
|
||||
SendNotifyMessage(activeWnd, MSG_CANCELSCREENSAVER, 0, 0);
|
||||
} else {
|
||||
__mg_screensaver_hide();
|
||||
SendNotifyMessage (HWND_DESKTOP, MSG_PAINT, 0, 0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
__mg_screensaver_hide();
|
||||
#if defined(_MGRM_PROCESSES)
|
||||
dskRefreshAllClient (&rcScr);
|
||||
#elif defined(_MGRM_STANDALONE)
|
||||
SendNotifyMessage (HWND_DESKTOP, MSG_PAINT, 0, 0);
|
||||
#else
|
||||
# error
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void __mg_license_on_timeout(void)
|
||||
{
|
||||
static unsigned int old_tick_count;
|
||||
unsigned int current_tick_count;
|
||||
|
||||
#ifdef _MGRM_PROCESSES
|
||||
if (!mgIsServer) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
current_tick_count = GetTickCount();
|
||||
|
||||
if (screensaver_running == TRUE) {
|
||||
/* screensaver is running, update the picture */
|
||||
if ((current_tick_count - old_tick_count) > _MG_LICENSE_SCREENSAVER_UPDATE_TIME) {
|
||||
old_tick_count = current_tick_count;
|
||||
screensaver_update();
|
||||
}
|
||||
} else {
|
||||
/* screensaver is not running, show it */
|
||||
if ((current_tick_count - s_tick_last_input) > _MG_LICENSE_SCREENSAVER_TIMEOUT) {
|
||||
screensaver_running = TRUE;
|
||||
__mg_screensaver_show();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* _MG_ENABLE_SCREENSAVER || _MG_ENABLE_WATERMARK */
|
||||
|
||||
/***********************************************************
|
||||
* Processor ID
|
||||
***********************************************************/
|
||||
#ifndef __TARGET_UNKNOWN__
|
||||
void license_get_processor_id (void) {
|
||||
g_license_processor_id = LICENSE_PROCESSOR_ID_NONE;
|
||||
#if defined(_WITH_TARGET_S3C6410) || defined(_WITH_TARGET_S3C2440) || defined(_WITH_TARGET_S3C2410) \
|
||||
|| defined (_WITH_TARGET_HI3560A)
|
||||
{
|
||||
int fd;
|
||||
unsigned char *addr;
|
||||
off_t SFR_offest;
|
||||
size_t cpuid_offest;
|
||||
unsigned char path[8] = "\x58\x1f\x6f\xc1\x58\x76\x6f\x76" /* "/dev/mem" */;
|
||||
|
||||
fd = open(LICENSE_ENCRYPTED_CONST_STRING(path, sizeof(path)), O_RDWR);
|
||||
if (fd <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef _WITH_TARGET_S3C6410
|
||||
SFR_offest = LICENSE_ENCRYPTED_CONST_INT(0x3CADA1AD /* 0x7E00F000 */);
|
||||
cpuid_offest = LICENSE_ENCRYPTED_CONST_INT(0xADADFD9F /* 0x00000118 */);
|
||||
#elif _WITH_TARGET_HI3560A
|
||||
SFR_offest = LICENSE_ENCRYPTED_CONST_INT(0xD3BCADAD /* 0x101E0000 */);
|
||||
cpuid_offest = LICENSE_ENCRYPTED_CONST_INT(0xADAD8470 /* 0x00000EE0 */);
|
||||
#else /* 2440, 2410 */
|
||||
SFR_offest = LICENSE_ENCRYPTED_CONST_INT(0x03ADADAD /* 0x56000000 */);
|
||||
cpuid_offest = LICENSE_ENCRYPTED_CONST_INT(0xADADADE4 /* 0x000000B0 */);
|
||||
#endif
|
||||
|
||||
addr = mmap(NULL, (4<<10), PROT_READ, MAP_SHARED, fd, SFR_offest);
|
||||
|
||||
#if _WITH_TARGET_HI3560A
|
||||
g_license_processor_id = *(unsigned int*)(addr+cpuid_offest+12) << 24 |
|
||||
*(unsigned int*)(addr+cpuid_offest+8) << 16 |
|
||||
*(unsigned int*)(addr+cpuid_offest+4) << 8 |
|
||||
*(unsigned int*)(addr+cpuid_offest);
|
||||
#else
|
||||
g_license_processor_id = *(unsigned int*)(addr+cpuid_offest);
|
||||
#endif
|
||||
munmap(addr, (4<<10));
|
||||
close(fd);
|
||||
}
|
||||
#else
|
||||
//# warning PROCESSOR_ID_verfication_is_DISABLED_on_this_target
|
||||
#endif
|
||||
}
|
||||
#endif /* __TARGET_UNKNOWN__ */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Makefile.am for the NEWGAL library
|
||||
|
||||
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
||||
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include $(PIXMAN_CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libnewgal.la
|
||||
|
||||
@@ -17,6 +17,9 @@ DRIVERS = @VIDEO_DRIVERS@
|
||||
|
||||
# Include the architecture-independent sources
|
||||
COMMON_SRCS = \
|
||||
video.c \
|
||||
newgal.c \
|
||||
surface.c \
|
||||
RLEaccel.c \
|
||||
RLEaccel_c.h \
|
||||
blit.c \
|
||||
@@ -29,12 +32,9 @@ COMMON_SRCS = \
|
||||
leaks.h \
|
||||
pixels.c \
|
||||
pixels_c.h \
|
||||
surface.c \
|
||||
stretch.c \
|
||||
stretch_c.h \
|
||||
sysvideo.h \
|
||||
video.c \
|
||||
newgal.c \
|
||||
videomem-bucket.h \
|
||||
videomem-bucket.c \
|
||||
surface-shared.c \
|
||||
|
||||
+123
-1
@@ -162,6 +162,13 @@ static void GAL_BlitCopyOverlap(GAL_BlitInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
#include <pixman.h>
|
||||
|
||||
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
|
||||
struct GAL_Surface *dst, GAL_Rect *dstrect);
|
||||
#endif
|
||||
|
||||
/* Figure out which of many blit routines to set up on a surface */
|
||||
int GAL_CalculateBlit(GAL_Surface *surface)
|
||||
{
|
||||
@@ -255,7 +262,7 @@ int GAL_CalculateBlit(GAL_Surface *surface)
|
||||
|
||||
/* Handle overlapping blits on the same surface */
|
||||
if ( surface == surface->map->dst ) {
|
||||
surface->map->sw_data->blit = GAL_BlitCopyOverlap;
|
||||
surface->map->sw_data->blit = GAL_BlitCopyOverlap;
|
||||
}
|
||||
} else {
|
||||
if ( surface->format->BitsPerPixel < 8 ) {
|
||||
@@ -301,8 +308,123 @@ int GAL_CalculateBlit(GAL_Surface *surface)
|
||||
}
|
||||
|
||||
if ( surface->map->sw_blit == NULL ) {
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
if (blit_index & 1) {
|
||||
// have colorkey
|
||||
surface->map->sw_blit = GAL_SoftBlit;
|
||||
}
|
||||
else if (surface->pix_img && surface->map->dst->pix_img &&
|
||||
surface != surface->map->dst) {
|
||||
surface->map->sw_blit = GAL_PixmanBlit;
|
||||
}
|
||||
else {
|
||||
surface->map->sw_blit = GAL_SoftBlit;
|
||||
}
|
||||
#else
|
||||
surface->map->sw_blit = GAL_SoftBlit;
|
||||
#endif
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
|
||||
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
|
||||
{
|
||||
if (GAL_CheckPixmanFormats (src, dst)) {
|
||||
if ((src->flags & GAL_SRCALPHA) && src->format->alpha != GAL_ALPHA_OPAQUE) {
|
||||
memset (&src->pix_alpha_bits, src->format->alpha, sizeof(uint32_t));
|
||||
src->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
|
||||
&src->pix_alpha_bits, 4);
|
||||
if (src->msk_img)
|
||||
pixman_image_set_repeat (src->msk_img, PIXMAN_REPEAT_NORMAL);
|
||||
}
|
||||
else
|
||||
src->msk_img = NULL;
|
||||
|
||||
ops &= COLOR_BLEND_FLAGS_MASK;
|
||||
if (ops == COLOR_BLEND_LEGACY) {
|
||||
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
|
||||
src->pix_op = PIXMAN_OP_OVER;
|
||||
}
|
||||
else {
|
||||
src->pix_op = PIXMAN_OP_SRC;
|
||||
}
|
||||
}
|
||||
else {
|
||||
src->pix_op = ops;
|
||||
}
|
||||
|
||||
if (src->pix_op > PIXMAN_OP_HSL_LUMINOSITY ||
|
||||
src->pix_op < PIXMAN_OP_CLEAR) {
|
||||
src->pix_op = PIXMAN_OP_SRC;
|
||||
}
|
||||
|
||||
/* reset transform and filter */
|
||||
pixman_image_set_transform (src->pix_img, NULL);
|
||||
pixman_image_set_filter (src->pix_img, PIXMAN_FILTER_NEAREST, NULL, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst)
|
||||
{
|
||||
if (src->msk_img) {
|
||||
pixman_image_unref (src->msk_img);
|
||||
src->msk_img = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
|
||||
struct GAL_Surface *dst, GAL_Rect *dstrect)
|
||||
{
|
||||
pixman_image_t *src_img = src->pix_img, *dst_img = dst->pix_img;
|
||||
pixman_image_t *msk_img;
|
||||
pixman_op_t op;
|
||||
|
||||
msk_img = src->msk_img;
|
||||
op = (pixman_op_t)src->pix_op;
|
||||
|
||||
_DBG_PRINTF ("srcrect: %d, %d, %dx%d; dstrect: %d, %d, %dx%d\n",
|
||||
srcrect->x, srcrect->y, srcrect->w, srcrect->h,
|
||||
dstrect->x, dstrect->y, dstrect->w, dstrect->h);
|
||||
|
||||
#if 0
|
||||
pixman_region32_t clip_region;
|
||||
pixman_region32_init_rect (&clip_region,
|
||||
dst->clip_rect.x, dst->clip_rect.y, dst->clip_rect.w, dst->clip_rect.h);
|
||||
pixman_image_set_clip_region32 (dst_img, &clip_region);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
// pixman_blt does not work
|
||||
if (pixman_image_get_format (src_img) == pixman_image_get_format (dst_img) &&
|
||||
op == PIXMAN_OP_SRC && msk_img == NULL) {
|
||||
pixman_blt ((uint32_t *)((char*)src->pixels + src->pixels_off),
|
||||
(uint32_t *)((char*)dst->pixels + dst->pixels_off),
|
||||
src->pitch, dst->pitch,
|
||||
GAL_BytesPerPixel (src),
|
||||
GAL_BytesPerPixel (dst),
|
||||
srcrect->x, srcrect->y,
|
||||
dstrect->x, dstrect->y,
|
||||
srcrect->w, srcrect->h);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pixman_image_composite32 (op, src_img, msk_img, dst_img,
|
||||
srcrect->x, srcrect->y,
|
||||
0, 0,
|
||||
dstrect->x, dstrect->y,
|
||||
srcrect->w, srcrect->h);
|
||||
}
|
||||
|
||||
//pixman_region32_fini (&clip_region);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif // _MGUSE_PIXMAN
|
||||
|
||||
|
||||
+2
-2
@@ -77,16 +77,16 @@ struct private_swaccel {
|
||||
/* Blit mapping definition */
|
||||
typedef struct GAL_BlitMap {
|
||||
GAL_Surface *dst;
|
||||
int identity;
|
||||
Uint8 *table;
|
||||
GAL_blit hw_blit;
|
||||
GAL_blit sw_blit;
|
||||
struct private_hwaccel *hw_data;
|
||||
struct private_swaccel *sw_data;
|
||||
|
||||
int identity;
|
||||
/* the version count matches the destination; mismatch indicates
|
||||
an invalid mapping */
|
||||
unsigned int format_version;
|
||||
unsigned int format_version;
|
||||
} GAL_BlitMap;
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user