mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-23 16:43:58 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
358c940763 | ||
|
|
b3d6c70a45 | ||
|
|
5fc1c1101e | ||
|
|
f336b8401b | ||
|
|
78a0a8addf | ||
|
|
be5f46f92d | ||
|
|
07592ad802 | ||
|
|
1764c47131 | ||
|
|
f83c92d91b | ||
|
|
bf85472935 | ||
|
|
ff6856ec1f | ||
|
|
a4d532f85e | ||
|
|
18f51a113d | ||
|
|
12313a2646 | ||
|
|
3ce8e5e8af | ||
|
|
a8b54bc301 | ||
|
|
7f711b383a | ||
|
|
bbda500121 | ||
|
|
deb248c96e | ||
|
|
c8e9b72663 | ||
|
|
0ff551a2da | ||
|
|
aef1e366f4 | ||
|
|
41d8a80c8e | ||
|
|
cbd2cea0e9 | ||
|
|
0c5f5115e6 | ||
|
|
86da42231c | ||
|
|
20974f305a | ||
|
|
5a22e67680 | ||
|
|
bae24f0964 | ||
|
|
2871657b65 | ||
|
|
767a8b088e | ||
|
|
2f77a0a8c8 | ||
|
|
2900f37c23 | ||
|
|
a693fa7dc2 | ||
|
|
f7cb85401c | ||
|
|
433d5d6cc5 | ||
|
|
98b66f158f | ||
|
|
4fc71946ca | ||
|
|
59c609dc2d | ||
|
|
ce6525d8f2 | ||
|
|
bbd1776911 | ||
|
|
f196a67afe | ||
|
|
5f895b2ad9 | ||
|
|
e5c31ee766 | ||
|
|
9f244a1093 | ||
|
|
43c387d0a0 | ||
|
|
f662f45e86 | ||
|
|
602f3c5748 | ||
|
|
74f727cb2e | ||
|
|
dccc997e75 | ||
|
|
41858de966 | ||
|
|
86b4d9c9ab | ||
|
|
4144065fb8 | ||
|
|
7932f5f687 | ||
|
|
0a54e292e9 | ||
|
|
d3770381b8 | ||
|
|
a5f13a023c | ||
|
|
039121892b | ||
|
|
150f670d2e | ||
|
|
7fbd3ef4f3 | ||
|
|
c03386f438 | ||
|
|
058db9ccdf | ||
|
|
a8c623b0dd | ||
|
|
50b7ee5fc2 | ||
|
|
9a95f9b706 | ||
|
|
4da4e0b1ac | ||
|
|
151400eac0 | ||
|
|
f8bd1a67bc | ||
|
|
3f65456f3f | ||
|
|
8c102fcafd | ||
|
|
e8150805ff | ||
|
|
88391c47d2 | ||
|
|
8d8f51f660 | ||
|
|
d2d10421b6 | ||
|
|
0e0c95e0a9 | ||
|
|
61e22faeb9 | ||
|
|
d81d40f9b7 | ||
|
|
66de31895a | ||
|
|
bfec1da2a6 | ||
|
|
c76adc0602 | ||
|
|
306dd9602a | ||
|
|
85c63e90fa | ||
|
|
cf537dd421 | ||
|
|
334a77adaf | ||
|
|
6ce6de157b | ||
|
|
9eb0a8b40c | ||
|
|
f1d670502c | ||
|
|
3269650084 | ||
|
|
53edb5dcba | ||
|
|
1f46ba258e | ||
|
|
959407d7ea | ||
|
|
3eacf471ac | ||
|
|
a2b65ba39f | ||
|
|
444d9bb1f7 | ||
|
|
b54c186688 | ||
|
|
19372b2fbb | ||
|
|
77c76c53ae | ||
|
|
50ddc8e31c | ||
|
|
e67849db69 | ||
|
|
96a085170b | ||
|
|
ff6f42e291 | ||
|
|
f8ced41de6 | ||
|
|
072ac4e166 | ||
|
|
43b8b8de59 | ||
|
|
5fa10b3d7f | ||
|
|
fdac75dce0 | ||
|
|
44b8552307 | ||
|
|
6ad5529ee7 | ||
|
|
6b47d74be7 | ||
|
|
32f29cc159 | ||
|
|
0d4b076fd5 | ||
|
|
cddfc2ed84 | ||
|
|
41b37abc13 | ||
|
|
d3e1837244 | ||
|
|
1bc10fb83e | ||
|
|
7188627084 | ||
|
|
615d1e72d3 | ||
|
|
cb8fb1a0c1 | ||
|
|
ed728100c3 | ||
|
|
56e24ff4ef | ||
|
|
ba3a0030fc | ||
|
|
2094cda9e5 | ||
|
|
aad307d676 | ||
|
|
3fa8169353 | ||
|
|
5cf3418c15 | ||
|
|
3611804ecc | ||
|
|
c121c87b75 | ||
|
|
47f577b672 | ||
|
|
7ca92b6350 | ||
|
|
e4cc1d4c26 | ||
|
|
9a076cba39 | ||
|
|
74178caf8c | ||
|
|
4fee49aa43 | ||
|
|
fa13587088 | ||
|
|
2b715208c0 | ||
|
|
1bbd5ea4f1 | ||
|
|
4ea138ef19 | ||
|
|
a39c1caa4a | ||
|
|
b1b4ce2a66 | ||
|
|
7c92a9334d | ||
|
|
aaa4ad1cbc | ||
|
|
7b93d0878d | ||
|
|
1c29f6373e | ||
|
|
57bdcd4754 | ||
|
|
b95538a415 | ||
|
|
fa7c84b2b5 | ||
|
|
bc77048488 | ||
|
|
2f21b22a49 | ||
|
|
ec91986854 | ||
|
|
e7b03037be | ||
|
|
9ff822c7fd | ||
|
|
239924c63e | ||
|
|
2f85645e9d |
+2
-1
@@ -4,6 +4,8 @@
|
|||||||
*.al
|
*.al
|
||||||
*.a
|
*.a
|
||||||
*.so
|
*.so
|
||||||
|
\#
|
||||||
|
am--include-marker
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
.deps/
|
.deps/
|
||||||
@@ -23,7 +25,6 @@ Makefile.in
|
|||||||
/*config.h
|
/*config.h
|
||||||
/*config.h.in
|
/*config.h.in
|
||||||
/*config.h.in~
|
/*config.h.in~
|
||||||
|
|
||||||
/src/font/utils/emoji/
|
/src/font/utils/emoji/
|
||||||
/src/font/utils/ucd/
|
/src/font/utils/ucd/
|
||||||
/src/sysres/font_list
|
/src/sysres/font_list
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
MAJOR_VERSION = 4
|
MAJOR_VERSION = 5
|
||||||
MINOR_VERSION = 1
|
MINOR_VERSION = 0
|
||||||
MICRO_VERSION = 0
|
MICRO_VERSION = 0
|
||||||
EXTRAVERSION =
|
EXTRAVERSION =
|
||||||
|
|
||||||
|
|||||||
@@ -6,19 +6,23 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
|||||||
## TABLE OF CONTENTS
|
## TABLE OF CONTENTS
|
||||||
|
|
||||||
- [INTRODUCTION](#introduction)
|
- [INTRODUCTION](#introduction)
|
||||||
- [A BRIEF BUILDING INSTRUCTION](#a-brief-building-instruction)
|
+ [What's MiniGUI](#whats-minigui)
|
||||||
+ [Prerequisites](#prerequisites)
|
+ [MiniGUI Components](#minigui-components)
|
||||||
+ [Building MiniGUI Core](#building-minigui-core)
|
+ [Open Source Apps Based-on MiniGUI](#open-source-apps-based-on-minigui)
|
||||||
+ [Building whole MiniGUI](#building-whole-minigui)
|
+ [MiniGUI and HybridOS](#minigui-and-hybridos)
|
||||||
+ [Unit Tests](#unit-tests)
|
+ [Source Code Repositories](#source-code-repositories)
|
||||||
- [NEW FEATURES IN VERSION 5.0.x](#new-features-in-version-50x)
|
- [NEW FEATURES IN VERSION 5.0.x](#new-features-in-version-50x)
|
||||||
+ [Compositing schema](#compositing-schema)
|
+ [Compositing Schema](#compositing-schema)
|
||||||
+ [New main window types](#new-main-window-types)
|
+ [New Main Window Types](#new-main-window-types)
|
||||||
+ [Virtual window](#virtual-window)
|
+ [Virtual Window](#virtual-window)
|
||||||
+ [Other enhancements](#other-enhancements)
|
+ [Other Enhancements](#other-enhancements)
|
||||||
- [NEW FEATURES IN VERSION 4.0.x](#new-features-in-version-40x)
|
- [NEW FEATURES IN VERSION 4.0.x](#new-features-in-version-40x)
|
||||||
- [NEW FEATURES IN VERSION 3.2.x](#new-features-in-version-32x)
|
- [NEW FEATURES IN VERSION 3.2.x](#new-features-in-version-32x)
|
||||||
- [THE RUNTIME MODES OF MINIGUI](#the-runtime-modes-of-minigui)
|
- [THE RUNTIME MODES OF MINIGUI](#the-runtime-modes-of-minigui)
|
||||||
|
- [A BRIEF BUILDING INSTRUCTION](#a-brief-building-instruction)
|
||||||
|
+ [Building Whole MiniGUI](#building-whole-minigui)
|
||||||
|
+ [Building MiniGUI Core](#building-minigui-core)
|
||||||
|
+ [Unit Tests](#unit-tests)
|
||||||
- [HISTORY](#history)
|
- [HISTORY](#history)
|
||||||
- [AUTHORS AND COPYING](#authors-and-copying)
|
- [AUTHORS AND COPYING](#authors-and-copying)
|
||||||
+ [Special Statement](#special-statement)
|
+ [Special Statement](#special-statement)
|
||||||
@@ -28,6 +32,8 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
|||||||
|
|
||||||
## INTRODUCTION
|
## INTRODUCTION
|
||||||
|
|
||||||
|
### What's MiniGUI
|
||||||
|
|
||||||
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
|
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
|
||||||
User Interface) support system for embedded systems and smart IoT devices.
|
User Interface) support system for embedded systems and smart IoT devices.
|
||||||
This is the version 5.0.x of MiniGUI maintained by WEI Yongming.
|
This is the version 5.0.x of MiniGUI maintained by WEI Yongming.
|
||||||
@@ -41,9 +47,11 @@ embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
|
|||||||
traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX,
|
traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX,
|
||||||
Nucleus, pSOS, uC/OS-II, and OSE.
|
Nucleus, pSOS, uC/OS-II, and OSE.
|
||||||
|
|
||||||
This is the source tree of MiniGUI Core, which provides windowing
|
This is the source tree of MiniGUI Core, which provides the windowing
|
||||||
and graphics interfaces as well as a lot of standard controls (toolkit).
|
and graphics interfaces as well as a lot of standard controls (toolkit).
|
||||||
|
|
||||||
|
### MiniGUI Components
|
||||||
|
|
||||||
Besides MiniGUI Core, FMSoft also provides some components
|
Besides MiniGUI Core, FMSoft also provides some components
|
||||||
for the developers to develop app much easier:
|
for the developers to develop app much easier:
|
||||||
|
|
||||||
@@ -82,22 +90,80 @@ from the download zone of the site:
|
|||||||
|
|
||||||
<http://www.minigui.com>
|
<http://www.minigui.com>
|
||||||
|
|
||||||
|
### Open Source Apps Based-on MiniGUI
|
||||||
|
|
||||||
FMSoft also releases some open source apps for MiniGUI on the site above,
|
FMSoft also releases some open source apps for MiniGUI on the site above,
|
||||||
for examples:
|
for examples:
|
||||||
|
|
||||||
* mDolphin, licensed under Apache 2.0, is a full-featured
|
* `mDolphin`, licensed under Apache 2.0, is a full-featured
|
||||||
WEB/WAP browser, which is developed based on the open source browser
|
WEB/WAP browser, which is developed based on the open source browser
|
||||||
core WebKit and uses MiniGUI as its underlying graphics support system.
|
core WebKit and uses MiniGUI as its underlying graphics support system.
|
||||||
* mGallery, licensed under Apache 2.0, intends to
|
* `mGallery`, licensed under Apache 2.0, intends to
|
||||||
provide a total solution for PMP (Portable Multimedia Player),
|
provide a total solution for PMP (Portable Multimedia Player),
|
||||||
which uses MiniGUI as the graphics platform.
|
which uses MiniGUI as the graphics platform.
|
||||||
* mSpider, licensed under GPL 3.0, intends to provide a
|
* `mSpider`, licensed under GPL 3.0, intends to provide a
|
||||||
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
|
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
|
||||||
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
|
* `mEagle`, licensed under GPL 3.0, is an embedded GIS development platform
|
||||||
which addresses the needs of map browse, query, analysis, etc
|
which addresses the needs of map browse, query, analysis, etc
|
||||||
|
|
||||||
|
### MiniGUI and HybridOS
|
||||||
|
|
||||||
|
HybridOS is another large open source project initiated by FMSoft. It is
|
||||||
|
a totally new open source operating system designed for smart IoT devices
|
||||||
|
and cloud computing environment.
|
||||||
|
|
||||||
|
In practice, MiniGUI and the software which are used to integrated with GPU
|
||||||
|
constitute the graphics stack of HybridOS.
|
||||||
|
|
||||||
|
HybridOS uses MiniGUI as the underlying windowing system, and the members of
|
||||||
|
HybridOS project are now maintaining the whole graphics stack.
|
||||||
|
The following chart shows the graphics stack of HybridOS:
|
||||||
|
|
||||||
|
```
|
||||||
|
-----------------------------------------------
|
||||||
|
| MiniGUI/HybridOS Apps |
|
||||||
|
|-----------------------------------------------|
|
||||||
|
| | (Graphics Stack) |
|
||||||
|
| | ---------------------|
|
||||||
|
| | | hiMesa |
|
||||||
|
| | hiCairo | ------------------|
|
||||||
|
| | MiniGUI | | EGL for MiniGUI |
|
||||||
|
| C++ libs | hiDRMDrivers | | GL, GLES, VG |
|
||||||
|
| C libs | libDRM | | GPU drivers |
|
||||||
|
|-----------------------------------------------|
|
||||||
|
| Linux Kernel |
|
||||||
|
| -----------------------------------|
|
||||||
|
| | DRI and DRI Drivers |
|
||||||
|
-----------------------------------------------
|
||||||
|
```
|
||||||
|
|
||||||
|
As shown in the chart above, the HybridOS graphics stack consists of
|
||||||
|
the following software:
|
||||||
|
|
||||||
|
- `libDRM` provides some user land APIs for Linux Direct Rendering Infrastructure.
|
||||||
|
- `hiDRMDrivers` contains the drivers (user land drivers, not kernel drivers) for
|
||||||
|
MiniGUI DRM engine. The drivers implement the basic hardware accelerated
|
||||||
|
2D graphics operations of various GPUs for MiniGUI.
|
||||||
|
- `hiMesa` is the Mesa derivative for HybridOS, while Mesa is the open source
|
||||||
|
implementation of OpenGL and other graphics APIs, including OpenGL ES
|
||||||
|
(versions 1, 2, 3), OpenCL, OpenMAX, and Vulkan. It contains the following
|
||||||
|
components:
|
||||||
|
+ The implementation of OpenGL, OpenGL ES (v1, 2, 3), and other
|
||||||
|
graphics APIs.
|
||||||
|
+ The EGL implementation for MiniGUI platform.
|
||||||
|
+ The graphics drivers for various GPUs and a software driver called `swrast`.
|
||||||
|
- `hiCairo` is the Cairo derivative for HybridOS. Cairo is a 2D vector graphics
|
||||||
|
library for Gtk. We provide support for MiniGUI backend in `hiCairo`.
|
||||||
|
|
||||||
|
For more information about HybridOS, please refer to:
|
||||||
|
|
||||||
|
<https://hybridos.fmsoft.cn/>
|
||||||
|
|
||||||
|
### Source Code Repositories
|
||||||
|
|
||||||
FMSoft had created the public repositories for MiniGUI Core, MiniGUI
|
FMSoft had created the public repositories for MiniGUI Core, MiniGUI
|
||||||
components, and other open source apps on GitHub. You can visit them on:
|
components, HybridOS, and other open source apps on GitHub. You can visit
|
||||||
|
them on:
|
||||||
|
|
||||||
<https://github.com/VincentWei>
|
<https://github.com/VincentWei>
|
||||||
|
|
||||||
@@ -109,75 +175,12 @@ We now maintain all documents about MiniGUI on the following public repo:
|
|||||||
|
|
||||||
<https://github.com/VincentWei/minigui-docs>
|
<https://github.com/VincentWei/minigui-docs>
|
||||||
|
|
||||||
## A BRIEF BUILDING INSTRUCTION
|
|
||||||
|
|
||||||
This instruction assumes that you are using Ubuntu Linux.
|
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
|
|
||||||
You should run `apt install <package_name>` to install the following packages
|
|
||||||
on your Ubuntu Linux.
|
|
||||||
|
|
||||||
* Building tools:
|
|
||||||
* autoconf
|
|
||||||
* Dependent libraries (all are optional):
|
|
||||||
* libjpeg64-dev
|
|
||||||
* libpng12-dev (use libpng-dev on Ubuntu Linux 18.04 LTS)
|
|
||||||
* libfreetype6-dev
|
|
||||||
|
|
||||||
### Building MiniGUI Core
|
|
||||||
|
|
||||||
MiniGUI Core uses GNU autoconf/automake scripts to configure and build the project.
|
|
||||||
|
|
||||||
Run
|
|
||||||
|
|
||||||
$ ./configure; make; sudo make install
|
|
||||||
|
|
||||||
to configure, make, and install the headers and the libraries. If there is not
|
|
||||||
`configure` file, please run
|
|
||||||
|
|
||||||
$ ./autogen.sh
|
|
||||||
|
|
||||||
to generate the script.
|
|
||||||
|
|
||||||
MiniGUI Core also provides some configuration options to customize the features.
|
|
||||||
For more information, please run
|
|
||||||
|
|
||||||
$ ./configure --help
|
|
||||||
|
|
||||||
### Building whole MiniGUI
|
|
||||||
|
|
||||||
If you are anxious to see the comprehensive demo of MiniGUI Core
|
|
||||||
and MiniGUI components, please fetch one of the following repositories
|
|
||||||
from GitHub and follow the instructions to build MiniGUI Core,
|
|
||||||
MiniGUI components, the samples, and the demonstration programs:
|
|
||||||
|
|
||||||
<https://github.com/VincentWei/build-minigui-5.0>
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
<https://github.com/VincentWei/build-minigui-4.0>
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
<https://github.com/VincentWei/build-minigui-3.2>
|
|
||||||
|
|
||||||
### Unit Tests
|
|
||||||
|
|
||||||
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
|
|
||||||
following repository:
|
|
||||||
|
|
||||||
<https://github.com/VincentWei/mg-tests>
|
|
||||||
|
|
||||||
If you are interested in hacking the MiniGUI code, please visit this repository.
|
|
||||||
|
|
||||||
|
|
||||||
## NEW FEATURES IN VERSION 5.0.x
|
## 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 new and exciting features, and refactored
|
||||||
a lot basic modules of MiniGUI Core.
|
a lot basic modules of MiniGUI Core.
|
||||||
|
|
||||||
### Compositing schema
|
### Compositing Schema
|
||||||
|
|
||||||
In this version, we enhanced the MiniGUI-Processes runtime mode to support
|
In this version, we enhanced the MiniGUI-Processes runtime mode to support
|
||||||
the compositing schema. Under compositing schema, regardless a main window
|
the compositing schema. Under compositing schema, regardless a main window
|
||||||
@@ -199,7 +202,7 @@ implementation for multi-process environment:
|
|||||||
- Better security. One client created by different user cannot
|
- Better security. One client created by different user cannot
|
||||||
read/write contents in/to another windows owned by other clients.
|
read/write contents in/to another windows owned by other clients.
|
||||||
|
|
||||||
### New main window types
|
### New Main Window Types
|
||||||
|
|
||||||
In this version, we also enhanced the window manager of MiniGUI Core
|
In this version, we also enhanced the window manager of MiniGUI Core
|
||||||
to support some special main window types.
|
to support some special main window types.
|
||||||
@@ -225,7 +228,7 @@ There are eight levels in MiniGUI from top to bottom:
|
|||||||
This enhancement allows us to create a special app which acts as
|
This enhancement allows us to create a special app which acts as
|
||||||
screen lock, docker, or launcher.
|
screen lock, docker, or launcher.
|
||||||
|
|
||||||
### Virtual window
|
### Virtual Window
|
||||||
|
|
||||||
You know that we can post or send a message to other windows which
|
You know that we can post or send a message to other windows which
|
||||||
may run in another thread under MiniGUI-Threads. The MiniGUI
|
may run in another thread under MiniGUI-Threads. The MiniGUI
|
||||||
@@ -256,7 +259,7 @@ and the new thread.
|
|||||||
This enhancement provides a very useful facility to you in order to
|
This enhancement provides a very useful facility to you in order to
|
||||||
develop a well-designed multithreaded application.
|
develop a well-designed multithreaded application.
|
||||||
|
|
||||||
### Other enhancements
|
### Other Enhancements
|
||||||
|
|
||||||
We also tune or enhance the following modules of MiniGUI Core:
|
We also tune or enhance the following modules of MiniGUI Core:
|
||||||
|
|
||||||
@@ -289,7 +292,7 @@ so that the old applications can smoothly migrate to the new
|
|||||||
version. However, there are still some slight changes you need to take care.
|
version. However, there are still some slight changes you need to take care.
|
||||||
For more information, please refer to `RELEASE-NOTES.md` file:
|
For more information, please refer to `RELEASE-NOTES.md` file:
|
||||||
|
|
||||||
<https://github.com/VincentWei/minigui/blob/master/RELEASE-NOTES.md>
|
<https://github.com/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
|
||||||
|
|
||||||
## NEW FEATURES IN VERSION 4.0.x
|
## NEW FEATURES IN VERSION 4.0.x
|
||||||
|
|
||||||
@@ -320,7 +323,7 @@ in order to support [HybridOS Foundation Class Library].
|
|||||||
|
|
||||||
For more information, please refer to `RELEASE-NOTES.md` file:
|
For more information, please refer to `RELEASE-NOTES.md` file:
|
||||||
|
|
||||||
<https://github.com/VincentWei/minigui/blob/tree/rel-4-0/RELEASE-NOTES.md>
|
<https://github.com/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md>
|
||||||
|
|
||||||
Because of the changes of some APIs, we recommended strongly that you
|
Because of the changes of some APIs, we recommended strongly that you
|
||||||
use this version for new projects.
|
use this version for new projects.
|
||||||
@@ -380,6 +383,68 @@ If a client exits or dies for some reasons, it will not damage other
|
|||||||
clients and the server.
|
clients and the server.
|
||||||
|
|
||||||
|
|
||||||
|
## A BRIEF BUILDING INSTRUCTION
|
||||||
|
|
||||||
|
### Building Whole MiniGUI
|
||||||
|
|
||||||
|
If you are anxious to see the comprehensive demo of MiniGUI Core
|
||||||
|
and MiniGUI components, please fetch one of the following repositories
|
||||||
|
from GitHub and follow the instructions to build MiniGUI Core,
|
||||||
|
MiniGUI components, the samples, and the demonstration programs:
|
||||||
|
|
||||||
|
<https://github.com/VincentWei/build-minigui-5.0>
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
<https://github.com/VincentWei/build-minigui-4.0>
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
<https://github.com/VincentWei/build-minigui-3.2>
|
||||||
|
|
||||||
|
### Building MiniGUI Core
|
||||||
|
|
||||||
|
We recommend that you use a latest Linux distribution with long term support,
|
||||||
|
for example, Ubuntu Linux LTS 16.04 or 18.04.
|
||||||
|
|
||||||
|
On Ubuntu Linux LTS 16.04 or 18.04, you should run `apt install <package_name>`
|
||||||
|
to install the following packages:
|
||||||
|
|
||||||
|
* Building tools:
|
||||||
|
* autoconf
|
||||||
|
* Dependent libraries (all are optional):
|
||||||
|
* libjpeg64-dev
|
||||||
|
* libpng12-dev (use libpng-dev on Ubuntu Linux 18.04 LTS)
|
||||||
|
* libfreetype6-dev
|
||||||
|
|
||||||
|
MiniGUI Core uses GNU autoconf/automake scripts to configure and build the project.
|
||||||
|
|
||||||
|
Run
|
||||||
|
|
||||||
|
$ ./configure; make; sudo make install
|
||||||
|
|
||||||
|
to configure, make, and install the headers and the libraries. If there is not
|
||||||
|
`configure` file, please run
|
||||||
|
|
||||||
|
$ ./autogen.sh
|
||||||
|
|
||||||
|
to generate the script.
|
||||||
|
|
||||||
|
MiniGUI Core also provides some configuration options to customize the features.
|
||||||
|
For more information, please run
|
||||||
|
|
||||||
|
$ ./configure --help
|
||||||
|
|
||||||
|
### Unit Tests
|
||||||
|
|
||||||
|
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
|
||||||
|
following repository:
|
||||||
|
|
||||||
|
<https://github.com/VincentWei/mg-tests>
|
||||||
|
|
||||||
|
If you are interested in hacking the MiniGUI code, please visit this repository.
|
||||||
|
|
||||||
|
|
||||||
## HISTORY
|
## HISTORY
|
||||||
|
|
||||||
21 years have pasted since MiniGUI was initially created at
|
21 years have pasted since MiniGUI was initially created at
|
||||||
@@ -483,7 +548,7 @@ A brief history description of the development progress is listed as follow:
|
|||||||
1. Feb., 2018: FMSoft released MiniGUI version 3.2.0.
|
1. Feb., 2018: FMSoft released MiniGUI version 3.2.0.
|
||||||
1. Apr., 2019: FMSoft released MiniGUI version 3.2.2.
|
1. Apr., 2019: FMSoft released MiniGUI version 3.2.2.
|
||||||
1. Jul., 2019: FMSoft released MiniGUI version 4.0.0.
|
1. Jul., 2019: FMSoft released MiniGUI version 4.0.0.
|
||||||
1. Apr., 2020: FMSoft released MiniGUI version 5.0.0.
|
1. Mar., 2020: FMSoft released MiniGUI version 5.0.0.
|
||||||
|
|
||||||
## AUTHORS AND COPYING
|
## AUTHORS AND COPYING
|
||||||
|
|
||||||
|
|||||||
+41
-46
@@ -1,9 +1,10 @@
|
|||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
- [Version 4.9.1](#version-491)
|
- [Version 5.0.2](#version-502)
|
||||||
+ [What's new in this version](#whats-new-in-this-version)
|
+ [What's new in version 5.0.2](#whats-new-in-version-502)
|
||||||
- [Version 4.9.0](#version-490)
|
|
||||||
+ [What's new in this version](#whats-new-in-this-version)
|
- [Version 5.0.0](#version-500)
|
||||||
|
+ [What's new in version 5.0.0](#whats-new-in-version-500)
|
||||||
+ [Compositing schema](#compositing-schema)
|
+ [Compositing schema](#compositing-schema)
|
||||||
+ [New main window styles](#new-main-window-styles)
|
+ [New main window styles](#new-main-window-styles)
|
||||||
+ [Virtual window](#virtual-window)
|
+ [Virtual window](#virtual-window)
|
||||||
@@ -12,46 +13,40 @@
|
|||||||
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
||||||
+ [Deprecated APIs](#deprecated-apis)
|
+ [Deprecated APIs](#deprecated-apis)
|
||||||
|
|
||||||
## Version 4.9.1
|
## Version 5.0.2
|
||||||
|
|
||||||
The MiniGUI development team announces the availability of MiniGUI 4.9.1,
|
The MiniGUI development team announces the availability of MiniGUI 5.0.2,
|
||||||
which is the second preview release of MiniGUI 5.0.0.
|
which is the bug fixing release of MiniGUI 5.0.x.
|
||||||
|
|
||||||
This is an unstable release to show you some new and exciting features.
|
### What's new in version 5.0.2
|
||||||
Here `unstable` means that the new APIs we introduced in this version
|
|
||||||
may change in the official release.
|
|
||||||
|
|
||||||
Nevertheless, we did our best to ensure backward compatibility of the
|
In this version, we tuned some code for GCC 9 and fixed some bugs:
|
||||||
existed APIs so that the old applications can smoothly migrate to the new
|
|
||||||
version. We recommend that you test this version and report any bugs and
|
* BUGFIXING:
|
||||||
|
- Initialize `cfg_res_path` in function `__sysres_get_system_res_path()`.
|
||||||
|
- Always return TRUE in `subtract_rgn_by_node()`.
|
||||||
|
* ADJUSTMENTS:
|
||||||
|
- Use upstream Harfbuzz for glyph shaping of complex scripts instead
|
||||||
|
of the modified version.
|
||||||
|
* TUNING:
|
||||||
|
- Tune some code to depress compilation warnings.
|
||||||
|
|
||||||
|
## Version 5.0.0
|
||||||
|
|
||||||
|
The MiniGUI development team announces the availability of MiniGUI 5.0.0,
|
||||||
|
which is the first official release of MiniGUI 5.0.x.
|
||||||
|
|
||||||
|
This version brings us some new and exciting features, and we did our best
|
||||||
|
to ensure backward compatibility of the existed APIs so that the old
|
||||||
|
applications can smoothly migrate to the new version.
|
||||||
|
We recommend that you use this version and report any bugs and
|
||||||
incompatibilities in
|
incompatibilities in
|
||||||
|
|
||||||
<https://github.com/VincentWei/minigui/tree/dev-4-1>
|
<https://github.com/VincentWei/minigui/tree/rel-5-0>
|
||||||
|
|
||||||
### What's new in this version
|
### What's new in version 5.0.0
|
||||||
|
|
||||||
- Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema.
|
In the development of version 5.0.x, we introduced the following new and
|
||||||
- Fix some bugs.
|
|
||||||
|
|
||||||
## Version 4.9.0
|
|
||||||
|
|
||||||
The MiniGUI development team announces the availability of MiniGUI 4.9.0,
|
|
||||||
which is the first preview release of MiniGUI 5.0.0.
|
|
||||||
|
|
||||||
This is an unstable release to show you some new and exciting features.
|
|
||||||
Here `unstable` means that the new APIs we introduced in this version
|
|
||||||
may change in the official release.
|
|
||||||
|
|
||||||
Nevertheless, we did our best to ensure backward compatibility of the
|
|
||||||
existed APIs so that the old applications can smoothly migrate to the new
|
|
||||||
version. We recommend that you test this version and report any bugs and
|
|
||||||
incompatibilities in
|
|
||||||
|
|
||||||
<https://github.com/VincentWei/minigui/tree/dev-4-1>
|
|
||||||
|
|
||||||
### What's new in this version
|
|
||||||
|
|
||||||
In the development of version 4.9.x, we introduced the following new and
|
|
||||||
exciting features for MiniGUI:
|
exciting features for MiniGUI:
|
||||||
|
|
||||||
* ENHANCEMENTS:
|
* ENHANCEMENTS:
|
||||||
@@ -89,6 +84,15 @@ exciting features for MiniGUI:
|
|||||||
* ADJUSTMENTS:
|
* ADJUSTMENTS:
|
||||||
- `g_rcScr` now is defined a macro calling function `GetScreenRect()`.
|
- `g_rcScr` now is defined a macro calling function `GetScreenRect()`.
|
||||||
- `mgIsServer` now is define a macro calling function `IsServer()`.
|
- `mgIsServer` now is define a macro calling function `IsServer()`.
|
||||||
|
* TUNING
|
||||||
|
- Tune the `drm` (DRM) engine to support MiniGUI-Processes runtime mode
|
||||||
|
and compositing schema.
|
||||||
|
- Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema.
|
||||||
|
- Tune the `commlcd` (common LCD) engine to support cumulative updating and
|
||||||
|
compositing schema.
|
||||||
|
- Tune the `dummy` GAL engine to support MiniGUI-Processes runtime mode.
|
||||||
|
compositing schema.
|
||||||
|
- Fix some bugs.
|
||||||
* CLEANUP:
|
* CLEANUP:
|
||||||
- Cleaned up a lot of internal symbols (the external functions and
|
- Cleaned up a lot of internal symbols (the external functions and
|
||||||
global variables) in order to avoid name polution.
|
global variables) in order to avoid name polution.
|
||||||
@@ -96,15 +100,6 @@ exciting features for MiniGUI:
|
|||||||
message queue, event/message handling, and part of graphics abstract
|
message queue, event/message handling, and part of graphics abstract
|
||||||
layer.
|
layer.
|
||||||
|
|
||||||
The following new features will be developed in the successive versions of
|
|
||||||
4.9.x:
|
|
||||||
|
|
||||||
- Enhance DRM engine to support MiniGUI-Processes runtime mode and the
|
|
||||||
compositing schema.
|
|
||||||
- Enhance other frequently used GAL engines to support compositing schema.
|
|
||||||
- Provide a customized compositor which provides window animation effects as
|
|
||||||
an example in `mg-demos`.
|
|
||||||
|
|
||||||
### Compositing schema
|
### Compositing schema
|
||||||
|
|
||||||
In this version, we enhanced the MiniGUI-Processes runtime mode to support
|
In this version, we enhanced the MiniGUI-Processes runtime mode to support
|
||||||
|
|||||||
+4
-4
@@ -1,11 +1,11 @@
|
|||||||
Version 4.9.1 (2019/03/11)
|
Version 5.0.0 (2019/03/30)
|
||||||
|
|
||||||
This is the second preview version of MiniGUI 5.0.0, an unstable version.
|
This is the first official release of MiniGUI 5.0.x, the stable version.
|
||||||
|
|
||||||
Other packages for MiniGUI resource, tools, components, and samples:
|
Other packages for MiniGUI resource, tools, components, and samples:
|
||||||
|
|
||||||
- GVFB: `gvfb-1.2.4.tar.gz`
|
- GVFB: `gvfb-1.2.5.tar.gz`
|
||||||
- The resource package: `minigui-res-4.0.0.tar.gz`
|
- The resource package: `minigui-res-5.0.0.tar.gz`
|
||||||
- mGUtils component: `libmgutils-1.5.0.tar.gz`
|
- mGUtils component: `libmgutils-1.5.0.tar.gz`
|
||||||
- mGPlus component: `libmgplus-1.5.0.tar.gz`
|
- mGPlus component: `libmgplus-1.5.0.tar.gz`
|
||||||
- mGEff component: `libmgeff-1.5.0.tar.gz`
|
- mGEff component: `libmgeff-1.5.0.tar.gz`
|
||||||
|
|||||||
+6
-1
@@ -172,5 +172,10 @@ tab2space() {
|
|||||||
# sed -i 's/\<checkAndGetMainWindowPtrOfMainWin\>/checkAndGetMainWinIfMainWin/g' `grep '\<checkAndGetMainWindowPtrOfMainWin\>' -rl include/ src/`
|
# sed -i 's/\<checkAndGetMainWindowPtrOfMainWin\>/checkAndGetMainWinIfMainWin/g' `grep '\<checkAndGetMainWindowPtrOfMainWin\>' -rl include/ src/`
|
||||||
# sed -i 's/\<checkAndGetMainWindowPtrOfControl\>/checkAndGetMainWinIfWindow/g' `grep '\<checkAndGetMainWindowPtrOfControl\>' -rl include/ src/`
|
# sed -i 's/\<checkAndGetMainWindowPtrOfControl\>/checkAndGetMainWinIfWindow/g' `grep '\<checkAndGetMainWindowPtrOfControl\>' -rl include/ src/`
|
||||||
|
|
||||||
sed -i 's/\<mg_GetMsgQueueForThisThread\>/getMsgQueueForThisThread/g' `grep '\<mg_GetMsgQueueForThisThread\>' -rl include/ src/`
|
# sed -i 's/\<mg_GetMsgQueueForThisThread\>/getMsgQueueForThisThread/g' `grep '\<mg_GetMsgQueueForThisThread\>' -rl include/ src/`
|
||||||
|
|
||||||
|
# sed -i 's/\<IS_SHAREDFB_SCHEMA\>/IS_SHAREDFB_SCHEMA_PROCS/g' `grep '\<IS_SHAREDFB_SCHEMA\>' -rl include/ src/`
|
||||||
|
|
||||||
|
sed -i 's/\<REQID_GETWPSURFACE\>/REQID_GETSHAREDSURFACE/g' `grep '\<REQID_GETWPSURFACE\>' -rl include/ src/`
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
+9
-9
@@ -1,6 +1,6 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ(2.60)
|
||||||
AC_INIT(libminigui, 4.9.1)
|
AC_INIT(libminigui, 5.0.2)
|
||||||
AC_CONFIG_SRCDIR(src/main/main.c)
|
AC_CONFIG_SRCDIR(src/main/main.c)
|
||||||
|
|
||||||
dnl Set various version strings - taken gratefully from the SDL sources
|
dnl Set various version strings - taken gratefully from the SDL sources
|
||||||
@@ -14,11 +14,11 @@ dnl Set various version strings - taken gratefully from the SDL sources
|
|||||||
# if backwards compatibility has been broken,
|
# if backwards compatibility has been broken,
|
||||||
# set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0.
|
# set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0.
|
||||||
#
|
#
|
||||||
MINIGUI_MAJOR_VERSION=4
|
MINIGUI_MAJOR_VERSION=5
|
||||||
MINIGUI_MINOR_VERSION=9
|
MINIGUI_MINOR_VERSION=0
|
||||||
MINIGUI_MICRO_VERSION=1
|
MINIGUI_MICRO_VERSION=2
|
||||||
MINIGUI_INTERFACE_AGE=1
|
MINIGUI_INTERFACE_AGE=2
|
||||||
MINIGUI_BINARY_AGE=1
|
MINIGUI_BINARY_AGE=2
|
||||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||||
|
|
||||||
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
||||||
@@ -94,7 +94,7 @@ osname="unspecified"
|
|||||||
runtime_mode="procs"
|
runtime_mode="procs"
|
||||||
compositing_schema="no"
|
compositing_schema="no"
|
||||||
virtual_window="no"
|
virtual_window="no"
|
||||||
use_shmopen="no"
|
use_shmopen="yes"
|
||||||
mgslice_use_fallback="no"
|
mgslice_use_fallback="no"
|
||||||
|
|
||||||
incore_res="no"
|
incore_res="no"
|
||||||
@@ -2143,7 +2143,7 @@ if test "x$build_ttf_support" = "xyes"; then
|
|||||||
if test "x$build_complex_scripts" = "xyes"; then
|
if test "x$build_complex_scripts" = "xyes"; then
|
||||||
dnl Check for HarfBuzz library
|
dnl Check for HarfBuzz library
|
||||||
AC_CHECK_LIB(harfbuzz, hb_version,
|
AC_CHECK_LIB(harfbuzz, hb_version,
|
||||||
DEP_LIBS="$DEP_LIBS -lharfbuzzex -lfreetype",
|
DEP_LIBS="$DEP_LIBS -lharfbuzz -lfreetype",
|
||||||
build_complex_scripts="no; support for complex scripts requires libharfbuzz")
|
build_complex_scripts="no; support for complex scripts requires libharfbuzz")
|
||||||
else
|
else
|
||||||
DEP_LIBS="$DEP_LIBS -lfreetype",
|
DEP_LIBS="$DEP_LIBS -lfreetype",
|
||||||
@@ -2223,7 +2223,7 @@ if test "x$build_complex_scripts" = "xyes"; then
|
|||||||
[ --with-hb-includes=DIR where the HarfBuzz includes are])
|
[ --with-hb-includes=DIR where the HarfBuzz includes are])
|
||||||
|
|
||||||
if test "x$with_hb_includes" = "x"; then
|
if test "x$with_hb_includes" = "x"; then
|
||||||
HB_INC_DIR="-I/usr/local/include/harfbuzz"
|
HB_INC_DIR="-I/usr/include/harfbuzz"
|
||||||
else
|
else
|
||||||
HB_INC_DIR="-I$with_hb_includes"
|
HB_INC_DIR="-I$with_hb_includes"
|
||||||
fi
|
fi
|
||||||
|
|||||||
+7
-1
@@ -72,9 +72,15 @@ device=/dev/dri/card0
|
|||||||
# The default value is 96.
|
# The default value is 96.
|
||||||
dpi=96
|
dpi=96
|
||||||
|
|
||||||
|
# Whether double buffering is enabled.
|
||||||
|
# Use `true` or `yes` for enabled, anything else for disabled.
|
||||||
|
# Note that under compositing schema, double buffering is always enabled.
|
||||||
|
# Since 5.0.0.
|
||||||
|
double_buffering=true
|
||||||
|
|
||||||
# The filename of the shared library for the external driver.
|
# The filename of the shared library for the external driver.
|
||||||
# The equivalent environment variable: MG_GAL_DRM_DRIVER
|
# The equivalent environment variable: MG_GAL_DRM_DRIVER
|
||||||
exdriver=libhidrmdrivers.so.0
|
exdriver=libhidrmdrivers-0.2.so.0
|
||||||
#}}
|
#}}
|
||||||
|
|
||||||
#{{ifdef _MGIAL_LIBINPUT
|
#{{ifdef _MGIAL_LIBINPUT
|
||||||
|
|||||||
+162
-86
@@ -92,64 +92,73 @@ struct _DrmDriver;
|
|||||||
typedef struct _DrmDriver DrmDriver;
|
typedef struct _DrmDriver DrmDriver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The struct type represents the bufffer can be used by
|
* The structure type represents the buffer can be used by
|
||||||
* MiniGUI NEWGAL engine for hardware surface.
|
* MiniGUI NEWGAL DRM engine for a hardware surface.
|
||||||
*/
|
*/
|
||||||
typedef struct _DrmSurfaceBuffer {
|
typedef struct _DrmSurfaceBuffer {
|
||||||
/** The prime fd of the buffer */
|
|
||||||
int prime_fd;
|
|
||||||
/** The global name of the buffer */
|
|
||||||
uint32_t name;
|
|
||||||
/** The local handle of the buffer */
|
/** The local handle of the buffer */
|
||||||
uint32_t handle;
|
uint32_t handle;
|
||||||
/** The buffer identifier */
|
|
||||||
uint32_t id;
|
|
||||||
/** The widht of the buffer */
|
|
||||||
uint32_t width;
|
|
||||||
/** The height of the buffer */
|
|
||||||
uint32_t height;
|
|
||||||
/** The pitch (row stride in bytes) of the buffer */
|
|
||||||
uint32_t pitch;
|
|
||||||
/** The DRM format of the buffer */
|
|
||||||
uint32_t drm_format;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The prime file descriptor of the buffer.
|
||||||
|
* It has a value >= 0 when this buffer has a prime file descriptor;
|
||||||
|
* otherwise it has the value -1;
|
||||||
|
*/
|
||||||
|
int prime_fd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The global name of the buffer.
|
||||||
|
* It has value > 0 when this buffer has a global name;
|
||||||
|
* otherwise it has the value 0;
|
||||||
|
*/
|
||||||
|
uint32_t name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The frame buffer identifier if the buffer has been added as a
|
||||||
|
* frame buffer to the system, otherwise it has the value 0.
|
||||||
|
*/
|
||||||
|
uint32_t fb_id;
|
||||||
|
|
||||||
|
/** The DRM format of the buffer. */
|
||||||
|
uint32_t drm_format;
|
||||||
/** The bits per pixel */
|
/** The bits per pixel */
|
||||||
uint32_t bpp:8;
|
uint32_t bpp:8;
|
||||||
/** The bytes per pixel */
|
/** The bytes per pixel */
|
||||||
uint32_t cpp:8;
|
uint32_t cpp:8;
|
||||||
/** Is foreign surface */
|
/** Is it a dumb buffer. Since 5.0.0. */
|
||||||
uint32_t foreign:1;
|
uint32_t dumb:1;
|
||||||
|
/** Is it a scanout buffer. Since 5.0.0. */
|
||||||
|
uint32_t scanout:1;
|
||||||
|
|
||||||
|
/** The width of the buffer. */
|
||||||
|
uint32_t width;
|
||||||
|
/** The height of the buffer. */
|
||||||
|
uint32_t height;
|
||||||
|
/** The pitch (row stride in bytes) of the buffer. */
|
||||||
|
uint32_t pitch;
|
||||||
|
|
||||||
/** The whole size in bytes of the buffer */
|
/** The whole size in bytes of the buffer */
|
||||||
unsigned long size;
|
size_t size;
|
||||||
/** The mapped address of the buffer; NULL when the buffer is not mapped yet. */
|
|
||||||
uint8_t* pixels;
|
/**
|
||||||
|
* The offset from the buffer start to the real pixel data in bytes.
|
||||||
|
* It must be equal to or larger than the size of the buffer header.
|
||||||
|
* Since 5.0.0.
|
||||||
|
*/
|
||||||
|
off_t offset;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The mapped address of the buffer;
|
||||||
|
* NULL when the buffer is not mapped yet.
|
||||||
|
*
|
||||||
|
* The address of the pixel data:
|
||||||
|
* uint8_t* pixels = this->buff + this->offset;
|
||||||
|
*/
|
||||||
|
uint8_t* buff;
|
||||||
} DrmSurfaceBuffer;
|
} DrmSurfaceBuffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The color logic operations.
|
* The structure type defines the operations for a DRM driver.
|
||||||
*/
|
|
||||||
enum DrmColorLogicOp {
|
|
||||||
COLOR_LOGICOP_COPY = 0,
|
|
||||||
COLOR_LOGICOP_COPY_INVERTED,
|
|
||||||
COLOR_LOGICOP_CLEAR,
|
|
||||||
COLOR_LOGICOP_SET,
|
|
||||||
COLOR_LOGICOP_NOR,
|
|
||||||
COLOR_LOGICOP_NAND,
|
|
||||||
COLOR_LOGICOP_EQUIV,
|
|
||||||
COLOR_LOGICOP_INVERT,
|
|
||||||
COLOR_LOGICOP_XOR,
|
|
||||||
COLOR_LOGICOP_AND,
|
|
||||||
COLOR_LOGICOP_AND_INVERTED,
|
|
||||||
COLOR_LOGICOP_AND_REVERSE,
|
|
||||||
COLOR_LOGICOP_OR,
|
|
||||||
COLOR_LOGICOP_OR_INVERTED,
|
|
||||||
COLOR_LOGICOP_OR_REVERSE,
|
|
||||||
COLOR_LOGICOP_NOOP,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The struct type defines the operations for a DRI driver.
|
|
||||||
*/
|
*/
|
||||||
typedef struct _DrmDriverOps {
|
typedef struct _DrmDriverOps {
|
||||||
/**
|
/**
|
||||||
@@ -160,81 +169,95 @@ typedef struct _DrmDriverOps {
|
|||||||
DrmDriver* (*create_driver) (int device_fd);
|
DrmDriver* (*create_driver) (int device_fd);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation destroies the DrmDriver object.
|
* This operation destroys the DrmDriver object.
|
||||||
*
|
*
|
||||||
* \note The driver must implement this operation.
|
* \note The driver must implement this operation.
|
||||||
*/
|
*/
|
||||||
void (*destroy_driver) (DrmDriver *driver);
|
void (*destroy_driver) (DrmDriver *driver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation flushs the batch buffer of the driver or the hardware cache.
|
* This operation flushes the batch buffer of the driver or
|
||||||
|
* the hardware cache.
|
||||||
*
|
*
|
||||||
* \note This operation can be NULL.
|
* \note This operation can be NULL.
|
||||||
*/
|
*/
|
||||||
void (* flush_driver) (DrmDriver *driver);
|
void (* flush_driver) (DrmDriver *driver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation creates a buffer with the specified pixel format,
|
* This operation creates a surface buffer with the specified pixel format,
|
||||||
* width, and height. If succeed, a valid DrmSurfaceBuffer object will
|
* header size, width, and height. If succeed, a valid DrmSurfaceBuffer
|
||||||
* be returned; NULL on error. Note that the field of `pixels` of the
|
* object will be returned; NULL on error. Note that the field of `buff`
|
||||||
* DrmSurfaceBuffer object is NULL until the \a map_buffer was called.
|
* of the DrmSurfaceBuffer object is NULL until the \a map_buffer was called.
|
||||||
*
|
*
|
||||||
* \note The driver must implement this operation.
|
* \note The driver must implement this operation and fill all fields of
|
||||||
|
* the new DrmSurfaceBuffer object.
|
||||||
*/
|
*/
|
||||||
DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver,
|
DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver,
|
||||||
uint32_t drm_format,
|
uint32_t drm_format, uint32_t hdr_size,
|
||||||
unsigned int width, unsigned int height);
|
uint32_t width, uint32_t height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation creates a buffer for the given handle
|
* This operation creates a buffer from a given and possibly foreign handle
|
||||||
* with the specified pixel format, width, and height. If succeed,
|
* with the size of the buffer. If succeed, a valid DrmSurfaceBuffer object
|
||||||
* a valid DrmSurfaceBuffer object will be returned; NULL on error.
|
* will be returned; NULL on error.
|
||||||
*
|
*
|
||||||
* \note This operation can be NULL.
|
* \note This operation can be NULL. Note that the handle might was created
|
||||||
|
* by a foreign module. If implemented, the driver must
|
||||||
|
* fill the correct prime_fd, handle, name, and size fields of the new
|
||||||
|
* DrmSurfaceBuffer object.
|
||||||
*/
|
*/
|
||||||
DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver,
|
DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver,
|
||||||
uint32_t handle, unsigned long size, uint32_t drm_format,
|
uint32_t handle, size_t size);
|
||||||
unsigned int width, unsigned int height, unsigned int pitch);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation creates a buffer for the given system global name
|
* This operation creates a buffer for the given system global name
|
||||||
* with the specified pixel format, width, and height. If succeed,
|
* If succeed, a valid DrmSurfaceBuffer object will be returned;
|
||||||
* a valid DrmSurfaceBuffer object will be returned; NULL on error.
|
* NULL on error.
|
||||||
*
|
*
|
||||||
* \note This operation can be NULL.
|
* \note This operation can be NULL. If implemented, the driver must
|
||||||
|
* fill the correct prime_fd, handle, name, and size fields of the new
|
||||||
|
* DrmSurfaceBuffer object.
|
||||||
*/
|
*/
|
||||||
DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver,
|
DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver,
|
||||||
uint32_t name, uint32_t drm_format,
|
uint32_t name);
|
||||||
unsigned int width, unsigned int height, unsigned int pitch);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation creates a buffer for the given PRIME file descriptor
|
* This operation creates a buffer for the given PRIME file descriptor
|
||||||
* with the specified pixel format, width, height, and pitch. If succeed,
|
* with the specified pixel format, width, height, and pitch. If succeed,
|
||||||
* a valid DrmSurfaceBuffer object will be returned; NULL on error.
|
* a valid DrmSurfaceBuffer object will be returned; NULL on error.
|
||||||
*
|
*
|
||||||
* \note This operation can be NULL.
|
* \note This operation can be NULL. If implemented, the driver must
|
||||||
|
* fill the correct prime_fd, handle, name, and size fields of the new
|
||||||
|
* DrmSurfaceBuffer object.
|
||||||
*/
|
*/
|
||||||
DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver,
|
DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver,
|
||||||
int prime_fd, unsigned long size, uint32_t drm_format,
|
int prime_fd, size_t size);
|
||||||
unsigned int width, unsigned int height, unsigned int pitch);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation maps the buffer into the current process's virtual memory
|
* This operation maps the buffer into the current process's virtual memory
|
||||||
* space, and returns the virtual address. If failed, it returns NULL.
|
* space, and returns the virtual address. If failed, it returns NULL.
|
||||||
*
|
*
|
||||||
* \note The driver must implement this operation.
|
* When \a for_scanout is not zero, the buffer will be used for scan out
|
||||||
|
* frame buffer.
|
||||||
|
*
|
||||||
|
* \note The driver must implement this operation. The driver must
|
||||||
|
* set a valid value for buff field of the DrmSurfaceBuffer object
|
||||||
|
* on success.
|
||||||
*/
|
*/
|
||||||
uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
|
uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer,
|
||||||
|
int for_scanout);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation un-maps a buffer.
|
* This operation un-maps a buffer.
|
||||||
*
|
*
|
||||||
* \note The driver must implement this operation.
|
* \note The driver must implement this operation. The driver must
|
||||||
|
* set NULL for buff field of the DrmSurfaceBuffer object
|
||||||
|
* on success.
|
||||||
*/
|
*/
|
||||||
void (* unmap_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
|
void (* unmap_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation destroies a buffer.
|
* This operation destroys a buffer.
|
||||||
*
|
*
|
||||||
* \note The driver must implement this operation.
|
* \note The driver must implement this operation.
|
||||||
*/
|
*/
|
||||||
@@ -256,7 +279,7 @@ typedef struct _DrmDriverOps {
|
|||||||
* If succeed, it returns 0.
|
* If succeed, it returns 0.
|
||||||
*
|
*
|
||||||
* \note If this operation is set as NULL, it will be supposed that
|
* \note If this operation is set as NULL, it will be supposed that
|
||||||
* the driver does not support any hardware accelerated blit operation.
|
* the driver does not support any hardware accelerated blitting operation.
|
||||||
*/
|
*/
|
||||||
int (* check_blit) (DrmDriver *driver,
|
int (* check_blit) (DrmDriver *driver,
|
||||||
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
|
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
|
||||||
@@ -265,51 +288,104 @@ typedef struct _DrmDriverOps {
|
|||||||
* This operation copies bits from a source buffer to a destination buffer.
|
* This operation copies bits from a source buffer to a destination buffer.
|
||||||
*
|
*
|
||||||
* \note If this operation is set as NULL, the driver does not support
|
* \note If this operation is set as NULL, the driver does not support
|
||||||
* hardware accelerated copy blit.
|
* hardware accelerated copy blitting.
|
||||||
|
*
|
||||||
|
* \note Currently, the logical operation is ignored.
|
||||||
*/
|
*/
|
||||||
int (* copy_blit) (DrmDriver *driver,
|
int (* copy_blit) (DrmDriver *driver,
|
||||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||||
enum DrmColorLogicOp logic_op);
|
ColorLogicalOp logic_op);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation blits pixles from a source buffer with the source alpha value
|
* This operation blits pixels from a source buffer with the source alpha
|
||||||
* specified to a destination buffer.
|
* value specified to a destination buffer.
|
||||||
*
|
*
|
||||||
* \note If this operation is set as NULL, the driver does not support
|
* \note If this operation is set as NULL, the driver does not support
|
||||||
* hardware accelerated blit with alpha.
|
* hardware accelerated blitting with alpha.
|
||||||
*/
|
*/
|
||||||
int (* alpha_blit) (DrmDriver *driver,
|
int (* alpha_blit) (DrmDriver *driver,
|
||||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint8_t alpha);
|
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||||
|
uint8_t alpha);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation blits pixles from a source buffer to a destination buffer,
|
* This operation blits pixels from a source buffer to a destination buffer,
|
||||||
* but skipping the pixel value specified by \a color_key.
|
* but skipping the pixel value specified by \a color_key.
|
||||||
*
|
*
|
||||||
* \note If this operation is set as NULL, the driver does not support
|
* \note If this operation is set as NULL, the driver does not support
|
||||||
* hardware accelerated blit with color key.
|
* hardware accelerated blitting with color key.
|
||||||
*/
|
*/
|
||||||
int (* key_blit) (DrmDriver *driver,
|
int (* key_blit) (DrmDriver *driver,
|
||||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint32_t color_key);
|
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||||
|
uint32_t color_key);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation blits pixles from a source buffer with the source alpha value
|
* This operation blits pixels from a source buffer with the source alpha
|
||||||
* specified to a destination buffer, but skipping the pixel value specified.
|
* value specified to a destination buffer, but skipping the pixel value
|
||||||
|
* specified.
|
||||||
*
|
*
|
||||||
* \note If this operation is set as NULL, the driver does not support
|
* \note If this operation is set as NULL, the driver does not support
|
||||||
* hardware accelerated blit with alpha and color key.
|
* hardware accelerated blitting with alpha and color key.
|
||||||
*/
|
*/
|
||||||
int (* alpha_key_blit) (DrmDriver *driver,
|
int (* alpha_key_blit) (DrmDriver *driver,
|
||||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||||
uint8_t alpha, uint32_t color_key);
|
uint8_t alpha, uint32_t color_key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This operation blits pixels from a source buffer with the source alpha
|
||||||
|
* value of pixels to the destination buffer, and with the specified color
|
||||||
|
* compositing/blending method (\a ColorBlendMethod).
|
||||||
|
*
|
||||||
|
* \note If this operation is set as NULL, the driver does not support
|
||||||
|
* hardware accelerated blitting with alpha on basis per pixel.
|
||||||
|
*
|
||||||
|
* \note Currently, the color compositing/blending method is ignored.
|
||||||
|
*/
|
||||||
|
int (* alpha_pixel_blit) (DrmDriver *driver,
|
||||||
|
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||||
|
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||||
|
ColorBlendMethod blend_method);
|
||||||
|
|
||||||
} DrmDriverOps;
|
} DrmDriverOps;
|
||||||
|
|
||||||
/** Implement this stub to return the DRI driver operations */
|
/** The current version of DRM driver. */
|
||||||
DrmDriverOps* __drm_ex_driver_get (const char* driver_name, int device_fd);
|
#define DRM_DRIVER_VERSION 1
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implement this stub to return the DRI driver operations
|
||||||
|
*
|
||||||
|
* This function takes three arguments and returns NULL or
|
||||||
|
* a valid pointer of DrmDriverOps to MiniGUI.
|
||||||
|
*
|
||||||
|
* This function can return different DrmDriverOps to MiniGUI according to
|
||||||
|
* the driver name and device file descriptor. In this way, your DRM engine
|
||||||
|
* driver implementation can support multiple GPUs.
|
||||||
|
*
|
||||||
|
* If the external stub returns NULL, MiniGUI will try to use the dumb
|
||||||
|
* frame buffer instead.
|
||||||
|
*
|
||||||
|
* \param driver_name This argument gives the driver name determined
|
||||||
|
* by MiniGUI. Generally, it is the kernel driver name for your GPU.
|
||||||
|
* For example, for Intel i915/i965 GPUs, the driver name will be `i915`.
|
||||||
|
* \param device_fd This argument gives the file descriptor of the
|
||||||
|
* opened DRI device.
|
||||||
|
* \param version A pointer to an integer which will be used to return
|
||||||
|
* the interface version of the DRM engine driver.
|
||||||
|
*
|
||||||
|
* \return NULL or a valid pointer to DrmDriverOps.
|
||||||
|
*
|
||||||
|
* \note We use the version control since 4.0.7. It will be initialized
|
||||||
|
* to zero by MiniGUI before calling this function. Because an old
|
||||||
|
* driver for MiniGUI 4.0.6 or earlier will not change the value,
|
||||||
|
* MiniGUI will deny to load the old driver.
|
||||||
|
*
|
||||||
|
* The constant \a DRM_DRIVER_VERSION defines the current version code.
|
||||||
|
*/
|
||||||
|
DrmDriverOps* __drm_ex_driver_get (const char* driver_name, int device_fd,
|
||||||
|
int* version);
|
||||||
|
|
||||||
/** @} end of external_stubs_dri */
|
/** @} end of external_stubs_dri */
|
||||||
|
|
||||||
|
|||||||
+65
-32
@@ -5304,22 +5304,22 @@ typedef enum {
|
|||||||
* The color logical operations.
|
* The color logical operations.
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
COLOR_LOGIC_OP_COPY = 0,
|
COLOR_LOGICOP_CLEAR = 0,
|
||||||
COLOR_LOGIC_OP_COPY_INVERTED,
|
COLOR_LOGICOP_NOR,
|
||||||
COLOR_LOGIC_OP_CLEAR,
|
COLOR_LOGICOP_AND_INVERTED,
|
||||||
COLOR_LOGIC_OP_SET,
|
COLOR_LOGICOP_COPY_INVERTED,
|
||||||
COLOR_LOGIC_OP_NOR,
|
COLOR_LOGICOP_AND_REVERSE,
|
||||||
COLOR_LOGIC_OP_NAND,
|
COLOR_LOGICOP_INVERT,
|
||||||
COLOR_LOGIC_OP_EQUIV,
|
COLOR_LOGICOP_XOR,
|
||||||
COLOR_LOGIC_OP_INVERT,
|
COLOR_LOGICOP_NAND,
|
||||||
COLOR_LOGIC_OP_XOR,
|
COLOR_LOGICOP_AND,
|
||||||
COLOR_LOGIC_OP_AND,
|
COLOR_LOGICOP_EQUIV,
|
||||||
COLOR_LOGIC_OP_AND_INVERTED,
|
COLOR_LOGICOP_NOOP0,
|
||||||
COLOR_LOGIC_OP_AND_REVERSE,
|
COLOR_LOGICOP_OR_INVERTED1,
|
||||||
COLOR_LOGIC_OP_OR,
|
COLOR_LOGICOP_COPY,
|
||||||
COLOR_LOGIC_OP_OR_INVERTED,
|
COLOR_LOGICOP_OR_REVERSE,
|
||||||
COLOR_LOGIC_OP_OR_REVERSE,
|
COLOR_LOGICOP_OR,
|
||||||
COLOR_LOGIC_OP_NOOP,
|
COLOR_LOGICOP_SET,
|
||||||
} ColorLogicalOp;
|
} ColorLogicalOp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14345,14 +14345,18 @@ MG_EXPORT int drmGetDeviceFD (GHANDLE video);
|
|||||||
* THe struct type defines the DRM surface information.
|
* THe struct type defines the DRM surface information.
|
||||||
*/
|
*/
|
||||||
typedef struct _DrmSurfaceInfo {
|
typedef struct _DrmSurfaceInfo {
|
||||||
/** The prime fd of the buffer object. */
|
|
||||||
int prime_fd;
|
|
||||||
/** The global name of the buffer object. */
|
|
||||||
uint32_t name;
|
|
||||||
/** The local handle of the buffer object. */
|
/** The local handle of the buffer object. */
|
||||||
uint32_t handle;
|
uint32_t handle;
|
||||||
/** The buffer identifier. */
|
/** The prime fd of the buffer object. If it was no exported as a global
|
||||||
uint32_t id;
|
buffer object, it has the value -1. */
|
||||||
|
int prime_fd;
|
||||||
|
/** The global name of the buffer object. It has the value 0 when it was
|
||||||
|
not expored as global buffer object. */
|
||||||
|
uint32_t name;
|
||||||
|
/** The frame buffer identifier. If the buffer was not added as
|
||||||
|
a frame buffer to the system, it has the value 0. */
|
||||||
|
uint32_t fb_id;
|
||||||
|
|
||||||
/** The width of the surface. */
|
/** The width of the surface. */
|
||||||
uint32_t width;
|
uint32_t width;
|
||||||
/** The height of the surface. */
|
/** The height of the surface. */
|
||||||
@@ -14362,7 +14366,9 @@ typedef struct _DrmSurfaceInfo {
|
|||||||
/** The DRM pixel format. */
|
/** The DRM pixel format. */
|
||||||
uint32_t drm_format;
|
uint32_t drm_format;
|
||||||
/** Size in bytes of the buffer object. */
|
/** Size in bytes of the buffer object. */
|
||||||
unsigned long size;
|
size_t size;
|
||||||
|
/** The offset from the buffer start to the real pixel data. */
|
||||||
|
off_t offset;
|
||||||
} DrmSurfaceInfo;
|
} DrmSurfaceInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14384,15 +14390,24 @@ MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info);
|
|||||||
* \param video The video handle.
|
* \param video The video handle.
|
||||||
* \param name The name handle of the DRM surface.
|
* \param name The name handle of the DRM surface.
|
||||||
* \param drm_format The DRM pixel format.
|
* \param drm_format The DRM pixel format.
|
||||||
|
* \param offset The offset from the buffer start to the real pixel data.
|
||||||
* \param width The width of the DRM surface.
|
* \param width The width of the DRM surface.
|
||||||
* \param height The height of the DRM surface.
|
* \param height The height of the DRM surface.
|
||||||
* \param pitch The pitch (row stride) of the DRM surface.
|
* \param pitch The pitch (row stride) of the DRM surface.
|
||||||
*
|
*
|
||||||
* \return The handle to the memory DC for success, HDC_INVALID for failure.
|
* \return The handle to the memory DC for success, HDC_INVALID for failure.
|
||||||
*/
|
*/
|
||||||
MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
|
MG_EXPORT HDC drmCreateDCFromNameEx (GHANDLE video,
|
||||||
uint32_t name, uint32_t drm_format,
|
uint32_t name, uint32_t drm_format, off_t offset,
|
||||||
unsigned int width, unsigned int height, uint32_t pitch);
|
uint32_t width, uint32_t height, uint32_t pitch);
|
||||||
|
|
||||||
|
static inline HDC drmCreateDCFromName (GHANDLE video,
|
||||||
|
uint32_t name, uint32_t drm_format,
|
||||||
|
uint32_t width, uint32_t height, uint32_t pitch)
|
||||||
|
{
|
||||||
|
return drmCreateDCFromNameEx (video,
|
||||||
|
name, drm_format, 0, width, height, pitch);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a memory DC with a DRM surface which is created by
|
* This function creates a memory DC with a DRM surface which is created by
|
||||||
@@ -14402,15 +14417,24 @@ MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
|
|||||||
* \param prime_fd The PRIME file descriptor.
|
* \param prime_fd The PRIME file descriptor.
|
||||||
* \param size The size of the DRM surface in bytes.
|
* \param size The size of the DRM surface in bytes.
|
||||||
* \param drm_format The DRM pixel format.
|
* \param drm_format The DRM pixel format.
|
||||||
|
* \param offset The offset from the buffer start to the real pixel data.
|
||||||
* \param width The width of the DRM surface.
|
* \param width The width of the DRM surface.
|
||||||
* \param height The height of the DRM surface.
|
* \param height The height of the DRM surface.
|
||||||
* \param pitch The pitch (row stride) of the DRM surface.
|
* \param pitch The pitch (row stride) of the DRM surface.
|
||||||
*
|
*
|
||||||
* \return The handle to the memory DC for success, HDC_INVALID for failure.
|
* \return The handle to the memory DC for success, HDC_INVALID for failure.
|
||||||
*/
|
*/
|
||||||
MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
MG_EXPORT HDC drmCreateDCFromPrimeFdEx (GHANDLE video,
|
||||||
int prime_fd, unsigned long size, uint32_t drm_format,
|
int prime_fd, size_t size, uint32_t drm_format, off_t offset,
|
||||||
unsigned int width, unsigned int height, uint32_t pitch);
|
uint32_t width, uint32_t height, uint32_t pitch);
|
||||||
|
|
||||||
|
static inline HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
||||||
|
int prime_fd, size_t size, uint32_t drm_format,
|
||||||
|
uint32_t width, uint32_t height, uint32_t pitch)
|
||||||
|
{
|
||||||
|
return drmCreateDCFromPrimeFdEx (video,
|
||||||
|
prime_fd, size, drm_format, 0, width, height, pitch);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a memory DC with a DRM surface which is created by
|
* This function creates a memory DC with a DRM surface which is created by
|
||||||
@@ -14420,15 +14444,24 @@ MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
|||||||
* \param handle The handle of the DRM surface.
|
* \param handle The handle of the DRM surface.
|
||||||
* \param size The size of the DRM surface in bytes.
|
* \param size The size of the DRM surface in bytes.
|
||||||
* \param drm_format The DRM pixel format.
|
* \param drm_format The DRM pixel format.
|
||||||
|
* \param offset The offset from the buffer start to the real pixel data.
|
||||||
* \param width The width of the DRM surface.
|
* \param width The width of the DRM surface.
|
||||||
* \param height The height of the DRM surface.
|
* \param height The height of the DRM surface.
|
||||||
* \param pitch The pitch (row stride) of the DRM surface.
|
* \param pitch The pitch (row stride) of the DRM surface.
|
||||||
*
|
*
|
||||||
* \return The handle to the memory DC for success, HDC_INVALID for failure.
|
* \return The handle to the memory DC for success, HDC_INVALID for failure.
|
||||||
*/
|
*/
|
||||||
MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video,
|
MG_EXPORT HDC drmCreateDCFromHandleEx (GHANDLE video,
|
||||||
uint32_t handle, unsigned long size, uint32_t drm_format,
|
uint32_t handle, size_t size, uint32_t drm_format, off_t offset,
|
||||||
unsigned int width, unsigned int height, uint32_t pitch);
|
uint32_t width, uint32_t height, uint32_t pitch);
|
||||||
|
|
||||||
|
static inline HDC drmCreateDCFromHandle (GHANDLE video,
|
||||||
|
uint32_t handle, size_t size, uint32_t drm_format,
|
||||||
|
uint32_t width, uint32_t height, uint32_t pitch)
|
||||||
|
{
|
||||||
|
return drmCreateDCFromHandleEx (video,
|
||||||
|
handle, size, drm_format, 0, width, height, pitch);
|
||||||
|
}
|
||||||
|
|
||||||
/** @} end of gdi_drm_fns */
|
/** @} end of gdi_drm_fns */
|
||||||
|
|
||||||
|
|||||||
+35
-6
@@ -1574,23 +1574,44 @@ typedef struct _CompositorOps {
|
|||||||
*/
|
*/
|
||||||
void (*on_layer_op) (CompositorCtxt* ctxt, int layer_op,
|
void (*on_layer_op) (CompositorCtxt* ctxt, int layer_op,
|
||||||
MG_Layer* layer, MG_Client* client);
|
MG_Layer* layer, MG_Client* client);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This operation will be called when the server intends to composite
|
||||||
|
* the whole screen for the particular layer.
|
||||||
|
* The compositor can reset the dirty region for the layer.
|
||||||
|
* If it returns FALSE, the compositor will not handle the layer.
|
||||||
|
*/
|
||||||
|
BOOL (*reset_dirty_region) (CompositorCtxt* ctxt, MG_Layer* layer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation will be called when there are some dirty
|
* This operation will be called when there are some dirty
|
||||||
* rectangles in the specific popup menu z-node.
|
* rectangles in the specific popup menu z-node.
|
||||||
|
* The compositor should merge the dirty rectangles to the
|
||||||
|
* dirty region maintained for the current layer.
|
||||||
*/
|
*/
|
||||||
void (*on_dirty_ppp) (CompositorCtxt* ctxt, int zidx);
|
BOOL (*merge_dirty_ppp) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation will be called when there are some dirty rectangles
|
* This operation will be called when there are some dirty rectangles
|
||||||
* in the specific window z-node on the specific layer.
|
* in the specific window z-node on the specific layer.
|
||||||
|
* The compositor should merge the dirty rectangles to the
|
||||||
|
* dirty region maintained for the current layer.
|
||||||
*/
|
*/
|
||||||
void (*on_dirty_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
|
BOOL (*merge_dirty_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation will be called when there are some dirty rectangles
|
* This operation will be called when there are some dirty rectangles
|
||||||
* in the wallpaper pattern.
|
* in the wallpaper pattern.
|
||||||
|
* The compositor should merge the dirty rectangles of the wallpaper
|
||||||
|
* pattern to the dirty region maintained for the current layer.
|
||||||
*/
|
*/
|
||||||
void (*on_dirty_wpp) (CompositorCtxt* ctxt);
|
BOOL (*merge_dirty_wpp) (CompositorCtxt* ctxt, MG_Layer* layer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This operation will be called to composite the dirty region
|
||||||
|
* for the particular layer.
|
||||||
|
*/
|
||||||
|
BOOL (*refresh_dirty_region) (CompositorCtxt* ctxt, MG_Layer* layer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation will be called when a z-node was out of action, e.g.,
|
* This operation will be called when a z-node was out of action, e.g.,
|
||||||
@@ -1771,18 +1792,26 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
|
|||||||
MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
|
MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
|
||||||
const char* name, CompositorCtxt** ctxt);
|
const char* name, CompositorCtxt** ctxt);
|
||||||
|
|
||||||
|
#define COMPSOR_OPS_VERSION 1
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement this stub to return the compositor operations
|
* Implement this stub to return the compositor operations
|
||||||
* for a specific compositor name if you implement the compositor
|
* for a specific compositor name if you implement the compositor
|
||||||
* in a shared library.
|
* in a shared library.
|
||||||
*
|
*
|
||||||
* \param name The name of the compositor desired.
|
* \param name The name of the compositor desired.
|
||||||
* \param fallback The fallback operations for this compositor.
|
* \param fallback_ops The fallback operations.
|
||||||
|
* \param version The version code for the operations of the compositor.
|
||||||
|
*
|
||||||
|
* \note The compositor should return the version code it follows through
|
||||||
|
* \a version argument. If the version code is not matched, MiniGUI
|
||||||
|
* will refuse to load the compositor. The current version code
|
||||||
|
* is defined by \a COMPSOR_OPS_VERSION.
|
||||||
*
|
*
|
||||||
* \return The compositor operations for specific name, NULL for error.
|
* \return The compositor operations for specific name, NULL for error.
|
||||||
*/
|
*/
|
||||||
const CompositorOps* __ex_compositor_get (const char* name,
|
const CompositorOps* __ex_compositor_get (const char* name,
|
||||||
const CompositorOps* fallback);
|
const CompositorOps* fallback_ops, int* version);
|
||||||
|
|
||||||
#endif /* defined _MGSCHEMA_COMPOSITING */
|
#endif /* defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
@@ -1822,7 +1851,7 @@ const CompositorOps* __ex_compositor_get (const char* name,
|
|||||||
*
|
*
|
||||||
* \sa RegisterRequestHandler
|
* \sa RegisterRequestHandler
|
||||||
*/
|
*/
|
||||||
#define MAX_SYS_REQID 0x0022
|
#define MAX_SYS_REQID 0x0023
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def MAX_REQID
|
* \def MAX_REQID
|
||||||
|
|||||||
+1
-1
@@ -192,7 +192,7 @@ int GUIAPI ClientRequestEx2 (const REQUEST* request,
|
|||||||
&& (__mg_client_id == 0 && request->id != REQID_JOINLAYER)) {
|
&& (__mg_client_id == 0 && request->id != REQID_JOINLAYER)) {
|
||||||
#elif defined(_MGSCHEMA_COMPOSITING)
|
#elif defined(_MGSCHEMA_COMPOSITING)
|
||||||
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER &&
|
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER &&
|
||||||
request->id != REQID_GETWPSURFACE) {
|
request->id != REQID_GETSHAREDSURFACE) {
|
||||||
#else
|
#else
|
||||||
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER) {
|
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER) {
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1433,10 +1433,12 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||||||
item_info->add_data = item->add_data;
|
item_info->add_data = item->add_data;
|
||||||
|
|
||||||
if (item_info->which & MTB_WHICH_TEXT)
|
if (item_info->which & MTB_WHICH_TEXT)
|
||||||
strncpy (item_info->text, item->text, NTB_TEXT_LEN);
|
//strncpy (item_info->text, item->text, NTB_TEXT_LEN);
|
||||||
|
strcpy (item_info->text, item->text);
|
||||||
|
|
||||||
if (item_info->which & MTB_WHICH_TIP)
|
if (item_info->which & MTB_WHICH_TIP)
|
||||||
strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
|
//strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
|
||||||
|
strcpy (item_info->tip, item->tip);
|
||||||
|
|
||||||
return NTB_OKAY;
|
return NTB_OKAY;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-13
@@ -1012,8 +1012,9 @@ void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
|
|||||||
{
|
{
|
||||||
char font_name [LEN_UNIDEVFONT_NAME + 1];
|
char font_name [LEN_UNIDEVFONT_NAME + 1];
|
||||||
|
|
||||||
memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
|
//memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
|
||||||
strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
|
//strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
|
||||||
|
strcpy(font_name, (*devfont)->name);
|
||||||
|
|
||||||
font_DelDevFont (font_name);
|
font_DelDevFont (font_name);
|
||||||
*devfont = NULL;
|
*devfont = NULL;
|
||||||
@@ -1069,25 +1070,22 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
|
|||||||
added_num ++;
|
added_num ++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* [DK] Fix Bug #4801, which introduce a absolute path check error in Windows,
|
/* [DK] Fix Bug #4801, which introduce an absolute path check error in Windows,
|
||||||
* first to load from sytem res path, else load it directly(relative or absolute path).*/
|
* first to load from sytem res path, else load it directly (relative or absolute path).*/
|
||||||
if ((add_dev_font (font_name, font_file, TRUE)) == TRUE)
|
if (add_dev_font (font_name, font_file, TRUE))
|
||||||
added_num++;
|
added_num++;
|
||||||
else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1,
|
else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1,
|
||||||
__sysres_get_system_res_path(), font_file))
|
__sysres_get_system_res_path(), font_file)) &&
|
||||||
&& ((add_dev_font (font_name, font_path, TRUE)) == TRUE))
|
add_dev_font (font_name, font_path, TRUE))
|
||||||
added_num++;
|
added_num++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_unload || added_num > 0 || added_num == font_num)
|
if (is_unload || added_num > 0 || added_num == font_num) {
|
||||||
{
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return FALSE;
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL font_InitSpecificalFonts (char* etc_section)
|
BOOL font_InitSpecificalFonts (char* etc_section)
|
||||||
|
|||||||
@@ -120,47 +120,42 @@ hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
|
|||||||
return UCharDecompose(ab, a, b);
|
return UCharDecompose(ab, a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static hb_unicode_funcs_t *_funcs;
|
/* extern hb_unicode_funcs_t *__mg_hb_unifuncs */
|
||||||
static hb_unicode_funcs_t *get_unicode_funcs(void)
|
hb_unicode_funcs_t *__mg_hb_unifuncs;
|
||||||
{
|
|
||||||
if (_funcs)
|
|
||||||
return _funcs;
|
|
||||||
|
|
||||||
_funcs = hb_unicode_funcs_create (NULL);
|
|
||||||
|
|
||||||
hb_unicode_funcs_set_combining_class_func (_funcs,
|
|
||||||
hb_minigui_unicode_combining_class, NULL, NULL);
|
|
||||||
hb_unicode_funcs_set_general_category_func (_funcs,
|
|
||||||
hb_minigui_unicode_general_category, NULL, NULL);
|
|
||||||
hb_unicode_funcs_set_mirroring_func (_funcs,
|
|
||||||
hb_minigui_unicode_mirroring, NULL, NULL);
|
|
||||||
hb_unicode_funcs_set_script_func (_funcs,
|
|
||||||
hb_minigui_unicode_script, NULL, NULL);
|
|
||||||
hb_unicode_funcs_set_compose_func (_funcs,
|
|
||||||
hb_minigui_unicode_compose, NULL, NULL);
|
|
||||||
hb_unicode_funcs_set_decompose_func (_funcs,
|
|
||||||
hb_minigui_unicode_decompose, NULL, NULL);
|
|
||||||
|
|
||||||
hb_unicode_funcs_make_immutable (_funcs);
|
|
||||||
|
|
||||||
return _funcs;
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
|
|
||||||
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
|
|
||||||
|
|
||||||
void __mg_init_harzbuff_funcs(void)
|
void __mg_init_harzbuff_funcs(void)
|
||||||
{
|
{
|
||||||
_DBG_PRINTF("%s: called\n", __FUNCTION__);
|
_DBG_PRINTF("%s: called\n", __FUNCTION__);
|
||||||
__hb_extern_get_unicode_funcs = get_unicode_funcs;
|
|
||||||
|
if (__mg_hb_unifuncs)
|
||||||
|
return;
|
||||||
|
|
||||||
|
__mg_hb_unifuncs = hb_unicode_funcs_create (NULL);
|
||||||
|
|
||||||
|
hb_unicode_funcs_set_combining_class_func (__mg_hb_unifuncs,
|
||||||
|
hb_minigui_unicode_combining_class, NULL, NULL);
|
||||||
|
hb_unicode_funcs_set_general_category_func (__mg_hb_unifuncs,
|
||||||
|
hb_minigui_unicode_general_category, NULL, NULL);
|
||||||
|
hb_unicode_funcs_set_mirroring_func (__mg_hb_unifuncs,
|
||||||
|
hb_minigui_unicode_mirroring, NULL, NULL);
|
||||||
|
hb_unicode_funcs_set_script_func (__mg_hb_unifuncs,
|
||||||
|
hb_minigui_unicode_script, NULL, NULL);
|
||||||
|
hb_unicode_funcs_set_compose_func (__mg_hb_unifuncs,
|
||||||
|
hb_minigui_unicode_compose, NULL, NULL);
|
||||||
|
hb_unicode_funcs_set_decompose_func (__mg_hb_unifuncs,
|
||||||
|
hb_minigui_unicode_decompose, NULL, NULL);
|
||||||
|
|
||||||
|
hb_unicode_funcs_make_immutable (__mg_hb_unifuncs);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __mg_term_harzbuff_funcs(void)
|
void __mg_term_harzbuff_funcs(void)
|
||||||
{
|
{
|
||||||
_DBG_PRINTF("%s: called\n", __FUNCTION__);
|
_DBG_PRINTF("%s: called\n", __FUNCTION__);
|
||||||
|
|
||||||
if (_funcs) {
|
if (__mg_hb_unifuncs) {
|
||||||
hb_unicode_funcs_destroy(_funcs);
|
hb_unicode_funcs_destroy(__mg_hb_unifuncs);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
|
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
|
||||||
|
|||||||
+5
-4
@@ -2203,14 +2203,15 @@ static int create_memdc_for_menu (TRACKMENUINFO* ptmi)
|
|||||||
static void delete_memdc_for_menu (TRACKMENUINFO* ptmi)
|
static void delete_memdc_for_menu (TRACKMENUINFO* ptmi)
|
||||||
{
|
{
|
||||||
if (ptmi->dc != HDC_INVALID) {
|
if (ptmi->dc != HDC_INVALID) {
|
||||||
GAL_Surface *surf = GetSurfaceFromDC (ptmi->dc);
|
|
||||||
|
|
||||||
DeleteMemDC (ptmi->dc);
|
|
||||||
ptmi->dc = HDC_INVALID;
|
|
||||||
|
|
||||||
|
#if 0 /* deprecated code: we always do refcount++ for any memdc */
|
||||||
/* we must free the surface here, or it can not be freed actually
|
/* we must free the surface here, or it can not be freed actually
|
||||||
due to the referenced count. */
|
due to the referenced count. */
|
||||||
|
GAL_Surface *surf = GetSurfaceFromDC (ptmi->dc);
|
||||||
GAL_FreeSurface (surf);
|
GAL_FreeSurface (surf);
|
||||||
|
#endif /* deprecated code */
|
||||||
|
DeleteMemDC (ptmi->dc);
|
||||||
|
ptmi->dc = HDC_INVALID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -4261,7 +4261,7 @@ HWND GUIAPI CreateMainWindowEx2 (PMAINWINCREATE pCreateInfo, LINT id,
|
|||||||
{pCreateInfo->lx, pCreateInfo->ty,
|
{pCreateInfo->lx, pCreateInfo->ty,
|
||||||
pCreateInfo->rx, pCreateInfo->by} };
|
pCreateInfo->rx, pCreateInfo->by} };
|
||||||
|
|
||||||
// we ignore the retval. may fail for client of procs runmode
|
// we ignore the retval. may fail for client under procs runmode
|
||||||
SendMessage (HWND_DESKTOP, MSG_CALC_POSITION, 0, (LPARAM)&info);
|
SendMessage (HWND_DESKTOP, MSG_CALC_POSITION, 0, (LPARAM)&info);
|
||||||
|
|
||||||
pCreateInfo->lx = info.rc.left;
|
pCreateInfo->lx = info.rc.left;
|
||||||
@@ -5393,6 +5393,7 @@ static BOOL _wndInvalidateRect(HWND hWnd, const RECT* prc, BOOL bEraseBkgnd, int
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
_WRN_PRINTF ("The invalid region is forzen\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5573,7 +5574,6 @@ HDC GUIAPI BeginPaint (HWND hWnd)
|
|||||||
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), HDC_INVALID);
|
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), HDC_INVALID);
|
||||||
pWin = MG_GET_WINDOW_PTR (hWnd);
|
pWin = MG_GET_WINDOW_PTR (hWnd);
|
||||||
|
|
||||||
|
|
||||||
if (pWin->pCaretInfo && pWin->pCaretInfo->fBlink) {
|
if (pWin->pCaretInfo && pWin->pCaretInfo->fBlink) {
|
||||||
HideCaretEx (hWnd, FALSE);
|
HideCaretEx (hWnd, FALSE);
|
||||||
pWin->pCaretInfo->fBlink = TRUE;
|
pWin->pCaretInfo->fBlink = TRUE;
|
||||||
|
|||||||
@@ -1243,11 +1243,9 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
default:
|
default:
|
||||||
_DBG_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
|
_WRN_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
libinput_event_destroy(event);
|
libinput_event_destroy(event);
|
||||||
|
|||||||
+27
-18
@@ -64,6 +64,9 @@ extern "C" {
|
|||||||
#define SHOW_HIDE_TYPE 5
|
#define SHOW_HIDE_TYPE 5
|
||||||
#define XVFB_CLOSE_TYPE 6
|
#define XVFB_CLOSE_TYPE 6
|
||||||
|
|
||||||
|
/* Since 5.0.0: command */
|
||||||
|
#define CMD_TYPE 7
|
||||||
|
|
||||||
struct PCXVFbKeyData
|
struct PCXVFbKeyData
|
||||||
{
|
{
|
||||||
unsigned int unicode;
|
unsigned int unicode;
|
||||||
@@ -74,36 +77,35 @@ struct PCXVFbKeyData
|
|||||||
|
|
||||||
typedef struct _XVFBKEYDATA
|
typedef struct _XVFBKEYDATA
|
||||||
{
|
{
|
||||||
unsigned short key_code;
|
unsigned short key_code;
|
||||||
unsigned short key_state;
|
unsigned short key_state;
|
||||||
} XVFBKEYDATA;
|
} XVFBKEYDATA;
|
||||||
|
|
||||||
typedef struct _XVFBMOUSEDATA
|
typedef struct _XVFBMOUSEDATA
|
||||||
{
|
{
|
||||||
unsigned short x;
|
unsigned short x;
|
||||||
unsigned short y;
|
unsigned short y;
|
||||||
unsigned int button;
|
unsigned int button;
|
||||||
} XVFBMOUSEDATA;
|
} XVFBMOUSEDATA;
|
||||||
|
|
||||||
typedef struct _XVFBEVENTDATA
|
typedef struct _XVFBEVENTDATA
|
||||||
{
|
{
|
||||||
int event_type;
|
int event_type;
|
||||||
union
|
union {
|
||||||
{
|
XVFBKEYDATA key;
|
||||||
XVFBKEYDATA key;
|
XVFBMOUSEDATA mouse;
|
||||||
XVFBMOUSEDATA mouse;
|
} data;
|
||||||
} data;
|
|
||||||
} XVFBEVENT;
|
} XVFBEVENT;
|
||||||
|
|
||||||
typedef struct _XVFBCaptionEventData{
|
typedef struct _XVFBCaptionEventData{
|
||||||
int event_type;
|
int event_type;
|
||||||
int size;
|
int size;
|
||||||
char buff[0];
|
char buff[0];
|
||||||
}XVFBCaptionEventData;
|
}XVFBCaptionEventData;
|
||||||
|
|
||||||
typedef struct _XVFBIMEEventData{
|
typedef struct _XVFBIMEEventData{
|
||||||
int event_type;
|
int event_type;
|
||||||
int ime_open;
|
int ime_open;
|
||||||
}XVFBIMEEventData;
|
}XVFBIMEEventData;
|
||||||
|
|
||||||
typedef struct _XVFBIMEMSGEventData{
|
typedef struct _XVFBIMEMSGEventData{
|
||||||
@@ -117,6 +119,13 @@ typedef struct _XVFBShowHideEventData{
|
|||||||
int show; /* 0 to hide, 1 to show */
|
int show; /* 0 to hide, 1 to show */
|
||||||
}XVFBShowHideEventData;
|
}XVFBShowHideEventData;
|
||||||
|
|
||||||
|
/* Since 5.0.0: command */
|
||||||
|
#define XVFB_CMD_QUIT 0
|
||||||
|
typedef struct _XVFBCmdEventData {
|
||||||
|
int event_type;
|
||||||
|
int cmd;
|
||||||
|
} XVFBCmdEventData;
|
||||||
|
|
||||||
extern int __mg_pcxvfb_server_sockfd;
|
extern int __mg_pcxvfb_server_sockfd;
|
||||||
extern int __mg_pcxvfb_client_sockfd;
|
extern int __mg_pcxvfb_client_sockfd;
|
||||||
|
|
||||||
@@ -124,8 +133,8 @@ BOOL ial_InitPCXVFBInput (INPUT* input, const char* mdev, const char* mtype);
|
|||||||
void TermPCXVFBInput (void);
|
void TermPCXVFBInput (void);
|
||||||
|
|
||||||
MG_EXPORT void GUIAPI VFBOpenIME(int bOpen);
|
MG_EXPORT void GUIAPI VFBOpenIME(int bOpen);
|
||||||
MG_EXPORT void GUIAPI VFBSetIMETextCallback(void (*setIMEText)(void *, const char* text),
|
MG_EXPORT void GUIAPI VFBSetIMETextCallback(void (*setIMEText)(void *,
|
||||||
void *user_data);
|
const char* text), void *user_data);
|
||||||
|
|
||||||
MG_EXPORT void GUIAPI VFBSetCaption(const char* caption);
|
MG_EXPORT void GUIAPI VFBSetCaption(const char* caption);
|
||||||
MG_EXPORT void GUIAPI VFBShowWindow(int show);
|
MG_EXPORT void GUIAPI VFBShowWindow(int show);
|
||||||
|
|||||||
+17
-11
@@ -689,21 +689,19 @@ BOOL ial_InitPCXVFBInput (INPUT* input, const char* mdev, const char* mtype)
|
|||||||
{
|
{
|
||||||
char path[PATH_MAX], *template;
|
char path[PATH_MAX], *template;
|
||||||
template = getenv("MG_ENV_RECORD_IAL");
|
template = getenv("MG_ENV_RECORD_IAL");
|
||||||
if (template)
|
if (template) {
|
||||||
{
|
|
||||||
#if 0
|
#if 0
|
||||||
snprintf(path, sizeof(path), "%s%ld", template, time(NULL));
|
snprintf(path, sizeof(path), "%s%ld", template, time(NULL));
|
||||||
#else
|
#else
|
||||||
snprintf(path, sizeof(path), "%s", template);
|
snprintf(path, sizeof(path), "%s", template);
|
||||||
#endif
|
#endif
|
||||||
path[sizeof(path)/sizeof(path[0])-1] = 0;
|
path[sizeof(path)/sizeof(path[0])-1] = 0;
|
||||||
|
|
||||||
open_rec (path);
|
open_rec (path);
|
||||||
record_time_start = getcurtime();
|
record_time_start = getcurtime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -725,6 +723,14 @@ void TermPCXVFBInput (void)
|
|||||||
socket_file[49] = '\0';
|
socket_file[49] = '\0';
|
||||||
|
|
||||||
if (__mg_pcxvfb_client_sockfd >= 0) {
|
if (__mg_pcxvfb_client_sockfd >= 0) {
|
||||||
|
/* Since 5.0.0: send a quit command to XVFB */
|
||||||
|
XVFBCmdEventData cmd = { CMD_TYPE, XVFB_CMD_QUIT };
|
||||||
|
|
||||||
|
if (mg_writesocket (__mg_pcxvfb_client_sockfd, &cmd, sizeof (cmd)) <
|
||||||
|
sizeof (cmd)) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
close(__mg_pcxvfb_client_sockfd);
|
close(__mg_pcxvfb_client_sockfd);
|
||||||
__mg_pcxvfb_client_sockfd = -1;
|
__mg_pcxvfb_client_sockfd = -1;
|
||||||
}
|
}
|
||||||
@@ -733,7 +739,7 @@ void TermPCXVFBInput (void)
|
|||||||
__mg_pcxvfb_server_sockfd = -1;
|
__mg_pcxvfb_server_sockfd = -1;
|
||||||
}
|
}
|
||||||
unlink(socket_file);
|
unlink(socket_file);
|
||||||
#if defined(_MGRM_PROCESSES) && !defined(_MGRM_STANDALONE)
|
#if defined(_MGRM_PROCESSES)
|
||||||
if (mgIsServer) {
|
if (mgIsServer) {
|
||||||
remove("/tmp/.pcxvfb_tmp");
|
remove("/tmp/.pcxvfb_tmp");
|
||||||
}
|
}
|
||||||
@@ -741,4 +747,4 @@ void TermPCXVFBInput (void)
|
|||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _MGGAL_PCXVFB*/
|
#endif /* _MGGAL_PCXVFB */
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ noinst_HEADERS = \
|
|||||||
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
|
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
|
||||||
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
|
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
|
||||||
glyph.h license.h mgsock.h unicode-ops.h \
|
glyph.h license.h mgsock.h unicode-ops.h \
|
||||||
linux-tty.h debug.h
|
linux-tty.h debug.h map.h
|
||||||
|
|||||||
+19
-5
@@ -101,8 +101,14 @@
|
|||||||
#define REQID_COPYCURSOR 0x001B
|
#define REQID_COPYCURSOR 0x001B
|
||||||
|
|
||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
// Get global wallpaper pattern surface
|
// Get shared surface
|
||||||
#define REQID_GETWPSURFACE 0x001C
|
#define REQID_GETSHAREDSURFACE 0x001C
|
||||||
|
// for compositing schema
|
||||||
|
#define SYSSF_WALLPAPER_PATTER "syssf-wallpaper-pattern"
|
||||||
|
// for sharedfb schema
|
||||||
|
#define SYSSF_REAL_SCREEN "syssf-real-screen"
|
||||||
|
#define SYSSF_SHADOW_SCREEN "syssf-shadow-screen"
|
||||||
|
|
||||||
// Load cursor from PNG file
|
// Load cursor from PNG file
|
||||||
#define REQID_LOADCURSOR_PNG 0x001D
|
#define REQID_LOADCURSOR_PNG 0x001D
|
||||||
// Load cursor from in-memory PNG
|
// Load cursor from in-memory PNG
|
||||||
@@ -117,7 +123,10 @@
|
|||||||
// Calculate the position a main window with WS_EX_AUTOPOSITION
|
// Calculate the position a main window with WS_EX_AUTOPOSITION
|
||||||
#define REQID_CALCPOSITION 0x0022
|
#define REQID_CALCPOSITION 0x0022
|
||||||
|
|
||||||
#define REQID_SYS_LAST REQID_CALCPOSITION
|
// Authenticate client
|
||||||
|
#define REQID_AUTHCLIENT 0x0023
|
||||||
|
|
||||||
|
#define REQID_SYS_LAST REQID_AUTHCLIENT
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX: To fellows who need to add a new REQID,
|
* XXX: To fellows who need to add a new REQID,
|
||||||
@@ -135,8 +144,13 @@ MGUI_COMPILE_TIME_ASSERT(sys_request_id, MAX_SYS_REQID >= REQID_SYS_LAST);
|
|||||||
|
|
||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
typedef struct _SharedSurfInfo {
|
typedef struct _SharedSurfInfo {
|
||||||
Uint32 flags;
|
uint32_t flags; // the flags of the surface
|
||||||
size_t map_size;
|
uint32_t width, height;
|
||||||
|
uint32_t pitch;
|
||||||
|
uint32_t name; // when use flink name
|
||||||
|
uint32_t drm_format; // DRM pixel format
|
||||||
|
size_t size; // whole size of the surface
|
||||||
|
off_t offset; // offset of pixel data
|
||||||
} SHAREDSURFINFO;
|
} SHAREDSURFINFO;
|
||||||
|
|
||||||
typedef struct JoinLayerInfo {
|
typedef struct JoinLayerInfo {
|
||||||
|
|||||||
@@ -62,9 +62,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_SHAREDFB)
|
#if defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_SHAREDFB)
|
||||||
# define IS_SHAREDFB_SCHEMA 1
|
# define IS_SHAREDFB_SCHEMA_PROCS 1
|
||||||
#else
|
#else
|
||||||
# define IS_SHAREDFB_SCHEMA 0
|
# define IS_SHAREDFB_SCHEMA_PROCS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* the maximal number of the dirty rects */
|
/* the maximal number of the dirty rects */
|
||||||
@@ -167,13 +167,13 @@ enum {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* constants for engine name and video mode */
|
/* constants for engine name and video mode */
|
||||||
|
#define LEN_SO_NAME 127 // name length of a shared object (library)
|
||||||
#define LEN_DEVICE_NAME 127
|
#define LEN_DEVICE_NAME 127
|
||||||
#define LEN_EXDRIVER_NAME 127
|
#define LEN_EXDRIVER_NAME LEN_SO_NAME
|
||||||
#define LEN_ENGINE_NAME 23
|
#define LEN_ENGINE_NAME 23
|
||||||
#define LEN_VIDEO_MODE 31
|
#define LEN_VIDEO_MODE 31
|
||||||
#define LEN_MTYPE_NAME 23
|
#define LEN_MTYPE_NAME 23
|
||||||
#define LEN_FOURCC_FORMAT 7
|
#define LEN_FOURCC_FORMAT 7
|
||||||
#define LEN_SO_NAME 255 // name length of a shared object (library)
|
|
||||||
|
|
||||||
/* misc constants and utilities */
|
/* misc constants and utilities */
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -162,7 +162,7 @@ dump_message (const MSG* msg, const char* name)
|
|||||||
name, msg->message, Message2Str (msg->message),
|
name, msg->message, Message2Str (msg->message),
|
||||||
msg->hwnd, (PVOID)msg->wParam, (PVOID)msg->lParam);
|
msg->hwnd, (PVOID)msg->wParam, (PVOID)msg->lParam);
|
||||||
#else
|
#else
|
||||||
_MG_PRINTF ("Message(%s): %u, Wnd: %p, wP: %p, lP: %p.\n",
|
_MG_PRINTF ("Message(%s) for %s: %u, Wnd: %p, wP: %p, lP: %p.\n",
|
||||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||||
msg->pSyncMsg?"SYNC":"NORM",
|
msg->pSyncMsg?"SYNC":"NORM",
|
||||||
#else
|
#else
|
||||||
|
|||||||
+53
-19
@@ -64,6 +64,10 @@
|
|||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
|
#include <semaphore.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DISABLE_THREADS
|
#define DISABLE_THREADS
|
||||||
#define GAL_mutex int
|
#define GAL_mutex int
|
||||||
|
|
||||||
@@ -131,15 +135,10 @@ typedef struct _DirtyInfo {
|
|||||||
* than the creator.
|
* than the creator.
|
||||||
*/
|
*/
|
||||||
typedef struct _SharedSurfaceHeader {
|
typedef struct _SharedSurfaceHeader {
|
||||||
#if 0
|
|
||||||
/* The semaphore for this shared surface */
|
|
||||||
sem_t sem_lock;
|
|
||||||
#else
|
|
||||||
/* The number of semphore for this surface.
|
/* The number of semphore for this surface.
|
||||||
The SysV semaphore set id for synchronizing this shared surface:
|
The SysV semaphore set id for synchronizing this shared surface:
|
||||||
SHAREDRES_SEMID_SHARED_SURF. */
|
SHAREDRES_SEMID_SHARED_SURF. */
|
||||||
int sem_num;
|
int sem_num;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The pid of the creator */
|
/* The pid of the creator */
|
||||||
pid_t creator;
|
pid_t creator;
|
||||||
@@ -159,27 +158,35 @@ typedef struct _SharedSurfaceHeader {
|
|||||||
/* the RGBA masks */
|
/* the RGBA masks */
|
||||||
Uint32 Rmask, Gmask, Bmask, Amask;
|
Uint32 Rmask, Gmask, Bmask, Amask;
|
||||||
|
|
||||||
/* the size of the buffer */
|
/* the size of the whole buffer */
|
||||||
size_t buf_size;
|
size_t map_size;
|
||||||
/* the pixels */
|
/* the offset of pixels data */
|
||||||
char buf[0];
|
off_t pixels_off;
|
||||||
} GAL_SharedSurfaceHeader;
|
} GAL_SharedSurfaceHeader;
|
||||||
#endif /* IS_COMPOSITING_SCHEMA */
|
#endif /* IS_COMPOSITING_SCHEMA */
|
||||||
|
|
||||||
|
/* The header for shadow screen; used to store the dirty rectangle. */
|
||||||
|
typedef struct _ShadowSurfaceHeader {
|
||||||
|
/* The dirty rectangle */
|
||||||
|
RECT dirty_rc;
|
||||||
|
} GAL_ShadowSurfaceHeader;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This structure should be treated as read-only, except for 'pixels',
|
* This structure should be treated as read-only, except for 'pixels',
|
||||||
* which, if not NULL, contains the raw pixel data for the surface.
|
* which, if not NULL, contains the raw pixel data for the surface.
|
||||||
*/
|
*/
|
||||||
typedef struct GAL_Surface {
|
typedef struct GAL_Surface {
|
||||||
Uint32 flags; /* Read-only */
|
void *video; /* Read-only */
|
||||||
GAL_PixelFormat *format; /* Read-only */
|
GAL_PixelFormat *format; /* Read-only */
|
||||||
void *video; /* Read-only */
|
|
||||||
int w, h; /* Read-only */
|
Uint32 flags; /* Read-only */
|
||||||
|
Uint32 pixels_off; /* Read-only; since 5.0.0, replace old offset */
|
||||||
|
int w, h; /* Read-only */
|
||||||
|
|
||||||
/* VW[2018-01-18]: For 64b, use signed int instead of Uint32 for pitch. */
|
/* VW[2018-01-18]: For 64b, use signed int instead of Uint32 for pitch. */
|
||||||
int pitch; /* Read-only */
|
int pitch; /* Read-only */
|
||||||
int dpi; /* Read-only */
|
int dpi; /* Read-only */
|
||||||
void *pixels; /* Read-write */
|
void *pixels; /* Read-write */
|
||||||
int offset; /* Private */
|
|
||||||
|
|
||||||
/* Hardware-specific surface info */
|
/* Hardware-specific surface info */
|
||||||
struct private_hwdata *hwdata;
|
struct private_hwdata *hwdata;
|
||||||
@@ -231,8 +238,7 @@ typedef struct GAL_Surface {
|
|||||||
|
|
||||||
/* Evaluates to true if the surface needs to be locked before access */
|
/* Evaluates to true if the surface needs to be locked before access */
|
||||||
#define GAL_MUSTLOCK(surface) \
|
#define GAL_MUSTLOCK(surface) \
|
||||||
(surface->offset || \
|
((surface->flags & (GAL_HWSURFACE|GAL_ASYNCBLIT|GAL_RLEACCEL)) != 0)
|
||||||
((surface->flags & (GAL_HWSURFACE|GAL_ASYNCBLIT|GAL_RLEACCEL)) != 0))
|
|
||||||
|
|
||||||
/* Useful for determining the video hardware capabilities */
|
/* Useful for determining the video hardware capabilities */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -958,6 +964,34 @@ BYTE* gal_PutPixelKeyAlpha (GAL_Surface* dst,
|
|||||||
|
|
||||||
#define mg_TerminateGAL GAL_VideoQuit
|
#define mg_TerminateGAL GAL_VideoQuit
|
||||||
|
|
||||||
|
#ifdef _MGRM_PROCESSES
|
||||||
|
/* Since 5.0.0: copy video information to the shared resource */
|
||||||
|
BOOL GAL_CopyVideoInfoToSharedRes (void);
|
||||||
|
|
||||||
|
/* Since 5.0.0: create/attach a surface in/to named shared memory */
|
||||||
|
GAL_Surface * GAL_CreateRGBSurfaceInShm (const char* shm_name, BOOL create,
|
||||||
|
Uint32 rw_modes, Uint32 hdr_size, int width, int height, int depth,
|
||||||
|
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||||
|
|
||||||
|
#endif /* _MGRM_PROCESSES */
|
||||||
|
|
||||||
|
#ifdef _MGGAL_DRM
|
||||||
|
/* functions implemented in DRM engine. */
|
||||||
|
BOOL __drm_get_surface_info (GAL_Surface *surface, DrmSurfaceInfo* info);
|
||||||
|
|
||||||
|
GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
|
||||||
|
uint32_t name, uint32_t drm_format, uint32_t pixels_off,
|
||||||
|
uint32_t width, uint32_t height, uint32_t pitch);
|
||||||
|
|
||||||
|
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video,
|
||||||
|
uint32_t handle, size_t size, uint32_t drm_format, uint32_t pixels_off,
|
||||||
|
uint32_t width, uint32_t height, uint32_t pitch);
|
||||||
|
|
||||||
|
GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
|
||||||
|
int prime_fd, size_t size, uint32_t drm_format, uint32_t pixels_off,
|
||||||
|
uint32_t width, uint32_t height, uint32_t pitch);
|
||||||
|
#endif /* defined _MGGAL_DRM */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
+12
-5
@@ -102,10 +102,13 @@ typedef struct tagG_RES {
|
|||||||
char video_engine [LEN_ENGINE_NAME + 1];
|
char video_engine [LEN_ENGINE_NAME + 1];
|
||||||
char video_mode [LEN_VIDEO_MODE + 1];
|
char video_mode [LEN_VIDEO_MODE + 1];
|
||||||
char video_device [LEN_DEVICE_NAME + 1];
|
char video_device [LEN_DEVICE_NAME + 1];
|
||||||
char video_exdriver [LEN_EXDRIVER_NAME + 1];
|
|
||||||
char video_fourcc [LEN_FOURCC_FORMAT + 1];
|
|
||||||
int video_dpi, video_hres, video_vres, video_depth;
|
int video_dpi, video_hres, video_vres, video_depth;
|
||||||
Uint32 video_rmask, video_gmask, video_bmask, video_amask;
|
Uint32 video_rmask, video_gmask, video_bmask, video_amask;
|
||||||
|
#ifdef _MGGAL_DRM
|
||||||
|
char video_exdriver [LEN_EXDRIVER_NAME + 1];
|
||||||
|
Uint32 video_drm_format;
|
||||||
|
Uint32 video_dbl_buff:1;
|
||||||
|
#endif
|
||||||
|
|
||||||
int nr_layers;
|
int nr_layers;
|
||||||
int semid_layer;
|
int semid_layer;
|
||||||
@@ -168,8 +171,6 @@ typedef G_RES* PG_RES;
|
|||||||
#define SHAREDRES_VIDEO_ENGINE (((PG_RES)mgSharedRes)->video_engine)
|
#define SHAREDRES_VIDEO_ENGINE (((PG_RES)mgSharedRes)->video_engine)
|
||||||
#define SHAREDRES_VIDEO_MODE (((PG_RES)mgSharedRes)->video_mode)
|
#define SHAREDRES_VIDEO_MODE (((PG_RES)mgSharedRes)->video_mode)
|
||||||
#define SHAREDRES_VIDEO_DEVICE (((PG_RES)mgSharedRes)->video_device)
|
#define SHAREDRES_VIDEO_DEVICE (((PG_RES)mgSharedRes)->video_device)
|
||||||
#define SHAREDRES_VIDEO_FOURCC (((PG_RES)mgSharedRes)->video_fourcc)
|
|
||||||
#define SHAREDRES_VIDEO_EXDRIVER (((PG_RES)mgSharedRes)->video_exdriver)
|
|
||||||
#define SHAREDRES_VIDEO_DPI (((PG_RES)mgSharedRes)->video_dpi)
|
#define SHAREDRES_VIDEO_DPI (((PG_RES)mgSharedRes)->video_dpi)
|
||||||
#define SHAREDRES_VIDEO_HRES (((PG_RES)mgSharedRes)->video_hres)
|
#define SHAREDRES_VIDEO_HRES (((PG_RES)mgSharedRes)->video_hres)
|
||||||
#define SHAREDRES_VIDEO_VRES (((PG_RES)mgSharedRes)->video_vres)
|
#define SHAREDRES_VIDEO_VRES (((PG_RES)mgSharedRes)->video_vres)
|
||||||
@@ -179,6 +180,12 @@ typedef G_RES* PG_RES;
|
|||||||
#define SHAREDRES_VIDEO_BMASK (((PG_RES)mgSharedRes)->video_bmask)
|
#define SHAREDRES_VIDEO_BMASK (((PG_RES)mgSharedRes)->video_bmask)
|
||||||
#define SHAREDRES_VIDEO_AMASK (((PG_RES)mgSharedRes)->video_amask)
|
#define SHAREDRES_VIDEO_AMASK (((PG_RES)mgSharedRes)->video_amask)
|
||||||
|
|
||||||
|
#ifdef _MGGAL_DRM
|
||||||
|
#define SHAREDRES_VIDEO_EXDRIVER (((PG_RES)mgSharedRes)->video_exdriver)
|
||||||
|
#define SHAREDRES_VIDEO_DRM_FORMAT (((PG_RES)mgSharedRes)->video_drm_format)
|
||||||
|
#define SHAREDRES_VIDEO_DBL_BUFF (((PG_RES)mgSharedRes)->video_dbl_buff)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SHAREDRES_TIMER_COUNTER (((PG_RES)mgSharedRes)->timer_counter)
|
#define SHAREDRES_TIMER_COUNTER (((PG_RES)mgSharedRes)->timer_counter)
|
||||||
#define SHAREDRES_TICK_ON_LOCKSEM (((PG_RES)mgSharedRes)->tick_on_locksem)
|
#define SHAREDRES_TICK_ON_LOCKSEM (((PG_RES)mgSharedRes)->tick_on_locksem)
|
||||||
#define SHAREDRES_TIMEOUT (((PG_RES)mgSharedRes)->timeout)
|
#define SHAREDRES_TIMEOUT (((PG_RES)mgSharedRes)->timeout)
|
||||||
@@ -205,7 +212,7 @@ typedef G_RES* PG_RES;
|
|||||||
# define SHAREDRES_SEMID_SHARED_SURF (((PG_RES)mgSharedRes)->semid_shared_surf)
|
# define SHAREDRES_SEMID_SHARED_SURF (((PG_RES)mgSharedRes)->semid_shared_surf)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SHAREDRES_NR_GLOBALS (((PG_RES)mgSharedRes)->nr_globals)
|
#define SHAREDRES_NR_GLOBALS (((PG_RES)mgSharedRes)->nr_globals)
|
||||||
#define SHAREDRES_DEF_NR_TOPMOSTS (((PG_RES)mgSharedRes)->def_nr_topmosts)
|
#define SHAREDRES_DEF_NR_TOPMOSTS (((PG_RES)mgSharedRes)->def_nr_topmosts)
|
||||||
#define SHAREDRES_DEF_NR_NORMALS (((PG_RES)mgSharedRes)->dev_nr_normals)
|
#define SHAREDRES_DEF_NR_NORMALS (((PG_RES)mgSharedRes)->dev_nr_normals)
|
||||||
|
|
||||||
|
|||||||
+124
-99
@@ -67,12 +67,17 @@
|
|||||||
|
|
||||||
#define SIZE_CLIPRC_HEAP 64
|
#define SIZE_CLIPRC_HEAP 64
|
||||||
|
|
||||||
|
#define DIRTY_ZT_PPP 0x01
|
||||||
|
#define DIRTY_ZT_WIN 0x02
|
||||||
|
#define DIRTY_ZT_WPP 0x04
|
||||||
|
|
||||||
struct _CompositorCtxt {
|
struct _CompositorCtxt {
|
||||||
RECT rc_screen; // screen rect - avoid duplicated GetScreenRect calls
|
RECT rc_screen; // screen rect - avoid duplicated GetScreenRect calls
|
||||||
BLOCKHEAP cliprc_heap;// heap for clipping rects
|
BLOCKHEAP cliprc_heap;// heap for clipping rects
|
||||||
CLIPRGN wins_rgn; // visible region for all windows (subtract popup menus)
|
CLIPRGN wins_rgn; // visible region for all windows (subtract popup menus)
|
||||||
CLIPRGN dirty_rgn; // the dirty region
|
CLIPRGN dirty_rgn; // the dirty region
|
||||||
CLIPRGN inv_rgn; // the invalid region for a specific znode
|
CLIPRGN inv_rgn; // the invalid region for a specific znode
|
||||||
|
Uint32 dirty_types;// the dirty znode types.
|
||||||
};
|
};
|
||||||
|
|
||||||
static CompositorCtxt* initialize (const char* name)
|
static CompositorCtxt* initialize (const char* name)
|
||||||
@@ -256,30 +261,6 @@ static inline void tile_dirty_region_for_wallpaper (CompositorCtxt* ctxt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL generate_dirty_region (CompositorCtxt* ctxt,
|
|
||||||
const ZNODEHEADER* znode_hdr, const CLIPRGN* znode_rgn)
|
|
||||||
{
|
|
||||||
EmptyClipRgn (&ctxt->dirty_rgn);
|
|
||||||
if (znode_hdr && znode_hdr->dirty_rcs) {
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < znode_hdr->nr_dirty_rcs; i++) {
|
|
||||||
RECT rc;
|
|
||||||
|
|
||||||
// device coordinates to screen coordinates
|
|
||||||
rc = znode_hdr->dirty_rcs [i];
|
|
||||||
OffsetRect (&rc, znode_hdr->rc.left, znode_hdr->rc.top);
|
|
||||||
AddClipRect (&ctxt->dirty_rgn, &rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (znode_rgn)
|
|
||||||
IntersectRegion (&ctxt->dirty_rgn, &ctxt->dirty_rgn, znode_rgn);
|
|
||||||
else
|
|
||||||
IntersectClipRect (&ctxt->dirty_rgn, &ctxt->rc_screen);
|
|
||||||
}
|
|
||||||
|
|
||||||
return !IsEmptyClipRgn (&ctxt->dirty_rgn);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void composite_wallpaper_rect (CompositorCtxt* ctxt,
|
static void composite_wallpaper_rect (CompositorCtxt* ctxt,
|
||||||
const RECT* dirty_rc)
|
const RECT* dirty_rc)
|
||||||
{
|
{
|
||||||
@@ -300,6 +281,8 @@ static void composite_wallpaper_rect (CompositorCtxt* ctxt,
|
|||||||
RECT eff_rc;
|
RECT eff_rc;
|
||||||
if (IntersectRect (&eff_rc, dirty_rc, &rc)) {
|
if (IntersectRect (&eff_rc, dirty_rc, &rc)) {
|
||||||
SelectClipRect (HDC_SCREEN_SYS, &eff_rc);
|
SelectClipRect (HDC_SCREEN_SYS, &eff_rc);
|
||||||
|
SetMemDCColorKey (HDC_SCREEN, 0, 0);
|
||||||
|
SetMemDCAlpha (HDC_SCREEN, 0, 0);
|
||||||
BitBlt (HDC_SCREEN, 0, 0, RECTW (rc), RECTH (rc),
|
BitBlt (HDC_SCREEN, 0, 0, RECTW (rc), RECTH (rc),
|
||||||
HDC_SCREEN_SYS, rc.left, rc.top, 0);
|
HDC_SCREEN_SYS, rc.left, rc.top, 0);
|
||||||
}
|
}
|
||||||
@@ -351,9 +334,11 @@ static void composite_ppp_znodes (CompositorCtxt* ctxt)
|
|||||||
ClipRgnIntersect (&ctxt->inv_rgn, &ctxt->dirty_rgn, rgn);
|
ClipRgnIntersect (&ctxt->inv_rgn, &ctxt->dirty_rgn, rgn);
|
||||||
if (IsEmptyClipRgn (&ctxt->inv_rgn)) {
|
if (IsEmptyClipRgn (&ctxt->inv_rgn)) {
|
||||||
ServerReleasePopupMenuZNodeHeader (zidx);
|
ServerReleasePopupMenuZNodeHeader (zidx);
|
||||||
break;
|
_DBG_PRINTF ("ppp %d skipped\n", zidx);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
_DBG_PRINTF ("ppp %d composited\n", zidx);
|
||||||
// blit this popup menu to screen
|
// blit this popup menu to screen
|
||||||
SelectClipRegion (HDC_SCREEN_SYS, &ctxt->inv_rgn);
|
SelectClipRegion (HDC_SCREEN_SYS, &ctxt->inv_rgn);
|
||||||
BitBlt (znode_hdr->mem_dc, 0, 0,
|
BitBlt (znode_hdr->mem_dc, 0, 0,
|
||||||
@@ -423,6 +408,7 @@ static void composite_all_lucent_win_znodes_above (CompositorCtxt* ctxt,
|
|||||||
|
|
||||||
switch (znode_hdr->ct & CT_SYSTEM_MASK) {
|
switch (znode_hdr->ct & CT_SYSTEM_MASK) {
|
||||||
case CT_COLORKEY:
|
case CT_COLORKEY:
|
||||||
|
SetMemDCAlpha (znode_hdr->mem_dc, 0, 0);
|
||||||
SetMemDCColorKey (znode_hdr->mem_dc,
|
SetMemDCColorKey (znode_hdr->mem_dc,
|
||||||
MEMDC_FLAG_SRCCOLORKEY,
|
MEMDC_FLAG_SRCCOLORKEY,
|
||||||
DWORD2Pixel (znode_hdr->mem_dc, znode_hdr->ct_arg));
|
DWORD2Pixel (znode_hdr->mem_dc, znode_hdr->ct_arg));
|
||||||
@@ -439,6 +425,7 @@ static void composite_all_lucent_win_znodes_above (CompositorCtxt* ctxt,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CT_ALPHAPIXEL:
|
case CT_ALPHAPIXEL:
|
||||||
|
SetMemDCColorKey (znode_hdr->mem_dc, 0, 0);
|
||||||
SetMemDCAlpha (znode_hdr->mem_dc,
|
SetMemDCAlpha (znode_hdr->mem_dc,
|
||||||
MEMDC_FLAG_SRCPIXELALPHA, 0);
|
MEMDC_FLAG_SRCPIXELALPHA, 0);
|
||||||
break;
|
break;
|
||||||
@@ -526,63 +513,6 @@ static void composite_on_dirty_region (CompositorCtxt* ctxt, int from)
|
|||||||
SyncUpdateDC (HDC_SCREEN_SYS);
|
SyncUpdateDC (HDC_SCREEN_SYS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_dirty_win (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
|
|
||||||
{
|
|
||||||
const ZNODEHEADER* znode_hdr = NULL;
|
|
||||||
CLIPRGN *rgn;
|
|
||||||
|
|
||||||
/* the fallback compositor only manages znodes on the topmost layer. */
|
|
||||||
if (layer != mgTopmostLayer || zidx <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_DBG_PRINTF("called: %d\n", zidx);
|
|
||||||
|
|
||||||
/* generate the dirty region */
|
|
||||||
znode_hdr = ServerGetWinZNodeHeader (NULL, zidx, (void**)&rgn, TRUE);
|
|
||||||
assert (znode_hdr);
|
|
||||||
|
|
||||||
if (generate_dirty_region (ctxt, znode_hdr, rgn)) {
|
|
||||||
if (znode_hdr->changes == 0) {
|
|
||||||
/* It's the first exposure of the window. */
|
|
||||||
_MG_PRINTF ("It is the first exposure of the window (%d): %u\n",
|
|
||||||
zidx, znode_hdr->dirty_age);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsEmptyClipRgn (&ctxt->dirty_rgn)) {
|
|
||||||
goto ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
composite_on_dirty_region (ctxt, zidx);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret:
|
|
||||||
ServerReleaseWinZNodeHeader (NULL, zidx);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void on_dirty_wpp (CompositorCtxt* ctxt)
|
|
||||||
{
|
|
||||||
const ZNODEHEADER* znode_hdr;
|
|
||||||
|
|
||||||
//_DBG_PRINTF ("called\n");
|
|
||||||
znode_hdr = ServerGetWinZNodeHeader (NULL, 0, NULL, TRUE);
|
|
||||||
assert (znode_hdr);
|
|
||||||
|
|
||||||
if (generate_dirty_region (ctxt, znode_hdr, NULL)) {
|
|
||||||
tile_dirty_region_for_wallpaper (ctxt);
|
|
||||||
subtract_opaque_win_znodes_above (ctxt, 0);
|
|
||||||
//subtract_opaque_ppp_znodes (ctxt);
|
|
||||||
|
|
||||||
if (IsEmptyClipRgn (&ctxt->dirty_rgn)) {
|
|
||||||
goto ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
composite_on_dirty_region (ctxt, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret:
|
|
||||||
ServerReleaseWinZNodeHeader (NULL, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rebuild_wins_region (CompositorCtxt* ctxt)
|
static void rebuild_wins_region (CompositorCtxt* ctxt)
|
||||||
{
|
{
|
||||||
int i, nr_ppps;
|
int i, nr_ppps;
|
||||||
@@ -679,29 +609,122 @@ static void on_showing_ppp (CompositorCtxt* ctxt, int zidx)
|
|||||||
SubtractRegion (&ctxt->wins_rgn, &ctxt->wins_rgn, rgn);
|
SubtractRegion (&ctxt->wins_rgn, &ctxt->wins_rgn, rgn);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_dirty_ppp (CompositorCtxt* ctxt, int zidx)
|
static BOOL reset_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
|
||||||
{
|
{
|
||||||
|
if (layer != mgTopmostLayer)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
ctxt->dirty_types = 0;
|
||||||
|
EmptyClipRgn (&ctxt->dirty_rgn);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL merge_dirty_region (CompositorCtxt* ctxt,
|
||||||
|
const ZNODEHEADER* znode_hdr, const CLIPRGN* znode_rgn)
|
||||||
|
{
|
||||||
|
EmptyClipRgn (&ctxt->inv_rgn);
|
||||||
|
if (znode_hdr && znode_hdr->dirty_rcs) {
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < znode_hdr->nr_dirty_rcs; i++) {
|
||||||
|
RECT rc;
|
||||||
|
|
||||||
|
// device coordinates to screen coordinates
|
||||||
|
rc = znode_hdr->dirty_rcs [i];
|
||||||
|
OffsetRect (&rc, znode_hdr->rc.left, znode_hdr->rc.top);
|
||||||
|
AddClipRect (&ctxt->inv_rgn, &rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (znode_rgn)
|
||||||
|
IntersectRegion (&ctxt->inv_rgn, &ctxt->inv_rgn, znode_rgn);
|
||||||
|
else
|
||||||
|
IntersectClipRect (&ctxt->inv_rgn, &ctxt->rc_screen);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsEmptyClipRgn (&ctxt->inv_rgn)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
UnionRegion (&ctxt->dirty_rgn, &ctxt->dirty_rgn, &ctxt->inv_rgn);
|
||||||
|
EmptyClipRgn (&ctxt->inv_rgn);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL merge_dirty_ppp (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
|
||||||
|
{
|
||||||
|
BOOL rc = FALSE;
|
||||||
const ZNODEHEADER* znode_hdr;
|
const ZNODEHEADER* znode_hdr;
|
||||||
CLIPRGN* rgn;
|
CLIPRGN* rgn;
|
||||||
|
|
||||||
_DBG_PRINTF ("called\n");
|
_DBG_PRINTF("called: %d\n", zidx);
|
||||||
|
|
||||||
|
/* the fallback compositor only manages znodes on the topmost layer. */
|
||||||
|
if (layer != mgTopmostLayer)
|
||||||
|
return rc;
|
||||||
|
|
||||||
znode_hdr = ServerGetPopupMenuZNodeHeader (zidx, (void**)&rgn, TRUE);
|
znode_hdr = ServerGetPopupMenuZNodeHeader (zidx, (void**)&rgn, TRUE);
|
||||||
assert (znode_hdr);
|
if (merge_dirty_region (ctxt, znode_hdr, rgn)) {
|
||||||
assert (rgn);
|
ctxt->dirty_types |= DIRTY_ZT_PPP;
|
||||||
|
rc = TRUE;
|
||||||
if (generate_dirty_region (ctxt, znode_hdr, rgn)) {
|
|
||||||
SelectClipRegion (HDC_SCREEN_SYS, &ctxt->dirty_rgn);
|
|
||||||
BitBlt (znode_hdr->mem_dc, 0, 0,
|
|
||||||
RECTW (znode_hdr->rc), RECTH (znode_hdr->rc),
|
|
||||||
HDC_SCREEN_SYS, znode_hdr->rc.left, znode_hdr->rc.top, 0);
|
|
||||||
|
|
||||||
SelectClipRect (HDC_SCREEN_SYS, &ctxt->rc_screen);
|
|
||||||
EmptyClipRgn (&ctxt->dirty_rgn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerReleasePopupMenuZNodeHeader (zidx);
|
ServerReleasePopupMenuZNodeHeader (zidx);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL merge_dirty_win (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
|
||||||
|
{
|
||||||
|
BOOL rc = FALSE;
|
||||||
|
const ZNODEHEADER* znode_hdr = NULL;
|
||||||
|
CLIPRGN *rgn;
|
||||||
|
|
||||||
|
/* the fallback compositor only manages znodes on the topmost layer. */
|
||||||
|
if (layer != mgTopmostLayer)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
_DBG_PRINTF("called: %d\n", zidx);
|
||||||
|
|
||||||
|
/* merge the dirty region */
|
||||||
|
znode_hdr = ServerGetWinZNodeHeader (NULL, zidx, (void**)&rgn, TRUE);
|
||||||
|
if (merge_dirty_region (ctxt, znode_hdr, rgn)) {
|
||||||
|
ctxt->dirty_types |= DIRTY_ZT_WIN;
|
||||||
|
rc = TRUE;
|
||||||
|
}
|
||||||
|
ServerReleaseWinZNodeHeader (NULL, zidx);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL merge_dirty_wpp (CompositorCtxt* ctxt, MG_Layer* layer)
|
||||||
|
{
|
||||||
|
BOOL rc = FALSE;
|
||||||
|
const ZNODEHEADER* znode_hdr;
|
||||||
|
|
||||||
|
znode_hdr = ServerGetWinZNodeHeader (NULL, 0, NULL, TRUE);
|
||||||
|
if (merge_dirty_region (ctxt, znode_hdr, NULL)) {
|
||||||
|
tile_dirty_region_for_wallpaper (ctxt);
|
||||||
|
//subtract_opaque_win_znodes_above (ctxt, 0);
|
||||||
|
ctxt->dirty_types |= DIRTY_ZT_WPP;
|
||||||
|
rc = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerReleaseWinZNodeHeader (NULL, 0);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
|
||||||
|
{
|
||||||
|
/* the fallback compositor only manages znodes on the topmost layer. */
|
||||||
|
if (layer != mgTopmostLayer || IsEmptyClipRgn (&ctxt->dirty_rgn))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (ctxt->dirty_types & DIRTY_ZT_PPP)
|
||||||
|
composite_ppp_znodes (ctxt);
|
||||||
|
composite_on_dirty_region (ctxt, 0);
|
||||||
|
|
||||||
|
EmptyClipRgn (&ctxt->dirty_rgn);
|
||||||
|
|
||||||
SyncUpdateDC (HDC_SCREEN_SYS);
|
SyncUpdateDC (HDC_SCREEN_SYS);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_hiding_ppp (CompositorCtxt* ctxt, int zidx)
|
static void on_hiding_ppp (CompositorCtxt* ctxt, int zidx)
|
||||||
@@ -903,9 +926,11 @@ CompositorOps __mg_fallback_compositor = {
|
|||||||
calc_mainwin_pos: calc_mainwin_pos,
|
calc_mainwin_pos: calc_mainwin_pos,
|
||||||
purge_ppp_data: purge_ppp_data,
|
purge_ppp_data: purge_ppp_data,
|
||||||
purge_win_data: purge_win_data,
|
purge_win_data: purge_win_data,
|
||||||
on_dirty_ppp: on_dirty_ppp,
|
reset_dirty_region: reset_dirty_region,
|
||||||
on_dirty_win: on_dirty_win,
|
merge_dirty_ppp: merge_dirty_ppp,
|
||||||
on_dirty_wpp: on_dirty_wpp,
|
merge_dirty_win: merge_dirty_win,
|
||||||
|
merge_dirty_wpp: merge_dirty_wpp,
|
||||||
|
refresh_dirty_region: refresh_dirty_region,
|
||||||
on_dirty_screen: on_dirty_screen,
|
on_dirty_screen: on_dirty_screen,
|
||||||
on_showing_ppp: on_showing_ppp,
|
on_showing_ppp: on_showing_ppp,
|
||||||
on_hiding_ppp: on_hiding_ppp,
|
on_hiding_ppp: on_hiding_ppp,
|
||||||
|
|||||||
@@ -88,8 +88,11 @@ static const CompositorOps* load_default_compositor (void)
|
|||||||
{
|
{
|
||||||
const char* filename = NULL;
|
const char* filename = NULL;
|
||||||
char buff [LEN_SO_NAME + 1];
|
char buff [LEN_SO_NAME + 1];
|
||||||
const CompositorOps* (*ex_compsor_get) (const char*, const CompositorOps*);
|
const CompositorOps* (*ex_compsor_get) (const char*,
|
||||||
|
const CompositorOps*, int*);
|
||||||
char* error;
|
char* error;
|
||||||
|
const CompositorOps* ops;
|
||||||
|
int version = 0;
|
||||||
|
|
||||||
filename = getenv ("MG_DEF_COMPOSITOR_SO");
|
filename = getenv ("MG_DEF_COMPOSITOR_SO");
|
||||||
if (filename == NULL) {
|
if (filename == NULL) {
|
||||||
@@ -117,7 +120,13 @@ static const CompositorOps* load_default_compositor (void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ex_compsor_get (COMPSOR_NAME_DEFAULT, &__mg_fallback_compositor);
|
ops = ex_compsor_get (COMPSOR_NAME_DEFAULT,
|
||||||
|
&__mg_fallback_compositor, &version);
|
||||||
|
|
||||||
|
if (ops == NULL || version != COMPSOR_OPS_VERSION)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return ops;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lock_znode_surface (PDC pdc, ZORDERNODE* node)
|
static void lock_znode_surface (PDC pdc, ZORDERNODE* node)
|
||||||
@@ -151,6 +160,7 @@ static void unlock_znode_surface (PDC pdc, ZORDERNODE* node)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* not optimized */
|
||||||
void __mg_composite_dirty_znodes (void)
|
void __mg_composite_dirty_znodes (void)
|
||||||
{
|
{
|
||||||
MG_Layer* layer;
|
MG_Layer* layer;
|
||||||
@@ -245,6 +255,128 @@ void __mg_composite_dirty_znodes (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* not optimized */
|
||||||
|
|
||||||
|
static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
|
||||||
|
const CompositorOps* ops)
|
||||||
|
{
|
||||||
|
ZORDERINFO* zi;
|
||||||
|
ZORDERNODE* nodes;
|
||||||
|
int i, next;
|
||||||
|
unsigned int changes_in_dc;
|
||||||
|
PDC pdc;
|
||||||
|
zi = (ZORDERINFO*)layer->zorder_info;
|
||||||
|
|
||||||
|
if (!ops->reset_dirty_region (ctxt, layer))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* travel menu znodes on the layer;
|
||||||
|
this will only work for topmost layer */
|
||||||
|
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
|
||||||
|
nodes = GET_MENUNODE(zi);
|
||||||
|
for (i = 0; i < zi->nr_popupmenus; i++) {
|
||||||
|
pdc = dc_HDC2PDC (nodes[i].mem_dc);
|
||||||
|
assert (pdc->surface->dirty_info);
|
||||||
|
|
||||||
|
lock_znode_surface (pdc, nodes + i);
|
||||||
|
changes_in_dc = pdc->surface->dirty_info->dirty_age;
|
||||||
|
if (changes_in_dc != nodes[i].changes) {
|
||||||
|
ops->merge_dirty_ppp (ctxt, layer, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* travel win znodes on the layer */
|
||||||
|
nodes = GET_ZORDERNODE(zi);
|
||||||
|
next = 0;
|
||||||
|
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
|
||||||
|
if (nodes [next].flags & ZOF_VISIBLE) {
|
||||||
|
pdc = dc_HDC2PDC (nodes[next].mem_dc);
|
||||||
|
assert (pdc->surface->dirty_info);
|
||||||
|
|
||||||
|
lock_znode_surface (pdc, nodes + next);
|
||||||
|
changes_in_dc = pdc->surface->dirty_info->dirty_age;
|
||||||
|
if (changes_in_dc != nodes[next].changes) {
|
||||||
|
ops->merge_dirty_win (ctxt, layer, next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check wallpaper pattern; only call for topmost layer */
|
||||||
|
if (layer == mgTopmostLayer) {
|
||||||
|
pdc = dc_HDC2PDC (HDC_SCREEN);
|
||||||
|
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
|
||||||
|
assert (pdc->surface->dirty_info);
|
||||||
|
lock_znode_surface (pdc, nodes);
|
||||||
|
changes_in_dc = pdc->surface->dirty_info->dirty_age;
|
||||||
|
if (changes_in_dc != nodes[0].changes) {
|
||||||
|
ops->merge_dirty_wpp (ctxt, layer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ops->refresh_dirty_region (ctxt, layer);
|
||||||
|
|
||||||
|
/* unlock the znode surfaces for popup menus */
|
||||||
|
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
|
||||||
|
nodes = GET_MENUNODE(zi);
|
||||||
|
for (i = 0; i < zi->nr_popupmenus; i++) {
|
||||||
|
pdc = dc_HDC2PDC (nodes[i].mem_dc);
|
||||||
|
|
||||||
|
nodes[i].changes = pdc->surface->dirty_info->dirty_age;
|
||||||
|
pdc->surface->dirty_info->nr_dirty_rcs = 0;
|
||||||
|
unlock_znode_surface (pdc, nodes + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* unlock the znode surfaces for windows */
|
||||||
|
nodes = GET_ZORDERNODE(zi);
|
||||||
|
next = 0;
|
||||||
|
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
|
||||||
|
if (nodes [next].flags & ZOF_VISIBLE) {
|
||||||
|
pdc = dc_HDC2PDC (nodes[next].mem_dc);
|
||||||
|
nodes[next].changes = pdc->surface->dirty_info->dirty_age;
|
||||||
|
pdc->surface->dirty_info->nr_dirty_rcs = 0;
|
||||||
|
unlock_znode_surface (pdc, nodes + next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* unlock the znode surfaces for wallpaper pattern;
|
||||||
|
only for topmost layer */
|
||||||
|
if (layer == mgTopmostLayer) {
|
||||||
|
pdc = dc_HDC2PDC (HDC_SCREEN);
|
||||||
|
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
|
||||||
|
nodes[0].changes = pdc->surface->dirty_info->dirty_age;
|
||||||
|
pdc->surface->dirty_info->nr_dirty_rcs = 0;
|
||||||
|
unlock_znode_surface (pdc, nodes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void __mg_composite_dirty_znodes (void)
|
||||||
|
{
|
||||||
|
MG_Layer* layer;
|
||||||
|
CompositorCtxt* ctxt;
|
||||||
|
const CompositorOps* ops = ServerSelectCompositor (NULL, &ctxt);
|
||||||
|
|
||||||
|
assert (ops);
|
||||||
|
|
||||||
|
/* first handle the topmost layer */
|
||||||
|
composite_layer (mgTopmostLayer, ctxt, ops);
|
||||||
|
|
||||||
|
/* then handle other layers */
|
||||||
|
layer = mgLayers;
|
||||||
|
while (layer) {
|
||||||
|
if (layer != mgTopmostLayer) {
|
||||||
|
composite_layer (layer, ctxt, ops);
|
||||||
|
}
|
||||||
|
|
||||||
|
layer = layer->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* optimized */
|
||||||
|
|
||||||
static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
|
static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
|
||||||
CompositorCtxt* ctxt, MG_Layer* layer)
|
CompositorCtxt* ctxt, MG_Layer* layer)
|
||||||
{
|
{
|
||||||
|
|||||||
+37
-46
@@ -80,7 +80,6 @@
|
|||||||
#include "drawsemop.h"
|
#include "drawsemop.h"
|
||||||
#include "readbmp.h"
|
#include "readbmp.h"
|
||||||
|
|
||||||
static int oldx = -1, oldy;
|
|
||||||
static RECT cliprc = {0, 0, 0, 0};
|
static RECT cliprc = {0, 0, 0, 0};
|
||||||
|
|
||||||
#ifdef _MGHAVE_CURSOR
|
#ifdef _MGHAVE_CURSOR
|
||||||
@@ -903,6 +902,7 @@ HCURSOR GUIAPI GetDefaultCursor (void)
|
|||||||
/* The return value indicates whether mouse has moved. */
|
/* The return value indicates whether mouse has moved. */
|
||||||
/* TRUE for moved. */
|
/* TRUE for moved. */
|
||||||
/* NOTE that only server can call this function. */
|
/* NOTE that only server can call this function. */
|
||||||
|
/* Since 5.0.0, this function only changes the cursor position */
|
||||||
BOOL kernel_RefreshCursor (int* x, int* y, int* button)
|
BOOL kernel_RefreshCursor (int* x, int* y, int* button)
|
||||||
{
|
{
|
||||||
int curx, cury;
|
int curx, cury;
|
||||||
@@ -912,51 +912,14 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
IAL_GetMouseXY (x, y);
|
IAL_GetMouseXY (x, y);
|
||||||
SHAREDRES_MOUSEX = curx = *x;
|
curx = *x;
|
||||||
SHAREDRES_MOUSEY = cury = *y;
|
cury = *y;
|
||||||
if (button)
|
if (button)
|
||||||
SHAREDRES_BUTTON = *button = IAL_GetMouseButton ();
|
SHAREDRES_BUTTON = *button = IAL_GetMouseButton ();
|
||||||
|
|
||||||
if (oldx != curx || oldy != cury) {
|
if (SHAREDRES_MOUSEX != curx || SHAREDRES_MOUSEY != cury) {
|
||||||
|
SHAREDRES_MOUSEX = curx;
|
||||||
#ifdef _MGHAVE_CURSOR
|
SHAREDRES_MOUSEY = cury;
|
||||||
#ifdef _MGSCHEMA_SHAREDFB
|
|
||||||
LOCK_CURSOR_SEM ();
|
|
||||||
CSR_CURSORX = curx;
|
|
||||||
CSR_CURSORY = cury;
|
|
||||||
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
|
|
||||||
if (get_hidecursor_sem_val ()) {
|
|
||||||
reset_hidecursor_sem ();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
hidecursor ();
|
|
||||||
}
|
|
||||||
|
|
||||||
showcursor ();
|
|
||||||
GAL_SyncUpdate (__gal_screen);
|
|
||||||
}
|
|
||||||
|
|
||||||
// GAL_SyncUpdate (__gal_screen);
|
|
||||||
UNLOCK_CURSOR_SEM ();
|
|
||||||
#else /* _MGSCHEMA_SHAREDFB */
|
|
||||||
CSR_CURSORX = curx;
|
|
||||||
CSR_CURSORY = cury;
|
|
||||||
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
|
|
||||||
if (csr_bmp.bmBits) {
|
|
||||||
hidecursor ();
|
|
||||||
showcursor ();
|
|
||||||
GAL_SyncUpdate (__gal_screen);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
PCURSOR pcsr = (PCURSOR)CSR_CURRENT;
|
|
||||||
GAL_MoveCursor (pcsr->surface, curx, cury);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* _MGSCHEMA_COMPOSITING */
|
|
||||||
#endif /* _MGHAVE_CURSOR */
|
|
||||||
|
|
||||||
oldx = curx;
|
|
||||||
oldy = cury;
|
|
||||||
moved = TRUE;
|
moved = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -965,21 +928,49 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
|
|||||||
|
|
||||||
#ifdef _MGHAVE_CURSOR
|
#ifdef _MGHAVE_CURSOR
|
||||||
|
|
||||||
#ifdef _MGSCHEMA_SHAREDFB
|
/* Change cursor position and show cursor hidden by client GDI function */
|
||||||
/* show cursor hidden by client GDI function */
|
|
||||||
void kernel_ReShowCursor (void)
|
void kernel_ReShowCursor (void)
|
||||||
{
|
{
|
||||||
|
#ifdef _MGSCHEMA_SHAREDFB
|
||||||
LOCK_CURSOR_SEM ();
|
LOCK_CURSOR_SEM ();
|
||||||
|
|
||||||
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
|
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
|
||||||
if (get_hidecursor_sem_val ()) {
|
if (get_hidecursor_sem_val ()) {
|
||||||
reset_hidecursor_sem ();
|
reset_hidecursor_sem ();
|
||||||
showcursor ();
|
showcursor ();
|
||||||
GAL_SyncUpdate (__gal_screen);
|
GAL_SyncUpdate (__gal_screen);
|
||||||
}
|
}
|
||||||
|
else if (CSR_CURSORX != SHAREDRES_MOUSEX ||
|
||||||
|
CSR_CURSORY != SHAREDRES_MOUSEY) {
|
||||||
|
CSR_CURSORX = SHAREDRES_MOUSEX;
|
||||||
|
CSR_CURSORY = SHAREDRES_MOUSEY;
|
||||||
|
hidecursor ();
|
||||||
|
showcursor ();
|
||||||
|
GAL_SyncUpdate (__gal_screen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UNLOCK_CURSOR_SEM ();
|
UNLOCK_CURSOR_SEM ();
|
||||||
|
#else /* _MGSCHEMA_SHAREDFB */
|
||||||
|
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT &&
|
||||||
|
(CSR_CURSORX != SHAREDRES_MOUSEX ||
|
||||||
|
CSR_CURSORY != SHAREDRES_MOUSEY)) {
|
||||||
|
|
||||||
|
CSR_CURSORX = SHAREDRES_MOUSEX;
|
||||||
|
CSR_CURSORY = SHAREDRES_MOUSEY;
|
||||||
|
if (csr_bmp.bmBits) {
|
||||||
|
hidecursor ();
|
||||||
|
showcursor ();
|
||||||
|
GAL_SyncUpdate (__gal_screen);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
PCURSOR pcsr = (PCURSOR)CSR_CURRENT;
|
||||||
|
GAL_MoveCursor (pcsr->surface, CSR_CURSORX, CSR_CURSORY);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif /* _MGSCHEMA_COMPOSITING */
|
||||||
}
|
}
|
||||||
#endif /* defined _MGSCHEMA_SHAREDFB */
|
|
||||||
|
|
||||||
/* Always call with "setdef = FALSE" for clients at server side. */
|
/* Always call with "setdef = FALSE" for clients at server side. */
|
||||||
HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL setdef)
|
HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL setdef)
|
||||||
|
|||||||
+44
-31
@@ -298,8 +298,10 @@ static int update_client_window_rgn (int cli, HWND hwnd)
|
|||||||
msg.lParam = MAKELONG (crc->rc.right, crc->rc.bottom);
|
msg.lParam = MAKELONG (crc->rc.right, crc->rc.bottom);
|
||||||
|
|
||||||
ret = __mg_send2client (&msg, mgClients + cli);
|
ret = __mg_send2client (&msg, mgClients + cli);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
_WRN_PRINTF ("__mg_send2client failed\n");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
crc = crc->next;
|
crc = crc->next;
|
||||||
}
|
}
|
||||||
@@ -357,8 +359,7 @@ static intptr_t cliAllocZOrderNode (PMAINWIN pWin, const COMPOSITINGINFO* ct_inf
|
|||||||
assert (pWin->surf && pWin->surf->shared_header);
|
assert (pWin->surf && pWin->surf->shared_header);
|
||||||
|
|
||||||
info.surf_flags = pWin->surf->flags;
|
info.surf_flags = pWin->surf->flags;
|
||||||
info.surf_size = pWin->surf->shared_header->buf_size;
|
info.surf_size = pWin->surf->shared_header->map_size;
|
||||||
info.surf_size += sizeof (*pWin->surf->shared_header);
|
|
||||||
|
|
||||||
if (ct_info) {
|
if (ct_info) {
|
||||||
info.ct = ct_info->type;
|
info.ct = ct_info->type;
|
||||||
@@ -474,8 +475,7 @@ static intptr_t cliMoveWindow (PMAINWIN pWin, const RECT* rcWin, int fd)
|
|||||||
|
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
info.surf_flags = pWin->surf->flags;
|
info.surf_flags = pWin->surf->flags;
|
||||||
info.surf_size = pWin->surf->shared_header->buf_size;
|
info.surf_size = pWin->surf->shared_header->map_size;
|
||||||
info.surf_size += sizeof (*pWin->surf->shared_header);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ClientRequestEx2 (&req, NULL, 0, fd,
|
if (ClientRequestEx2 (&req, NULL, 0, fd,
|
||||||
@@ -529,8 +529,7 @@ static intptr_t cliStartTrackPopupMenu (PTRACKMENUINFO ptmi)
|
|||||||
assert (surf->shared_header);
|
assert (surf->shared_header);
|
||||||
|
|
||||||
info.surf_flags = surf->flags;
|
info.surf_flags = surf->flags;
|
||||||
info.surf_size = surf->shared_header->buf_size;
|
info.surf_size = surf->shared_header->map_size;
|
||||||
info.surf_size += sizeof (*surf->shared_header);
|
|
||||||
if (ClientRequestEx2 (&req, NULL, 0, surf->shared_header->fd,
|
if (ClientRequestEx2 (&req, NULL, 0, surf->shared_header->fd,
|
||||||
&ret, sizeof (intptr_t), NULL) < 0)
|
&ret, sizeof (intptr_t), NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -818,6 +817,9 @@ static int srvAllocZOrderNode (int cli, HWND hwnd, HWND main_win,
|
|||||||
if (cli == 0) {
|
if (cli == 0) {
|
||||||
PMAINWIN pwin = (PMAINWIN)hwnd;
|
PMAINWIN pwin = (PMAINWIN)hwnd;
|
||||||
surf = pwin->surf;
|
surf = pwin->surf;
|
||||||
|
|
||||||
|
// prevent to free this surface when deleting memdc for znode.
|
||||||
|
surf->refcount++;
|
||||||
}
|
}
|
||||||
else if (fd >= 0) {
|
else if (fd >= 0) {
|
||||||
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
|
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
|
||||||
@@ -866,16 +868,25 @@ static BOOL _cb_update_cli_znode (void* context,
|
|||||||
if (znode->cli == cli && znode->flags & ZOF_VISIBLE && znode->hwnd) {
|
if (znode->cli == cli && znode->flags & ZOF_VISIBLE && znode->hwnd) {
|
||||||
MSG msg = {znode->hwnd, MSG_UPDATECLIWIN, 0, 0, __mg_tick_counter};
|
MSG msg = {znode->hwnd, MSG_UPDATECLIWIN, 0, 0, __mg_tick_counter};
|
||||||
|
|
||||||
if (!IsRectEmpty(&(znode->dirty_rc))) {
|
if (!IsRectEmpty(&znode->dirty_rc)) {
|
||||||
|
|
||||||
IntersectRect(&rcInv, &znode->dirty_rc, &rcScr);
|
if (IntersectRect(&rcScr, &znode->rc, &rcScr) &&
|
||||||
|
IntersectRect(&rcInv, &znode->dirty_rc, &rcScr)) {
|
||||||
|
rcInv = znode->dirty_rc;
|
||||||
|
msg.wParam = MAKELONG (rcInv.left, rcInv.top);
|
||||||
|
msg.lParam = MAKELONG (rcInv.right, rcInv.bottom);
|
||||||
|
|
||||||
msg.wParam = MAKELONG (rcInv.left, rcInv.top);
|
_DBG_PRINTF ("Send MSG_UPDATECLIWIN to client window (%s): "
|
||||||
msg.lParam = MAKELONG (rcInv.right, rcInv.bottom);
|
"%d, %d, %d x %d\n",
|
||||||
|
znode->caption,
|
||||||
|
rcInv.left, rcInv.top,
|
||||||
|
rcInv.right - rcInv.left,
|
||||||
|
rcInv.bottom - rcInv.top);
|
||||||
|
|
||||||
SetRectEmpty (&(znode->dirty_rc));
|
__mg_send2client (&msg, mgClients + znode->cli);
|
||||||
|
}
|
||||||
|
|
||||||
__mg_send2client (&msg, mgClients + znode->cli);
|
SetRectEmpty (&znode->dirty_rc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -964,28 +975,31 @@ static int srvMoveWindow (int cli, int idx_znode, const RECT* rcWin,
|
|||||||
if (cli == 0) {
|
if (cli == 0) {
|
||||||
PMAINWIN pwin = (PMAINWIN)hwnd;
|
PMAINWIN pwin = (PMAINWIN)hwnd;
|
||||||
surf = pwin->surf;
|
surf = pwin->surf;
|
||||||
|
// prevent to free this surface when deleting memdc for znode.
|
||||||
|
surf->refcount++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
|
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
|
||||||
close (fd);
|
close (fd);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (surf) {
|
if (surf) {
|
||||||
memdc = CreateMemDCFromSurface (surf);
|
memdc = CreateMemDCFromSurface (surf);
|
||||||
if (memdc == HDC_INVALID) {
|
if (memdc == HDC_INVALID) {
|
||||||
if (cli > 0) {
|
if (cli > 0) {
|
||||||
GAL_FreeSurface (surf);
|
GAL_FreeSurface (surf);
|
||||||
|
}
|
||||||
|
|
||||||
|
_ERR_PRINTF("KERNEL: failed to create new memory dc for znode\n");
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
_ERR_PRINTF("KERNEL: failed to create new memory dc for znode\n");
|
else {
|
||||||
|
_ERR_PRINTF("KERNEL: failed to attach to shared surface\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fd >= 0) {
|
|
||||||
_ERR_PRINTF("KERNEL: failed to attach to shared surface\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif /* def _MGSCHEMA_COMPOSITING */
|
#endif /* def _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
ret = dskMoveWindow (cli, idx_znode, memdc, rcWin);
|
ret = dskMoveWindow (cli, idx_znode, memdc, rcWin);
|
||||||
@@ -1197,6 +1211,7 @@ static int do_drag_drop_window (int msg, int x, int y)
|
|||||||
#ifndef _MGSCHEMA_COMPOSITING
|
#ifndef _MGSCHEMA_COMPOSITING
|
||||||
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
|
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
|
||||||
_dd_info.rc.right, _dd_info.rc.bottom);
|
_dd_info.rc.right, _dd_info.rc.bottom);
|
||||||
|
SyncUpdateDC (HDC_SCREEN_SYS);
|
||||||
#else /* not defined _MGSCHEMA_COMPOSITING */
|
#else /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
msg.wParam = MAKELONG (_dd_info.rc.left, _dd_info.rc.top);
|
msg.wParam = MAKELONG (_dd_info.rc.left, _dd_info.rc.top);
|
||||||
@@ -1224,6 +1239,7 @@ static int do_drag_drop_window (int msg, int x, int y)
|
|||||||
SetPenColor (HDC_SCREEN_SYS, PIXEL_lightwhite);
|
SetPenColor (HDC_SCREEN_SYS, PIXEL_lightwhite);
|
||||||
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
|
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
|
||||||
_dd_info.rc.right, _dd_info.rc.bottom);
|
_dd_info.rc.right, _dd_info.rc.bottom);
|
||||||
|
SyncUpdateDC (HDC_SCREEN_SYS);
|
||||||
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
/* post MSG_WINDOWDROPPED to the target window */
|
/* post MSG_WINDOWDROPPED to the target window */
|
||||||
@@ -3677,9 +3693,7 @@ static int srvDesktopCommand (int id)
|
|||||||
unlock_zi_for_read (__mg_zorder_info);
|
unlock_zi_for_read (__mg_zorder_info);
|
||||||
}
|
}
|
||||||
else if (id == IDM_ENDSESSION) {
|
else if (id == IDM_ENDSESSION) {
|
||||||
if (SERVER_HAS_NO_MAINWINDOW()) {
|
SendMessage (HWND_DESKTOP, MSG_ENDSESSION, 0, 0);
|
||||||
ExitGUISafely (-1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#ifdef _MGHAVE_MENU
|
#ifdef _MGHAVE_MENU
|
||||||
else if (id >= IDM_FIRSTWINDOW && id < IDM_SWITCH_LAYER) {
|
else if (id >= IDM_FIRSTWINDOW && id < IDM_SWITCH_LAYER) {
|
||||||
@@ -4094,10 +4108,8 @@ static int srvSesseionMessageHandler (int message, WPARAM wParam, LPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MSG_ERASEDESKTOP:
|
case MSG_ERASEDESKTOP:
|
||||||
|
|
||||||
if (dsk_ops->paint_desktop)
|
if (dsk_ops->paint_desktop)
|
||||||
dsk_ops->paint_desktop(dt_context, hDesktopDC, (PRECT)lParam);
|
dsk_ops->paint_desktop(dt_context, hDesktopDC, (PRECT)lParam);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSG_DT_KEYLONGPRESS:
|
case MSG_DT_KEYLONGPRESS:
|
||||||
@@ -4114,6 +4126,7 @@ static int srvSesseionMessageHandler (int message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
#ifdef _MGHAVE_MENU
|
#ifdef _MGHAVE_MENU
|
||||||
case MSG_DT_RBUTTONUP:
|
case MSG_DT_RBUTTONUP:
|
||||||
|
if (sg_DesktopMenu)
|
||||||
srvUpdateDesktopMenu ();
|
srvUpdateDesktopMenu ();
|
||||||
#endif
|
#endif
|
||||||
case MSG_DT_LBUTTONDOWN:
|
case MSG_DT_LBUTTONDOWN:
|
||||||
@@ -4375,7 +4388,7 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
|
|||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
case MSG_CALC_POSITION:
|
case MSG_CALC_POSITION:
|
||||||
if (mgIsServer) {
|
if (mgIsServer) {
|
||||||
dskCalculateDefaultPosition (0, (CALCPOSINFO*)lParam);
|
dskCalculateDefaultPosition ((int)wParam, (CALCPOSINFO*)lParam);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+51
-30
@@ -188,7 +188,7 @@ static BOOL subtract_rgn_by_node (PCLIPRGN region, const ZORDERINFO* zi,
|
|||||||
else
|
else
|
||||||
SubtractClipRect(region, &(node->rc));
|
SubtractClipRect(region, &(node->rc));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE; // !IsEmptyClipRgn(region); We must return TRUE for this callback.
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* not defined _MGSCHEMA_COMPOSITING */
|
#else /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
@@ -427,15 +427,18 @@ void __mg_update_window (HWND hwnd,
|
|||||||
((pWin->WinType == TYPE_CONTROL &&
|
((pWin->WinType == TYPE_CONTROL &&
|
||||||
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)) ||
|
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)) ||
|
||||||
pWin->WinType != TYPE_CONTROL) && pWin->dwStyle & WS_VISIBLE) {
|
pWin->WinType != TYPE_CONTROL) && pWin->dwStyle & WS_VISIBLE) {
|
||||||
RECT invrc;
|
RECT rcInv;
|
||||||
SetRect(&invrc, left, top, right, bottom);
|
SetRect(&rcInv, left, top, right, bottom);
|
||||||
|
|
||||||
if (IsRectEmpty (&invrc)) {
|
_DBG_PRINTF ("Update window (%s): %d, %d, %d, %d\n",
|
||||||
|
pWin->spCaption, left, top, right, bottom);
|
||||||
|
|
||||||
|
if (IsRectEmpty (&rcInv)) {
|
||||||
SendAsyncMessage ((HWND)pWin, MSG_NCPAINT, 0, 0);
|
SendAsyncMessage ((HWND)pWin, MSG_NCPAINT, 0, 0);
|
||||||
InvalidateRect ((HWND)pWin, NULL, TRUE);
|
InvalidateRect ((HWND)pWin, NULL, TRUE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
RECT rcTemp, rcInv, rcWin;
|
RECT rcTemp, rcWin;
|
||||||
|
|
||||||
if (pWin->WinType == TYPE_CONTROL &&
|
if (pWin->WinType == TYPE_CONTROL &&
|
||||||
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)){
|
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)){
|
||||||
@@ -444,13 +447,18 @@ void __mg_update_window (HWND hwnd,
|
|||||||
else
|
else
|
||||||
GetWindowRect(hwnd, &rcWin);
|
GetWindowRect(hwnd, &rcWin);
|
||||||
|
|
||||||
if (IntersectRect (&rcTemp,
|
/* XXX: when we move a window fast, there are some dirty rectangles
|
||||||
&rcWin, &invrc)) {
|
were not updated. We update whole area of the window for a work
|
||||||
|
around. */
|
||||||
|
if (IntersectRect (&rcTemp, &rcWin, &rcInv)) {
|
||||||
dskScreenToWindow (pWin, &rcTemp, &rcInv);
|
dskScreenToWindow (pWin, &rcTemp, &rcInv);
|
||||||
SendAsyncMessage ((HWND)pWin,
|
SendAsyncMessage ((HWND)pWin,
|
||||||
MSG_NCPAINT, 0, (LPARAM)(&rcInv));
|
MSG_NCPAINT, 0, 0); // (LPARAM)(&rcInv));
|
||||||
dskScreenToClient (pWin, &rcTemp, &rcInv);
|
dskScreenToClient (pWin, &rcTemp, &rcInv);
|
||||||
InvalidateRect ((HWND)pWin, &rcInv, TRUE);
|
InvalidateRect ((HWND)pWin, NULL/*&rcInv*/, TRUE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_DBG_PRINTF ("IGNORED update\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -465,6 +473,9 @@ static int update_client_window (ZORDERNODE* znode, const RECT* rc)
|
|||||||
|
|
||||||
if (znode->cli != 0) {
|
if (znode->cli != 0) {
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
_DBG_PRINTF ("Update window (%s): %d, %d, %d x %d\n",
|
||||||
|
znode->caption, rc->left, rc->top,
|
||||||
|
RECTWP(rc), RECTHP(rc));
|
||||||
|
|
||||||
if (IsRectEmpty (&znode->dirty_rc)) {
|
if (IsRectEmpty (&znode->dirty_rc)) {
|
||||||
SetRect (&znode->dirty_rc,
|
SetRect (&znode->dirty_rc,
|
||||||
@@ -473,8 +484,8 @@ static int update_client_window (ZORDERNODE* znode, const RECT* rc)
|
|||||||
else {
|
else {
|
||||||
GetBoundRect (&znode->dirty_rc, &znode->dirty_rc, rc);
|
GetBoundRect (&znode->dirty_rc, &znode->dirty_rc, rc);
|
||||||
}
|
}
|
||||||
|
mgClients [znode->cli].has_dirty = TRUE;
|
||||||
}
|
}
|
||||||
mgClients [znode->cli].has_dirty = TRUE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* defined _MGRM_PROCESSES */
|
#endif /* defined _MGRM_PROCESSES */
|
||||||
@@ -494,7 +505,13 @@ static BOOL _cb_update_znode (void* context,
|
|||||||
{
|
{
|
||||||
const RECT* rc = (RECT*)context;
|
const RECT* rc = (RECT*)context;
|
||||||
|
|
||||||
if (znode->flags & ZOF_VISIBLE && znode->flags & ZOF_IF_REFERENCE) {
|
_DBG_PRINTF ("Checking window (%s), visibility: %s, referred: %s\n", znode->caption,
|
||||||
|
(znode->flags & ZOF_VISIBLE)? "TRUE" : "FALSE",
|
||||||
|
(znode->flags & ZOF_IF_REFERENCE)? "TRUE" : "FALSE");
|
||||||
|
|
||||||
|
if (znode->flags & ZOF_VISIBLE &&
|
||||||
|
znode->flags & ZOF_IF_REFERENCE) {
|
||||||
|
_DBG_PRINTF ("Widnow (%s) will be updated\n", znode->caption);
|
||||||
update_client_window (znode, rc);
|
update_client_window (znode, rc);
|
||||||
znode->flags &= ~ZOF_IF_REFERENCE;
|
znode->flags &= ~ZOF_IF_REFERENCE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1570,6 +1587,8 @@ static int srvStartTrackPopupMenu (int cli, const RECT* rc, HWND ptmi,
|
|||||||
GAL_Surface* surf;
|
GAL_Surface* surf;
|
||||||
if (cli == 0) {
|
if (cli == 0) {
|
||||||
surf = GetSurfaceFromDC (((PTRACKMENUINFO)ptmi)->dc);
|
surf = GetSurfaceFromDC (((PTRACKMENUINFO)ptmi)->dc);
|
||||||
|
// prevent to free this surface when deleting memdc for znode.
|
||||||
|
surf->refcount++;
|
||||||
}
|
}
|
||||||
else if (fd >= 0) {
|
else if (fd >= 0) {
|
||||||
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
|
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
|
||||||
@@ -3233,7 +3252,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
|||||||
slot = nodes [idx_znode].next;
|
slot = nodes [idx_znode].next;
|
||||||
for (; slot != 0; slot = nodes [slot].next) {
|
for (; slot != 0; slot = nodes [slot].next) {
|
||||||
if (nodes [slot].flags & ZOF_VISIBLE &&
|
if (nodes [slot].flags & ZOF_VISIBLE &&
|
||||||
DoesIntersect (rcWin, &nodes [slot].rc)) {
|
DoesIntersect (rcWin, &nodes [slot].rc)) {
|
||||||
nodes [slot].age++;
|
nodes [slot].age++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3246,6 +3265,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
|||||||
//SetClipRgn (&sg_UpdateRgn, rcInv + i);
|
//SetClipRgn (&sg_UpdateRgn, rcInv + i);
|
||||||
SetClipRgn (&sg_UpdateRgn, &(nodes [idx_znode].rc));
|
SetClipRgn (&sg_UpdateRgn, &(nodes [idx_znode].rc));
|
||||||
|
|
||||||
|
/* znodes below current znode in the same level */
|
||||||
slot = nodes [idx_znode].next;
|
slot = nodes [idx_znode].next;
|
||||||
for (; slot > 0; slot = nodes [slot].next) {
|
for (; slot > 0; slot = nodes [slot].next) {
|
||||||
if (nodes [slot].flags & ZOF_VISIBLE &&
|
if (nodes [slot].flags & ZOF_VISIBLE &&
|
||||||
@@ -3256,6 +3276,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* znodes below current level */
|
||||||
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
|
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
|
||||||
if (type > _zof_types_for_level[level]) {
|
if (type > _zof_types_for_level[level]) {
|
||||||
slot = zi->first_in_levels[level];
|
slot = zi->first_in_levels[level];
|
||||||
@@ -3370,12 +3391,10 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
|||||||
do_for_all_znodes (NULL, zi, _cb_exclude_rc, ZT_ALL);
|
do_for_all_znodes (NULL, zi, _cb_exclude_rc, ZT_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (slot && slot != idx_znode) {
|
while (slot) {
|
||||||
#if 0
|
if (slot == idx_znode)
|
||||||
if (nodes [slot].flags & ZOF_VISIBLE) {
|
break;
|
||||||
ExcludeClipRect (HDC_SCREEN_SYS, &nodes [slot].rc);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/* houhh 20090730, if slot window is no regular.*/
|
/* houhh 20090730, if slot window is no regular.*/
|
||||||
if (nodes [slot].flags & ZOF_VISIBLE) {
|
if (nodes [slot].flags & ZOF_VISIBLE) {
|
||||||
if (nodes[slot].idx_mask_rect == 0) {
|
if (nodes[slot].idx_mask_rect == 0) {
|
||||||
@@ -3402,6 +3421,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
|||||||
}
|
}
|
||||||
slot = nodes [slot].next;
|
slot = nodes [slot].next;
|
||||||
}
|
}
|
||||||
|
|
||||||
BitBlt (HDC_SCREEN_SYS, rcOld.left, rcOld.top,
|
BitBlt (HDC_SCREEN_SYS, rcOld.left, rcOld.top,
|
||||||
MIN (RECTWP (rcWin), RECTW (rcOld)),
|
MIN (RECTWP (rcWin), RECTW (rcOld)),
|
||||||
MIN (RECTHP (rcWin), RECTH (rcOld)),
|
MIN (RECTHP (rcWin), RECTH (rcOld)),
|
||||||
@@ -3415,17 +3435,22 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* unlock zi for change ... */
|
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
|
||||||
unlock_zi_for_change (zi);
|
|
||||||
|
|
||||||
/* check the invalid rect of the window */
|
if (nodes [0].flags & ZOF_IF_REFERENCE) {
|
||||||
|
SendMessage (HWND_DESKTOP,
|
||||||
|
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
|
||||||
|
nodes [0].flags &= ~ZOF_IF_REFERENCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check the invalid rectangles of the being moved window */
|
||||||
EmptyClipRgn (&sg_UpdateRgn);
|
EmptyClipRgn (&sg_UpdateRgn);
|
||||||
nInvCount = SubtractRect (rcInv, &rcOld, &rcScr);
|
nInvCount = SubtractRect (rcInv, &rcOld, &rcScr);
|
||||||
for (i = 0; i < nInvCount; i++) {
|
for (i = 0; i < nInvCount; i++) {
|
||||||
AddClipRect (&sg_UpdateRgn, rcInv + i);
|
AddClipRect (&sg_UpdateRgn, rcInv + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Since 5.0.0: handle levels */
|
/* Since 5.0.0: handle levels above the current level */
|
||||||
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
|
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
|
||||||
if (type < _zof_types_for_level[level]) {
|
if (type < _zof_types_for_level[level]) {
|
||||||
slot = zi->first_in_levels[level];
|
slot = zi->first_in_levels[level];
|
||||||
@@ -3437,6 +3462,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* handle znodes above the current znode */
|
||||||
slot = *first;
|
slot = *first;
|
||||||
for (; slot != idx_znode; slot = nodes [slot].next) {
|
for (; slot != idx_znode; slot = nodes [slot].next) {
|
||||||
if (nodes [slot].flags & ZOF_VISIBLE &&
|
if (nodes [slot].flags & ZOF_VISIBLE &&
|
||||||
@@ -3444,20 +3470,15 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
|||||||
AddClipRect(&sg_UpdateRgn, &rcInter);
|
AddClipRect(&sg_UpdateRgn, &rcInter);
|
||||||
}
|
}
|
||||||
|
|
||||||
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
|
|
||||||
|
|
||||||
if (nodes [0].flags & ZOF_IF_REFERENCE) {
|
|
||||||
SendMessage (HWND_DESKTOP,
|
|
||||||
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
|
|
||||||
nodes [0].flags &= ~ZOF_IF_REFERENCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
OffsetRegion (&sg_UpdateRgn,
|
OffsetRegion (&sg_UpdateRgn,
|
||||||
rcWin->left - rcOld.left,
|
rcWin->left - rcOld.left,
|
||||||
rcWin->top - rcOld.top);
|
rcWin->top - rcOld.top);
|
||||||
|
|
||||||
update_client_window_rgn (nodes [idx_znode].cli,
|
update_client_window_rgn (nodes [idx_znode].cli,
|
||||||
nodes [idx_znode].hwnd);
|
nodes [idx_znode].hwnd);
|
||||||
|
|
||||||
|
/* unlock zi for change ... */
|
||||||
|
unlock_zi_for_change (zi);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lock_zi_for_change (zi);
|
lock_zi_for_change (zi);
|
||||||
|
|||||||
+3
-1
@@ -348,7 +348,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
|||||||
}
|
}
|
||||||
|
|
||||||
timeout_count = __mg_tick_counter + timeout_threshold;
|
timeout_count = __mg_tick_counter + timeout_threshold;
|
||||||
// There was a event occurred.
|
// There was an event occurred.
|
||||||
if (event & IAL_MOUSEEVENT) {
|
if (event & IAL_MOUSEEVENT) {
|
||||||
if (!IAL_UpdateMouse ())
|
if (!IAL_UpdateMouse ())
|
||||||
return 0;
|
return 0;
|
||||||
@@ -459,6 +459,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
|||||||
#endif
|
#endif
|
||||||
ke->event = KE_KEYUP;
|
ke->event = KE_KEYUP;
|
||||||
ke->scancode = i;
|
ke->scancode = i;
|
||||||
|
olddownkey = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -765,6 +766,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
|||||||
if(oldkeystate[i] && !keystate[i]) {
|
if(oldkeystate[i] && !keystate[i]) {
|
||||||
ke->event = KE_KEYUP;
|
ke->event = KE_KEYUP;
|
||||||
ke->scancode = i;
|
ke->scancode = i;
|
||||||
|
olddownkey = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-3
@@ -478,8 +478,12 @@ int InitGUI (int argc, const char* agr[])
|
|||||||
/* Since 5.0.0
|
/* Since 5.0.0
|
||||||
* Copy the video engine information to the shared resource segement
|
* Copy the video engine information to the shared resource segement
|
||||||
*/
|
*/
|
||||||
strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
|
//strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
|
||||||
strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
|
strcpy (SHAREDRES_VIDEO_ENGINE, engine);
|
||||||
|
//strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
|
||||||
|
strcpy (SHAREDRES_VIDEO_MODE, mode);
|
||||||
|
#if 0 /* deprecated code */
|
||||||
|
// these fileds will be initialized by DRM engine.
|
||||||
if (GetMgEtcValue (engine, "device",
|
if (GetMgEtcValue (engine, "device",
|
||||||
SHAREDRES_VIDEO_DEVICE, LEN_DEVICE_NAME) < 0)
|
SHAREDRES_VIDEO_DEVICE, LEN_DEVICE_NAME) < 0)
|
||||||
*SHAREDRES_VIDEO_DEVICE = 0;
|
*SHAREDRES_VIDEO_DEVICE = 0;
|
||||||
@@ -489,6 +493,7 @@ int InitGUI (int argc, const char* agr[])
|
|||||||
if (GetMgEtcValue (engine, "exdriver",
|
if (GetMgEtcValue (engine, "exdriver",
|
||||||
SHAREDRES_VIDEO_EXDRIVER, LEN_EXDRIVER_NAME) < 0)
|
SHAREDRES_VIDEO_EXDRIVER, LEN_EXDRIVER_NAME) < 0)
|
||||||
*SHAREDRES_VIDEO_EXDRIVER = 0;
|
*SHAREDRES_VIDEO_EXDRIVER = 0;
|
||||||
|
#endif /* deprecated code */
|
||||||
|
|
||||||
SHAREDRES_VIDEO_DPI = __gal_screen->dpi;
|
SHAREDRES_VIDEO_DPI = __gal_screen->dpi;
|
||||||
SHAREDRES_VIDEO_HRES = __gal_screen->w;
|
SHAREDRES_VIDEO_HRES = __gal_screen->w;
|
||||||
@@ -498,6 +503,8 @@ int InitGUI (int argc, const char* agr[])
|
|||||||
SHAREDRES_VIDEO_GMASK = __gal_screen->format->Gmask;
|
SHAREDRES_VIDEO_GMASK = __gal_screen->format->Gmask;
|
||||||
SHAREDRES_VIDEO_BMASK = __gal_screen->format->Bmask;
|
SHAREDRES_VIDEO_BMASK = __gal_screen->format->Bmask;
|
||||||
SHAREDRES_VIDEO_AMASK = __gal_screen->format->Amask;
|
SHAREDRES_VIDEO_AMASK = __gal_screen->format->Amask;
|
||||||
|
|
||||||
|
GAL_CopyVideoInfoToSharedRes();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_DBG_PRINTF("Engien info from shared resource: %s %s %d\n",
|
_DBG_PRINTF("Engien info from shared resource: %s %s %d\n",
|
||||||
@@ -579,7 +586,6 @@ void TerminateGUI (int rcByGUI)
|
|||||||
__mg_join_all_message_threads ();
|
__mg_join_all_message_threads ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mg_DestroyFreeQMSGList ();
|
|
||||||
mg_TerminateAccel ();
|
mg_TerminateAccel ();
|
||||||
mg_TerminateControlClass ();
|
mg_TerminateControlClass ();
|
||||||
|
|
||||||
@@ -613,6 +619,8 @@ void TerminateGUI (int rcByGUI)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mg_DestroyFreeQMSGList ();
|
||||||
|
|
||||||
#ifdef _MGHAVE_ADV_2DAPI
|
#ifdef _MGHAVE_ADV_2DAPI
|
||||||
extern void miFreeArcCache (void);
|
extern void miFreeArcCache (void);
|
||||||
miFreeArcCache ();
|
miFreeArcCache ();
|
||||||
|
|||||||
+6
-6
@@ -274,7 +274,7 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* deprecated code */
|
#if 0 /* deprecated code */
|
||||||
#if IS_SHAREDFB_SCHEMA
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
|
|
||||||
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
||||||
{
|
{
|
||||||
@@ -299,7 +299,7 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
|||||||
return zorder_shmid;
|
return zorder_shmid;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* not IS_SHAREDFB_SCHEMA */
|
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
|
||||||
|
|
||||||
ZORDERINFO* __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
ZORDERINFO* __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
||||||
{
|
{
|
||||||
@@ -378,14 +378,14 @@ ZORDERINFO* __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
|||||||
return zi;
|
return zi;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* not IS_SHAREDFB_SCHEMA */
|
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
|
||||||
|
|
||||||
void __kernel_free_z_order_info (ZORDERINFO* zi)
|
void __kernel_free_z_order_info (ZORDERINFO* zi)
|
||||||
{
|
{
|
||||||
#if IS_SHAREDFB_SCHEMA
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
if (shmdt (zi) < 0)
|
if (shmdt (zi) < 0)
|
||||||
perror ("Detaches shared zorder nodes");
|
perror ("Detaches shared zorder nodes");
|
||||||
#else /* not IS_SHAREDFB_SCHEMA */
|
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
|
||||||
|
|
||||||
#ifdef _MGRM_THREADS
|
#ifdef _MGRM_THREADS
|
||||||
#ifndef __NOUNIX__
|
#ifndef __NOUNIX__
|
||||||
@@ -396,7 +396,7 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
|
|||||||
#endif /* _MGRM_THREADS */
|
#endif /* _MGRM_THREADS */
|
||||||
|
|
||||||
free (zi);
|
free (zi);
|
||||||
#endif /* not IS_SHAREDFB_SCHEMA */
|
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* deprecated code */
|
#endif /* deprecated code */
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ static LRESULT AboutWinProc (HWND hWnd, UINT message,
|
|||||||
DestroyMainWindow (hWnd);
|
DestroyMainWindow (hWnd);
|
||||||
#ifdef _MGRM_THREADS
|
#ifdef _MGRM_THREADS
|
||||||
PostQuitMessage (hWnd);
|
PostQuitMessage (hWnd);
|
||||||
|
#else
|
||||||
|
MainWindowCleanup (hWnd);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-2
@@ -1433,7 +1433,9 @@ char * strtrimall( char *src)
|
|||||||
return src;
|
return src;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy (src, src + nIndex1);
|
// VW: use memmove instead of strcpy to avoid overlapping
|
||||||
|
// strcpy (src, src + nIndex1);
|
||||||
|
memmove (src, src + nIndex1, nLen - nIndex1 + 1);
|
||||||
|
|
||||||
nLen = strlen (src);
|
nLen = strlen (src);
|
||||||
nIndex1 = nLen - 1;
|
nIndex1 = nLen - 1;
|
||||||
@@ -1468,11 +1470,18 @@ int __mg_path_joint (char* dst, int dst_size,
|
|||||||
if (__mg_is_abs_path(abs_path) && (!__mg_is_abs_path(sub_path))) {
|
if (__mg_is_abs_path(abs_path) && (!__mg_is_abs_path(sub_path))) {
|
||||||
if (dst_size >= strlen(abs_path) + strlen(sub_path)
|
if (dst_size >= strlen(abs_path) + strlen(sub_path)
|
||||||
+ 2/* size of split '/' and terminator '\0' */) {
|
+ 2/* size of split '/' and terminator '\0' */) {
|
||||||
sprintf(dst, "%s/%s", abs_path, sub_path);
|
strcpy (dst, abs_path);
|
||||||
|
strcat (dst, "/");
|
||||||
|
strcat (dst, sub_path);
|
||||||
|
//sprintf(dst, "%s/%s", abs_path, sub_path);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
_WRN_PRINTF ("The buffer space for the full path is too short: %d\n", dst_size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ COMMON_SRCS = \
|
|||||||
videomem-bucket.c \
|
videomem-bucket.c \
|
||||||
surface-shared.c \
|
surface-shared.c \
|
||||||
surface-cursor.c \
|
surface-cursor.c \
|
||||||
|
surface-shm.c \
|
||||||
shadow-screen.h \
|
shadow-screen.h \
|
||||||
shadow-screen.c \
|
shadow-screen.c \
|
||||||
$(NULL_FILE)
|
$(NULL_FILE)
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ int GAL_RLEBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
|||||||
/* Set up the source and destination pointers */
|
/* Set up the source and destination pointers */
|
||||||
x = dstrect->x;
|
x = dstrect->x;
|
||||||
y = dstrect->y;
|
y = dstrect->y;
|
||||||
dstbuf = (Uint8 *)dst->pixels + dst->offset
|
dstbuf = (Uint8 *)dst->pixels
|
||||||
+ y * dst->pitch + x * src->format->BytesPerPixel;
|
+ y * dst->pitch + x * src->format->BytesPerPixel;
|
||||||
srcbuf = (Uint8 *)src->map->sw_data->aux_data;
|
srcbuf = (Uint8 *)src->map->sw_data->aux_data;
|
||||||
|
|
||||||
@@ -730,7 +730,7 @@ int GAL_RLEAlphaBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
|||||||
|
|
||||||
x = dstrect->x;
|
x = dstrect->x;
|
||||||
y = dstrect->y;
|
y = dstrect->y;
|
||||||
dstbuf = (Uint8 *)dst->pixels + dst->offset
|
dstbuf = (Uint8 *)dst->pixels
|
||||||
+ y * dst->pitch + x * df->BytesPerPixel;
|
+ y * dst->pitch + x * df->BytesPerPixel;
|
||||||
srcbuf = (Uint8 *)src->map->sw_data->aux_data + sizeof(RLEDestFormat);
|
srcbuf = (Uint8 *)src->map->sw_data->aux_data + sizeof(RLEDestFormat);
|
||||||
|
|
||||||
@@ -1098,7 +1098,7 @@ static int RLEAlphaSurface(GAL_Surface *surface)
|
|||||||
int x, y;
|
int x, y;
|
||||||
int h = surface->h, w = surface->w;
|
int h = surface->h, w = surface->w;
|
||||||
GAL_PixelFormat *sf = surface->format;
|
GAL_PixelFormat *sf = surface->format;
|
||||||
Uint32 *src = (Uint32 *)((Uint8 *)surface->pixels + surface->offset);
|
Uint32 *src = (Uint32 *)((Uint8 *)surface->pixels);
|
||||||
Uint8 *lastline = dst; /* end of last non-blank line */
|
Uint8 *lastline = dst; /* end of last non-blank line */
|
||||||
|
|
||||||
/* opaque counts are 8 or 16 bits, depending on target depth */
|
/* opaque counts are 8 or 16 bits, depending on target depth */
|
||||||
@@ -1283,7 +1283,7 @@ static int RLEColorkeySurface(GAL_Surface *surface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set up the conversion */
|
/* Set up the conversion */
|
||||||
srcbuf = (Uint8 *)surface->pixels+surface->offset;
|
srcbuf = (Uint8 *)surface->pixels;
|
||||||
maxn = bpp == 4 ? 65535 : 255;
|
maxn = bpp == 4 ? 65535 : 255;
|
||||||
dst = rlebuf;
|
dst = rlebuf;
|
||||||
rgbmask = ~surface->format->Amask;
|
rgbmask = ~surface->format->Amask;
|
||||||
|
|||||||
+3
-4
@@ -77,13 +77,13 @@ static int GAL_SoftBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
|||||||
GAL_loblit RunBlit;
|
GAL_loblit RunBlit;
|
||||||
|
|
||||||
/* Set up the blit information */
|
/* Set up the blit information */
|
||||||
info.s_pixels = (Uint8 *)src->pixels + src->offset +
|
info.s_pixels = (Uint8 *)src->pixels +
|
||||||
(Uint16)srcrect->y*src->pitch +
|
(Uint16)srcrect->y*src->pitch +
|
||||||
(Uint16)srcrect->x*src->format->BytesPerPixel;
|
(Uint16)srcrect->x*src->format->BytesPerPixel;
|
||||||
info.s_width = srcrect->w;
|
info.s_width = srcrect->w;
|
||||||
info.s_height = srcrect->h;
|
info.s_height = srcrect->h;
|
||||||
info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel;
|
info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel;
|
||||||
info.d_pixels = (Uint8 *)dst->pixels + dst->offset +
|
info.d_pixels = (Uint8 *)dst->pixels +
|
||||||
(Uint16)dstrect->y*dst->pitch +
|
(Uint16)dstrect->y*dst->pitch +
|
||||||
(Uint16)dstrect->x*dst->format->BytesPerPixel;
|
(Uint16)dstrect->x*dst->format->BytesPerPixel;
|
||||||
info.d_width = dstrect->w;
|
info.d_width = dstrect->w;
|
||||||
@@ -290,8 +290,7 @@ int GAL_CalculateBlit(GAL_Surface *surface)
|
|||||||
if(surface->flags & GAL_RLEACCELOK
|
if(surface->flags & GAL_RLEACCELOK
|
||||||
&& (surface->flags & GAL_HWACCEL) != GAL_HWACCEL) {
|
&& (surface->flags & GAL_HWACCEL) != GAL_HWACCEL) {
|
||||||
|
|
||||||
if(surface->map->identity
|
if(surface->map->identity && (blit_index == 1
|
||||||
&& (blit_index == 1
|
|
||||||
|| (blit_index == 3 && !surface->format->Amask))) {
|
|| (blit_index == 3 && !surface->format->Amask))) {
|
||||||
if ( GAL_RLESurface(surface) == 0 )
|
if ( GAL_RLESurface(surface) == 0 )
|
||||||
surface->map->sw_blit = GAL_RLEBlit;
|
surface->map->sw_blit = GAL_RLEBlit;
|
||||||
|
|||||||
@@ -94,26 +94,70 @@ static void COMMLCD_DeleteDevice(GAL_VideoDevice *device)
|
|||||||
static void COMMLCD_UpdateRects_Sync (_THIS, int numrects, GAL_Rect *rects)
|
static void COMMLCD_UpdateRects_Sync (_THIS, int numrects, GAL_Rect *rects)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
RECT bound;
|
||||||
|
|
||||||
/* sync update */
|
bound = this->hidden->rc_dirty;
|
||||||
for (i = 0; i < numrects; i++) {
|
for (i = 0; i < numrects; i++) {
|
||||||
RECT rc;
|
RECT rc;
|
||||||
SetRect (&rc, rects[i].x, rects[i].y,
|
SetRect (&rc, rects[i].x, rects[i].y,
|
||||||
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
|
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
|
||||||
if (!IsRectEmpty (&rc)) {
|
if (IsRectEmpty (&bound))
|
||||||
__mg_commlcd_ops.update (&rc);
|
bound = rc;
|
||||||
|
else
|
||||||
|
GetBoundRect (&bound, &bound, &rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsRectEmpty (&bound)) {
|
||||||
|
RECT rcScr = GetScreenRect();
|
||||||
|
|
||||||
|
if (IntersectRect (&bound, &bound, &rcScr)) {
|
||||||
|
this->hidden->rc_dirty = bound;
|
||||||
|
this->hidden->dirty = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL _valid_async_updater = TRUE;
|
static BOOL COMMLCD_SyncUpdate_Sync (_THIS)
|
||||||
|
{
|
||||||
|
if (!IsRectEmpty (&this->hidden->rc_dirty)) {
|
||||||
|
__mg_commlcd_ops.update (&this->hidden->rc_dirty);
|
||||||
|
SetRect (&this->hidden->rc_dirty, 0, 0, 0, 0);
|
||||||
|
this->hidden->dirty = FALSE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL COMMLCD_SyncUpdate_Async (_THIS)
|
||||||
|
{
|
||||||
|
BOOL rc = FALSE;
|
||||||
|
|
||||||
|
pthread_mutex_lock (&this->hidden->update_lock);
|
||||||
|
|
||||||
|
if (this->hidden->dirty) {
|
||||||
|
// signal the update thread to do update
|
||||||
|
sem_post (&this->hidden->sem_update);
|
||||||
|
rc = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
pthread_mutex_unlock (&this->hidden->update_lock);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static void* task_do_update (void* data)
|
static void* task_do_update (void* data)
|
||||||
{
|
{
|
||||||
_THIS;
|
_THIS;
|
||||||
this = data;
|
this = data;
|
||||||
|
|
||||||
|
if (pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
sem_wait (&this->hidden->sem_update);
|
||||||
|
|
||||||
|
pthread_testcancel ();
|
||||||
|
|
||||||
pthread_mutex_lock (&this->hidden->update_lock);
|
pthread_mutex_lock (&this->hidden->update_lock);
|
||||||
if (this->hidden->dirty) {
|
if (this->hidden->dirty) {
|
||||||
__mg_commlcd_ops.update (&this->hidden->rc_dirty);
|
__mg_commlcd_ops.update (&this->hidden->rc_dirty);
|
||||||
@@ -122,8 +166,11 @@ static void* task_do_update (void* data)
|
|||||||
this->hidden->dirty = FALSE;
|
this->hidden->dirty = FALSE;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock (&this->hidden->update_lock);
|
pthread_mutex_unlock (&this->hidden->update_lock);
|
||||||
|
|
||||||
|
#if 0 /* since 5.0.0: use semaphore */
|
||||||
__mg_os_time_delay(50); /* 50 ms */
|
__mg_os_time_delay(50); /* 50 ms */
|
||||||
} while (_valid_async_updater);
|
#endif
|
||||||
|
} while (1);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -186,12 +233,13 @@ static GAL_VideoDevice *COMMLCD_CreateDevice (int devindex)
|
|||||||
device->SetColors = COMMLCD_SetColors;
|
device->SetColors = COMMLCD_SetColors;
|
||||||
device->VideoQuit = COMMLCD_VideoQuit;
|
device->VideoQuit = COMMLCD_VideoQuit;
|
||||||
device->AllocHWSurface = COMMLCD_AllocHWSurface;
|
device->AllocHWSurface = COMMLCD_AllocHWSurface;
|
||||||
|
device->FreeHWSurface = COMMLCD_FreeHWSurface;
|
||||||
device->CheckHWBlit = NULL;
|
device->CheckHWBlit = NULL;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
device->SetHWColorKey = NULL;
|
||||||
device->SetHWAlpha = NULL;
|
device->SetHWAlpha = NULL;
|
||||||
device->FreeHWSurface = COMMLCD_FreeHWSurface;
|
|
||||||
device->UpdateRects = NULL;
|
device->UpdateRects = NULL;
|
||||||
|
device->SyncUpdate = NULL;
|
||||||
|
|
||||||
device->free = COMMLCD_DeleteDevice;
|
device->free = COMMLCD_DeleteDevice;
|
||||||
return device;
|
return device;
|
||||||
@@ -307,11 +355,15 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
|
|||||||
|
|
||||||
if (li.update_method == COMMLCD_UPDATE_NONE) {
|
if (li.update_method == COMMLCD_UPDATE_NONE) {
|
||||||
this->UpdateRects = NULL;
|
this->UpdateRects = NULL;
|
||||||
|
this->SyncUpdate = NULL;
|
||||||
this->hidden->update_th = 0;
|
this->hidden->update_th = 0;
|
||||||
}
|
}
|
||||||
else if (li.update_method == COMMLCD_UPDATE_ASYNC) {
|
else if (li.update_method == COMMLCD_UPDATE_ASYNC) {
|
||||||
this->UpdateRects = COMMLCD_UpdateRects_Async;
|
this->UpdateRects = COMMLCD_UpdateRects_Async;
|
||||||
|
this->SyncUpdate = COMMLCD_SyncUpdate_Async;
|
||||||
|
|
||||||
|
pthread_mutex_init (&this->hidden->update_lock, NULL);
|
||||||
|
sem_init (&this->hidden->sem_update, 0, 0);
|
||||||
#if 0
|
#if 0
|
||||||
pthread_attr_t new_attr;
|
pthread_attr_t new_attr;
|
||||||
|
|
||||||
@@ -324,10 +376,10 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
|
|||||||
pthread_create (&this->hidden->update_th, NULL,
|
pthread_create (&this->hidden->update_th, NULL,
|
||||||
task_do_update, this);
|
task_do_update, this);
|
||||||
#endif
|
#endif
|
||||||
pthread_mutex_init (&this->hidden->update_lock, NULL);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->UpdateRects = COMMLCD_UpdateRects_Sync;
|
this->UpdateRects = COMMLCD_UpdateRects_Sync;
|
||||||
|
this->SyncUpdate = COMMLCD_SyncUpdate_Sync;
|
||||||
this->hidden->update_th = 0;
|
this->hidden->update_th = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,9 +394,9 @@ static void COMMLCD_VideoQuit (_THIS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this->hidden->update_th) {
|
if (this->hidden->update_th) {
|
||||||
/* quit the update task */
|
/* send cancel request */
|
||||||
_valid_async_updater = FALSE;
|
pthread_cancel (this->hidden->update_th);
|
||||||
pthread_join(this->hidden->update_th, NULL);
|
pthread_join (this->hidden->update_th, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (__mg_commlcd_ops.release)
|
if (__mg_commlcd_ops.release)
|
||||||
|
|||||||
@@ -47,6 +47,8 @@
|
|||||||
#ifndef _GAL_COMMLCD_H
|
#ifndef _GAL_COMMLCD_H
|
||||||
#define _GAL_COMMLCD_H
|
#define _GAL_COMMLCD_H
|
||||||
|
|
||||||
|
#include <semaphore.h>
|
||||||
|
|
||||||
#include "sysvideo.h"
|
#include "sysvideo.h"
|
||||||
|
|
||||||
#include "exstubs.h"
|
#include "exstubs.h"
|
||||||
@@ -68,6 +70,7 @@ struct GAL_PrivateVideoData {
|
|||||||
RECT rc_dirty;
|
RECT rc_dirty;
|
||||||
pthread_t update_th;
|
pthread_t update_th;
|
||||||
pthread_mutex_t update_lock;
|
pthread_mutex_t update_lock;
|
||||||
|
sem_t sem_update;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct commlcd_ops {
|
struct commlcd_ops {
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ GAL_FunctionTable mgGALFuncTable = {
|
|||||||
DFB_SetColors,
|
DFB_SetColors,
|
||||||
DFB_UpdateRects,
|
DFB_UpdateRects,
|
||||||
DFB_VideoQuit,
|
DFB_VideoQuit,
|
||||||
#if IS_SHAREDFB_SCHEMA
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
DFB_RequestHWSurface,
|
DFB_RequestHWSurface,
|
||||||
#endif
|
#endif
|
||||||
DFB_AllocHWSurface,
|
DFB_AllocHWSurface,
|
||||||
@@ -167,7 +167,7 @@ static GAL_VideoDevice *DFB_CreateDevice (int devindex)
|
|||||||
device->SetColors = DFB_SetColors;
|
device->SetColors = DFB_SetColors;
|
||||||
device->VideoQuit = DFB_VideoQuit;
|
device->VideoQuit = DFB_VideoQuit;
|
||||||
device->UpdateRects = DFB_UpdateRects;
|
device->UpdateRects = DFB_UpdateRects;
|
||||||
#if IS_SHAREDFB_SCHEMA
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
device->RequestHWSurface = DFB_RequestHWSurface;
|
device->RequestHWSurface = DFB_RequestHWSurface;
|
||||||
#endif
|
#endif
|
||||||
device->AllocHWSurface = DFB_AllocHWSurface;
|
device->AllocHWSurface = DFB_AllocHWSurface;
|
||||||
|
|||||||
+2620
-1066
File diff suppressed because it is too large
Load Diff
+45
-15
@@ -15,7 +15,7 @@
|
|||||||
* and Graphics User Interface (GUI) support system for embedded systems
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
* and smart IoT devices.
|
* and smart IoT devices.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019, Beijing FMSoft Technologies Co., Ltd.
|
* Copyright (C) 2019 ~ 2020, Beijing FMSoft Technologies Co., Ltd.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -58,9 +58,49 @@
|
|||||||
typedef struct drm_mode_info DrmModeInfo;
|
typedef struct drm_mode_info DrmModeInfo;
|
||||||
|
|
||||||
typedef struct GAL_PrivateVideoData {
|
typedef struct GAL_PrivateVideoData {
|
||||||
char dev_name[LEN_DEVICE_NAME + 1];
|
/* For compositing schema, we force to use double buffering */
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
GAL_Surface *real_screen, *shadow_screen;
|
||||||
|
|
||||||
|
DrmSurfaceBuffer *cursor_buff;
|
||||||
|
uint32_t cursor_plane_id;
|
||||||
|
|
||||||
|
/* Used to simulate the hardware cursor when hardware cursor not available. */
|
||||||
|
GAL_Surface *cursor;
|
||||||
|
int csr_x, csr_y;
|
||||||
|
int hot_x, hot_y;
|
||||||
|
|
||||||
|
#if 0 /* test code */
|
||||||
|
/* for asynchronous update */
|
||||||
|
pthread_t update_th;
|
||||||
|
pthread_mutex_t update_lock;
|
||||||
|
sem_t sem_update;
|
||||||
|
#endif /* test code */
|
||||||
|
#else /* defined _MGSCHEMA_COMPOSITING */
|
||||||
|
/* When double buffering supported, the real surface represents the ultimate
|
||||||
|
* scan-out frame buffer, and the shadow screen represents the rendering
|
||||||
|
* surface. When double buffering disabled, shadow_screen is NULL. */
|
||||||
|
GAL_Surface *real_screen, *shadow_screen;
|
||||||
|
|
||||||
|
/* the global names of real screen and shadow screen */
|
||||||
|
uint32_t real_name, shadow_name;
|
||||||
|
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
|
#if !IS_SHAREDFB_SCHEMA_PROCS
|
||||||
|
RECT dirty_rc;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char* dev_name;
|
||||||
|
char* ex_driver;
|
||||||
int dev_fd;
|
int dev_fd;
|
||||||
|
|
||||||
|
/* capabilities */
|
||||||
|
uint32_t cap_cursor_width;
|
||||||
|
uint32_t cap_cursor_height;
|
||||||
|
uint32_t cap_dumb:1;
|
||||||
|
uint32_t dbl_buff:1;
|
||||||
|
uint32_t scanout_buff_id;
|
||||||
|
|
||||||
void* exdrv_handle;
|
void* exdrv_handle;
|
||||||
DrmDriverOps* driver_ops;
|
DrmDriverOps* driver_ops;
|
||||||
DrmDriver* driver;
|
DrmDriver* driver;
|
||||||
@@ -68,23 +108,13 @@ typedef struct GAL_PrivateVideoData {
|
|||||||
DrmModeInfo* mode_list;
|
DrmModeInfo* mode_list;
|
||||||
GAL_Rect** modes;
|
GAL_Rect** modes;
|
||||||
|
|
||||||
int bpp;
|
|
||||||
uint32_t width;
|
|
||||||
uint32_t height;
|
|
||||||
uint32_t pitch;
|
|
||||||
uint32_t size;
|
|
||||||
|
|
||||||
uint32_t scanout_buff_id;
|
|
||||||
uint8_t* scanout_fb;
|
|
||||||
|
|
||||||
DrmModeInfo* saved_info;
|
DrmModeInfo* saved_info;
|
||||||
drmModeCrtc* saved_crtc;
|
drmModeCrtc* saved_crtc;
|
||||||
|
|
||||||
/* only valid when using DUMB frame buffer */
|
#if 0 /* deprecated code */
|
||||||
uint32_t handle;
|
|
||||||
|
|
||||||
/* only valid when using DRM driver */
|
|
||||||
uint32_t console_buff_id;
|
uint32_t console_buff_id;
|
||||||
|
uint8_t* scanout_fb;
|
||||||
|
#endif /* deprecated code */
|
||||||
} DrmVideoData;
|
} DrmVideoData;
|
||||||
|
|
||||||
#endif /* _NEWGAL_DRIVIDEO_H */
|
#endif /* _NEWGAL_DRIVIDEO_H */
|
||||||
|
|||||||
@@ -152,6 +152,12 @@ static int FB_Available(void)
|
|||||||
|
|
||||||
static void FB_DeleteDevice(GAL_VideoDevice *device)
|
static void FB_DeleteDevice(GAL_VideoDevice *device)
|
||||||
{
|
{
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
if (device->hidden->shadow_screen) {
|
||||||
|
GAL_FreeSurface (device->hidden->real_screen);
|
||||||
|
}
|
||||||
|
#endif /* _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
free(device->hidden);
|
free(device->hidden);
|
||||||
free(device);
|
free(device);
|
||||||
}
|
}
|
||||||
@@ -251,9 +257,11 @@ static int FB_EnterGraphicsMode (_THIS)
|
|||||||
_WRN_PRINTF ("Can't open %s: %m\n", tty_dev);
|
_WRN_PRINTF ("Can't open %s: %m\n", tty_dev);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl (ttyfd, KDSETMODE, KD_GRAPHICS) == -1) {
|
if (ioctl (ttyfd, KDSETMODE, KD_GRAPHICS) == -1) {
|
||||||
_WRN_PRINTF ("Error when setting the terminal to graphics mode: %m\n");
|
_WRN_PRINTF ("Error when setting the terminal (%s) "
|
||||||
_WRN_PRINTF ("Maybe is not a console.\n");
|
"to graphics mode: %m\n", tty_dev);
|
||||||
|
_WRN_PRINTF ("It might is not a console.\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
#ifdef _MGRM_PROCESSES
|
#ifdef _MGRM_PROCESSES
|
||||||
@@ -858,7 +866,8 @@ static void FB_FreeHWSurfaces(_THIS)
|
|||||||
surfaces.next = NULL;
|
surfaces.next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURFACE* reply)
|
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request,
|
||||||
|
REP_HWSURFACE* reply)
|
||||||
{
|
{
|
||||||
if (request->bucket == NULL) { /* alloc hw surface */
|
if (request->bucket == NULL) { /* alloc hw surface */
|
||||||
vidmem_bucket *bucket;
|
vidmem_bucket *bucket;
|
||||||
@@ -948,9 +957,9 @@ static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURF
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bucket && bucket->used) {
|
if (bucket && bucket->used) {
|
||||||
/* Add the memory back to the total */
|
/* Add the memory back to the total */
|
||||||
_DBG_PRINTF ("Freeing bucket of %d bytes\n", bucket->size);
|
|
||||||
surfaces_memleft += bucket->size;
|
surfaces_memleft += bucket->size;
|
||||||
|
|
||||||
/* Can we merge the space with surrounding buckets? */
|
/* Can we merge the space with surrounding buckets? */
|
||||||
@@ -1009,12 +1018,14 @@ static int FB_AllocHWSurface (_THIS, GAL_Surface *surface)
|
|||||||
surface->pitch = reply.pitch;
|
surface->pitch = reply.pitch;
|
||||||
surface->pixels = mapped_mem + reply.offset;
|
surface->pixels = mapped_mem + reply.offset;
|
||||||
surface->hwdata = (struct private_hwdata *)reply.bucket;
|
surface->hwdata = (struct private_hwdata *)reply.bucket;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FB_FreeHWSurface(_THIS, GAL_Surface *surface)
|
static void FB_FreeHWSurface(_THIS, GAL_Surface *surface)
|
||||||
{
|
{
|
||||||
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0, surface->hwdata};
|
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0,
|
||||||
|
surface->hwdata};
|
||||||
REP_HWSURFACE reply = {0, 0};
|
REP_HWSURFACE reply = {0, 0};
|
||||||
|
|
||||||
request.offset = (char*)surface->pixels - (char*)mapped_mem;
|
request.offset = (char*)surface->pixels - (char*)mapped_mem;
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ static GAL_VideoDevice *HI3560A_CreateDevice(int devindex)
|
|||||||
device->SetVideoMode = HI3560A_SetVideoMode;
|
device->SetVideoMode = HI3560A_SetVideoMode;
|
||||||
device->SetColors = HI3560A_SetColors;
|
device->SetColors = HI3560A_SetColors;
|
||||||
device->VideoQuit = HI3560A_VideoQuit;
|
device->VideoQuit = HI3560A_VideoQuit;
|
||||||
#if IS_SHAREDFB_SCHEMA
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
device->RequestHWSurface = HI3560A_RequestHWSurface;
|
device->RequestHWSurface = HI3560A_RequestHWSurface;
|
||||||
#endif
|
#endif
|
||||||
device->AllocHWSurface = HI3560A_AllocHWSurface;
|
device->AllocHWSurface = HI3560A_AllocHWSurface;
|
||||||
|
|||||||
@@ -1851,7 +1851,7 @@ static GAL_VideoDevice *HI3510_CreateDevice (int devindex)
|
|||||||
this->SetVideoMode = HI3510_SetVideoMode;
|
this->SetVideoMode = HI3510_SetVideoMode;
|
||||||
//this->SetColors = FB_SetColors;
|
//this->SetColors = FB_SetColors;
|
||||||
this->VideoQuit = HI3510_VideoQuit;
|
this->VideoQuit = HI3510_VideoQuit;
|
||||||
#if IS_SHAREDFB_SCHEMA
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
this->RequestHWSurface = HI3510_RequestHWSurface;
|
this->RequestHWSurface = HI3510_RequestHWSurface;
|
||||||
#endif
|
#endif
|
||||||
this->AllocHWSurface = HI3510_AllocHWSurface;
|
this->AllocHWSurface = HI3510_AllocHWSurface;
|
||||||
|
|||||||
@@ -1843,7 +1843,7 @@ static GAL_VideoDevice *HI3560_CreateDevice (int devindex)
|
|||||||
this->ListModes = HI3560_ListModes;
|
this->ListModes = HI3560_ListModes;
|
||||||
this->SetVideoMode = HI3560_SetVideoMode;
|
this->SetVideoMode = HI3560_SetVideoMode;
|
||||||
this->VideoQuit = HI3560_VideoQuit;
|
this->VideoQuit = HI3560_VideoQuit;
|
||||||
#if IS_SHAREDFB_SCHEMA
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
this->RequestHWSurface = HI3560_RequestHWSurface;
|
this->RequestHWSurface = HI3560_RequestHWSurface;
|
||||||
#endif
|
#endif
|
||||||
this->AllocHWSurface = HI3560_AllocHWSurface;
|
this->AllocHWSurface = HI3560_AllocHWSurface;
|
||||||
|
|||||||
+11
-11
@@ -219,8 +219,10 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
|
|||||||
screen->format->BitsPerPixel,
|
screen->format->BitsPerPixel,
|
||||||
screen->format->Rmask, screen->format->Gmask,
|
screen->format->Rmask, screen->format->Gmask,
|
||||||
screen->format->Bmask, screen->format->Amask);
|
screen->format->Bmask, screen->format->Amask);
|
||||||
_DBG_PRINTF ("GAL_CreateSharedRGBSurface: buf_size: %lu, fd: %d\n",
|
_DBG_PRINTF ("GAL_CreateSharedRGBSurface: map size: %lu, fd: %d, RGBAmasks: %x, %x, %x, %x\n",
|
||||||
wp_surf->shared_header->buf_size, wp_surf->shared_header->fd);
|
wp_surf->shared_header->map_size, wp_surf->shared_header->fd,
|
||||||
|
wp_surf->format->Rmask, wp_surf->format->Gmask,
|
||||||
|
wp_surf->format->Bmask, wp_surf->format->Amask);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
goto empty;
|
goto empty;
|
||||||
@@ -233,17 +235,17 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
|
|||||||
int fd = -1;
|
int fd = -1;
|
||||||
SHAREDSURFINFO info;
|
SHAREDSURFINFO info;
|
||||||
|
|
||||||
req.id = REQID_GETWPSURFACE;
|
req.id = REQID_GETSHAREDSURFACE;
|
||||||
req.data = &fd;
|
req.data = SYSSF_WALLPAPER_PATTER;
|
||||||
req.len_data = sizeof(int);
|
req.len_data = strlen (SYSSF_WALLPAPER_PATTER) + 1;
|
||||||
|
|
||||||
if ((ClientRequestEx2 (&req, NULL, 0, -1,
|
if ((ClientRequestEx2 (&req, NULL, 0, -1,
|
||||||
&info, sizeof (SHAREDSURFINFO), &fd) < 0) || (fd < 0))
|
&info, sizeof (SHAREDSURFINFO), &fd) < 0) || (fd < 0))
|
||||||
goto empty;
|
goto empty;
|
||||||
|
|
||||||
_DBG_PRINTF ("REQID_GETWPSURFACE: map_size (%lu), flags (0x%x), fd: %d\n",
|
_DBG_PRINTF ("REQID_GETSHAREDSURFACE: size (%lu), flags (0x%x), fd: %d\n",
|
||||||
info.map_size, info.flags, fd);
|
info.size, info.flags, fd);
|
||||||
wp_surf = GAL_AttachSharedRGBSurface (fd, info.map_size,
|
wp_surf = GAL_AttachSharedRGBSurface (fd, info.size,
|
||||||
info.flags, TRUE);
|
info.flags, TRUE);
|
||||||
close (fd);
|
close (fd);
|
||||||
|
|
||||||
@@ -302,9 +304,7 @@ int mg_InitGAL (char* engine, char* mode)
|
|||||||
if (GAL_VideoInit (engine, 0)) {
|
if (GAL_VideoInit (engine, 0)) {
|
||||||
GAL_VideoQuit ();
|
GAL_VideoQuit ();
|
||||||
_ERR_PRINTF ("NEWGAL: Does not find matched engine: %s.\n", engine);
|
_ERR_PRINTF ("NEWGAL: Does not find matched engine: %s.\n", engine);
|
||||||
if (IS_COMPOSITING_SCHEMA) {
|
_ERR_PRINTF (" Or failed to initialize the engine.\n");
|
||||||
_ERR_PRINTF (" Or the specified engine does not support compositing schema.\n");
|
|
||||||
}
|
|
||||||
return ERR_NO_MATCH;
|
return ERR_NO_MATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -269,6 +269,8 @@ static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
|
|||||||
|
|
||||||
static BOOL PCXVFB_SyncUpdate (_THIS)
|
static BOOL PCXVFB_SyncUpdate (_THIS)
|
||||||
{
|
{
|
||||||
|
RECT dirty_rc;
|
||||||
|
|
||||||
if (IsRectEmpty (&this->hidden->dirty_rc))
|
if (IsRectEmpty (&this->hidden->dirty_rc))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@@ -278,6 +280,16 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
|
|||||||
shm_lock(semid);
|
shm_lock(semid);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
dirty_rc.left = this->hidden->hdr->dirty_rc_l;
|
||||||
|
dirty_rc.top = this->hidden->hdr->dirty_rc_t;
|
||||||
|
dirty_rc.right = this->hidden->hdr->dirty_rc_r;
|
||||||
|
dirty_rc.bottom = this->hidden->hdr->dirty_rc_b;
|
||||||
|
if (dirty_rc.right == -1) dirty_rc.right = 0;
|
||||||
|
if (dirty_rc.bottom == -1) dirty_rc.bottom = 0;
|
||||||
|
|
||||||
|
GetBoundRect (&this->hidden->dirty_rc, &dirty_rc,
|
||||||
|
&this->hidden->dirty_rc);
|
||||||
|
|
||||||
shadowScreen_BlitToReal (this);
|
shadowScreen_BlitToReal (this);
|
||||||
|
|
||||||
this->hidden->hdr->dirty_rc_l = this->hidden->dirty_rc.left;
|
this->hidden->hdr->dirty_rc_l = this->hidden->dirty_rc.left;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user