mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-28 16:17:09 +08:00
Compare commits
112
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0abaeef4c7 | ||
|
|
c2779cbf09 | ||
|
|
e118805eef | ||
|
|
7513d461bf | ||
|
|
b131f00a79 | ||
|
|
649fbf571e | ||
|
|
e38fd05cb4 | ||
|
|
ce53f2c703 | ||
|
|
fbebc94718 | ||
|
|
b4ce6f9f10 | ||
|
|
c04dde31e5 | ||
|
|
5a2b425012 | ||
|
|
fa18025350 | ||
|
|
890ab1db44 | ||
|
|
3d963b3d25 | ||
|
|
29ac6a4277 | ||
|
|
96ecf5e9b7 | ||
|
|
50aafa3faa | ||
|
|
d06ce0683b | ||
|
|
5a9b08fe94 | ||
|
|
c7569e9d32 | ||
|
|
06fcf2eaa0 | ||
|
|
33e5d62da8 | ||
|
|
f0bae4444c | ||
|
|
0a5ace7f82 | ||
|
|
5b27cc70fc | ||
|
|
cf3340c01d | ||
|
|
950f73716a | ||
|
|
295c993d50 | ||
|
|
95ab7dad2a | ||
|
|
3d42f72e21 | ||
|
|
59d9d08158 | ||
|
|
3a9cbfdd9b | ||
|
|
bc7d5f6ce0 | ||
|
|
1131973f7a | ||
|
|
a46804080e | ||
|
|
81b25968ca | ||
|
|
f1463f41de | ||
|
|
0a10b81499 | ||
|
|
fd07118939 | ||
|
|
a0a757a621 | ||
|
|
7cd7f954c6 | ||
|
|
e673452b7d | ||
|
|
e24490e92f | ||
|
|
0c2345aed1 | ||
|
|
95b9def0d5 | ||
|
|
563fe9232c | ||
|
|
5ad525c1d8 | ||
|
|
fcde9eb405 | ||
|
|
39d03be6d7 | ||
|
|
43101379ed | ||
|
|
bce5b73e1c | ||
|
|
0b4a5a1c17 | ||
|
|
c609e2e5b1 | ||
|
|
f6bf02aa5c | ||
|
|
d52aa4c1a4 | ||
|
|
d6a961aa6c | ||
|
|
2665200eee | ||
|
|
469eb1c05a | ||
|
|
6a83f2efbf | ||
|
|
6422cb8568 | ||
|
|
6be4b719c8 | ||
|
|
0f566d0342 | ||
|
|
1de19f9bee | ||
|
|
5f8a88c0a2 | ||
|
|
1611a56754 | ||
|
|
73fcb8d2c3 | ||
|
|
bc0efac21f | ||
|
|
26341b162e | ||
|
|
c6957bec23 | ||
|
|
56ddd87189 | ||
|
|
5cdd258046 | ||
|
|
8b4ab267b6 | ||
|
|
613a19c236 | ||
|
|
e242cbe32f | ||
|
|
5f921a2908 | ||
|
|
39493ef4dc | ||
|
|
fef311f0b2 | ||
|
|
e98aeab8dc | ||
|
|
2ff96ba383 | ||
|
|
03d90aec9f | ||
|
|
57293a2896 | ||
|
|
cfd3311f86 | ||
|
|
51b09bc2ed | ||
|
|
ff54c6ffe5 | ||
|
|
4c836603c1 | ||
|
|
311d2262d6 | ||
|
|
209a0c6ab0 | ||
|
|
4c2b20c49f | ||
|
|
b7625c5726 | ||
|
|
872e299ad9 | ||
|
|
c60c19aad5 | ||
|
|
5d216dcc32 | ||
|
|
37c122a1de | ||
|
|
50ae4b9b44 | ||
|
|
695c55e464 | ||
|
|
a16903d570 | ||
|
|
3189931910 | ||
|
|
c3a8dc0798 | ||
|
|
848ed3fecc | ||
|
|
0d1f1f028a | ||
|
|
d4add19e6a | ||
|
|
bfaeae0023 | ||
|
|
70705c7db0 | ||
|
|
517d74a2d2 | ||
|
|
d68eee3c90 | ||
|
|
e575e7c69d | ||
|
|
d059fc8de2 | ||
|
|
5d9d787dac | ||
|
|
9696fbb3ba | ||
|
|
800329086e | ||
|
|
11be6af9d3 |
@@ -72,7 +72,7 @@ It greatly reduces the size and resource consumption of the entire solution, imp
|
|||||||
[HybridOS] is another large open source project initiated by FMSoft.
|
[HybridOS] is another large open source project initiated by FMSoft.
|
||||||
It is an open source operating system designed for embedded/AIoT devices and cloud computing environment.
|
It is an open source operating system designed for embedded/AIoT devices and cloud computing environment.
|
||||||
|
|
||||||
HybridOS provides the complete software stack and the app framework based on HVML for embedded systems.
|
HybridOS provides the complete software stack and the app framework based on [HVML] for embedded systems.
|
||||||
You can easily develop your products which has rich functions and excellent expressiveness by using HybridOS.
|
You can easily develop your products which has rich functions and excellent expressiveness by using HybridOS.
|
||||||
|
|
||||||
In practice, MiniGUI and the software which are used to integrated with GPU constitute the graphics stack of HybridOS.
|
In practice, MiniGUI and the software which are used to integrated with GPU constitute the graphics stack of HybridOS.
|
||||||
@@ -85,13 +85,13 @@ The following chart shows the graphics stack of HybridOS:
|
|||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
| MiniGUI/HVML Apps |
|
| MiniGUI/HVML Apps |
|
||||||
|-----------------------------------------------|
|
|-----------------------------------------------|
|
||||||
| | (Graphics Stack) |
|
| | (Graphics Stack) |
|
||||||
| | ---------------------|
|
| | --------------------|
|
||||||
| | | hiMesa |
|
| | | Mesa-HBD |
|
||||||
| | hiCairo | ------------------|
|
| | Cairo-HBD | ------------------|
|
||||||
| | MiniGUI | | EGL for MiniGUI |
|
| | MiniGUI | | EGL for MiniGUI |
|
||||||
| C++ libs | hiDRMDrivers | | GL, GLES, VG |
|
| C++ libs | HBDDRMDrivers | | GL, GLES, VG |
|
||||||
| C libs | libDRM | | GPU drivers |
|
| C libs | libDRM | | GPU drivers |
|
||||||
|-----------------------------------------------|
|
|-----------------------------------------------|
|
||||||
| Linux Kernel |
|
| Linux Kernel |
|
||||||
| -----------------------------------|
|
| -----------------------------------|
|
||||||
@@ -102,10 +102,10 @@ The following chart shows the graphics stack of HybridOS:
|
|||||||
As shown in the chart above, the HybridOS graphics stack consists of the following software:
|
As shown in the chart above, the HybridOS graphics stack consists of the following software:
|
||||||
|
|
||||||
- `libDRM` provides some user land APIs for Linux Direct Rendering Infrastructure.
|
- `libDRM` provides some user land APIs for Linux Direct Rendering Infrastructure.
|
||||||
- `hiDRMDrivers` contains the drivers (user land drivers, not kernel drivers) for
|
- `HBDDRMDrivers` contains the drivers (user land drivers, not kernel drivers) for
|
||||||
MiniGUI DRM engine. The drivers implement the basic hardware accelerated
|
MiniGUI DRM engine. The drivers implement the basic hardware accelerated
|
||||||
2D graphics operations of various GPUs for MiniGUI.
|
2D graphics operations of various GPUs for MiniGUI.
|
||||||
- `hiMesa` is the Mesa derivative for HybridOS, while Mesa is the open source
|
- `Mesa-HBD` is the Mesa derivative for HybridOS, while Mesa is the open source
|
||||||
implementation of OpenGL and other graphics APIs, including OpenGL ES
|
implementation of OpenGL and other graphics APIs, including OpenGL ES
|
||||||
(versions 1, 2, 3), OpenCL, OpenMAX, and Vulkan. It contains the following
|
(versions 1, 2, 3), OpenCL, OpenMAX, and Vulkan. It contains the following
|
||||||
components:
|
components:
|
||||||
@@ -113,13 +113,17 @@ As shown in the chart above, the HybridOS graphics stack consists of the followi
|
|||||||
graphics APIs.
|
graphics APIs.
|
||||||
+ The EGL implementation for MiniGUI platform.
|
+ The EGL implementation for MiniGUI platform.
|
||||||
+ The graphics drivers for various GPUs and a software driver called `swrast`.
|
+ 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
|
- `Cairo-HBD` is the Cairo derivative for HybridOS. Cairo is a 2D vector graphics
|
||||||
library for Gtk. We provide support for MiniGUI backend in `hiCairo`.
|
library for Gtk. We provide support for MiniGUI backend in `hiCairo`.
|
||||||
|
|
||||||
For more information about HybridOS, please refer to:
|
For more information about HybridOS, please refer to:
|
||||||
|
|
||||||
<https://hybridos.fmsoft.cn/>
|
<https://hybridos.fmsoft.cn/>
|
||||||
|
|
||||||
|
For more information about HVML, please refer to:
|
||||||
|
|
||||||
|
<https://hvml.fmsoft.cn/> or <https://www.hvml.org>
|
||||||
|
|
||||||
### Source Code Repositories
|
### Source Code Repositories
|
||||||
|
|
||||||
FMSoft had created the public repositories for MiniGUI Core, MiniGUI
|
FMSoft had created the public repositories for MiniGUI Core, MiniGUI
|
||||||
@@ -561,13 +565,14 @@ A brief history description of the development progress is listed as follow:
|
|||||||
1. May., 2021: FMSoft released MiniGUI version 5.0.6.
|
1. May., 2021: FMSoft released MiniGUI version 5.0.6.
|
||||||
1. Jan., 2022: FMSoft released MiniGUI version 5.0.9.
|
1. Jan., 2022: FMSoft released MiniGUI version 5.0.9.
|
||||||
1. Sep., 2022: FMSoft released MiniGUI version 5.0.10.
|
1. Sep., 2022: FMSoft released MiniGUI version 5.0.10.
|
||||||
|
1. Aug., 2023: FMSoft released MiniGUI version 5.0.13.
|
||||||
|
|
||||||
## AUTHORS AND COPYING
|
## AUTHORS AND COPYING
|
||||||
|
|
||||||
The original author of MiniGUI is Vincent Wei, and now MiniGUI is maintained by FMSoft.
|
The original author of MiniGUI is Vincent Wei, and now MiniGUI is maintained by FMSoft.
|
||||||
For more information, please refer to <http://www.fmsoft.cn>.
|
For more information, please refer to <http://www.fmsoft.cn>.
|
||||||
|
|
||||||
Copyright (C) 2002 ~ 2022, Beijing FMSoft Technologies Co., Ltd.
|
Copyright (C) 2002 ~ 2023, Beijing FMSoft Technologies Co., Ltd.
|
||||||
Copyright (C) 1998 ~ 2002, Vincent Wei
|
Copyright (C) 1998 ~ 2002, Vincent Wei
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
@@ -645,13 +650,12 @@ A: Yes, FMSoft can provide you with guaranteed commercial technical
|
|||||||
[FMSoft Technologies]: https://www.fmsoft.cn
|
[FMSoft Technologies]: https://www.fmsoft.cn
|
||||||
[FMSoft]: https://www.fmsoft.cn
|
[FMSoft]: https://www.fmsoft.cn
|
||||||
[HybridOS Official Site]: https://hybridos.fmsoft.cn
|
[HybridOS Official Site]: https://hybridos.fmsoft.cn
|
||||||
[MiniGUI Official Site]: https://hvml.fmsoft.cn
|
[MiniGUI Official Site]: https://minigui.fmsoft.cn
|
||||||
[HVML Official Site]: https://hvml.fmsoft.cn
|
[HVML Official Site]: https://hvml.fmsoft.cn
|
||||||
[Vincent Wei]: https://github.com/VincentWei
|
[Vincent Wei]: https://github.com/VincentWei
|
||||||
|
|
||||||
[MiniGUI]: https://github.com/VincentWei/MiniGUI
|
[MiniGUI]: https://github.com/VincentWei
|
||||||
[HybridOS]: https://github.com/FMSoftCN/HybridOS
|
[HybridOS]: https://github.com/HybridOS2
|
||||||
|
|
||||||
[HVML]: https://github.com/HVML
|
[HVML]: https://github.com/HVML
|
||||||
[PurC]: https://github.com/HVML/PurC
|
[PurC]: https://github.com/HVML/PurC
|
||||||
[xGUI Pro]: https://github.com/HVML/xGUI-Pro
|
[xGUI Pro]: https://github.com/HVML/xGUI-Pro
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
|
- [Version 5.2.0](#version-520)
|
||||||
|
+ [What's new in version 5.2.0](#whats-new-in-version-520)
|
||||||
|
- [Version 5.0.13](#version-5013)
|
||||||
|
+ [What's new in version 5.0.13](#whats-new-in-version-5013)
|
||||||
|
- [Version 5.0.12](#version-5012)
|
||||||
|
+ [What's new in version 5.0.12](#whats-new-in-version-5012)
|
||||||
- [Version 5.0.11](#version-5011)
|
- [Version 5.0.11](#version-5011)
|
||||||
+ [What's new in version 5.0.11](#whats-new-in-version-5011)
|
+ [What's new in version 5.0.11](#whats-new-in-version-5011)
|
||||||
- [Version 5.0.10](#version-5010)
|
- [Version 5.0.10](#version-5010)
|
||||||
@@ -28,6 +34,55 @@
|
|||||||
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
||||||
+ [Deprecated APIs](#deprecated-apis)
|
+ [Deprecated APIs](#deprecated-apis)
|
||||||
|
|
||||||
|
## Version 5.2.0
|
||||||
|
|
||||||
|
On Nov. 30, 2023, FMSoft announces the availability of MiniGUI 5.2.0,
|
||||||
|
which is an mainline release with some major enhancements:
|
||||||
|
|
||||||
|
* ENHANCEMENTS:
|
||||||
|
- Optimize NEWGAL engines: `shadow`, `drm`, and `fbcon` for large resolution.
|
||||||
|
- New APIs: `GetWindowSharedSurfaceFD()` and `CreateMemDCFromSharedSurfaceFD()` for compositing schema.
|
||||||
|
* CHANGES:
|
||||||
|
- The operations for DRM userland driver changed.
|
||||||
|
|
||||||
|
## Version 5.0.13
|
||||||
|
|
||||||
|
On Aug. 31, 2023, FMSoft announces the availability of MiniGUI 5.0.13,
|
||||||
|
which is an enhancement release with some minor enhancements
|
||||||
|
of MiniGUI 5.0.x.
|
||||||
|
|
||||||
|
### What's new in version 5.0.13
|
||||||
|
|
||||||
|
In this version, we made some enhancements:
|
||||||
|
|
||||||
|
* ENHANCEMENTS:
|
||||||
|
- Disable BIDI for text in UTF-8 charset by default.
|
||||||
|
* CHANGES:
|
||||||
|
- Add `BIDI_FLAG_NONE` and `BIDI_FLAG_LEGACY`.
|
||||||
|
* BUGFIXING:
|
||||||
|
- Ignore C0CTRL characters when renerding text.
|
||||||
|
- Support for vowels.
|
||||||
|
|
||||||
|
## Version 5.0.12
|
||||||
|
|
||||||
|
On May 10, 2023, FMSoft announces the availability of MiniGUI 5.0.12,
|
||||||
|
which is an enhancement release with some minor enhancements
|
||||||
|
of MiniGUI 5.0.x.
|
||||||
|
|
||||||
|
### What's new in version 5.0.12
|
||||||
|
|
||||||
|
In this version, we made some enhancements:
|
||||||
|
|
||||||
|
* ENHANCEMENTS:
|
||||||
|
- Add new API `GetACharsExtentPointEx()`.
|
||||||
|
- Add new APIs `GetTabbedACharsExtent()`, `GetTabbedACharsExtentPoint()`,
|
||||||
|
and `GetTabbedACharsExtentPointEx()`.
|
||||||
|
- Enhance two APIs `GetTextExtentPoint()` and `GetTabbedTextExtentPoint()`
|
||||||
|
to support BIDI charsets.
|
||||||
|
- Tune management of tick count.
|
||||||
|
* BUGFIXING:
|
||||||
|
- Fix a typo: `Achar2UChar()` to `AChar2UChar()`.
|
||||||
|
|
||||||
## Version 5.0.11
|
## Version 5.0.11
|
||||||
|
|
||||||
On Dec. 31, 2022, FMSoft announces the availability of MiniGUI 5.0.11,
|
On Dec. 31, 2022, FMSoft announces the availability of MiniGUI 5.0.11,
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
Version 5.0.11 (2022/12/31)
|
Version 5.2.0 (2023/09/30)
|
||||||
|
|
||||||
This is a minor enhancement and bugfix release of MiniGUI 5.0.x, the stable version.
|
This is a minor enhancement and bugfix release of MiniGUI 5.2.x, the stable version.
|
||||||
|
|
||||||
Other packages for MiniGUI resource, tools, components, and samples:
|
Other packages for MiniGUI resource, tools, components, and samples:
|
||||||
|
|
||||||
|
|||||||
+12
-11
@@ -1,6 +1,6 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ(2.60)
|
||||||
AC_INIT(libminigui, 5.0.11)
|
AC_INIT(libminigui, 5.2.0)
|
||||||
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
|
||||||
@@ -15,10 +15,10 @@ dnl Set various version strings - taken gratefully from the SDL sources
|
|||||||
# set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0.
|
# set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0.
|
||||||
#
|
#
|
||||||
MINIGUI_MAJOR_VERSION=5
|
MINIGUI_MAJOR_VERSION=5
|
||||||
MINIGUI_MINOR_VERSION=0
|
MINIGUI_MINOR_VERSION=2
|
||||||
MINIGUI_MICRO_VERSION=11
|
MINIGUI_MICRO_VERSION=0
|
||||||
MINIGUI_INTERFACE_AGE=1
|
MINIGUI_INTERFACE_AGE=0
|
||||||
MINIGUI_BINARY_AGE=1
|
MINIGUI_BINARY_AGE=0
|
||||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||||
|
|
||||||
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
||||||
@@ -62,7 +62,7 @@ dnl ========================================================================
|
|||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_CHECK_HEADERS(limits.h math.h locale.h unistd.h termio.h sys/types.h sys/time.h sys/select.h sys/memfd.h)
|
AC_CHECK_HEADERS(limits.h math.h stdatomic.h locale.h unistd.h termio.h sys/types.h sys/time.h sys/select.h sys/memfd.h)
|
||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
@@ -95,7 +95,7 @@ message_string="no"
|
|||||||
osname="unspecified"
|
osname="unspecified"
|
||||||
runtime_mode="procs"
|
runtime_mode="procs"
|
||||||
compositing_schema="yes"
|
compositing_schema="yes"
|
||||||
virtual_window="no"
|
virtual_window="yes"
|
||||||
use_shmopen="no"
|
use_shmopen="no"
|
||||||
mgslice_use_fallback="no"
|
mgslice_use_fallback="no"
|
||||||
|
|
||||||
@@ -1704,12 +1704,12 @@ fi
|
|||||||
|
|
||||||
CPPFLAGS="$CPPFLAGS -D__MINIGUI_LIB__"
|
CPPFLAGS="$CPPFLAGS -D__MINIGUI_LIB__"
|
||||||
|
|
||||||
surface_schema="shared frame buffer"
|
surface_schema="shared"
|
||||||
case "$runtime_mode" in
|
case "$runtime_mode" in
|
||||||
sa)
|
sa)
|
||||||
AC_DEFINE(_MGRM_STANDALONE, 1,
|
AC_DEFINE(_MGRM_STANDALONE, 1,
|
||||||
[Define if build MiniGUI-Standalone])
|
[Define if build MiniGUI-Standalone])
|
||||||
MINIGUI_RUNMODE="sa"
|
MINIGUI_RUNMODE="standalone"
|
||||||
RUNMODE_LADD="standalone/libstandalone.la"
|
RUNMODE_LADD="standalone/libstandalone.la"
|
||||||
RUNMODE_SUBDIRS="standalone"
|
RUNMODE_SUBDIRS="standalone"
|
||||||
;;
|
;;
|
||||||
@@ -1717,13 +1717,13 @@ case "$runtime_mode" in
|
|||||||
AC_DEFINE(_MGRM_THREADS, 1,
|
AC_DEFINE(_MGRM_THREADS, 1,
|
||||||
[Define if build MiniGUI-Threads])
|
[Define if build MiniGUI-Threads])
|
||||||
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
|
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
|
||||||
MINIGUI_RUNMODE="ths"
|
MINIGUI_RUNMODE="threads"
|
||||||
virtual_window="yes"
|
virtual_window="yes"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_DEFINE(_MGRM_PROCESSES, 1,
|
AC_DEFINE(_MGRM_PROCESSES, 1,
|
||||||
[Define if build MiniGUI-Processes])
|
[Define if build MiniGUI-Processes])
|
||||||
MINIGUI_RUNMODE="procs"
|
MINIGUI_RUNMODE="processes"
|
||||||
RUNMODE_LADD="server/libserver.la client/libclient.la"
|
RUNMODE_LADD="server/libserver.la client/libclient.la"
|
||||||
RUNMODE_SUBDIRS="server client"
|
RUNMODE_SUBDIRS="server client"
|
||||||
if test "x$compositing_schema" = "xyes"; then
|
if test "x$compositing_schema" = "xyes"; then
|
||||||
@@ -2664,6 +2664,7 @@ if test "x$no_math" = "xno"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
DEP_LIBS="$DEP_LIBS -lpthread"
|
DEP_LIBS="$DEP_LIBS -lpthread"
|
||||||
|
MINIGUI_RUNMODE="$MINIGUI_RUNMODE-${surface_schema}"
|
||||||
|
|
||||||
AC_SUBST(VIDEO_SUBDIRS)
|
AC_SUBST(VIDEO_SUBDIRS)
|
||||||
AC_SUBST(VIDEO_DRIVERS)
|
AC_SUBST(VIDEO_DRIVERS)
|
||||||
|
|||||||
+53
-8
@@ -55,6 +55,36 @@ wallpaper_pattern_size=full
|
|||||||
# def_compositor_so=
|
# def_compositor_so=
|
||||||
#}}
|
#}}
|
||||||
|
|
||||||
|
#{{ifdef _MGGAL_SHADOW
|
||||||
|
[shadow]
|
||||||
|
real_engine=pc_xvfb
|
||||||
|
defaultmode=800x600-16bpp
|
||||||
|
|
||||||
|
# `cw`: rotating screen clock-wise.
|
||||||
|
# `ccw`: rotating screen counter clock-wise.
|
||||||
|
# `hflip`: flipping screen horizontally.
|
||||||
|
# `vflip`: flipping screen vertically.
|
||||||
|
rotate_screen=ccw
|
||||||
|
|
||||||
|
# Whether the async. update is enabled.
|
||||||
|
# Use `true` or `yes` for enabled, anything else for disabled.
|
||||||
|
# Since 5.0.13.
|
||||||
|
async_update=yes
|
||||||
|
|
||||||
|
# The synchronization interval for the asyn. updater (milli-seconds).
|
||||||
|
# This setting is only valid when `async_update` is enabled and
|
||||||
|
# the real engine does not provide WaitWBlank method.
|
||||||
|
# Since 5.0.13.
|
||||||
|
update_interval=15
|
||||||
|
|
||||||
|
# The minimal pixels to use the hardware accelerator.
|
||||||
|
# If the number of pixels to copy is less than this value,
|
||||||
|
# MiniGUI will use the software copy routine to update the real screen,
|
||||||
|
# even if the real device provides a hardware accelerator.
|
||||||
|
# Since 5.0.13.
|
||||||
|
min_pixels_using_hwaccl=4096
|
||||||
|
#}}
|
||||||
|
|
||||||
#{{ifdef _MGGAL_DRM
|
#{{ifdef _MGGAL_DRM
|
||||||
[drm]
|
[drm]
|
||||||
defaultmode=1024x768-32bpp
|
defaultmode=1024x768-32bpp
|
||||||
@@ -78,9 +108,21 @@ dpi=96
|
|||||||
# Since 5.0.0.
|
# Since 5.0.0.
|
||||||
double_buffering=true
|
double_buffering=true
|
||||||
|
|
||||||
|
# The update interval for the asyn. updater (milli-seconds).
|
||||||
|
# This setting is only valid when drmWaitVBlank doesn't work correctly.
|
||||||
|
# Since 5.0.13.
|
||||||
|
update_interval=15
|
||||||
|
|
||||||
|
# The minimal pixels to use the hardware accelerator.
|
||||||
|
# If the number of pixels to copy is less than this value,
|
||||||
|
# MiniGUI will use the software copy routine to update the real screen,
|
||||||
|
# even if the device provides a hardware accelerator.
|
||||||
|
# Since 5.0.13.
|
||||||
|
min_pixels_using_hwaccl=4096
|
||||||
|
|
||||||
# The filename of the shared library for the external driver.
|
# The filename of the shared library for the external driver.
|
||||||
# The equivalent environment variable: MG_GAL_DRM_DRIVER
|
# The equivalent environment variable: MG_GAL_DRM_DRIVER
|
||||||
exdriver=libhidrmdrivers-0.2.so.0
|
exdriver=libdrmdrivers.so
|
||||||
#}}
|
#}}
|
||||||
|
|
||||||
#{{ifdef _MGIAL_SINGLETOUCHKEY
|
#{{ifdef _MGIAL_SINGLETOUCHKEY
|
||||||
@@ -111,6 +153,16 @@ dpi=96
|
|||||||
# Note that under compositing schema, double buffering is always enabled.
|
# Note that under compositing schema, double buffering is always enabled.
|
||||||
# Since 5.0.10.
|
# Since 5.0.10.
|
||||||
double_buffering=true
|
double_buffering=true
|
||||||
|
|
||||||
|
# Whether the async. update is enabled.
|
||||||
|
# Use `true` or `yes` for enabled, anything else for disabled.
|
||||||
|
# Since 5.0.13.
|
||||||
|
async_update=yes
|
||||||
|
|
||||||
|
# The update interval for the asyn. updater (milli-seconds).
|
||||||
|
# This setting is only valid when drmWaitVBlank doesn't work correctly.
|
||||||
|
# Since 5.0.13.
|
||||||
|
update_interval=15
|
||||||
#}}
|
#}}
|
||||||
|
|
||||||
#{{ifdef _MGGAL_PCXVFB
|
#{{ifdef _MGGAL_PCXVFB
|
||||||
@@ -123,13 +175,6 @@ exec_file=/usr/local/bin/gvfb
|
|||||||
[rtos_xvfb]
|
[rtos_xvfb]
|
||||||
defaultmode=800x600-16bpp
|
defaultmode=800x600-16bpp
|
||||||
|
|
||||||
#{{ifdef _MGGAL_SHADOW
|
|
||||||
[shadow]
|
|
||||||
real_engine=pc_xvfb
|
|
||||||
defaultmode=800x600-16bpp
|
|
||||||
rotate_screen=ccw
|
|
||||||
#}}
|
|
||||||
|
|
||||||
#{{ifdef _MGGAL_MLSHADOW
|
#{{ifdef _MGGAL_MLSHADOW
|
||||||
[mlshadow]
|
[mlshadow]
|
||||||
real_engine=qvfb
|
real_engine=qvfb
|
||||||
|
|||||||
@@ -268,6 +268,8 @@ MGUI_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
|||||||
#define MG_UNLIKELY(expr) (expr)
|
#define MG_UNLIKELY(expr) (expr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define HAVE(FEATURE) (defined HAVE_##FEATURE && HAVE_##FEATURE)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup endian_info Endianness information
|
* \defgroup endian_info Endianness information
|
||||||
* @{
|
* @{
|
||||||
@@ -2347,6 +2349,7 @@ int init_minigui_printf (int (*output_char) (int ch),
|
|||||||
#define _ERR_PRINTF(fmt, ...) \
|
#define _ERR_PRINTF(fmt, ...) \
|
||||||
do { \
|
do { \
|
||||||
TCS_RED (stderr); \
|
TCS_RED (stderr); \
|
||||||
|
fprintf (stderr, "%s: ", __FUNCTION__); \
|
||||||
fprintf (stderr, fmt, ##__VA_ARGS__); \
|
fprintf (stderr, fmt, ##__VA_ARGS__); \
|
||||||
TCS_NONE (stderr); \
|
TCS_NONE (stderr); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|||||||
+57
-77
File diff suppressed because it is too large
Load Diff
+486
-33
File diff suppressed because it is too large
Load Diff
+85
-4
@@ -456,6 +456,45 @@ MG_EXPORT void GUIAPI MiniGUIPanic (int exitcode);
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \fn GHANDLE GUIAPI JoinLayerEx (const char* layer_name,
|
||||||
|
const char* client_name,
|
||||||
|
int max_nr_highers, int max_nr_normals, int *cli_id)
|
||||||
|
* \brief Joins to a layer and returns the client identifier if success.
|
||||||
|
*
|
||||||
|
* This function should be called by clients before calling any other MiniGUI
|
||||||
|
* functions. You can call \a GetLayerInfo to get the layer information.
|
||||||
|
* If the layer to be joined does not exist, the server, i.e. \a mginit, will
|
||||||
|
* try to create a new one. If you passed a NULL pointer or a null string for
|
||||||
|
* \a layer_name, the client will join to the default layer.
|
||||||
|
*
|
||||||
|
* If the client want to create a new layer, you should specify the maximal
|
||||||
|
* number of z-nodes in the higher level (max_nr_highers) and the maximal
|
||||||
|
* number of z-nodes in the normal level (max_nr_normals) of the new layer.
|
||||||
|
* Passing zero to \a max_nr_highers and max_nr_normals will use the default
|
||||||
|
* values, and the default values are specified by ServerStartup.
|
||||||
|
*
|
||||||
|
* Note that the server will create a default layer named "mginit".
|
||||||
|
*
|
||||||
|
* \param layer_name The name of the layer. You can use NAME_TOPMOST_LAYER to
|
||||||
|
* specify the current topmost layer.
|
||||||
|
* \param client_name The name of the client.
|
||||||
|
* \param max_nr_highers The maximal number of z-nodes in the higher level of
|
||||||
|
* the new layer.
|
||||||
|
* \param max_nr_normals The maximal number of z-nodes in the normal level of
|
||||||
|
* the new layer.
|
||||||
|
* \param cli_id The pointer to a buffer of int to return the client identifier.
|
||||||
|
*
|
||||||
|
* \return The handle to the layer on success, INV_LAYER_HANDLE on error.
|
||||||
|
*
|
||||||
|
* \note Only call this function in clients of MiniGUI-Processes.
|
||||||
|
*
|
||||||
|
* \sa GetLayerInfo, ServerStartup, ServerCreateLayer
|
||||||
|
*/
|
||||||
|
MG_EXPORT GHANDLE GUIAPI JoinLayerEx (const char* layer_name,
|
||||||
|
const char* client_name,
|
||||||
|
int max_nr_highers, int max_nr_normals, int *cli_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn GHANDLE GUIAPI JoinLayer (const char* layer_name,
|
* \fn GHANDLE GUIAPI JoinLayer (const char* layer_name,
|
||||||
const char* client_name,
|
const char* client_name,
|
||||||
@@ -490,9 +529,30 @@ MG_EXPORT void GUIAPI MiniGUIPanic (int exitcode);
|
|||||||
*
|
*
|
||||||
* \sa GetLayerInfo, ServerStartup, ServerCreateLayer
|
* \sa GetLayerInfo, ServerStartup, ServerCreateLayer
|
||||||
*/
|
*/
|
||||||
MG_EXPORT GHANDLE GUIAPI JoinLayer (const char* layer_name,
|
static inline GHANDLE GUIAPI JoinLayer (const char* layer_name,
|
||||||
const char* client_name,
|
const char* client_name,
|
||||||
int max_nr_highers, int max_nr_normals);
|
int max_nr_highers, int max_nr_normals)
|
||||||
|
{
|
||||||
|
return JoinLayerEx (layer_name, client_name,
|
||||||
|
max_nr_highers, max_nr_normals, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \fn int GUIAPI GetClientId (void)
|
||||||
|
* \brief Gets the client identifier.
|
||||||
|
*
|
||||||
|
* You can get the information of a layer through this function.
|
||||||
|
* The information will be returned through the pointer arguments
|
||||||
|
* if the specific pointer is not NULL.
|
||||||
|
*
|
||||||
|
* \return Returns the client identifier of the current process.
|
||||||
|
* Note that the server always returns 0.
|
||||||
|
*
|
||||||
|
* \sa JoinLayerEx
|
||||||
|
*
|
||||||
|
* Since 5.2.0
|
||||||
|
*/
|
||||||
|
MG_EXPORT int GUIAPI GetClientId (void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn GHANDLE GUIAPI GetLayerInfo (const char* layer_name,
|
* \fn GHANDLE GUIAPI GetLayerInfo (const char* layer_name,
|
||||||
@@ -2125,7 +2185,7 @@ MG_EXPORT int GUIAPI ServerSendReplyEx (int clifd,
|
|||||||
* \fn int GUIAPI ServerSendReply (int clifd, const void* reply, int len)
|
* \fn int GUIAPI ServerSendReply (int clifd, const void* reply, int len)
|
||||||
* \brief Sends the reply to the client.
|
* \brief Sends the reply to the client.
|
||||||
*
|
*
|
||||||
* This function sends a replay pointed to by \a reply which is
|
* This function sends a reply pointed to by \a reply which is
|
||||||
* \a len bytes long to the client.
|
* \a len bytes long to the client.
|
||||||
*
|
*
|
||||||
* \note Only used by the server to send the reply to the client.
|
* \note Only used by the server to send the reply to the client.
|
||||||
@@ -2673,6 +2733,26 @@ MG_EXPORT void GUIAPI DesktopUpdateAllWindow (void);
|
|||||||
|
|
||||||
#define DUMMY_LAYER_HANDLE (GHANDLE)(-1)
|
#define DUMMY_LAYER_HANDLE (GHANDLE)(-1)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \fn GHANDLE GUIAPI JoinLayerEx (const char* layer_name,
|
||||||
|
const char* client_name,
|
||||||
|
int max_nr_highers, int max_nr_normals, int *cli_fd)
|
||||||
|
* \brief The dummy replacement of the same function for MiniGUI-Processes.
|
||||||
|
*
|
||||||
|
* This function is a replacment of the same function for MiniGUI-Processes
|
||||||
|
* runtime mode. We provide this function for MiniGUI-Threads and
|
||||||
|
* MiniGUI-Standalone runtime modes, in order to avoid using the
|
||||||
|
* conditional compilation instructions in your source code.
|
||||||
|
*
|
||||||
|
* \return Always returns DUMMY_LAYER_HANDLE to indicate success.
|
||||||
|
*/
|
||||||
|
static inline GHANDLE GUIAPI JoinLayerEx (const char* layer_name,
|
||||||
|
const char* client_name,
|
||||||
|
int max_nr_highers, int max_nr_normals, int *cli_fd)
|
||||||
|
{
|
||||||
|
return DUMMY_LAYER_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn GHANDLE GUIAPI JoinLayer (const char* layer_name,
|
* \fn GHANDLE GUIAPI JoinLayer (const char* layer_name,
|
||||||
const char* client_name,
|
const char* client_name,
|
||||||
@@ -2687,7 +2767,8 @@ MG_EXPORT void GUIAPI DesktopUpdateAllWindow (void);
|
|||||||
* \return Always returns DUMMY_LAYER_HANDLE to indicate success.
|
* \return Always returns DUMMY_LAYER_HANDLE to indicate success.
|
||||||
*/
|
*/
|
||||||
static inline GHANDLE GUIAPI JoinLayer (const char* layer_name,
|
static inline GHANDLE GUIAPI JoinLayer (const char* layer_name,
|
||||||
const char* client_name, int max_nr_highers, int max_nr_normals)
|
const char* client_name,
|
||||||
|
int max_nr_highers, int max_nr_normals)
|
||||||
{
|
{
|
||||||
return DUMMY_LAYER_HANDLE;
|
return DUMMY_LAYER_HANDLE;
|
||||||
}
|
}
|
||||||
|
|||||||
+32
-3
@@ -2990,18 +2990,22 @@ typedef struct _WINMASKINFO {
|
|||||||
if the client moved to a new layer */
|
if the client moved to a new layer */
|
||||||
#define MSG_LAYERCHANGED 0x0149
|
#define MSG_LAYERCHANGED 0x0149
|
||||||
|
|
||||||
|
/* Since 5.2.0; the server send this message to the client
|
||||||
|
if a window has been composited to the screen. */
|
||||||
|
#define MSG_WINCOMPOSITED 0x014A
|
||||||
|
|
||||||
#endif /* defined _MGRM_PROCESSES */
|
#endif /* defined _MGRM_PROCESSES */
|
||||||
|
|
||||||
/* Since 5.0.0: for managing message thread */
|
/* Since 5.0.0: for managing message thread */
|
||||||
#define MSG_MANAGE_MSGTHREAD 0x014A
|
#define MSG_MANAGE_MSGTHREAD 0x014B
|
||||||
#define MSGTHREAD_SIGNIN 0x00
|
#define MSGTHREAD_SIGNIN 0x00
|
||||||
#define MSGTHREAD_SIGNOUT 0x01
|
#define MSGTHREAD_SIGNOUT 0x01
|
||||||
|
|
||||||
/* Since 5.0.0: for calculating the default position */
|
/* Since 5.0.0: for calculating the default position */
|
||||||
#define MSG_CALC_POSITION 0x014B
|
#define MSG_CALC_POSITION 0x014C
|
||||||
|
|
||||||
/* Since 5.0.6: for waking up the client */
|
/* Since 5.0.6: for waking up the client */
|
||||||
#define MSG_WAKEUP_CLIENT 0x014C
|
#define MSG_WAKEUP_CLIENT 0x014D
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def MSG_DOESNEEDIME
|
* \def MSG_DOESNEEDIME
|
||||||
@@ -7237,6 +7241,31 @@ MG_EXPORT BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags);
|
|||||||
|
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \fn int GUIAPI GetWindowSharedSurfaceFD (HWND hwnd, size_t *map_size,
|
||||||
|
* DWORD *flags)
|
||||||
|
* \brief Gets the file descriptor of the surface buffer for a window or
|
||||||
|
* the main window it locates.
|
||||||
|
*
|
||||||
|
* This function gets the file descriptor of the surface buffer for
|
||||||
|
* the specified window if it is a main window or the main window it locates.
|
||||||
|
* Note that if the window is a control that has the style `WS_EX_CTRLASMAINWIN`,
|
||||||
|
* the window will have a separate surface buffer.
|
||||||
|
*
|
||||||
|
* \param hwnd The handle to the window.
|
||||||
|
*
|
||||||
|
* \return An integer larger than or equal to 0 for a valid file descriptor,
|
||||||
|
* otherwise a negative value.
|
||||||
|
*
|
||||||
|
* \note This function only available when _MGSCHEMA_COMPOSITING is defined.
|
||||||
|
*
|
||||||
|
* \sa CreateMemDCFromSharedSurfaceFD
|
||||||
|
*
|
||||||
|
* Since 5.0.13
|
||||||
|
*/
|
||||||
|
MG_EXPORT int GUIAPI GetWindowSharedSurfaceFD (HWND hWnd, size_t *map_size,
|
||||||
|
DWORD *flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn BOOL GUIAPI SetMainWindowCompositing (HWND hWnd,
|
* \fn BOOL GUIAPI SetMainWindowCompositing (HWND hWnd,
|
||||||
int type, DWORD arg)
|
int type, DWORD arg)
|
||||||
|
|||||||
+2
-1
@@ -2,11 +2,12 @@ prefix=@prefix@
|
|||||||
exec_prefix=@exec_prefix@
|
exec_prefix=@exec_prefix@
|
||||||
libdir=@libdir@
|
libdir=@libdir@
|
||||||
includedir=@includedir@
|
includedir=@includedir@
|
||||||
|
runmode=@MINIGUI_RUNMODE@
|
||||||
|
libsuffix=@MGLIB_SUFFIX@
|
||||||
|
|
||||||
Name: MiniGUI
|
Name: MiniGUI
|
||||||
Description: A mature cross-platform windowing and GUI system for embedded systems and IoT smart devices.
|
Description: A mature cross-platform windowing and GUI system for embedded systems and IoT smart devices.
|
||||||
Version: @MINIGUI_VERSION@
|
Version: @MINIGUI_VERSION@
|
||||||
Runmode: @MINIGUI_RUNMODE@
|
|
||||||
Requires:
|
Requires:
|
||||||
Libs: -L${libdir} -lminigui_@MGLIB_SUFFIX@ @DEP_LIBS@
|
Libs: -L${libdir} -lminigui_@MGLIB_SUFFIX@ @DEP_LIBS@
|
||||||
Libs.private:
|
Libs.private:
|
||||||
|
|||||||
+32
-3
@@ -184,6 +184,23 @@ static void process_socket_message (MSG *msg)
|
|||||||
LOSWORD(msg->wParam), HISWORD(msg->wParam),
|
LOSWORD(msg->wParam), HISWORD(msg->wParam),
|
||||||
LOSWORD(msg->lParam), HISWORD(msg->lParam));
|
LOSWORD(msg->lParam), HISWORD(msg->lParam));
|
||||||
}
|
}
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
else if (msg->message == MSG_WINCOMPOSITED) {
|
||||||
|
/* Since 5.2.0 */
|
||||||
|
int slot = (int)msg->wParam;
|
||||||
|
HWND hwnd = (HWND)msg->lParam;
|
||||||
|
unsigned dirty_age = (unsigned)msg->time;
|
||||||
|
if (__mg_client_check_znode_hwnd(slot, hwnd, __mg_client_id)) {
|
||||||
|
GAL_Surface *ssurf = ((PMAINWIN)hwnd)->surf;
|
||||||
|
assert(ssurf->shared_header);
|
||||||
|
__mg_lock_file_for_write(ssurf->fd);
|
||||||
|
if (ssurf->dirty_info->dirty_age == dirty_age) {
|
||||||
|
ssurf->dirty_info->nr_dirty_rcs = 0;
|
||||||
|
}
|
||||||
|
__mg_unlock_file_for_write(ssurf->fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else {
|
else {
|
||||||
if (msg->hwnd == HWND_NULL) {
|
if (msg->hwnd == HWND_NULL) {
|
||||||
msg->hwnd = HWND_DESKTOP;
|
msg->hwnd = HWND_DESKTOP;
|
||||||
@@ -518,8 +535,8 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
|
|||||||
return (n > 0);
|
return (n > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
|
GHANDLE GUIAPI JoinLayerEx (const char* layer_name, const char* client_name,
|
||||||
int max_nr_topmosts, int max_nr_normals)
|
int max_nr_topmosts, int max_nr_normals, int *cli_id)
|
||||||
{
|
{
|
||||||
GHANDLE layer_handle = INV_LAYER_HANDLE;
|
GHANDLE layer_handle = INV_LAYER_HANDLE;
|
||||||
REQUEST req;
|
REQUEST req;
|
||||||
@@ -529,8 +546,12 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
|
|||||||
if (mgIsServer)
|
if (mgIsServer)
|
||||||
return layer_handle;
|
return layer_handle;
|
||||||
|
|
||||||
if (__mg_client_id != 0) /* Already joined, return the handle */
|
if (__mg_client_id != 0) {
|
||||||
|
/* Already joined, return the handle */
|
||||||
|
if (cli_id)
|
||||||
|
*cli_id = __mg_client_id;
|
||||||
return GetLayerInfo (NAME_SELF_LAYER, NULL, NULL, NULL);
|
return GetLayerInfo (NAME_SELF_LAYER, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (layer_name) {
|
if (layer_name) {
|
||||||
strncpy (info.layer_name, layer_name, LEN_LAYER_NAME);
|
strncpy (info.layer_name, layer_name, LEN_LAYER_NAME);
|
||||||
@@ -593,10 +614,18 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
|
|||||||
|
|
||||||
__mg_start_client_desktop ();
|
__mg_start_client_desktop ();
|
||||||
|
|
||||||
|
if (cli_id)
|
||||||
|
*cli_id = __mg_client_id;
|
||||||
|
|
||||||
ret:
|
ret:
|
||||||
return layer_handle;
|
return layer_handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GUIAPI GetClientId (void)
|
||||||
|
{
|
||||||
|
return __mg_client_id;
|
||||||
|
}
|
||||||
|
|
||||||
GHANDLE GUIAPI GetLayerInfo (const char* layer_name,
|
GHANDLE GUIAPI GetLayerInfo (const char* layer_name,
|
||||||
int* nr_clients, BOOL* is_topmost, int* cli_active)
|
int* nr_clients, BOOL* is_topmost, int* cli_active)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ void mglist_set_itemops (MgList *mglst, PMGITEMOPS iop)
|
|||||||
mglst->iop = *iop;
|
mglst->iop = *iop;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam,
|
LRESULT DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam,
|
||||||
PSCRDATA pscrdata, MgList *mglst)
|
PSCRDATA pscrdata, MgList *mglst)
|
||||||
{
|
{
|
||||||
switch (message) {
|
switch (message) {
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ struct _MgList
|
|||||||
|
|
||||||
/* ------------------------- external api -------------------------- */
|
/* ------------------------- external api -------------------------- */
|
||||||
|
|
||||||
MG_EXPORT int DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam,
|
MG_EXPORT LRESULT DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam,
|
||||||
PSCRDATA pscrdata, MgList *mglst);
|
PSCRDATA pscrdata, MgList *mglst);
|
||||||
|
|
||||||
MG_EXPORT SVITEM_DRAWFUNC mglist_set_itemdraw (MgList *mglst, SVITEM_DRAWFUNC draw_func);
|
MG_EXPORT SVITEM_DRAWFUNC mglist_set_itemdraw (MgList *mglst, SVITEM_DRAWFUNC draw_func);
|
||||||
|
|||||||
@@ -589,7 +589,7 @@ int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
LRESULT DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
PSCRDATA pscrdata = NULL;
|
PSCRDATA pscrdata = NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ typedef struct _scrdata
|
|||||||
typedef SCRDATA *PSCRDATA;
|
typedef SCRDATA *PSCRDATA;
|
||||||
|
|
||||||
|
|
||||||
MG_EXPORT int DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
|
MG_EXPORT LRESULT DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
|
||||||
MG_EXPORT int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h);
|
MG_EXPORT int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h);
|
||||||
MG_EXPORT void scrolled_destroy (PSCRDATA pscrdata);
|
MG_EXPORT void scrolled_destroy (PSCRDATA pscrdata);
|
||||||
MG_EXPORT void scrolled_hscroll (HWND hWnd, PSCRDATA pscrdata, WPARAM wParam, LPARAM lParam);
|
MG_EXPORT void scrolled_hscroll (HWND hWnd, PSCRDATA pscrdata, WPARAM wParam, LPARAM lParam);
|
||||||
|
|||||||
@@ -202,6 +202,17 @@ static void destroy (GLYPHTREENODE *root)
|
|||||||
|
|
||||||
/*** device font ops ***/
|
/*** device font ops ***/
|
||||||
|
|
||||||
|
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature)
|
||||||
|
{
|
||||||
|
switch (feature) {
|
||||||
|
case DEVFONT_FEATURE_MARK_BBOX:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
return DEVFONTGLYPHTYPE_PRERDRBMP;
|
return DEVFONTGLYPHTYPE_PRERDRBMP;
|
||||||
@@ -380,6 +391,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
|
|
||||||
/**************************** Global data ************************************/
|
/**************************** Global data ************************************/
|
||||||
FONTOPS __mg_bitmap_font_ops = {
|
FONTOPS __mg_bitmap_font_ops = {
|
||||||
|
get_feature,
|
||||||
get_glyph_bmptype,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* and Graphics User Interface (GUI) support system for embedded systems
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
* and smart IoT devices.
|
* and smart IoT devices.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
* Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
|
||||||
* Copyright (C) 1998~2002, WEI Yongming
|
* Copyright (C) 1998~2002, WEI Yongming
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@@ -226,7 +226,7 @@ static int iso8859_6_conv_from_uc32 (Uchar32 wc, unsigned char* mchar)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* must attetion the para s is arabic chv value.*/
|
#if 0
|
||||||
static int is_arabic_char_vowel(Uint8 c)
|
static int is_arabic_char_vowel(Uint8 c)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -240,6 +240,7 @@ static int is_arabic_char_vowel(Uint8 c)
|
|||||||
*/
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ISO8859-6 charset vowel relative define and judge */
|
/* ISO8859-6 charset vowel relative define and judge */
|
||||||
#define ISARABIC_VOWEL(s) ((s >= FATHATAN) && (s <= SUKUN))
|
#define ISARABIC_VOWEL(s) ((s >= FATHATAN) && (s <= SUKUN))
|
||||||
@@ -469,9 +470,12 @@ static int iso8859_6_len_first_char (const unsigned char* mstr, int len)
|
|||||||
|
|
||||||
static unsigned int iso8859_6_char_type (Achar32 chv)
|
static unsigned int iso8859_6_char_type (Achar32 chv)
|
||||||
{
|
{
|
||||||
|
chv = REAL_ACHAR(chv);
|
||||||
|
#if 1
|
||||||
|
return sb_char_type(chv);
|
||||||
|
#else
|
||||||
unsigned int ch_type = ACHAR_BASIC_UNKNOWN;
|
unsigned int ch_type = ACHAR_BASIC_UNKNOWN;
|
||||||
|
|
||||||
chv = REAL_ACHAR(chv);
|
|
||||||
if (is_arabic_char_vowel (chv)) { /* is vowel */
|
if (is_arabic_char_vowel (chv)) { /* is vowel */
|
||||||
ch_type = ACHAR_BASIC_VOWEL;
|
ch_type = ACHAR_BASIC_VOWEL;
|
||||||
}
|
}
|
||||||
@@ -480,6 +484,7 @@ static unsigned int iso8859_6_char_type (Achar32 chv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ch_type;
|
return ch_type;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
|
static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
|
||||||
@@ -868,6 +873,7 @@ static CHARSETOPS CharsetOps_iso8859_6 = {
|
|||||||
3,
|
3,
|
||||||
FONT_CHARSET_ISO8859_6,
|
FONT_CHARSET_ISO8859_6,
|
||||||
0,
|
0,
|
||||||
|
1,
|
||||||
iso8859_6_len_first_char,
|
iso8859_6_len_first_char,
|
||||||
iso8859_6_get_char_value,
|
iso8859_6_get_char_value,
|
||||||
iso8859_6_get_shaped_char_value,
|
iso8859_6_get_shaped_char_value,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* and Graphics User Interface (GUI) support system for embedded systems
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
* and smart IoT devices.
|
* and smart IoT devices.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
* Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
|
||||||
* Copyright (C) 1998~2002, WEI Yongming
|
* Copyright (C) 1998~2002, WEI Yongming
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@@ -210,6 +210,8 @@ static unsigned int unicode_char_type (Achar32 chv)
|
|||||||
mchar_type = ACHAR_BASIC_LF;
|
mchar_type = ACHAR_BASIC_LF;
|
||||||
else if (break_type == UCHAR_BREAK_SPACE)
|
else if (break_type == UCHAR_BREAK_SPACE)
|
||||||
mchar_type = ACHAR_BASIC_SPACE;
|
mchar_type = ACHAR_BASIC_SPACE;
|
||||||
|
else if (basic_type == UCHAR_CATEGORY_NON_SPACING_MARK)
|
||||||
|
mchar_type = ACHAR_BASIC_VOWEL;
|
||||||
else if (chv != 0x00AD && ISZEROWIDTHTYPE (basic_type))
|
else if (chv != 0x00AD && ISZEROWIDTHTYPE (basic_type))
|
||||||
mchar_type = ACHAR_BASIC_ZEROWIDTH;
|
mchar_type = ACHAR_BASIC_ZEROWIDTH;
|
||||||
else if ((chv >= 0x1160 && chv < 0x1200)
|
else if ((chv >= 0x1160 && chv < 0x1200)
|
||||||
@@ -239,10 +241,36 @@ static const BidiType linear_enum_to_bidi_type[] = {
|
|||||||
#undef _UNIBIDI_ADD_TYPE
|
#undef _UNIBIDI_ADD_TYPE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Since 5.0.13: this function only returns BidiType which
|
||||||
|
is recognizable by the legacy BIDI algorithm. */
|
||||||
static BidiType unicode_bidi_char_type(Achar32 ch)
|
static BidiType unicode_bidi_char_type(Achar32 ch)
|
||||||
{
|
{
|
||||||
ch = REAL_ACHAR(ch);
|
ch = REAL_ACHAR(ch);
|
||||||
return linear_enum_to_bidi_type[UNIBIDI_GET_BIDI_TYPE(ch)];
|
BidiType bt = linear_enum_to_bidi_type[UNIBIDI_GET_BIDI_TYPE(ch)];
|
||||||
|
|
||||||
|
switch (bt) {
|
||||||
|
case BIDI_TYPE_LTR:
|
||||||
|
case BIDI_TYPE_RTL:
|
||||||
|
case BIDI_TYPE_AL:
|
||||||
|
case BIDI_TYPE_EN:
|
||||||
|
case BIDI_TYPE_AN:
|
||||||
|
case BIDI_TYPE_ET:
|
||||||
|
case BIDI_TYPE_CS:
|
||||||
|
case BIDI_TYPE_NSM:
|
||||||
|
case BIDI_TYPE_BN:
|
||||||
|
case BIDI_TYPE_BS:
|
||||||
|
case BIDI_TYPE_SS:
|
||||||
|
case BIDI_TYPE_WS:
|
||||||
|
case BIDI_TYPE_ON:
|
||||||
|
case BIDI_TYPE_SOT:
|
||||||
|
case BIDI_TYPE_EOT:
|
||||||
|
return bt;
|
||||||
|
default:
|
||||||
|
_DBG_PRINTF("Not recognizable for char (0x%04x): %u\n", ch, bt);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return BIDI_TYPE_WS;
|
||||||
}
|
}
|
||||||
|
|
||||||
BidiType GUIAPI UCharGetBidiType(Uchar32 uc)
|
BidiType GUIAPI UCharGetBidiType(Uchar32 uc)
|
||||||
@@ -628,6 +656,7 @@ CHARSETOPS __mg_CharsetOps_utf8 = {
|
|||||||
6,
|
6,
|
||||||
FONT_CHARSET_UTF8,
|
FONT_CHARSET_UTF8,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
utf8_len_first_char,
|
utf8_len_first_char,
|
||||||
utf8_get_char_value,
|
utf8_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -854,6 +883,7 @@ CHARSETOPS __mg_CharsetOps_utf16le = {
|
|||||||
4,
|
4,
|
||||||
FONT_CHARSET_UTF16LE,
|
FONT_CHARSET_UTF16LE,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
utf16le_len_first_char,
|
utf16le_len_first_char,
|
||||||
utf16le_get_char_value,
|
utf16le_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1080,6 +1110,7 @@ CHARSETOPS __mg_CharsetOps_utf16be = {
|
|||||||
4,
|
4,
|
||||||
FONT_CHARSET_UTF16BE,
|
FONT_CHARSET_UTF16BE,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
utf16be_len_first_char,
|
utf16be_len_first_char,
|
||||||
utf16be_get_char_value,
|
utf16be_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
|
|||||||
+25
-1
@@ -15,7 +15,7 @@
|
|||||||
* and Graphics User Interface (GUI) support system for embedded systems
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
* and smart IoT devices.
|
* and smart IoT devices.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
* Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
|
||||||
* Copyright (C) 1998~2002, WEI Yongming
|
* Copyright (C) 1998~2002, WEI Yongming
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@@ -235,6 +235,7 @@ static CHARSETOPS CharsetOps_ascii = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_US_ASCII,
|
FONT_CHARSET_US_ASCII,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -298,6 +299,7 @@ static CHARSETOPS CharsetOps_iso8859_1 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_1,
|
FONT_CHARSET_ISO8859_1,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -409,6 +411,7 @@ static CHARSETOPS CharsetOps_iso8859_2 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_2,
|
FONT_CHARSET_ISO8859_2,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -521,6 +524,7 @@ static CHARSETOPS CharsetOps_iso8859_3 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_3,
|
FONT_CHARSET_ISO8859_3,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -634,6 +638,7 @@ static CHARSETOPS CharsetOps_iso8859_4 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_4,
|
FONT_CHARSET_ISO8859_4,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -728,6 +733,7 @@ static CHARSETOPS CharsetOps_iso8859_5 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_5,
|
FONT_CHARSET_ISO8859_5,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -886,6 +892,7 @@ static CHARSETOPS CharsetOps_iso8859_7 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_7,
|
FONT_CHARSET_ISO8859_7,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1159,6 +1166,7 @@ static CHARSETOPS CharsetOps_iso8859_8 = {
|
|||||||
2, // This is a trick for bidi reorder only implemented for MBC.
|
2, // This is a trick for bidi reorder only implemented for MBC.
|
||||||
FONT_CHARSET_ISO8859_8,
|
FONT_CHARSET_ISO8859_8,
|
||||||
0,
|
0,
|
||||||
|
1,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1260,6 +1268,7 @@ static CHARSETOPS CharsetOps_iso8859_9 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_9,
|
FONT_CHARSET_ISO8859_9,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1373,6 +1382,7 @@ static CHARSETOPS CharsetOps_iso8859_10 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_10,
|
FONT_CHARSET_ISO8859_10,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1485,6 +1495,7 @@ static CHARSETOPS CharsetOps_iso8859_11 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_11,
|
FONT_CHARSET_ISO8859_11,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1597,6 +1608,7 @@ static CHARSETOPS CharsetOps_iso8859_13 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_13,
|
FONT_CHARSET_ISO8859_13,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1709,6 +1721,7 @@ static CHARSETOPS CharsetOps_iso8859_14 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_14,
|
FONT_CHARSET_ISO8859_14,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1820,6 +1833,7 @@ static CHARSETOPS CharsetOps_iso8859_15 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_15,
|
FONT_CHARSET_ISO8859_15,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1970,6 +1984,7 @@ static CHARSETOPS CharsetOps_iso8859_16 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_ISO8859_16,
|
FONT_CHARSET_ISO8859_16,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -2167,6 +2182,7 @@ static CHARSETOPS CharsetOps_gb2312_0 = {
|
|||||||
2,
|
2,
|
||||||
FONT_CHARSET_GB2312_0,
|
FONT_CHARSET_GB2312_0,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
gb2312_0_len_first_char,
|
gb2312_0_len_first_char,
|
||||||
gb2312_0_get_char_value,
|
gb2312_0_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -2324,6 +2340,7 @@ static CHARSETOPS CharsetOps_gbk = {
|
|||||||
2,
|
2,
|
||||||
FONT_CHARSET_GBK,
|
FONT_CHARSET_GBK,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
gbk_len_first_char,
|
gbk_len_first_char,
|
||||||
gbk_get_char_value,
|
gbk_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -2592,6 +2609,7 @@ static CHARSETOPS CharsetOps_gb18030_0 = {
|
|||||||
4,
|
4,
|
||||||
FONT_CHARSET_GB18030_0,
|
FONT_CHARSET_GB18030_0,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
gb18030_0_len_first_char,
|
gb18030_0_len_first_char,
|
||||||
gb18030_0_get_char_value,
|
gb18030_0_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -2749,6 +2767,7 @@ static CHARSETOPS CharsetOps_big5 = {
|
|||||||
2,
|
2,
|
||||||
FONT_CHARSET_BIG5,
|
FONT_CHARSET_BIG5,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
big5_len_first_char,
|
big5_len_first_char,
|
||||||
big5_get_char_value,
|
big5_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -2895,6 +2914,7 @@ static CHARSETOPS CharsetOps_ksc5601_0 = {
|
|||||||
2,
|
2,
|
||||||
FONT_CHARSET_EUCKR,
|
FONT_CHARSET_EUCKR,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
ksc5601_0_len_first_char,
|
ksc5601_0_len_first_char,
|
||||||
ksc5601_0_get_char_value,
|
ksc5601_0_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -3019,6 +3039,7 @@ static CHARSETOPS CharsetOps_jisx0201_0 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_JISX0201_0,
|
FONT_CHARSET_JISX0201_0,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
jisx0201_0_len_first_char,
|
jisx0201_0_len_first_char,
|
||||||
jisx0201_0_get_char_value,
|
jisx0201_0_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -3162,6 +3183,7 @@ static CHARSETOPS CharsetOps_jisx0208_0 = {
|
|||||||
2,
|
2,
|
||||||
FONT_CHARSET_JISX0208_0,
|
FONT_CHARSET_JISX0208_0,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
jisx0208_0_len_first_char,
|
jisx0208_0_len_first_char,
|
||||||
jisx0208_0_get_char_value,
|
jisx0208_0_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -3247,6 +3269,7 @@ static CHARSETOPS CharsetOps_jisx0201_1 = {
|
|||||||
1,
|
1,
|
||||||
FONT_CHARSET_JISX0201_1,
|
FONT_CHARSET_JISX0201_1,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
sb_len_first_char,
|
sb_len_first_char,
|
||||||
sb_get_char_value,
|
sb_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -3418,6 +3441,7 @@ static CHARSETOPS CharsetOps_jisx0208_1 = {
|
|||||||
2,
|
2,
|
||||||
FONT_CHARSET_JISX0208_1,
|
FONT_CHARSET_JISX0208_1,
|
||||||
0,
|
0,
|
||||||
|
0,
|
||||||
jisx0208_1_len_first_char,
|
jisx0208_1_len_first_char,
|
||||||
jisx0208_1_get_char_value,
|
jisx0208_1_get_char_value,
|
||||||
NULL,
|
NULL,
|
||||||
|
|||||||
@@ -255,6 +255,17 @@ compute_kernval (TTFINSTANCEINFO* ttf_inst_info)
|
|||||||
return kernval;
|
return kernval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature)
|
||||||
|
{
|
||||||
|
switch (feature) {
|
||||||
|
case DEVFONT_FEATURE_MARK_BBOX:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
if (logfont->style & FS_WEIGHT_BOOK)
|
if (logfont->style & FS_WEIGHT_BOOK)
|
||||||
@@ -792,6 +803,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
|||||||
}
|
}
|
||||||
/**************************** Global data ************************************/
|
/**************************** Global data ************************************/
|
||||||
FONTOPS __mg_ttf_ops = {
|
FONTOPS __mg_ttf_ops = {
|
||||||
|
get_feature,
|
||||||
get_glyph_bmptype,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
|
|||||||
@@ -197,6 +197,17 @@ print_bitmap_grey (const BYTE* buffer, int width, int rows, int pitch)
|
|||||||
printf("*******************************************\n");
|
printf("*******************************************\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature)
|
||||||
|
{
|
||||||
|
switch (feature) {
|
||||||
|
case DEVFONT_FEATURE_MARK_BBOX:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
switch (logfont->style & FS_RENDER_MASK) {
|
switch (logfont->style & FS_RENDER_MASK) {
|
||||||
@@ -1265,6 +1276,7 @@ void font_TermFreetypeLibrary (void)
|
|||||||
|
|
||||||
/**************************** Global data ************************************/
|
/**************************** Global data ************************************/
|
||||||
FONTOPS __mg_ttf_ops = {
|
FONTOPS __mg_ttf_ops = {
|
||||||
|
get_feature,
|
||||||
get_glyph_bmptype,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
|
|||||||
@@ -735,8 +735,7 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
|
|||||||
run_pos = node_p->pos;
|
run_pos = node_p->pos;
|
||||||
run_len = node_p->len;
|
run_len = node_p->len;
|
||||||
|
|
||||||
for (i=0; i<run_len; i++)
|
for (i=0; i<run_len; i++) {
|
||||||
{
|
|
||||||
(map+run_pos+i)->is_rtol = (node_p)->level & 1;
|
(map+run_pos+i)->is_rtol = (node_p)->level & 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,17 @@
|
|||||||
#define NUF_WIDTH 8
|
#define NUF_WIDTH 8
|
||||||
#define NUF_HEIGHT 1
|
#define NUF_HEIGHT 1
|
||||||
|
|
||||||
|
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature)
|
||||||
|
{
|
||||||
|
switch (feature) {
|
||||||
|
case DEVFONT_FEATURE_MARK_BBOX:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
return DEVFONTGLYPHTYPE_MONOBMP;
|
return DEVFONTGLYPHTYPE_MONOBMP;
|
||||||
@@ -171,6 +182,7 @@ static void unload_font_data (DEVFONT* devfont, void* data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FONTOPS __mg_null_font_ops = {
|
FONTOPS __mg_null_font_ops = {
|
||||||
|
get_feature,
|
||||||
get_glyph_bmptype,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
|
|||||||
@@ -287,6 +287,17 @@ static unsigned char def_smooth_bitmap [] =
|
|||||||
static QPF_GLYPH def_glyph = {&def_metrics, def_bitmap};
|
static QPF_GLYPH def_glyph = {&def_metrics, def_bitmap};
|
||||||
static QPF_GLYPH def_smooth_glyph = {&def_smooth_metrics, def_smooth_bitmap};
|
static QPF_GLYPH def_smooth_glyph = {&def_smooth_metrics, def_smooth_bitmap};
|
||||||
|
|
||||||
|
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature)
|
||||||
|
{
|
||||||
|
switch (feature) {
|
||||||
|
case DEVFONT_FEATURE_MARK_BBOX:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH)
|
if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH)
|
||||||
@@ -541,6 +552,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
|||||||
|
|
||||||
/**************************** Global data ************************************/
|
/**************************** Global data ************************************/
|
||||||
FONTOPS __mg_qpf_ops = {
|
FONTOPS __mg_qpf_ops = {
|
||||||
|
get_feature,
|
||||||
get_glyph_bmptype,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
|
|||||||
@@ -151,6 +151,17 @@ static void unload_font_data (DEVFONT* devfont, void* data)
|
|||||||
|
|
||||||
/*************** Raw bitmap font operations *********************************/
|
/*************** Raw bitmap font operations *********************************/
|
||||||
|
|
||||||
|
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature)
|
||||||
|
{
|
||||||
|
switch (feature) {
|
||||||
|
case DEVFONT_FEATURE_MARK_BBOX:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
return DEVFONTGLYPHTYPE_MONOBMP;
|
return DEVFONTGLYPHTYPE_MONOBMP;
|
||||||
@@ -280,6 +291,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
|||||||
|
|
||||||
/**************************** Global data ************************************/
|
/**************************** Global data ************************************/
|
||||||
FONTOPS __mg_rbf_ops = {
|
FONTOPS __mg_rbf_ops = {
|
||||||
|
get_feature,
|
||||||
get_glyph_bmptype,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_ave_width, // max_width same as ave_width
|
get_ave_width, // max_width same as ave_width
|
||||||
|
|||||||
@@ -377,6 +377,17 @@ static int get_max_width (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
return logfont->size;
|
return logfont->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature)
|
||||||
|
{
|
||||||
|
switch (feature) {
|
||||||
|
case DEVFONT_FEATURE_MARK_BBOX:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
if (logfont->style & FS_WEIGHT_BOOK)
|
if (logfont->style & FS_WEIGHT_BOOK)
|
||||||
@@ -598,6 +609,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
|||||||
|
|
||||||
/**************************** Global data ************************************/
|
/**************************** Global data ************************************/
|
||||||
static FONTOPS scripteasy_font_ops = {
|
static FONTOPS scripteasy_font_ops = {
|
||||||
|
get_feature,
|
||||||
get_glyph_bmptype,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
|
|||||||
@@ -148,6 +148,17 @@ static void unload_font_data (DEVFONT* devfont, void* data)
|
|||||||
free (((UPFINFO*) data));
|
free (((UPFINFO*) data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature)
|
||||||
|
{
|
||||||
|
switch (feature) {
|
||||||
|
case DEVFONT_FEATURE_MARK_BBOX:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
Uint8* p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir;
|
Uint8* p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir;
|
||||||
@@ -525,6 +536,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FONTOPS __mg_upf_ops = {
|
FONTOPS __mg_upf_ops = {
|
||||||
|
get_feature,
|
||||||
get_glyph_bmptype,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
|
|||||||
@@ -109,6 +109,17 @@ typedef struct _FONT_PROPT {
|
|||||||
int def_glyph;
|
int def_glyph;
|
||||||
} FONT_PROPT;
|
} FONT_PROPT;
|
||||||
|
|
||||||
|
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature)
|
||||||
|
{
|
||||||
|
switch (feature) {
|
||||||
|
case DEVFONT_FEATURE_MARK_BBOX:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
return DEVFONTGLYPHTYPE_MONOBMP;
|
return DEVFONTGLYPHTYPE_MONOBMP;
|
||||||
@@ -477,6 +488,7 @@ static void unload_font_data (DEVFONT* devfont, void* data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FONTOPS __mg_vbf_ops = {
|
FONTOPS __mg_vbf_ops = {
|
||||||
|
get_feature,
|
||||||
get_glyph_bmptype,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
|
|||||||
+1
-1
@@ -2185,7 +2185,7 @@ static int create_memdc_for_menu (TRACKMENUINFO* ptmi)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptmi->dc = CreateMemDCFromSurface (surf);
|
ptmi->dc = __mg_create_memdc_for_surface (surf);
|
||||||
if (ptmi->dc == HDC_INVALID) {
|
if (ptmi->dc == HDC_INVALID) {
|
||||||
GAL_FreeSurface (surf);
|
GAL_FreeSurface (surf);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
+33
-9
@@ -4476,10 +4476,10 @@ HWND GUIAPI CreateMainWindowEx2 (PMAINWINCREATE pCreateInfo, LINT id,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
// Close file descriptor to free kernel memory?
|
/* Since 5.2.0: keep fd available. */
|
||||||
if (pWin->surf->shared_header) {
|
if (0 && pWin->surf->shared_header) {
|
||||||
close (pWin->surf->shared_header->fd);
|
close (pWin->surf->fd);
|
||||||
pWin->surf->shared_header->fd = -1;
|
pWin->surf->fd = -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -5585,11 +5585,13 @@ BOOL GUIAPI ValidateRegion (HWND hWnd, const CLIPRGN* pRgn)
|
|||||||
BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect)
|
BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect)
|
||||||
{
|
{
|
||||||
PMAINWIN pWin;
|
PMAINWIN pWin;
|
||||||
|
RECT rcClient;
|
||||||
|
|
||||||
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE);
|
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE);
|
||||||
pWin = MG_GET_WINDOW_PTR (hWnd);
|
pWin = MG_GET_WINDOW_PTR (hWnd);
|
||||||
|
|
||||||
*update_rect = pWin->InvRgn.rgn.rcBound;
|
GetClientRect(hWnd, &rcClient);
|
||||||
|
IntersectRect(update_rect, &pWin->InvRgn.rgn.rcBound, &rcClient);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6036,10 +6038,10 @@ HWND GUIAPI CreateWindowEx2 (const char* spClassName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
// Close file descriptor to free kernel memory?
|
/* Since 5.2.0: keep fd available. */
|
||||||
if (dwExStyle & WS_EX_CTRLASMAINWIN && pNewCtrl->surf->shared_header) {
|
if (0 && dwExStyle & WS_EX_CTRLASMAINWIN && pNewCtrl->surf->shared_header) {
|
||||||
close (pNewCtrl->surf->shared_header->fd);
|
close (pNewCtrl->surf->fd);
|
||||||
pNewCtrl->surf->shared_header->fd = -1;
|
pNewCtrl->surf->fd = -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -6066,6 +6068,28 @@ error:
|
|||||||
return HWND_INVALID;
|
return HWND_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
int GUIAPI GetWindowSharedSurfaceFD (HWND hWnd, size_t *map_size, DWORD *flags)
|
||||||
|
{
|
||||||
|
MG_CHECK_RET (MG_IS_NORMAL_WINDOW (hWnd), -1);
|
||||||
|
|
||||||
|
PMAINWIN pWin = (PMAINWIN)hWnd;
|
||||||
|
if (pWin->surf->shared_header) {
|
||||||
|
if (map_size)
|
||||||
|
*map_size = pWin->surf->shared_header->map_size;
|
||||||
|
if (flags) {
|
||||||
|
*flags = MEMDC_FLAG_SWSURFACE;
|
||||||
|
if (pWin->surf->shared_header->byhw)
|
||||||
|
*flags |= MEMDC_FLAG_HWSURFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pWin->surf->fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif /* _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
BOOL GUIAPI DestroyWindow (HWND hWnd)
|
BOOL GUIAPI DestroyWindow (HWND hWnd)
|
||||||
{
|
{
|
||||||
PCONTROL pCtrl;
|
PCONTROL pCtrl;
|
||||||
|
|||||||
+27
-2
@@ -105,6 +105,10 @@
|
|||||||
#define REQID_GETSHAREDSURFACE 0x001C
|
#define REQID_GETSHAREDSURFACE 0x001C
|
||||||
// for compositing schema
|
// for compositing schema
|
||||||
#define SYSSF_WALLPAPER_PATTER "syssf-wallpaper-pattern"
|
#define SYSSF_WALLPAPER_PATTER "syssf-wallpaper-pattern"
|
||||||
|
#define APPSF_NAME_PREFIX "appsf-name-"
|
||||||
|
#define APPSF_NAME_PATTER "appsf-name-%s"
|
||||||
|
#define APPSF_HWND_PREFIX "appsf-hwnd-"
|
||||||
|
#define APPSF_HWND_PATTER "appsf-hwnd-%d-%p"
|
||||||
// for sharedfb schema
|
// for sharedfb schema
|
||||||
#define SYSSF_REAL_SCREEN "syssf-real-screen"
|
#define SYSSF_REAL_SCREEN "syssf-real-screen"
|
||||||
#define SYSSF_SHADOW_SCREEN "syssf-shadow-screen"
|
#define SYSSF_SHADOW_SCREEN "syssf-shadow-screen"
|
||||||
@@ -113,10 +117,22 @@
|
|||||||
#define REQID_LOADCURSOR_PNG 0x001D
|
#define REQID_LOADCURSOR_PNG 0x001D
|
||||||
// Load cursor from in-memory PNG
|
// Load cursor from in-memory PNG
|
||||||
#define REQID_LOADCURSOR_PNG_MEM 0x001E
|
#define REQID_LOADCURSOR_PNG_MEM 0x001E
|
||||||
|
|
||||||
|
#if 0 // Deprecated since 5.2.0
|
||||||
// allocate semaphore for shared surface
|
// allocate semaphore for shared surface
|
||||||
#define REQID_ALLOC_SURF_SEM 0x001F
|
#define REQID_ALLOC_SURF_SEM 0x001F
|
||||||
// free semaphore of shared surface
|
// free semaphore of shared surface
|
||||||
#define REQID_FREE_SURF_SEM 0x0020
|
#define REQID_FREE_SURF_SEM 0x0020
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Since 5.2.0 */
|
||||||
|
// Operate a shared surface to register/revoke the name and set the fd
|
||||||
|
#define REQID_OPERATENAMEDSSURF 0x001F
|
||||||
|
#define ID_NAMEDSSURFOP_REGISTER 1
|
||||||
|
#define ID_NAMEDSSURFOP_SET 2
|
||||||
|
#define ID_NAMEDSSURFOP_REVOKE 3
|
||||||
|
|
||||||
|
#define REQID_RESERVED 0x0020
|
||||||
|
|
||||||
// Move the current client to another layer
|
// Move the current client to another layer
|
||||||
#define REQID_MOVETOLAYER 0x0021
|
#define REQID_MOVETOLAYER 0x0021
|
||||||
@@ -142,15 +158,23 @@ MGUI_COMPILE_TIME_ASSERT(sys_request_id, MAX_SYS_REQID >= REQID_SYS_LAST);
|
|||||||
|
|
||||||
#undef MGUI_COMPILE_TIME_ASSERT
|
#undef MGUI_COMPILE_TIME_ASSERT
|
||||||
|
|
||||||
|
/* Since 5.2.0 */
|
||||||
|
typedef struct OperateNSSurfInfo
|
||||||
|
{
|
||||||
|
int id_op;
|
||||||
|
char name[NAME_MAX + 1];
|
||||||
|
size_t map_size;
|
||||||
|
} OPERATENSSURFINFO;
|
||||||
|
|
||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
typedef struct _SharedSurfInfo {
|
typedef struct _SharedSurfInfo {
|
||||||
|
size_t size; // whole size of the surface
|
||||||
|
off_t offset; // offset of pixel data
|
||||||
uint32_t flags; // the flags of the surface
|
uint32_t flags; // the flags of the surface
|
||||||
uint32_t width, height;
|
uint32_t width, height;
|
||||||
uint32_t pitch;
|
uint32_t pitch;
|
||||||
uint32_t name; // when use flink name
|
uint32_t name; // when use flink name
|
||||||
uint32_t drm_format; // DRM pixel format
|
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 {
|
||||||
@@ -359,6 +383,7 @@ void __mg_start_client_desktop (void);
|
|||||||
|
|
||||||
void __mg_update_window (HWND hwnd, int left, int top, int right, int bottom);
|
void __mg_update_window (HWND hwnd, int left, int top, int right, int bottom);
|
||||||
|
|
||||||
|
BOOL __mg_client_check_znode_hwnd (int slot, HWND hwnd, int cli);
|
||||||
BOOL __mg_client_check_hwnd (HWND hwnd, int cli);
|
BOOL __mg_client_check_hwnd (HWND hwnd, int cli);
|
||||||
BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid);
|
BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid);
|
||||||
|
|
||||||
|
|||||||
+6
-4
@@ -521,14 +521,16 @@ static inline void _dc_step_y (PDC pdc, int step)
|
|||||||
|
|
||||||
# define BLOCK_DRAW_SEM(pdc) \
|
# define BLOCK_DRAW_SEM(pdc) \
|
||||||
do { \
|
do { \
|
||||||
if (pdc->surface->shared_header) \
|
if (pdc->surface->shared_header) { \
|
||||||
LOCK_SURFACE_SEM (pdc->surface->shared_header->sem_num); \
|
__mg_lock_file_for_write(pdc->surface->fd); \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
# define UNBLOCK_DRAW_SEM(pdc) \
|
# define UNBLOCK_DRAW_SEM(pdc) \
|
||||||
do { \
|
do { \
|
||||||
if (pdc->surface->shared_header) \
|
if (pdc->surface->shared_header) { \
|
||||||
UNLOCK_SURFACE_SEM (pdc->surface->shared_header->sem_num); \
|
__mg_unlock_file_for_write(pdc->surface->fd); \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
# define IS_SCREEN_SURFACE(pdc) \
|
# define IS_SCREEN_SURFACE(pdc) \
|
||||||
|
|||||||
+12
-1
@@ -15,7 +15,7 @@
|
|||||||
* and Graphics User Interface (GUI) support system for embedded systems
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
* and smart IoT devices.
|
* and smart IoT devices.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
* Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
|
||||||
* Copyright (C) 1998~2002, WEI Yongming
|
* Copyright (C) 1998~2002, WEI Yongming
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@@ -209,6 +209,9 @@ struct _CHARSETOPS
|
|||||||
/** Default character. */
|
/** Default character. */
|
||||||
Achar32 def_char_value;
|
Achar32 def_char_value;
|
||||||
|
|
||||||
|
/** Whether using legacy BIDI algorithm (Since 5.0.13). */
|
||||||
|
unsigned legacy_bidi:1;
|
||||||
|
|
||||||
/** The method to get the length of the first character. */
|
/** The method to get the length of the first character. */
|
||||||
int (*len_first_char) (const unsigned char* mstr, int mstrlen);
|
int (*len_first_char) (const unsigned char* mstr, int mstrlen);
|
||||||
|
|
||||||
@@ -263,9 +266,17 @@ struct _CHARSETOPS
|
|||||||
|
|
||||||
#define DEVFONTGLYPHTYPE_MASK_BMPTYPE 0x0F
|
#define DEVFONTGLYPHTYPE_MASK_BMPTYPE 0x0F
|
||||||
|
|
||||||
|
enum devfont_feature {
|
||||||
|
DEVFONT_FEATURE_MARK_BBOX = 0,
|
||||||
|
};
|
||||||
|
|
||||||
/** The font operation structure. */
|
/** The font operation structure. */
|
||||||
struct _FONTOPS
|
struct _FONTOPS
|
||||||
{
|
{
|
||||||
|
/** The method to get the feature value of the font (Since 5.0.13). */
|
||||||
|
DWORD (*get_feature) (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
enum devfont_feature feature);
|
||||||
|
|
||||||
/** The method to get the glyph bitmap type . */
|
/** The method to get the glyph bitmap type . */
|
||||||
DWORD (*get_glyph_bmptype) (LOGFONT* logfont, DEVFONT* devfont);
|
DWORD (*get_glyph_bmptype) (LOGFONT* logfont, DEVFONT* devfont);
|
||||||
|
|
||||||
|
|||||||
+10
-8
@@ -51,12 +51,10 @@
|
|||||||
#ifndef GUI_DRAWSEMOP_H
|
#ifndef GUI_DRAWSEMOP_H
|
||||||
#define GUI_DRAWSEMOP_H
|
#define GUI_DRAWSEMOP_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
static inline void my_sem_op (int semid, int num, int op)
|
static inline void my_sem_op (int semid, int num, int op)
|
||||||
{
|
{
|
||||||
struct sembuf sb;
|
struct sembuf sb;
|
||||||
@@ -70,6 +68,9 @@ again:
|
|||||||
if (errno == EINTR) {
|
if (errno == EINTR) {
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
_ERR_PRINTF("Failed semop: %m\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,10 +80,7 @@ again:
|
|||||||
#define LOCK_SCREEN_SEM() my_sem_op(SHAREDRES_SEMID, _IDX_SEM_SCR, -1)
|
#define LOCK_SCREEN_SEM() my_sem_op(SHAREDRES_SEMID, _IDX_SEM_SCR, -1)
|
||||||
#define UNLOCK_SCREEN_SEM() my_sem_op(SHAREDRES_SEMID, _IDX_SEM_SCR, 1)
|
#define UNLOCK_SCREEN_SEM() my_sem_op(SHAREDRES_SEMID, _IDX_SEM_SCR, 1)
|
||||||
|
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
extern int __mg_client_id;
|
||||||
# define LOCK_SURFACE_SEM(num) my_sem_op(SHAREDRES_SEMID_SHARED_SURF, num, -1)
|
|
||||||
# define UNLOCK_SURFACE_SEM(num) my_sem_op(SHAREDRES_SEMID_SHARED_SURF, num, 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _MGHAVE_CURSOR
|
#ifdef _MGHAVE_CURSOR
|
||||||
|
|
||||||
@@ -157,6 +155,10 @@ again:
|
|||||||
# define UNLOCK_MOUSEMOVE_SEM() my_sem_op(SHAREDRES_SEMID, _IDX_SEM_MOUSEMOVE, 1)
|
# define UNLOCK_MOUSEMOVE_SEM() my_sem_op(SHAREDRES_SEMID, _IDX_SEM_MOUSEMOVE, 1)
|
||||||
#endif /* _MGRM_PROCESSES */
|
#endif /* _MGRM_PROCESSES */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
@@ -958,9 +958,7 @@ BOOL gui_LoadIconRes(HDC hdc, const char* rdr_name, char* file);
|
|||||||
void gui_WndRect(HWND hWnd, PRECT prc);
|
void gui_WndRect(HWND hWnd, PRECT prc);
|
||||||
void gui_WndClientRect(HWND hWnd, PRECT prc);
|
void gui_WndClientRect(HWND hWnd, PRECT prc);
|
||||||
|
|
||||||
/* Undisclosed APIs */
|
HDC __mg_create_memdc_for_surface (struct GAL_Surface* surface);
|
||||||
HDC CreateMemDCFromSurface (struct GAL_Surface* surface);
|
|
||||||
struct GAL_Surface* GetSurfaceFromDC (HDC hdc);
|
|
||||||
|
|
||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
#ifdef _MGRM_PROCESSES
|
#ifdef _MGRM_PROCESSES
|
||||||
|
|||||||
+14
-2
@@ -83,6 +83,11 @@ static inline int comp_key_string (const void *key1, const void *key2)
|
|||||||
return strcmp (key1, key2);
|
return strcmp (key1, key2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void free_val_alloc (void *val)
|
||||||
|
{
|
||||||
|
free (val);
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct _map_t map_t;
|
typedef struct _map_t map_t;
|
||||||
typedef struct _map_entry_t {
|
typedef struct _map_entry_t {
|
||||||
struct rb_node node;
|
struct rb_node node;
|
||||||
@@ -100,8 +105,15 @@ int __mg_map_get_size (map_t* map);
|
|||||||
|
|
||||||
map_entry_t* __mg_map_find (map_t* map, const void* key);
|
map_entry_t* __mg_map_find (map_t* map, const void* key);
|
||||||
|
|
||||||
int __mg_map_insert_ex (map_t* map, const void* key,
|
map_entry_t* __mg_map_insert_ex2 (map_t* map, const void* key,
|
||||||
const void* val, free_val_fn free_val_alt);
|
const void* val, free_val_fn free_val_alt);
|
||||||
|
|
||||||
|
static int __mg_map_insert_ex (map_t* map, const void* key,
|
||||||
|
const void* val, free_val_fn free_val_alt)
|
||||||
|
{
|
||||||
|
return __mg_map_insert_ex2(map, key, val, NULL) ? 0 : -1;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int __mg_map_insert (map_t* map, const void* key,
|
static inline int __mg_map_insert (map_t* map, const void* key,
|
||||||
const void* val)
|
const void* val)
|
||||||
{
|
{
|
||||||
@@ -114,7 +126,7 @@ int __mg_map_find_replace_or_insert (map_t* map, const void* key,
|
|||||||
int __mg_map_replace (map_t* map, const void* key,
|
int __mg_map_replace (map_t* map, const void* key,
|
||||||
const void* val, free_val_fn free_val_alt);
|
const void* val, free_val_fn free_val_alt);
|
||||||
|
|
||||||
int __mg_map_erase (map_t* map, void* key);
|
int __mg_map_erase (map_t* map, const void* key);
|
||||||
int __mg_map_get_size (map_t* map);
|
int __mg_map_get_size (map_t* map);
|
||||||
|
|
||||||
#if 0 /* deprecated code */
|
#if 0 /* deprecated code */
|
||||||
|
|||||||
+7
-1
@@ -79,6 +79,11 @@ struct timezone {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
void __mg_lock_file_for_read(int fd);
|
||||||
|
void __mg_unlock_file_for_read(int fd);
|
||||||
|
void __mg_lock_file_for_write(int fd);
|
||||||
|
void __mg_unlock_file_for_write(int fd);
|
||||||
|
|
||||||
unsigned int __mg_os_get_random_seed (void);
|
unsigned int __mg_os_get_random_seed (void);
|
||||||
void __mg_os_time_delay (int ms);
|
void __mg_os_time_delay (int ms);
|
||||||
void __mg_os_start_time (void);
|
void __mg_os_start_time (void);
|
||||||
@@ -115,10 +120,11 @@ void mg_TerminateMisc (void);
|
|||||||
BOOL mg_InitSystemRes (void);
|
BOOL mg_InitSystemRes (void);
|
||||||
void mg_TerminateSystemRes (void);
|
void mg_TerminateSystemRes (void);
|
||||||
|
|
||||||
|
/* Deprecated since 5.2.0
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
int __mg_alloc_sem_for_shared_surf (void);
|
int __mg_alloc_sem_for_shared_surf (void);
|
||||||
int __mg_free_sem_for_shared_surf (int sem_num);
|
int __mg_free_sem_for_shared_surf (int sem_num);
|
||||||
#endif /* _MGSCHEMA_COMPOSITING */
|
#endif _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set);
|
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set);
|
||||||
|
|
||||||
|
|||||||
@@ -396,10 +396,10 @@ char * __mg_msgstr3 [] =
|
|||||||
"MSG_SRVNOTIFY", // 0x0147
|
"MSG_SRVNOTIFY", // 0x0147
|
||||||
"MSG_UPDATECLIWIN", // 0x0148
|
"MSG_UPDATECLIWIN", // 0x0148
|
||||||
"MSG_LAYERCHANGED", // 0x0149
|
"MSG_LAYERCHANGED", // 0x0149
|
||||||
"MSG_MANAGE_MSGTHREAD", // 0x014A
|
"MSG_WINCOMPOSITED", // 0x014A
|
||||||
"MSG_CALC_POSITION", // 0x014B
|
"MSG_MANAGE_MSGTHREAD", // 0x014B
|
||||||
"", // 0x014C
|
"MSG_CALC_POSITION", // 0x014C
|
||||||
"", // 0x014D
|
"MSG_WAKEUP_CLIENT", // 0x014D
|
||||||
"", // 0x014E
|
"", // 0x014E
|
||||||
"", // 0x014F
|
"", // 0x014F
|
||||||
|
|
||||||
|
|||||||
+36
-21
@@ -117,8 +117,10 @@ void GAL_FreeFormat(GAL_PixelFormat *format);
|
|||||||
|
|
||||||
/* typedef for private surface blitting functions */
|
/* typedef for private surface blitting functions */
|
||||||
struct GAL_Surface;
|
struct GAL_Surface;
|
||||||
typedef int (*GAL_blit)(struct GAL_Surface *src, GAL_Rect *srcrect,
|
|
||||||
struct GAL_Surface *dst, GAL_Rect *dstrect);
|
typedef int (*GAL_blit)(GAL_VideoDevice *video,
|
||||||
|
struct GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
|
struct GAL_Surface *dst, GAL_Rect *dstrect);
|
||||||
|
|
||||||
#if IS_COMPOSITING_SCHEMA
|
#if IS_COMPOSITING_SCHEMA
|
||||||
typedef struct _DirtyInfo {
|
typedef struct _DirtyInfo {
|
||||||
@@ -137,20 +139,25 @@ typedef struct _DirtyInfo {
|
|||||||
* than the creator.
|
* than the creator.
|
||||||
*/
|
*/
|
||||||
typedef struct _SharedSurfaceHeader {
|
typedef struct _SharedSurfaceHeader {
|
||||||
/* The number of semphore for this surface.
|
/* the name of the shared surface; since 5.2.0. */
|
||||||
The SysV semaphore set id for synchronizing this shared surface:
|
char name[NAME_MAX + 1];
|
||||||
SHAREDRES_SEMID_SHARED_SURF. */
|
|
||||||
int sem_num;
|
|
||||||
|
|
||||||
/* The pid of the creator */
|
/* The client identifier of the creator. */
|
||||||
pid_t creator;
|
int create_cli;
|
||||||
|
|
||||||
/* The file descriptor in context of the creator. */
|
|
||||||
int fd;
|
|
||||||
/* Not zero for hardware surface. */
|
/* Not zero for hardware surface. */
|
||||||
int byhw;
|
int byhw;
|
||||||
/* The dirty information */
|
|
||||||
GAL_DirtyInfo dirty_info;
|
/* Deprecated since 5.2.0.
|
||||||
|
The number of semphore for this surface.
|
||||||
|
The SysV semaphore set id for synchronizing this shared surface:
|
||||||
|
SHAREDRES_SEMID_SHARED_SURF.
|
||||||
|
int sem_num; */
|
||||||
|
|
||||||
|
/* Deprecated since 5.2.0.
|
||||||
|
The file descriptor in context of the creator.
|
||||||
|
int fd; */
|
||||||
|
|
||||||
/* the size of the surface */
|
/* the size of the surface */
|
||||||
int width, height;
|
int width, height;
|
||||||
/* the pitch of the surface */
|
/* the pitch of the surface */
|
||||||
@@ -164,6 +171,9 @@ typedef struct _SharedSurfaceHeader {
|
|||||||
size_t map_size;
|
size_t map_size;
|
||||||
/* the offset of pixels data */
|
/* the offset of pixels data */
|
||||||
off_t pixels_off;
|
off_t pixels_off;
|
||||||
|
|
||||||
|
/* The dirty information */
|
||||||
|
GAL_DirtyInfo dirty_info;
|
||||||
} GAL_SharedSurfaceHeader;
|
} GAL_SharedSurfaceHeader;
|
||||||
#endif /* IS_COMPOSITING_SCHEMA */
|
#endif /* IS_COMPOSITING_SCHEMA */
|
||||||
|
|
||||||
@@ -228,6 +238,8 @@ typedef struct GAL_Surface {
|
|||||||
GAL_SharedSurfaceHeader *shared_header; /* Private */
|
GAL_SharedSurfaceHeader *shared_header; /* Private */
|
||||||
/* The dirty info for non-shared surface. */
|
/* The dirty info for non-shared surface. */
|
||||||
GAL_DirtyInfo *dirty_info; /* Private */
|
GAL_DirtyInfo *dirty_info; /* Private */
|
||||||
|
/* The file descriptor if the surface is a shared surface. */
|
||||||
|
int fd; /* Private; since 5.2.0. */
|
||||||
#endif
|
#endif
|
||||||
} GAL_Surface;
|
} GAL_Surface;
|
||||||
|
|
||||||
@@ -250,6 +262,8 @@ typedef struct GAL_Surface {
|
|||||||
|
|
||||||
#define GAL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
|
#define GAL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
|
||||||
#define GAL_FORMAT_CHECKED 0x02000000 /* Pixman format checked */
|
#define GAL_FORMAT_CHECKED 0x02000000 /* Pixman format checked */
|
||||||
|
#define GAL_SSURF_ATTACHED 0x04000000 /* The shared surface is attached to. */
|
||||||
|
#define GAL_SSURF_LOCKED 0x08000000 /* The shared surface is locked. */
|
||||||
|
|
||||||
/* Available for GAL_SetVideoMode() */
|
/* Available for GAL_SetVideoMode() */
|
||||||
#define GAL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
|
#define GAL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
|
||||||
@@ -569,6 +583,11 @@ GAL_Surface *GAL_CreateRGBSurface
|
|||||||
GAL_Surface *GAL_CreateRGBSurfaceFrom (void *pixels,
|
GAL_Surface *GAL_CreateRGBSurfaceFrom (void *pixels,
|
||||||
int width, int height, int depth, int pitch,
|
int width, int height, int depth, int pitch,
|
||||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||||
|
/* Since 5.2.0 */
|
||||||
|
static GAL_Surface *GAL_RefSurface (GAL_Surface *surface) {
|
||||||
|
surface->refcount++;
|
||||||
|
return surface;
|
||||||
|
}
|
||||||
void GAL_FreeSurface (GAL_Surface *surface);
|
void GAL_FreeSurface (GAL_Surface *surface);
|
||||||
|
|
||||||
typedef struct REQ_HWSURFACE {
|
typedef struct REQ_HWSURFACE {
|
||||||
@@ -649,11 +668,11 @@ GAL_Surface *GAL_CreateSurfaceForZNodeAs (const GAL_Surface* ref_surf,
|
|||||||
void GAL_FreeSharedSurfaceData (GAL_Surface *surface);
|
void GAL_FreeSharedSurfaceData (GAL_Surface *surface);
|
||||||
|
|
||||||
/* Attach to a shared RGB surface. */
|
/* Attach to a shared RGB surface. */
|
||||||
GAL_Surface *GAL_AttachSharedRGBSurface (int fd, size_t map_size,
|
GAL_Surface *GAL_AttachSharedRGBSurface (GAL_VideoDevice* video,
|
||||||
Uint32 flags, BOOL with_wr);
|
int fd, size_t map_size, Uint32 flags, BOOL with_wr);
|
||||||
|
|
||||||
/* Dettach from a shared RGB surface from the specific video device. */
|
/* Detach from a shared RGB surface from the specific video device. */
|
||||||
void GAL_DettachSharedSurfaceData (GAL_Surface *surface);
|
void GAL_DetachSharedSurfaceData (GAL_Surface *surface);
|
||||||
|
|
||||||
/* Create a cursor surface from the specific video device. */
|
/* Create a cursor surface from the specific video device. */
|
||||||
GAL_Surface* GAL_CreateCursorSurface (GAL_VideoDevice* video,
|
GAL_Surface* GAL_CreateCursorSurface (GAL_VideoDevice* video,
|
||||||
@@ -670,7 +689,6 @@ void GAL_MoveCursor (GAL_Surface* surface, int x, int y);
|
|||||||
|
|
||||||
#endif /* defined _MGSCHEMA_COMPOSITING */
|
#endif /* defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
/*
|
||||||
* GAL_LockSurface() sets up a surface for directly accessing the pixels.
|
* GAL_LockSurface() sets up a surface for directly accessing the pixels.
|
||||||
* Between calls to GAL_LockSurface()/GAL_UnlockSurface(), you can write
|
* Between calls to GAL_LockSurface()/GAL_UnlockSurface(), you can write
|
||||||
@@ -680,9 +698,7 @@ void GAL_MoveCursor (GAL_Surface* surface, int x, int y);
|
|||||||
*
|
*
|
||||||
* Not all surfaces require locking. If GAL_MUSTLOCK(surface) evaluates
|
* Not all surfaces require locking. If GAL_MUSTLOCK(surface) evaluates
|
||||||
* to 0, then you can read and write to the surface at any time, and the
|
* to 0, then you can read and write to the surface at any time, and the
|
||||||
* pixel format of the surface will not change. In particular, if the
|
* pixel format of the surface will not change.
|
||||||
* GAL_HWSURFACE flag is not given when calling GAL_SetVideoMode(), you
|
|
||||||
* will not need to lock the display surface before accessing it.
|
|
||||||
*
|
*
|
||||||
* No operating system or library calls should be made between lock/unlock
|
* No operating system or library calls should be made between lock/unlock
|
||||||
* pairs, as critical system locks may be held during this time.
|
* pairs, as critical system locks may be held during this time.
|
||||||
@@ -691,7 +707,6 @@ void GAL_MoveCursor (GAL_Surface* surface, int x, int y);
|
|||||||
*/
|
*/
|
||||||
int GAL_LockSurface (GAL_Surface *surface);
|
int GAL_LockSurface (GAL_Surface *surface);
|
||||||
void GAL_UnlockSurface (GAL_Surface *surface);
|
void GAL_UnlockSurface (GAL_Surface *surface);
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the color key (transparent pixel) in a blittable surface.
|
* Set the color key (transparent pixel) in a blittable surface.
|
||||||
|
|||||||
@@ -73,6 +73,8 @@
|
|||||||
|
|
||||||
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
|
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
|
||||||
/* union semun is defined by including <sys/sem.h> */
|
/* union semun is defined by including <sys/sem.h> */
|
||||||
|
#elif defined(__DARWIN__)
|
||||||
|
/* union semun is defined by including <sys/sem.h> */
|
||||||
#else
|
#else
|
||||||
/* according to X/OPEN we have to define it ourselves */
|
/* according to X/OPEN we have to define it ourselves */
|
||||||
union semun {
|
union semun {
|
||||||
|
|||||||
@@ -132,6 +132,13 @@ void __mg_client_del (int cli);
|
|||||||
|
|
||||||
void __mg_release_global_res (int cli);
|
void __mg_release_global_res (int cli);
|
||||||
|
|
||||||
|
/* Since 5.2.0 */
|
||||||
|
int __mg_nssurf_map_new(void);
|
||||||
|
void __mg_nssurf_map_delete(void);
|
||||||
|
int __mg_nssurf_map_operate_srv(const OPERATENSSURFINFO* req_info,
|
||||||
|
int cli, int fd);
|
||||||
|
int __mg_get_shared_surface_srv(const char *itn_name, SHAREDSURFINFO *info);
|
||||||
|
|
||||||
void __mg_remove_client (int cli, int clifd);
|
void __mg_remove_client (int cli, int clifd);
|
||||||
|
|
||||||
int __mg_handle_request (int clifd, int req_id, int cli);
|
int __mg_handle_request (int clifd, int req_id, int cli);
|
||||||
@@ -150,6 +157,7 @@ int __mg_remove_all_znodes_of_client (int cli);
|
|||||||
|
|
||||||
int __mg_handle_normal_mouse_move (const ZORDERINFO* zi, int x, int y);
|
int __mg_handle_normal_mouse_move (const ZORDERINFO* zi, int x, int y);
|
||||||
int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd);
|
int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd);
|
||||||
|
ZORDERNODE *__mg_find_znode_by_client_hwnd (int cli, HWND hwnd);
|
||||||
|
|
||||||
int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info);
|
int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info);
|
||||||
int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
|
int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ typedef struct tagG_RES {
|
|||||||
|
|
||||||
int nr_layers;
|
int nr_layers;
|
||||||
int semid_layer;
|
int semid_layer;
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#if 0 && defined(_MGSCHEMA_COMPOSITING) // deprecated since 5.2.0
|
||||||
int semid_shared_surf; /* the id of semaphore set for shared surfaces */
|
int semid_shared_surf; /* the id of semaphore set for shared surfaces */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ typedef G_RES* PG_RES;
|
|||||||
#define SHAREDRES_NR_LAYSERS (((PG_RES)mgSharedRes)->nr_layers)
|
#define SHAREDRES_NR_LAYSERS (((PG_RES)mgSharedRes)->nr_layers)
|
||||||
#define SHAREDRES_SEMID_LAYER (((PG_RES)mgSharedRes)->semid_layer)
|
#define SHAREDRES_SEMID_LAYER (((PG_RES)mgSharedRes)->semid_layer)
|
||||||
|
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#if 0 && defined(_MGSCHEMA_COMPOSITING) // Deprecated since 5.2.0
|
||||||
# define SHAREDRES_SEMID_SHARED_SURF (((PG_RES)mgSharedRes)->semid_shared_surf)
|
# define SHAREDRES_SEMID_SHARED_SURF (((PG_RES)mgSharedRes)->semid_shared_surf)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ static void composite_wallpaper_rect (CompositorCtxt* ctxt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
SelectClipRect (HDC_SCREEN_SYS, dirty_rc);
|
||||||
SetBrushColor (HDC_SCREEN_SYS,
|
SetBrushColor (HDC_SCREEN_SYS,
|
||||||
GetWindowElementPixelEx (HWND_DESKTOP, HDC_SCREEN_SYS,
|
GetWindowElementPixelEx (HWND_DESKTOP, HDC_SCREEN_SYS,
|
||||||
WE_BGC_DESKTOP));
|
WE_BGC_DESKTOP));
|
||||||
@@ -678,6 +679,19 @@ static BOOL merge_dirty_ppp (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
static void dump_dirty_region(CompositorCtxt* ctxt, const char *prefix, int zidx)
|
||||||
|
{
|
||||||
|
CLIPRGN* rgn = &ctxt->dirty_rgn;
|
||||||
|
_WRN_PRINTF("%s (%d): dirty region on screen: (%d, %d) %d x %d; "
|
||||||
|
"highest dirty win: %d; lowest dirty win: %d\n",
|
||||||
|
prefix, zidx,
|
||||||
|
rgn->rcBound.left, rgn->rcBound.top,
|
||||||
|
RECTW (rgn->rcBound), RECTH (rgn->rcBound),
|
||||||
|
ctxt->highest_dirty_win, ctxt->lowest_dirty_win);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static BOOL merge_dirty_win (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
|
static BOOL merge_dirty_win (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
|
||||||
{
|
{
|
||||||
BOOL rc = FALSE;
|
BOOL rc = FALSE;
|
||||||
@@ -721,9 +735,13 @@ static BOOL merge_dirty_wpp (CompositorCtxt* ctxt, MG_Layer* layer)
|
|||||||
static BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
|
static BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
|
||||||
{
|
{
|
||||||
/* the fallback compositor only manages znodes on the topmost layer. */
|
/* the fallback compositor only manages znodes on the topmost layer. */
|
||||||
if (layer != mgTopmostLayer || IsEmptyClipRgn (&ctxt->dirty_rgn))
|
if (layer != mgTopmostLayer)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (IsEmptyClipRgn (&ctxt->dirty_rgn)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (ctxt->highest_dirty_ppp >= 0) {
|
if (ctxt->highest_dirty_ppp >= 0) {
|
||||||
composite_ppp_znodes (ctxt);
|
composite_ppp_znodes (ctxt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#define _DEBUG
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#if defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING)
|
#if defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING)
|
||||||
@@ -69,6 +68,7 @@
|
|||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "zorder.h"
|
#include "zorder.h"
|
||||||
#include "dc.h"
|
#include "dc.h"
|
||||||
|
#include "server.h"
|
||||||
|
|
||||||
#define MAX_NR_COMPOSITORS 8
|
#define MAX_NR_COMPOSITORS 8
|
||||||
#define LEN_COMPOSITOR_NAME 15
|
#define LEN_COMPOSITOR_NAME 15
|
||||||
@@ -133,31 +133,51 @@ static void lock_znode_surface (PDC pdc, ZORDERNODE* node)
|
|||||||
{
|
{
|
||||||
if (node->lock_count == 0) {
|
if (node->lock_count == 0) {
|
||||||
if (pdc->surface->shared_header) {
|
if (pdc->surface->shared_header) {
|
||||||
LOCK_SURFACE_SEM (pdc->surface->shared_header->sem_num);
|
__mg_lock_file_for_read(pdc->surface->fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
node->dirty_age = pdc->surface->dirty_info->dirty_age;
|
node->dirty_age = pdc->surface->dirty_info->dirty_age;
|
||||||
node->nr_dirty_rcs = pdc->surface->dirty_info->nr_dirty_rcs;
|
node->nr_dirty_rcs = pdc->surface->dirty_info->nr_dirty_rcs;
|
||||||
node->dirty_rcs = pdc->surface->dirty_info->dirty_rcs;
|
node->dirty_rcs = pdc->surface->dirty_info->dirty_rcs;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
node->lock_count++;
|
node->lock_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unlock_znode_surface (PDC pdc, ZORDERNODE* node)
|
static BOOL unlock_znode_surface (PDC pdc, ZORDERNODE* node)
|
||||||
{
|
{
|
||||||
|
BOOL need_reset = FALSE;
|
||||||
if (node->lock_count > 0) {
|
if (node->lock_count > 0) {
|
||||||
node->lock_count--;
|
node->lock_count--;
|
||||||
if (node->lock_count == 0) {
|
if (node->lock_count == 0) {
|
||||||
if (pdc->surface->shared_header)
|
if (node->changes != pdc->surface->dirty_info->dirty_age) {
|
||||||
UNLOCK_SURFACE_SEM (pdc->surface->shared_header->sem_num);
|
node->changes = pdc->surface->dirty_info->dirty_age;
|
||||||
|
need_reset = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pdc->surface->shared_header) {
|
||||||
|
__mg_unlock_file_for_read(pdc->surface->fd);
|
||||||
|
}
|
||||||
|
|
||||||
node->dirty_age = 0;
|
node->dirty_age = 0;
|
||||||
node->nr_dirty_rcs = 0;
|
node->nr_dirty_rcs = 0;
|
||||||
node->dirty_rcs = NULL;
|
node->dirty_rcs = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return need_reset;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void reset_znode_surface_dirty (PDC pdc, ZORDERNODE* node, int slot)
|
||||||
|
{
|
||||||
|
if (node->cli == 0 || slot == 0) {
|
||||||
|
pdc->surface->dirty_info->nr_dirty_rcs = 0;
|
||||||
|
}
|
||||||
|
else if (node->hwnd) {
|
||||||
|
MSG msg = { HWND_NULL, MSG_WINCOMPOSITED,
|
||||||
|
slot, (LPARAM)node->hwnd, (DWORD)node->changes };
|
||||||
|
__mg_send2client(&msg, mgClients + node->cli);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* not optimized */
|
#if 0 /* not optimized */
|
||||||
@@ -322,10 +342,8 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
|
|||||||
nodes = GET_MENUNODE(zi);
|
nodes = GET_MENUNODE(zi);
|
||||||
for (i = 0; i < zi->nr_popupmenus; i++) {
|
for (i = 0; i < zi->nr_popupmenus; i++) {
|
||||||
pdc = dc_HDC2PDC (nodes[i].mem_dc);
|
pdc = dc_HDC2PDC (nodes[i].mem_dc);
|
||||||
|
if (unlock_znode_surface (pdc, nodes + i))
|
||||||
nodes[i].changes = pdc->surface->dirty_info->dirty_age;
|
reset_znode_surface_dirty (pdc, nodes + i, i);
|
||||||
pdc->surface->dirty_info->nr_dirty_rcs = 0;
|
|
||||||
unlock_znode_surface (pdc, nodes + i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,9 +353,8 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
|
|||||||
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
|
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
|
||||||
if (nodes [next].flags & ZOF_VISIBLE) {
|
if (nodes [next].flags & ZOF_VISIBLE) {
|
||||||
pdc = dc_HDC2PDC (nodes[next].mem_dc);
|
pdc = dc_HDC2PDC (nodes[next].mem_dc);
|
||||||
nodes[next].changes = pdc->surface->dirty_info->dirty_age;
|
if (unlock_znode_surface (pdc, nodes + next))
|
||||||
pdc->surface->dirty_info->nr_dirty_rcs = 0;
|
reset_znode_surface_dirty (pdc, nodes + next, next);
|
||||||
unlock_znode_surface (pdc, nodes + next);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,9 +363,8 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
|
|||||||
if (layer == mgTopmostLayer) {
|
if (layer == mgTopmostLayer) {
|
||||||
pdc = dc_HDC2PDC (HDC_SCREEN);
|
pdc = dc_HDC2PDC (HDC_SCREEN);
|
||||||
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
|
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
|
||||||
nodes[0].changes = pdc->surface->dirty_info->dirty_age;
|
if (unlock_znode_surface (pdc, nodes))
|
||||||
pdc->surface->dirty_info->nr_dirty_rcs = 0;
|
reset_znode_surface_dirty (pdc, nodes, 0);
|
||||||
unlock_znode_surface (pdc, nodes);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+36
-14
@@ -1081,6 +1081,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
const RECT* prc;
|
const RECT* prc;
|
||||||
|
|
||||||
prc = &cur_pdc->rc_output;
|
prc = &cur_pdc->rc_output;
|
||||||
|
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (!fShow) {
|
||||||
|
GAL_LockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
|
|
||||||
if (cur_pdc->surface != __gal_screen) {
|
if (cur_pdc->surface != __gal_screen) {
|
||||||
if (fShow) {
|
if (fShow) {
|
||||||
GAL_UpdateRect (cur_pdc->surface,
|
GAL_UpdateRect (cur_pdc->surface,
|
||||||
@@ -1090,7 +1096,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) {
|
if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) {
|
||||||
return;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fShow) {
|
if (!fShow) {
|
||||||
@@ -1109,6 +1115,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
UNLOCK_CURSOR_SEM ();
|
UNLOCK_CURSOR_SEM ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (fShow) {
|
||||||
|
GAL_UnlockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* defined _MGSCHEMA_SHAREDFB */
|
#else /* defined _MGSCHEMA_SHAREDFB */
|
||||||
@@ -1124,6 +1136,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
prc = &cur_pdc->rc_output;
|
prc = &cur_pdc->rc_output;
|
||||||
|
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (!fShow) {
|
||||||
|
GAL_LockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
|
|
||||||
if (cur_pdc->surface == __gal_screen) {
|
if (cur_pdc->surface == __gal_screen) {
|
||||||
// Under compositing schema, we never call SyncUpdate in
|
// Under compositing schema, we never call SyncUpdate in
|
||||||
// kernel_ShowCursorForGDI for __gal_screen.
|
// kernel_ShowCursorForGDI for __gal_screen.
|
||||||
@@ -1150,6 +1168,11 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
// For surface other than screen, we call SyncUpdate.
|
// For surface other than screen, we call SyncUpdate.
|
||||||
GAL_SyncUpdate (cur_pdc->surface);
|
GAL_SyncUpdate (cur_pdc->surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (fShow) {
|
||||||
|
GAL_UnlockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* not defined _MGSCHEMA_SHAREDFB */
|
#endif /* not defined _MGSCHEMA_SHAREDFB */
|
||||||
@@ -1228,26 +1251,25 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
PDC cur_pdc = (PDC)pdc;
|
PDC cur_pdc = (PDC)pdc;
|
||||||
const RECT* prc = NULL;
|
const RECT* prc = NULL;
|
||||||
|
|
||||||
prc = &cur_pdc->rc_output;
|
|
||||||
|
|
||||||
/* houhh20080827, if --disable-cursor, mginit can not update auto(qvfb). */
|
|
||||||
#if 0
|
|
||||||
if (cur_pdc->surface == __gal_screen
|
|
||||||
&& mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (fShow)
|
|
||||||
GAL_UpdateRect (cur_pdc->surface,
|
|
||||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
|
||||||
#else
|
|
||||||
if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) {
|
if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prc = &cur_pdc->rc_output;
|
||||||
|
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (!fShow) {
|
||||||
|
GAL_LockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
|
|
||||||
if (fShow)
|
if (fShow)
|
||||||
GAL_UpdateRect (cur_pdc->surface,
|
GAL_UpdateRect (cur_pdc->surface,
|
||||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||||
#endif
|
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (fShow) {
|
||||||
|
GAL_UnlockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _MGHAVE_CURSOR */
|
#endif /* _MGHAVE_CURSOR */
|
||||||
|
|||||||
+20
-2
@@ -448,6 +448,11 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
|
|
||||||
prc = &cur_pdc->rc_output;
|
prc = &cur_pdc->rc_output;
|
||||||
|
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (!fShow) {
|
||||||
|
GAL_LockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
|
|
||||||
if (cur_pdc->surface != __gal_screen) {
|
if (cur_pdc->surface != __gal_screen) {
|
||||||
if (fShow) {
|
if (fShow) {
|
||||||
GAL_UpdateRect (cur_pdc->surface,
|
GAL_UpdateRect (cur_pdc->surface,
|
||||||
@@ -472,7 +477,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||||
//GAL_SyncUpdate (cur_pdc->surface);
|
//GAL_SyncUpdate (cur_pdc->surface);
|
||||||
}
|
}
|
||||||
return;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fShow && nShowCount >= 0 && pCurCsr) {
|
if (fShow && nShowCount >= 0 && pCurCsr) {
|
||||||
@@ -488,6 +493,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
//GAL_SyncUpdate (cur_pdc->surface);
|
//GAL_SyncUpdate (cur_pdc->surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (fShow) {
|
||||||
|
GAL_UnlockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GUIAPI ShowCursor (BOOL fShow)
|
int GUIAPI ShowCursor (BOOL fShow)
|
||||||
@@ -516,9 +527,16 @@ void kernel_ShowCursorForGDI(BOOL fShow, void* pdc)
|
|||||||
|
|
||||||
prc = &cur_pdc->rc_output;
|
prc = &cur_pdc->rc_output;
|
||||||
|
|
||||||
if (fShow)
|
/* Since 5.0.13 */
|
||||||
|
if (!fShow) {
|
||||||
|
GAL_LockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
|
else {
|
||||||
GAL_UpdateRect (cur_pdc->surface,
|
GAL_UpdateRect (cur_pdc->surface,
|
||||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
GAL_UnlockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _MGHAVE_CURSOR */
|
#endif /* _MGHAVE_CURSOR */
|
||||||
|
|||||||
+22
-4
@@ -472,11 +472,15 @@ void kernel_ShowCursorForGDI (BOOL fShow, void *pdc)
|
|||||||
|
|
||||||
prc = &cur_pdc->rc_output;
|
prc = &cur_pdc->rc_output;
|
||||||
|
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (!fShow) {
|
||||||
|
GAL_LockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
|
|
||||||
if (cur_pdc->surface != __gal_screen) {
|
if (cur_pdc->surface != __gal_screen) {
|
||||||
if (fShow) {
|
if (fShow) {
|
||||||
GAL_UpdateRect (cur_pdc->surface,
|
GAL_UpdateRect(cur_pdc->surface,
|
||||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||||
// GAL_SyncUpdate (cur_pdc->surface);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -500,7 +504,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void *pdc)
|
|||||||
pthread_mutex_unlock(&__mg_mouselock);
|
pthread_mutex_unlock(&__mg_mouselock);
|
||||||
// GAL_SyncUpdate (cur_pdc->surface);
|
// GAL_SyncUpdate (cur_pdc->surface);
|
||||||
}
|
}
|
||||||
return;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fShow && nShowCount >= 0 && pCurCsr) {
|
if (fShow && nShowCount >= 0 && pCurCsr) {
|
||||||
@@ -518,6 +522,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void *pdc)
|
|||||||
// GAL_SyncUpdate (cur_pdc->surface);
|
// GAL_SyncUpdate (cur_pdc->surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
if (fShow) {
|
||||||
|
GAL_UnlockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GUIAPI ShowCursor(BOOL fShow)
|
int GUIAPI ShowCursor(BOOL fShow)
|
||||||
@@ -558,9 +568,17 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
|||||||
|
|
||||||
prc = &cur_pdc->rc_output;
|
prc = &cur_pdc->rc_output;
|
||||||
|
|
||||||
if (fShow)
|
/* Since 5.0.13 */
|
||||||
|
if (!fShow) {
|
||||||
|
GAL_LockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
|
else {
|
||||||
GAL_UpdateRect (cur_pdc->surface,
|
GAL_UpdateRect (cur_pdc->surface,
|
||||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||||
|
|
||||||
|
/* Since 5.0.13 */
|
||||||
|
GAL_UnlockSurface(cur_pdc->surface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _MGHAVE_CURSOR */
|
#endif /* _MGHAVE_CURSOR */
|
||||||
|
|||||||
+64
-16
@@ -55,6 +55,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
@@ -364,7 +365,7 @@ static intptr_t cliAllocZOrderNode (PMAINWIN pWin, const COMPOSITINGINFO* ct_inf
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ClientRequestEx2 (&req, caption, strlen(caption) + 1,
|
if (ClientRequestEx2 (&req, caption, strlen(caption) + 1,
|
||||||
pWin->surf->shared_header->fd,
|
pWin->surf->fd,
|
||||||
&ret, sizeof (intptr_t), NULL) < 0)
|
&ret, sizeof (intptr_t), NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
#else /* ndef _MGSCHEMA_COMPOSITING */
|
#else /* ndef _MGSCHEMA_COMPOSITING */
|
||||||
@@ -523,7 +524,7 @@ static intptr_t cliStartTrackPopupMenu (PTRACKMENUINFO ptmi)
|
|||||||
|
|
||||||
info.surf_flags = surf->flags;
|
info.surf_flags = surf->flags;
|
||||||
info.surf_size = surf->shared_header->map_size;
|
info.surf_size = surf->shared_header->map_size;
|
||||||
if (ClientRequestEx2 (&req, NULL, 0, surf->shared_header->fd,
|
if (ClientRequestEx2 (&req, NULL, 0, surf->fd,
|
||||||
&ret, sizeof (intptr_t), NULL) < 0)
|
&ret, sizeof (intptr_t), NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -836,8 +837,10 @@ static int srvAllocZOrderNode (int cli, HWND hwnd, HWND main_win,
|
|||||||
surf->refcount++;
|
surf->refcount++;
|
||||||
}
|
}
|
||||||
else if (fd >= 0) {
|
else if (fd >= 0) {
|
||||||
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
|
surf = GAL_AttachSharedRGBSurface (NULL, fd,
|
||||||
close (fd);
|
surf_size, surf_flags, TRUE);
|
||||||
|
/* Since 5.2.0: keep fd available.
|
||||||
|
close (fd); */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_ERR_PRINTF("KERNEL: not server but fd for shared surface is invalid\n");
|
_ERR_PRINTF("KERNEL: not server but fd for shared surface is invalid\n");
|
||||||
@@ -845,7 +848,7 @@ static int srvAllocZOrderNode (int cli, HWND hwnd, HWND main_win,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (surf) {
|
if (surf) {
|
||||||
memdc = CreateMemDCFromSurface (surf);
|
memdc = __mg_create_memdc_for_surface (surf);
|
||||||
if (memdc == HDC_INVALID) {
|
if (memdc == HDC_INVALID) {
|
||||||
if (cli > 0) {
|
if (cli > 0) {
|
||||||
GAL_FreeSurface (surf);
|
GAL_FreeSurface (surf);
|
||||||
@@ -993,12 +996,14 @@ static int srvMoveWindow (int cli, int idx_znode, const RECT* rcWin,
|
|||||||
surf->refcount++;
|
surf->refcount++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
|
surf = GAL_AttachSharedRGBSurface (NULL, fd,
|
||||||
close (fd);
|
surf_size, surf_flags, TRUE);
|
||||||
|
/* Since 5.2.0: keep fd available.
|
||||||
|
close (fd); */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (surf) {
|
if (surf) {
|
||||||
memdc = CreateMemDCFromSurface (surf);
|
memdc = __mg_create_memdc_for_surface (surf);
|
||||||
if (memdc == HDC_INVALID) {
|
if (memdc == HDC_INVALID) {
|
||||||
if (cli > 0) {
|
if (cli > 0) {
|
||||||
GAL_FreeSurface (surf);
|
GAL_FreeSurface (surf);
|
||||||
@@ -1013,7 +1018,6 @@ static int srvMoveWindow (int cli, int idx_znode, const RECT* rcWin,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* def _MGSCHEMA_COMPOSITING */
|
#endif /* def _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
ret = dskMoveWindow (cli, idx_znode, memdc, rcWin);
|
ret = dskMoveWindow (cli, idx_znode, memdc, rcWin);
|
||||||
@@ -1520,6 +1524,33 @@ static BOOL _cb_update_rc_nocli (void* context,
|
|||||||
}
|
}
|
||||||
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
|
/* Since 5.2.0 */
|
||||||
|
ZORDERNODE *__mg_find_znode_by_client_hwnd (int cli, HWND hwnd)
|
||||||
|
{
|
||||||
|
ZORDERINFO* zi = get_zorder_info(cli);
|
||||||
|
ZORDERNODE* nodes;
|
||||||
|
|
||||||
|
if (zi == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
int level, slot = -1;
|
||||||
|
nodes = GET_ZORDERNODE(zi);
|
||||||
|
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
|
||||||
|
slot = zi->first_in_levels[level];
|
||||||
|
for (; slot > 0; slot = nodes[slot].next) {
|
||||||
|
if (nodes[slot].cli == cli && nodes[slot].hwnd == hwnd) {
|
||||||
|
goto found;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
found:
|
||||||
|
assert(slot >= 0);
|
||||||
|
return nodes + slot;
|
||||||
|
}
|
||||||
|
|
||||||
int __mg_remove_all_znodes_of_client (int cli)
|
int __mg_remove_all_znodes_of_client (int cli)
|
||||||
{
|
{
|
||||||
BOOL has_special = FALSE;
|
BOOL has_special = FALSE;
|
||||||
@@ -2180,7 +2211,7 @@ static int resize_window_surface (PMAINWIN pWin, const RECT* prcResult)
|
|||||||
|
|
||||||
pWin->surf = new_surf;
|
pWin->surf = new_surf;
|
||||||
if (pWin->surf->shared_header)
|
if (pWin->surf->shared_header)
|
||||||
return pWin->surf->shared_header->fd;
|
return pWin->surf->fd;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2225,9 +2256,10 @@ static int dskMoveGlobalControl (PMAINWIN pCtrl, RECT* prcExpect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
if (pCtrl->surf->shared_header && pCtrl->surf->shared_header->fd >= 0) {
|
/* Since 5.2.0: keep fd available. */
|
||||||
close (pCtrl->surf->shared_header->fd);
|
if (0 && pCtrl->surf->shared_header && pCtrl->surf->fd >= 0) {
|
||||||
pCtrl->surf->shared_header->fd = -1;
|
close (pCtrl->surf->fd);
|
||||||
|
pCtrl->surf->fd = -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2256,9 +2288,10 @@ static int dskMoveMainWindow (PMAINWIN pWin, RECT* prcExpect)
|
|||||||
__mg_update_dc_on_surface_changed ((HWND)pWin, pWin->surf);
|
__mg_update_dc_on_surface_changed ((HWND)pWin, pWin->surf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pWin->surf->shared_header && pWin->surf->shared_header->fd >= 0) {
|
/* Since 5.2.0: keep fd available. */
|
||||||
close (pWin->surf->shared_header->fd);
|
if (0 && pWin->surf->shared_header && pWin->surf->fd >= 0) {
|
||||||
pWin->surf->shared_header->fd = -1;
|
close (pWin->surf->fd);
|
||||||
|
pWin->surf->fd = -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2874,6 +2907,21 @@ int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
#endif /* deprecated code */
|
#endif /* deprecated code */
|
||||||
|
|
||||||
|
/* used by client to check the validation of a hwnd in the given znode slot. */
|
||||||
|
BOOL __mg_client_check_znode_hwnd (int slot, HWND hwnd, int cli)
|
||||||
|
{
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
ZORDERINFO* zi = __mg_zorder_info;
|
||||||
|
ZORDERNODE* nodes;
|
||||||
|
|
||||||
|
nodes = GET_ZORDERNODE(zi);
|
||||||
|
lock_zi_for_read (zi);
|
||||||
|
if (nodes[slot].hwnd == hwnd && nodes[slot].cli == cli)
|
||||||
|
ret = TRUE;
|
||||||
|
unlock_zi_for_read (zi);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* used by client to check the validation of a hwnd */
|
/* used by client to check the validation of a hwnd */
|
||||||
BOOL __mg_client_check_hwnd (HWND hwnd, int cli)
|
BOOL __mg_client_check_hwnd (HWND hwnd, int cli)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -141,6 +141,14 @@ BOOL mg_InitDesktop (void)
|
|||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
static IDLEHANDLER std_idle_handler;
|
||||||
|
|
||||||
|
static BOOL idle_handler_for_desktop_thread (MSGQUEUE *msg_queue, BOOL wait)
|
||||||
|
{
|
||||||
|
__mg_update_tick_count (NULL);
|
||||||
|
return std_idle_handler (msg_queue, wait);
|
||||||
|
}
|
||||||
|
|
||||||
void* __kernel_desktop_main (void* data)
|
void* __kernel_desktop_main (void* data)
|
||||||
{
|
{
|
||||||
MSG Msg;
|
MSG Msg;
|
||||||
@@ -152,8 +160,10 @@ void* __kernel_desktop_main (void* data)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for threads mode, the idle handler for desktop thread is NULL */
|
/* For bug reported in Issue #116, under threads mode, the idle handler
|
||||||
__mg_dsk_msg_queue->OnIdle = NULL;
|
for the desktop thread should call __mg_update_tick_count () */
|
||||||
|
std_idle_handler = __mg_dsk_msg_queue->OnIdle;
|
||||||
|
__mg_dsk_msg_queue->OnIdle = idle_handler_for_desktop_thread;
|
||||||
|
|
||||||
/* init desktop window */
|
/* init desktop window */
|
||||||
init_desktop_win ();
|
init_desktop_win ();
|
||||||
|
|||||||
+10
-3
@@ -1603,8 +1603,10 @@ static int srvStartTrackPopupMenu (int cli, const RECT* rc, HWND ptmi,
|
|||||||
surf->refcount++;
|
surf->refcount++;
|
||||||
}
|
}
|
||||||
else if (fd >= 0) {
|
else if (fd >= 0) {
|
||||||
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
|
surf = GAL_AttachSharedRGBSurface (NULL, fd,
|
||||||
close (fd);
|
surf_size, surf_flags, TRUE);
|
||||||
|
/* Since 5.2.0: keep fd available.
|
||||||
|
close (fd); */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_WRN_PRINTF("not server but fd for shared surface is invalid\n");
|
_WRN_PRINTF("not server but fd for shared surface is invalid\n");
|
||||||
@@ -1612,7 +1614,7 @@ static int srvStartTrackPopupMenu (int cli, const RECT* rc, HWND ptmi,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (surf) {
|
if (surf) {
|
||||||
memdc = CreateMemDCFromSurface (surf);
|
memdc = __mg_create_memdc_for_surface (surf);
|
||||||
if (memdc == HDC_INVALID) {
|
if (memdc == HDC_INVALID) {
|
||||||
GAL_FreeSurface (surf);
|
GAL_FreeSurface (surf);
|
||||||
_WRN_PRINTF("failed to create memory dc for znode\n");
|
_WRN_PRINTF("failed to create memory dc for znode\n");
|
||||||
@@ -1646,11 +1648,14 @@ static int srvStartTrackPopupMenu (int cli, const RECT* rc, HWND ptmi,
|
|||||||
menu_nodes [zi->nr_popupmenus].flags = ZOF_TYPE_POPUPMENU;
|
menu_nodes [zi->nr_popupmenus].flags = ZOF_TYPE_POPUPMENU;
|
||||||
menu_nodes [zi->nr_popupmenus].rc = *rc;
|
menu_nodes [zi->nr_popupmenus].rc = *rc;
|
||||||
menu_nodes [zi->nr_popupmenus].hwnd = ptmi;
|
menu_nodes [zi->nr_popupmenus].hwnd = ptmi;
|
||||||
|
menu_nodes [zi->nr_popupmenus].cli = 0;
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
menu_nodes [zi->nr_popupmenus].changes = 0;
|
menu_nodes [zi->nr_popupmenus].changes = 0;
|
||||||
menu_nodes [zi->nr_popupmenus].ct = CT_OPAQUE;
|
menu_nodes [zi->nr_popupmenus].ct = CT_OPAQUE;
|
||||||
menu_nodes [zi->nr_popupmenus].ct_arg = 0;
|
menu_nodes [zi->nr_popupmenus].ct_arg = 0;
|
||||||
menu_nodes [zi->nr_popupmenus].mem_dc = memdc;
|
menu_nodes [zi->nr_popupmenus].mem_dc = memdc;
|
||||||
|
menu_nodes [zi->nr_popupmenus].dirty_age = 0;
|
||||||
|
menu_nodes [zi->nr_popupmenus].nr_dirty_rcs = 0;
|
||||||
menu_nodes [zi->nr_popupmenus].dirty_rcs = NULL;
|
menu_nodes [zi->nr_popupmenus].dirty_rcs = NULL;
|
||||||
#endif
|
#endif
|
||||||
menu_nodes [zi->nr_popupmenus].priv_data = NULL;
|
menu_nodes [zi->nr_popupmenus].priv_data = NULL;
|
||||||
@@ -2356,6 +2361,8 @@ static int AllocZOrderNodeEx (ZORDERINFO* zi, int cli, HWND hwnd, HWND main_win,
|
|||||||
nodes [free_slot].ct = validate_compositing_type (flags, ct);
|
nodes [free_slot].ct = validate_compositing_type (flags, ct);
|
||||||
nodes [free_slot].ct_arg = ct_arg;
|
nodes [free_slot].ct_arg = ct_arg;
|
||||||
nodes [free_slot].mem_dc = mem_dc;
|
nodes [free_slot].mem_dc = mem_dc;
|
||||||
|
nodes [free_slot].dirty_age = 0;
|
||||||
|
nodes [free_slot].nr_dirty_rcs = 0;
|
||||||
nodes [free_slot].dirty_rcs = NULL;
|
nodes [free_slot].dirty_rcs = NULL;
|
||||||
#else
|
#else
|
||||||
nodes [free_slot].age = 1;
|
nodes [free_slot].age = 1;
|
||||||
|
|||||||
@@ -391,14 +391,6 @@ static BOOL InstallSEGVHandler (void)
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static IDLEHANDLER std_idle_handler;
|
|
||||||
|
|
||||||
static BOOL idle_handler_for_main_thread (MSGQUEUE *msg_queue, BOOL wait)
|
|
||||||
{
|
|
||||||
__mg_update_tick_count (NULL);
|
|
||||||
return std_idle_handler (msg_queue, wait);
|
|
||||||
}
|
|
||||||
|
|
||||||
int GUIAPI InitGUI (int args, const char *agr[])
|
int GUIAPI InitGUI (int args, const char *agr[])
|
||||||
{
|
{
|
||||||
char engine [LEN_ENGINE_NAME + 1];
|
char engine [LEN_ENGINE_NAME + 1];
|
||||||
@@ -583,11 +575,6 @@ int GUIAPI InitGUI (int args, const char *agr[])
|
|||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for threads mode, the idle handler for the main threads should
|
|
||||||
call __mg_update_tick_count () */
|
|
||||||
std_idle_handler = msg_queue->OnIdle;
|
|
||||||
msg_queue->OnIdle = idle_handler_for_main_thread;
|
|
||||||
|
|
||||||
/* init timer for tick counter */
|
/* init timer for tick counter */
|
||||||
step++;
|
step++;
|
||||||
if (!mg_InitTimer (FALSE)) {
|
if (!mg_InitTimer (FALSE)) {
|
||||||
|
|||||||
@@ -955,6 +955,12 @@ checkagain:
|
|||||||
|
|
||||||
goto checkagain;
|
goto checkagain;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* no message, wait again. */
|
||||||
|
if (pMsgQueue->OnIdle && !pMsgQueue->OnIdle (pMsgQueue, FALSE)) {
|
||||||
|
handle_idle_message (pMsgQueue);
|
||||||
|
}
|
||||||
|
}
|
||||||
#else /* defined _MGHAVE_VIRTUAL_WINDOW */
|
#else /* defined _MGHAVE_VIRTUAL_WINDOW */
|
||||||
/* no message, idle */
|
/* no message, idle */
|
||||||
if (bWait) {
|
if (bWait) {
|
||||||
@@ -964,6 +970,11 @@ checkagain:
|
|||||||
}
|
}
|
||||||
goto checkagain;
|
goto checkagain;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (!pMsgQueue->OnIdle (pMsgQueue, FALE)) {
|
||||||
|
handle_idle_message (pMsgQueue);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif /* not defined _MGHAVE_VIRTUAL_WINDOW */
|
#endif /* not defined _MGHAVE_VIRTUAL_WINDOW */
|
||||||
|
|
||||||
/* no message */
|
/* no message */
|
||||||
|
|||||||
+31
-173
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
|||||||
|
|
||||||
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||||
math.c about.c license.c anon_file.c rbtree.c map.c \
|
math.c about.c license.c anon_file.c rbtree.c map.c \
|
||||||
error.c sockio.c
|
error.c sockio.c lock_file.c
|
||||||
|
|
||||||
SRC_FILES = $(libmisc_la_SOURCES)
|
SRC_FILES = $(libmisc_la_SOURCES)
|
||||||
LIB_NAME=libmisc
|
LIB_NAME=libmisc
|
||||||
|
|||||||
+1
-1
@@ -114,7 +114,7 @@ static LRESULT AboutWinProc (HWND hWnd, UINT message,
|
|||||||
DrawText (hdc,
|
DrawText (hdc,
|
||||||
"MiniGUI -- a mature cross-platform windowing system "
|
"MiniGUI -- a mature cross-platform windowing system "
|
||||||
"and GUI support system for embedded or IoT devices.\n\n"
|
"and GUI support system for embedded or IoT devices.\n\n"
|
||||||
"Copyright (C) 2002 ~ 2020 FMSoft Co., Ltd.",
|
"Copyright (C) 2002 ~ 2023 FMSoft Co., Ltd.",
|
||||||
-1, &rcClient, DT_WORDBREAK | DT_CENTER);
|
-1, &rcClient, DT_WORDBREAK | DT_CENTER);
|
||||||
|
|
||||||
EndPaint (hWnd, hdc);
|
EndPaint (hWnd, hdc);
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT NOTICE
|
||||||
|
//
|
||||||
|
// The following open source license statement does not apply to any
|
||||||
|
// entity in the Exception List published by FMSoft.
|
||||||
|
//
|
||||||
|
// For more information, please visit:
|
||||||
|
//
|
||||||
|
// https://www.fmsoft.cn/exception-list
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
/*
|
||||||
|
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||||
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
|
* and smart IoT devices.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2023, Beijing FMSoft Technologies Co., Ltd.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* Or,
|
||||||
|
*
|
||||||
|
* As this program is a library, any link to this program must follow
|
||||||
|
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||||
|
* GPLv3, you need to be licensed from FMSoft.
|
||||||
|
*
|
||||||
|
* If you have got a commercial license of this program, please use it
|
||||||
|
* under the terms and conditions of the commercial license.
|
||||||
|
*
|
||||||
|
* For more information about the commercial license, please refer to
|
||||||
|
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
** lock_file.c: This file include functions for locking/unlocking a file.
|
||||||
|
**
|
||||||
|
** Create date: 2023/09/10
|
||||||
|
**
|
||||||
|
** Current maintainer: Wei Yongming.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
#ifndef __NOUNIX__
|
||||||
|
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/file.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
void __mg_lock_file_for_read(int fd)
|
||||||
|
{
|
||||||
|
struct flock lock;
|
||||||
|
|
||||||
|
lock.l_type = F_RDLCK;
|
||||||
|
lock.l_whence = SEEK_SET;
|
||||||
|
lock.l_start = 0;
|
||||||
|
lock.l_len = 0;
|
||||||
|
|
||||||
|
while (fcntl(fd, F_SETLKW, &lock) == -1 && errno == EINTR);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __mg_unlock_file_for_read(int fd)
|
||||||
|
{
|
||||||
|
struct flock lock;
|
||||||
|
|
||||||
|
lock.l_type = F_UNLCK;
|
||||||
|
lock.l_whence = SEEK_SET;
|
||||||
|
lock.l_start = 0;
|
||||||
|
lock.l_len = 0;
|
||||||
|
|
||||||
|
fcntl(fd, F_SETLK, &lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __mg_lock_file_for_write(int fd)
|
||||||
|
{
|
||||||
|
struct flock lock;
|
||||||
|
|
||||||
|
lock.l_type = F_WRLCK;
|
||||||
|
lock.l_whence = SEEK_SET;
|
||||||
|
lock.l_start = 0;
|
||||||
|
lock.l_len = 0;
|
||||||
|
|
||||||
|
while (fcntl(fd, F_SETLKW, &lock) == -1 && errno == EINTR);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __mg_unlock_file_for_write(int fd)
|
||||||
|
{
|
||||||
|
struct flock lock;
|
||||||
|
|
||||||
|
lock.l_type = F_UNLCK;
|
||||||
|
lock.l_whence = SEEK_SET;
|
||||||
|
lock.l_start = 0;
|
||||||
|
lock.l_len = 0;
|
||||||
|
|
||||||
|
fcntl(fd, F_SETLK, &lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* __NOUNIX__ */
|
||||||
+5
-5
@@ -243,7 +243,7 @@ map_entry_t* __mg_map_find (map_t* map, const void* key)
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
int __mg_map_erase (map_t* map, void* key)
|
int __mg_map_erase (map_t* map, const void* key)
|
||||||
{
|
{
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
map_entry_t* entry = NULL;
|
map_entry_t* entry = NULL;
|
||||||
@@ -299,7 +299,7 @@ ret:
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int __mg_map_insert_ex (map_t* map, const void* key,
|
map_entry_t* __mg_map_insert_ex2 (map_t* map, const void* key,
|
||||||
const void* val, free_val_fn free_val_alt)
|
const void* val, free_val_fn free_val_alt)
|
||||||
{
|
{
|
||||||
map_entry_t **pentry;
|
map_entry_t **pentry;
|
||||||
@@ -307,7 +307,7 @@ int __mg_map_insert_ex (map_t* map, const void* key,
|
|||||||
map_entry_t *parent;
|
map_entry_t *parent;
|
||||||
|
|
||||||
if (map == NULL)
|
if (map == NULL)
|
||||||
return -1;
|
return NULL;
|
||||||
|
|
||||||
WRLOCK_MAP (map);
|
WRLOCK_MAP (map);
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ int __mg_map_insert_ex (map_t* map, const void* key,
|
|||||||
|
|
||||||
while (*pentry) {
|
while (*pentry) {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (map->comp_key)
|
if (map->comp_key)
|
||||||
ret = map->comp_key (key, (*pentry)->key);
|
ret = map->comp_key (key, (*pentry)->key);
|
||||||
else
|
else
|
||||||
@@ -354,7 +354,7 @@ int __mg_map_insert_ex (map_t* map, const void* key,
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNLOCK_MAP (map);
|
UNLOCK_MAP (map);
|
||||||
return 0;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
int __mg_map_find_replace_or_insert (map_t* map, const void* key,
|
int __mg_map_find_replace_or_insert (map_t* map, const void* key,
|
||||||
|
|||||||
@@ -96,8 +96,12 @@ static BITMAP_TYPE_INFO bitmap_types [MAX_BITMAP_TYPES] =
|
|||||||
{ "jpeg", __mg_init_jpg, __mg_load_jpg, __mg_cleanup_jpg, __mg_save_jpg, __mg_check_jpg },
|
{ "jpeg", __mg_init_jpg, __mg_load_jpg, __mg_cleanup_jpg, __mg_save_jpg, __mg_check_jpg },
|
||||||
#endif
|
#endif
|
||||||
#ifdef _MGIMAGE_PNG
|
#ifdef _MGIMAGE_PNG
|
||||||
|
#if _MGLIBPNG_VER == 16
|
||||||
|
{ "png", __mg_init_png, __mg_load_png, __mg_cleanup_png, __mg_save_png, __mg_check_png },
|
||||||
|
#else
|
||||||
{ "png", __mg_init_png, __mg_load_png, __mg_cleanup_png, NULL, __mg_check_png },
|
{ "png", __mg_init_png, __mg_load_png, __mg_cleanup_png, NULL, __mg_check_png },
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#ifdef _MGIMAGE_WEBP
|
#ifdef _MGIMAGE_WEBP
|
||||||
{ "webp", __mg_init_webp, __mg_load_webp, __mg_cleanup_webp, NULL, __mg_check_webp },
|
{ "webp", __mg_init_webp, __mg_load_webp, __mg_cleanup_webp, NULL, __mg_check_webp },
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+79
-75
@@ -462,99 +462,100 @@ static void RLEClipBlit(int w, Uint8 *srcbuf, GAL_Surface *dst,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* blit a colorkeyed RLE surface */
|
/* blit a colorkeyed RLE surface */
|
||||||
int GAL_RLEBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
int GAL_RLEBlit(GAL_VideoDevice *video, GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
GAL_Surface *dst, GAL_Rect *dstrect)
|
GAL_Surface *dst, GAL_Rect *dstrect)
|
||||||
{
|
{
|
||||||
Uint8 *dstbuf;
|
(void)video;
|
||||||
Uint8 *srcbuf;
|
|
||||||
int x, y;
|
|
||||||
int w = src->w;
|
|
||||||
unsigned alpha;
|
|
||||||
|
|
||||||
/* Set up the source and destination pointers */
|
Uint8 *dstbuf;
|
||||||
x = dstrect->x;
|
Uint8 *srcbuf;
|
||||||
y = dstrect->y;
|
int x, y;
|
||||||
dstbuf = (Uint8 *)dst->pixels
|
int w = src->w;
|
||||||
+ y * dst->pitch + x * src->format->BytesPerPixel;
|
unsigned alpha;
|
||||||
srcbuf = (Uint8 *)src->map->sw_data->aux_data;
|
|
||||||
|
|
||||||
{
|
/* Set up the source and destination pointers */
|
||||||
/* skip lines at the top if neccessary */
|
x = dstrect->x;
|
||||||
int vskip = srcrect->y;
|
y = dstrect->y;
|
||||||
int ofs = 0;
|
dstbuf = (Uint8 *)dst->pixels
|
||||||
if(vskip) {
|
+ y * dst->pitch + x * src->format->BytesPerPixel;
|
||||||
|
srcbuf = (Uint8 *)src->map->sw_data->aux_data;
|
||||||
|
|
||||||
|
{
|
||||||
|
/* skip lines at the top if neccessary */
|
||||||
|
int vskip = srcrect->y;
|
||||||
|
int ofs = 0;
|
||||||
|
if(vskip) {
|
||||||
|
|
||||||
#define RLESKIP(bpp, Type) \
|
#define RLESKIP(bpp, Type) \
|
||||||
for(;;) { \
|
for(;;) { \
|
||||||
int run; \
|
int run; \
|
||||||
ofs += *(Type *)srcbuf; \
|
ofs += *(Type *)srcbuf; \
|
||||||
run = ((Type *)srcbuf)[1]; \
|
run = ((Type *)srcbuf)[1]; \
|
||||||
srcbuf += sizeof(Type) * 2; \
|
srcbuf += sizeof(Type) * 2; \
|
||||||
if(run) { \
|
if(run) { \
|
||||||
srcbuf += run * bpp; \
|
srcbuf += run * bpp; \
|
||||||
ofs += run; \
|
ofs += run; \
|
||||||
} else if(!ofs) \
|
} else if(!ofs) \
|
||||||
goto done; \
|
goto done; \
|
||||||
if(ofs == w) { \
|
if(ofs == w) { \
|
||||||
ofs = 0; \
|
ofs = 0; \
|
||||||
if(!--vskip) \
|
if(!--vskip) \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(src->format->BytesPerPixel) {
|
switch(src->format->BytesPerPixel) {
|
||||||
case 1: RLESKIP(1, Uint8); break;
|
case 1: RLESKIP(1, Uint8); break;
|
||||||
case 2: RLESKIP(2, Uint8); break;
|
case 2: RLESKIP(2, Uint8); break;
|
||||||
case 3: RLESKIP(3, Uint8); break;
|
case 3: RLESKIP(3, Uint8); break;
|
||||||
case 4: RLESKIP(4, Uint16); break;
|
case 4: RLESKIP(4, Uint16); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef RLESKIP
|
#undef RLESKIP
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
alpha = (src->flags & GAL_SRCALPHA) == GAL_SRCALPHA
|
alpha = (src->flags & GAL_SRCALPHA) == GAL_SRCALPHA
|
||||||
? src->format->alpha : 255;
|
? src->format->alpha : 255;
|
||||||
/* if left or right edge clipping needed, call clip blit */
|
/* if left or right edge clipping needed, call clip blit */
|
||||||
if ( srcrect->x || srcrect->w != src->w ) {
|
if ( srcrect->x || srcrect->w != src->w ) {
|
||||||
RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha);
|
RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha);
|
||||||
} else {
|
} else {
|
||||||
GAL_PixelFormat *fmt = src->format;
|
GAL_PixelFormat *fmt = src->format;
|
||||||
|
|
||||||
#define RLEBLIT(bpp, Type, do_blit) \
|
#define RLEBLIT(bpp, Type, do_blit) \
|
||||||
do { \
|
do { \
|
||||||
int linecount = srcrect->h; \
|
int linecount = srcrect->h; \
|
||||||
int ofs = 0; \
|
int ofs = 0; \
|
||||||
for(;;) { \
|
for(;;) { \
|
||||||
unsigned run; \
|
unsigned run; \
|
||||||
ofs += *(Type *)srcbuf; \
|
ofs += *(Type *)srcbuf; \
|
||||||
run = ((Type *)srcbuf)[1]; \
|
run = ((Type *)srcbuf)[1]; \
|
||||||
srcbuf += 2 * sizeof(Type); \
|
srcbuf += 2 * sizeof(Type); \
|
||||||
if(run) { \
|
if(run) { \
|
||||||
do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \
|
do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \
|
||||||
srcbuf += run * bpp; \
|
srcbuf += run * bpp; \
|
||||||
ofs += run; \
|
ofs += run; \
|
||||||
} else if(!ofs) \
|
} else if(!ofs) \
|
||||||
break; \
|
break; \
|
||||||
if(ofs == w) { \
|
if(ofs == w) { \
|
||||||
ofs = 0; \
|
ofs = 0; \
|
||||||
dstbuf += dst->pitch; \
|
dstbuf += dst->pitch; \
|
||||||
if(!--linecount) \
|
if(!--linecount) \
|
||||||
break; \
|
break; \
|
||||||
} \
|
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
CHOOSE_BLIT(RLEBLIT, alpha, fmt);
|
CHOOSE_BLIT(RLEBLIT, alpha, fmt);
|
||||||
|
|
||||||
#undef RLEBLIT
|
#undef RLEBLIT
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef OPAQUE_BLIT
|
#undef OPAQUE_BLIT
|
||||||
@@ -720,9 +721,12 @@ static void RLEAlphaClipBlit(int w, Uint8 *srcbuf, GAL_Surface *dst,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* blit a pixel-alpha RLE surface */
|
/* blit a pixel-alpha RLE surface */
|
||||||
int GAL_RLEAlphaBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
int GAL_RLEAlphaBlit(GAL_VideoDevice *video,
|
||||||
GAL_Surface *dst, GAL_Rect *dstrect)
|
GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
|
GAL_Surface *dst, GAL_Rect *dstrect)
|
||||||
{
|
{
|
||||||
|
(void)video;
|
||||||
|
|
||||||
int x, y;
|
int x, y;
|
||||||
int w = src->w;
|
int w = src->w;
|
||||||
Uint8 *srcbuf, *dstbuf;
|
Uint8 *srcbuf, *dstbuf;
|
||||||
@@ -1502,7 +1506,7 @@ void GAL_UnRLESurface(GAL_Surface *surface, int recode)
|
|||||||
full.h = surface->h;
|
full.h = surface->h;
|
||||||
alpha_flag = surface->flags & GAL_SRCALPHA;
|
alpha_flag = surface->flags & GAL_SRCALPHA;
|
||||||
surface->flags &= ~GAL_SRCALPHA; /* opaque blit */
|
surface->flags &= ~GAL_SRCALPHA; /* opaque blit */
|
||||||
GAL_RLEBlit(surface, &full, surface, &full);
|
GAL_RLEBlit(NULL, surface, &full, surface, &full);
|
||||||
surface->flags |= alpha_flag;
|
surface->flags |= alpha_flag;
|
||||||
} else
|
} else
|
||||||
UnRLEAlpha(surface);
|
UnRLEAlpha(surface);
|
||||||
|
|||||||
@@ -47,9 +47,11 @@
|
|||||||
/* Useful functions and variables from RLEaccel.c */
|
/* Useful functions and variables from RLEaccel.c */
|
||||||
|
|
||||||
extern int GAL_RLESurface(GAL_Surface *surface);
|
extern int GAL_RLESurface(GAL_Surface *surface);
|
||||||
extern int GAL_RLEBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
extern int GAL_RLEBlit(GAL_VideoDevice *video,
|
||||||
GAL_Surface *dst, GAL_Rect *dstrect);
|
GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
extern int GAL_RLEAlphaBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
GAL_Surface *dst, GAL_Rect *dstrect);
|
||||||
GAL_Surface *dst, GAL_Rect *dstrect);
|
extern int GAL_RLEAlphaBlit(GAL_VideoDevice *video,
|
||||||
|
GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
|
GAL_Surface *dst, GAL_Rect *dstrect);
|
||||||
extern void GAL_UnRLESurface(GAL_Surface *surface, int recode);
|
extern void GAL_UnRLESurface(GAL_Surface *surface, int recode);
|
||||||
|
|
||||||
|
|||||||
@@ -157,8 +157,6 @@ static GAL_VideoDevice *BF533_CreateDevice(int devindex)
|
|||||||
device->AllocHWSurface = BF533_AllocHWSurface;
|
device->AllocHWSurface = BF533_AllocHWSurface;
|
||||||
device->CheckHWBlit = NULL;
|
device->CheckHWBlit = NULL;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = BF533_FreeHWSurface;
|
device->FreeHWSurface = BF533_FreeHWSurface;
|
||||||
device->UpdateRects = BF533_UpdateRects;
|
device->UpdateRects = BF533_UpdateRects;
|
||||||
|
|
||||||
|
|||||||
+16
-7
@@ -57,9 +57,12 @@
|
|||||||
#include "memops.h"
|
#include "memops.h"
|
||||||
|
|
||||||
/* The general purpose software blit routine */
|
/* The general purpose software blit routine */
|
||||||
static int GAL_SoftBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
static int GAL_SoftBlit(GAL_VideoDevice *video,
|
||||||
GAL_Surface *dst, GAL_Rect *dstrect)
|
GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
|
GAL_Surface *dst, GAL_Rect *dstrect)
|
||||||
{
|
{
|
||||||
|
(void)video;
|
||||||
|
|
||||||
int okay;
|
int okay;
|
||||||
|
|
||||||
/* Everything is okay at the beginning... */
|
/* Everything is okay at the beginning... */
|
||||||
@@ -166,12 +169,14 @@ static void GAL_BlitCopyOverlap(GAL_BlitInfo *info)
|
|||||||
#ifdef _MGUSE_PIXMAN
|
#ifdef _MGUSE_PIXMAN
|
||||||
#include <pixman.h>
|
#include <pixman.h>
|
||||||
|
|
||||||
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
|
static int GAL_PixmanBlit(GAL_VideoDevice *video,
|
||||||
|
struct GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
struct GAL_Surface *dst, GAL_Rect *dstrect);
|
struct GAL_Surface *dst, GAL_Rect *dstrect);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Figure out which of many blit routines to set up on a surface */
|
/* Figure out which of many blit routines to set up on a surface */
|
||||||
int GAL_CalculateBlit(GAL_Surface *surface)
|
int GAL_CalculateBlit(GAL_Surface *surface, const GAL_Rect *srcrc,
|
||||||
|
const GAL_Rect *dstrc, DWORD op)
|
||||||
{
|
{
|
||||||
int blit_index;
|
int blit_index;
|
||||||
GAL_VideoDevice *src_video, *dst_video, *cur_video = NULL;
|
GAL_VideoDevice *src_video, *dst_video, *cur_video = NULL;
|
||||||
@@ -242,7 +247,8 @@ int GAL_CalculateBlit(GAL_Surface *surface)
|
|||||||
if (hw_blit_ok && cur_video) {
|
if (hw_blit_ok && cur_video) {
|
||||||
GAL_VideoDevice *video = cur_video;
|
GAL_VideoDevice *video = cur_video;
|
||||||
GAL_VideoDevice *this = cur_video;
|
GAL_VideoDevice *this = cur_video;
|
||||||
video->CheckHWBlit (this, surface, surface->map->dst);
|
video->CheckHWBlit (this, surface, srcrc,
|
||||||
|
surface->map->dst, dstrc, op);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,7 +349,7 @@ int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
|
|||||||
else
|
else
|
||||||
src->msk_img = NULL;
|
src->msk_img = NULL;
|
||||||
|
|
||||||
ops &= COLOR_BLEND_FLAGS_MASK;
|
ops &= COLOR_BLEND_PIXMAN_MASK;
|
||||||
if (ops == COLOR_BLEND_LEGACY) {
|
if (ops == COLOR_BLEND_LEGACY) {
|
||||||
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
|
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
|
||||||
src->pix_op = PIXMAN_OP_OVER;
|
src->pix_op = PIXMAN_OP_OVER;
|
||||||
@@ -381,9 +387,12 @@ int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
|
static int GAL_PixmanBlit (GAL_VideoDevice *video,
|
||||||
|
struct GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
struct GAL_Surface *dst, GAL_Rect *dstrect)
|
struct GAL_Surface *dst, GAL_Rect *dstrect)
|
||||||
{
|
{
|
||||||
|
(void)video;
|
||||||
|
|
||||||
pixman_image_t *src_img = src->pix_img, *dst_img = dst->pix_img;
|
pixman_image_t *src_img = src->pix_img, *dst_img = dst->pix_img;
|
||||||
pixman_image_t *msk_img;
|
pixman_image_t *msk_img;
|
||||||
pixman_op_t op;
|
pixman_op_t op;
|
||||||
|
|||||||
+6
-1
@@ -80,7 +80,11 @@ typedef struct GAL_BlitMap {
|
|||||||
Uint8 *table;
|
Uint8 *table;
|
||||||
GAL_blit hw_blit;
|
GAL_blit hw_blit;
|
||||||
GAL_blit sw_blit;
|
GAL_blit sw_blit;
|
||||||
|
GAL_VideoDevice *video;
|
||||||
|
|
||||||
|
/* data for hardware blittor */
|
||||||
struct private_hwaccel *hw_data;
|
struct private_hwaccel *hw_data;
|
||||||
|
/* data for software blittor */
|
||||||
struct private_swaccel *sw_data;
|
struct private_swaccel *sw_data;
|
||||||
|
|
||||||
int identity;
|
int identity;
|
||||||
@@ -94,7 +98,8 @@ typedef struct GAL_BlitMap {
|
|||||||
#include "blit_A.h"
|
#include "blit_A.h"
|
||||||
|
|
||||||
/* Functions found in GAL_blit.c */
|
/* Functions found in GAL_blit.c */
|
||||||
extern int GAL_CalculateBlit(GAL_Surface *surface);
|
extern int GAL_CalculateBlit(GAL_Surface *surface, const GAL_Rect *srcrc,
|
||||||
|
const GAL_Rect *dstrc, DWORD op);
|
||||||
|
|
||||||
/* Functions found in GAL_blit_{0,1,N,A}.c */
|
/* Functions found in GAL_blit_{0,1,N,A}.c */
|
||||||
extern GAL_loblit GAL_CalculateBlit0(GAL_Surface *surface, int complex);
|
extern GAL_loblit GAL_CalculateBlit0(GAL_Surface *surface, int complex);
|
||||||
|
|||||||
@@ -236,8 +236,6 @@ static GAL_VideoDevice *COMMLCD_CreateDevice (int devindex)
|
|||||||
device->FreeHWSurface = COMMLCD_FreeHWSurface;
|
device->FreeHWSurface = COMMLCD_FreeHWSurface;
|
||||||
device->CheckHWBlit = NULL;
|
device->CheckHWBlit = NULL;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->UpdateRects = NULL;
|
device->UpdateRects = NULL;
|
||||||
device->SyncUpdate = NULL;
|
device->SyncUpdate = NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ static int DFB_AllocHWSurface (_THIS, GAL_Surface *surface);
|
|||||||
static void DFB_FreeHWSurface (_THIS, GAL_Surface *surface);
|
static void DFB_FreeHWSurface (_THIS, GAL_Surface *surface);
|
||||||
static int DFB_HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
|
static int DFB_HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
|
||||||
static int DFB_CheckHWBlit (_THIS, GAL_Surface * src, GAL_Surface * dst);
|
static int DFB_CheckHWBlit (_THIS, GAL_Surface * src, GAL_Surface * dst);
|
||||||
static int DFB_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color);
|
static int DFB_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
|
||||||
|
|
||||||
/* common dfb function address */
|
/* common dfb function address */
|
||||||
GAL_FunctionTable mgGALFuncTable = {
|
GAL_FunctionTable mgGALFuncTable = {
|
||||||
@@ -173,8 +173,6 @@ static GAL_VideoDevice *DFB_CreateDevice (int devindex)
|
|||||||
device->AllocHWSurface = DFB_AllocHWSurface;
|
device->AllocHWSurface = DFB_AllocHWSurface;
|
||||||
device->CheckHWBlit = DFB_CheckHWBlit;
|
device->CheckHWBlit = DFB_CheckHWBlit;
|
||||||
device->FillHWRect = DFB_FillHWRect;
|
device->FillHWRect = DFB_FillHWRect;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = DFB_FreeHWSurface;
|
device->FreeHWSurface = DFB_FreeHWSurface;
|
||||||
device->free = DFB_DeleteDevice;
|
device->free = DFB_DeleteDevice;
|
||||||
|
|
||||||
@@ -518,7 +516,8 @@ static void DFB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSUR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int DFB_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
static int
|
||||||
|
DFB_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
|
||||||
{
|
{
|
||||||
if ((dst->hwdata == NULL && dst != GAL_VideoSurface)) {
|
if ((dst->hwdata == NULL && dst != GAL_VideoSurface)) {
|
||||||
fprintf(stderr, "NEWGAL>DFB: src_hwdata or dst_hwdata NULL\n");
|
fprintf(stderr, "NEWGAL>DFB: src_hwdata or dst_hwdata NULL\n");
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ typedef struct _GAL_FunctionTable {
|
|||||||
int (*AllocHWSurface)(_THIS, GAL_Surface *surface);
|
int (*AllocHWSurface)(_THIS, GAL_Surface *surface);
|
||||||
int (*CheckHWBlit)(_THIS, GAL_Surface *src, GAL_Surface *dst);
|
int (*CheckHWBlit)(_THIS, GAL_Surface *src, GAL_Surface *dst);
|
||||||
int (*HWAccelBlit)(GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
|
int (*HWAccelBlit)(GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
|
||||||
int (*FillHWRect)(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color);
|
int (*FillHWRect)(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
|
||||||
int (*SetHWColorKey)(_THIS, GAL_Surface *surface, Uint32 key);
|
int (*SetHWColorKey)(_THIS, GAL_Surface *surface, Uint32 key);
|
||||||
int (*SetHWAlpha)(_THIS, GAL_Surface *surface, Uint8 value);
|
int (*SetHWAlpha)(_THIS, GAL_Surface *surface, Uint8 value);
|
||||||
void (*FreeHWSurface)(_THIS, GAL_Surface *surface);
|
void (*FreeHWSurface)(_THIS, GAL_Surface *surface);
|
||||||
|
|||||||
+913
-365
File diff suppressed because it is too large
Load Diff
@@ -53,10 +53,12 @@
|
|||||||
#ifndef _MGSCHEMA_COMPOSITING
|
#ifndef _MGSCHEMA_COMPOSITING
|
||||||
#include <fcntl.h> /* For O_* constants */
|
#include <fcntl.h> /* For O_* constants */
|
||||||
#include <sys/stat.h> /* For mode constants */
|
#include <sys/stat.h> /* For mode constants */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
|
|
||||||
#define SEM_UPDATE_LOCK "mginit-drm-update"
|
#define SEM_UPDATE_LOCK "minigui-drm-update"
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Hidden "this" pointer for the video functions */
|
/* Hidden "this" pointer for the video functions */
|
||||||
#define _THIS GAL_VideoDevice *this
|
#define _THIS GAL_VideoDevice *this
|
||||||
@@ -85,9 +87,10 @@ typedef struct GAL_PrivateVideoData {
|
|||||||
|
|
||||||
/* the global names of real screen and shadow screen */
|
/* the global names of real screen and shadow screen */
|
||||||
uint32_t real_name, shadow_name;
|
uint32_t real_name, shadow_name;
|
||||||
sem_t *update_lock;
|
|
||||||
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
|
sem_t *update_lock;
|
||||||
|
|
||||||
#if !IS_SHAREDFB_SCHEMA_PROCS
|
#if !IS_SHAREDFB_SCHEMA_PROCS
|
||||||
RECT dirty_rc;
|
RECT dirty_rc;
|
||||||
#endif
|
#endif
|
||||||
@@ -100,8 +103,11 @@ typedef struct GAL_PrivateVideoData {
|
|||||||
uint32_t cap_cursor_width;
|
uint32_t cap_cursor_width;
|
||||||
uint32_t cap_cursor_height;
|
uint32_t cap_cursor_height;
|
||||||
uint32_t cap_dumb:1;
|
uint32_t cap_dumb:1;
|
||||||
|
uint32_t cap_vblank_high_crtc:1;
|
||||||
uint32_t dbl_buff:1;
|
uint32_t dbl_buff:1;
|
||||||
|
uint32_t dirty_fb_ok:1;
|
||||||
uint32_t scanout_buff_id;
|
uint32_t scanout_buff_id;
|
||||||
|
int crtc_idx;
|
||||||
|
|
||||||
void* exdrv_handle;
|
void* exdrv_handle;
|
||||||
DrmDriverOps* driver_ops;
|
DrmDriverOps* driver_ops;
|
||||||
@@ -113,10 +119,20 @@ typedef struct GAL_PrivateVideoData {
|
|||||||
DrmModeInfo* saved_info;
|
DrmModeInfo* saved_info;
|
||||||
drmModeCrtc* saved_crtc;
|
drmModeCrtc* saved_crtc;
|
||||||
|
|
||||||
#if 0 /* deprecated code */
|
int min_pixels_using_hwaccl;
|
||||||
uint32_t console_buff_id;
|
|
||||||
uint8_t* scanout_fb;
|
/* async updater */
|
||||||
#endif /* deprecated code */
|
int updater_ready;
|
||||||
|
int update_interval;
|
||||||
|
RECT update_rect;
|
||||||
|
pthread_t update_thd;
|
||||||
|
sem_t sync_sem;
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
struct timespec ts_start;
|
||||||
|
unsigned frames;
|
||||||
|
#endif
|
||||||
|
|
||||||
} DrmVideoData;
|
} DrmVideoData;
|
||||||
|
|
||||||
#endif /* _NEWGAL_DRIVIDEO_H */
|
#endif /* _NEWGAL_DRIVIDEO_H */
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||||
|
/*
|
||||||
|
* Framework for buffer objects that can be shared across devices/subsystems.
|
||||||
|
*
|
||||||
|
* Copyright(C) 2015 Intel Ltd
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 as published by
|
||||||
|
* the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _DMA_BUF_UAPI_H_
|
||||||
|
#define _DMA_BUF_UAPI_H_
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
/* begin/end dma-buf functions used for userspace mmap. */
|
||||||
|
struct dma_buf_sync {
|
||||||
|
__u64 flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define DMA_BUF_SYNC_READ (1 << 0)
|
||||||
|
#define DMA_BUF_SYNC_WRITE (2 << 0)
|
||||||
|
#define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
|
||||||
|
#define DMA_BUF_SYNC_START (0 << 2)
|
||||||
|
#define DMA_BUF_SYNC_END (1 << 2)
|
||||||
|
#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
|
||||||
|
(DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
|
||||||
|
|
||||||
|
#define DMA_BUF_BASE 'b'
|
||||||
|
#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -139,8 +139,6 @@ static GAL_VideoDevice *DUMMY_CreateDevice(int devindex)
|
|||||||
device->AllocHWSurface = DUMMY_AllocHWSurface;
|
device->AllocHWSurface = DUMMY_AllocHWSurface;
|
||||||
device->CheckHWBlit = NULL;
|
device->CheckHWBlit = NULL;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = DUMMY_FreeHWSurface;
|
device->FreeHWSurface = DUMMY_FreeHWSurface;
|
||||||
|
|
||||||
device->free = DUMMY_DeleteDevice;
|
device->free = DUMMY_DeleteDevice;
|
||||||
|
|||||||
@@ -183,8 +183,6 @@ static GAL_VideoDevice *EM85XXOSD_CreateDevice(int devindex)
|
|||||||
device->AllocHWSurface = EM85XXOSD_AllocHWSurface;
|
device->AllocHWSurface = EM85XXOSD_AllocHWSurface;
|
||||||
device->CheckHWBlit = NULL;
|
device->CheckHWBlit = NULL;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = EM85XXOSD_FreeHWSurface;
|
device->FreeHWSurface = EM85XXOSD_FreeHWSurface;
|
||||||
device->UpdateRects = EM85XXOSD_UpdateRects;
|
device->UpdateRects = EM85XXOSD_UpdateRects;
|
||||||
|
|
||||||
|
|||||||
@@ -454,8 +454,6 @@ static GAL_VideoDevice *EM85XXYUV_CreateDevice(int devindex)
|
|||||||
device->AllocHWSurface = EM85XXYUV_AllocHWSurface;
|
device->AllocHWSurface = EM85XXYUV_AllocHWSurface;
|
||||||
device->CheckHWBlit = NULL;
|
device->CheckHWBlit = NULL;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = EM85XXYUV_FreeHWSurface;
|
device->FreeHWSurface = EM85XXYUV_FreeHWSurface;
|
||||||
device->UpdateRects = EM85XXYUV_UpdateRects;
|
device->UpdateRects = EM85XXYUV_UpdateRects;
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ static int GFX_VideoInit(_THIS, GAL_PixelFormat * vformat);
|
|||||||
static GAL_Rect ** GFX_ListModes(_THIS, GAL_PixelFormat * format, Uint32 flags);
|
static GAL_Rect ** GFX_ListModes(_THIS, GAL_PixelFormat * format, Uint32 flags);
|
||||||
static GAL_Surface * GFX_SetVideoMode(_THIS, GAL_Surface * current, int width, int height, int bpp, Uint32 flags);
|
static GAL_Surface * GFX_SetVideoMode(_THIS, GAL_Surface * current, int width, int height, int bpp, Uint32 flags);
|
||||||
static void GFX_VideoQuit(_THIS);
|
static void GFX_VideoQuit(_THIS);
|
||||||
static int GFX_FillHWRect(_THIS, GAL_Surface * dst, GAL_Rect * rect, Uint32 color);
|
static int GFX_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
|
||||||
static int GFX_AllocHWSurface(_THIS, GAL_Surface * surface);
|
static int GFX_AllocHWSurface(_THIS, GAL_Surface * surface);
|
||||||
static void GFX_FreeHWSurface(_THIS, GAL_Surface * surface);
|
static void GFX_FreeHWSurface(_THIS, GAL_Surface * surface);
|
||||||
static int GFX_HWAccelBlit(GAL_Surface * src, GAL_Rect * srcrect, GAL_Surface * dst, GAL_Rect * dstrect);
|
static int GFX_HWAccelBlit(GAL_Surface * src, GAL_Rect * srcrect, GAL_Surface * dst, GAL_Rect * dstrect);
|
||||||
@@ -112,8 +112,6 @@ static GAL_VideoDevice * GFX_CreateDevice(int devindex)
|
|||||||
this->AllocHWSurface = GFX_AllocHWSurface;
|
this->AllocHWSurface = GFX_AllocHWSurface;
|
||||||
this->CheckHWBlit = GFX_CheckHWBlit;
|
this->CheckHWBlit = GFX_CheckHWBlit;
|
||||||
this->FillHWRect = GFX_FillHWRect;
|
this->FillHWRect = GFX_FillHWRect;
|
||||||
this->SetHWColorKey = NULL;
|
|
||||||
this->SetHWAlpha = NULL;
|
|
||||||
this->UpdateRects = NULL;
|
this->UpdateRects = NULL;
|
||||||
this->FreeHWSurface = GFX_FreeHWSurface;
|
this->FreeHWSurface = GFX_FreeHWSurface;
|
||||||
|
|
||||||
@@ -298,7 +296,8 @@ static void GFX_VideoQuit (_THIS)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int GFX_FillHWRect(_THIS, GAL_Surface * surface, GAL_Rect * rect, Uint32 color)
|
static int
|
||||||
|
GFX_FillHWRect(_THIS, GAL_Surface *surface, const GAL_Rect *rect, Uint32 color)
|
||||||
{
|
{
|
||||||
struct GFXEngine_FillRectangle_type fill_param;
|
struct GFXEngine_FillRectangle_type fill_param;
|
||||||
struct GFXEngine_Surface_type surface_param;
|
struct GFXEngine_Surface_type surface_param;
|
||||||
|
|||||||
+19
-11
@@ -68,13 +68,7 @@ static void WaitIdle(_THIS)
|
|||||||
tdfx_waitidle();
|
tdfx_waitidle();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set video mem colorkey and accelerated blit function */
|
static int FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
|
||||||
static int SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key)
|
|
||||||
{
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
|
||||||
{
|
{
|
||||||
int bpp;
|
int bpp;
|
||||||
char *dst_base;
|
char *dst_base;
|
||||||
@@ -106,10 +100,9 @@ static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
static int HWAccelBlit(_THIS, GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
GAL_Surface *dst, GAL_Rect *dstrect)
|
GAL_Surface *dst, GAL_Rect *dstrect)
|
||||||
{
|
{
|
||||||
GAL_VideoDevice *this = __mg_current_video;
|
|
||||||
int bpp;
|
int bpp;
|
||||||
Uint32 src_format;
|
Uint32 src_format;
|
||||||
/* Uint32 dst_format; */
|
/* Uint32 dst_format; */
|
||||||
@@ -175,8 +168,11 @@ static int HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
static int CheckHWBlit(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||||
|
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||||
{
|
{
|
||||||
|
(void)srcrc;
|
||||||
|
(void)dstrc;
|
||||||
int accelerated;
|
int accelerated;
|
||||||
|
|
||||||
/* Set initial acceleration on */
|
/* Set initial acceleration on */
|
||||||
@@ -194,11 +190,24 @@ static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* color blend, logical operation, and scaling filter are not supported */
|
||||||
|
if ((op & COLOR_BLEND_MASK) ||
|
||||||
|
((op & COLOR_LOGICOP_MASK) != COLOR_LOGICOP_COPY) ||
|
||||||
|
(op & SCALING_FILTER_MASK)) {
|
||||||
|
src->flags &= ~GAL_HWACCEL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check to see if final surface blit is accelerated */
|
/* Check to see if final surface blit is accelerated */
|
||||||
accelerated = !!(src->flags & GAL_HWACCEL);
|
accelerated = !!(src->flags & GAL_HWACCEL);
|
||||||
if ( accelerated ) {
|
if ( accelerated ) {
|
||||||
|
src->map->video = this;
|
||||||
src->map->hw_blit = HWAccelBlit;
|
src->map->hw_blit = HWAccelBlit;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
src->map->video = NULL;
|
||||||
|
src->map->hw_blit = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return(accelerated);
|
return(accelerated);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,5 +229,4 @@ void FB_3DfxAccel(_THIS, __u32 card)
|
|||||||
/* The 3Dfx has accelerated normal and colorkey blits */
|
/* The 3Dfx has accelerated normal and colorkey blits */
|
||||||
this->info.blit_hw = 1;
|
this->info.blit_hw = 1;
|
||||||
this->info.blit_hw_CC = 1;
|
this->info.blit_hw_CC = 1;
|
||||||
this->SetHWColorKey = SetHWColorKey;
|
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-20
@@ -74,21 +74,7 @@ static void WaitIdle(_THIS)
|
|||||||
mga_waitidle();
|
mga_waitidle();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set video mem colorkey and accelerated blit function */
|
static int FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
|
||||||
static int SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key)
|
|
||||||
{
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set per surface hardware alpha value */
|
|
||||||
#if 0
|
|
||||||
static int SetHWAlpha(_THIS, GAL_Surface *surface, Uint8 value)
|
|
||||||
{
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
|
||||||
{
|
{
|
||||||
int dstX, dstY;
|
int dstX, dstY;
|
||||||
Uint32 fxbndry;
|
Uint32 fxbndry;
|
||||||
@@ -132,10 +118,9 @@ static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
static int HWAccelBlit(_THIS, GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
GAL_Surface *dst, GAL_Rect *dstrect)
|
GAL_Surface *dst, GAL_Rect *dstrect)
|
||||||
{
|
{
|
||||||
GAL_VideoDevice *this = __mg_current_video;
|
|
||||||
int pitch, w, h;
|
int pitch, w, h;
|
||||||
int srcX, srcY;
|
int srcX, srcY;
|
||||||
int dstX, dstY;
|
int dstX, dstY;
|
||||||
@@ -146,7 +131,7 @@ static int HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
|||||||
|
|
||||||
/* FIXME: For now, only blit to display surface */
|
/* FIXME: For now, only blit to display surface */
|
||||||
if ( dst->pitch != GAL_VideoSurface->pitch ) {
|
if ( dst->pitch != GAL_VideoSurface->pitch ) {
|
||||||
return(src->map->sw_blit(src, srcrect, dst, dstrect));
|
return(src->map->sw_blit(this, src, srcrect, dst, dstrect));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate source and destination base coordinates (in pixels) */
|
/* Calculate source and destination base coordinates (in pixels) */
|
||||||
@@ -224,8 +209,11 @@ static int HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
static int CheckHWBlit(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||||
|
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||||
{
|
{
|
||||||
|
(void)srcrc;
|
||||||
|
(void)dstrc;
|
||||||
int accelerated;
|
int accelerated;
|
||||||
|
|
||||||
/* Set initial acceleration on */
|
/* Set initial acceleration on */
|
||||||
@@ -243,11 +231,24 @@ static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* color blend, logical operation, and scaling filter are not supported */
|
||||||
|
if ((op & COLOR_BLEND_MASK) ||
|
||||||
|
((op & COLOR_LOGICOP_MASK) != COLOR_LOGICOP_COPY) ||
|
||||||
|
(op & SCALING_FILTER_MASK)) {
|
||||||
|
src->flags &= ~GAL_HWACCEL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check to see if final surface blit is accelerated */
|
/* Check to see if final surface blit is accelerated */
|
||||||
accelerated = !!(src->flags & GAL_HWACCEL);
|
accelerated = !!(src->flags & GAL_HWACCEL);
|
||||||
if ( accelerated ) {
|
if ( accelerated ) {
|
||||||
|
src->map->video = this;
|
||||||
src->map->hw_blit = HWAccelBlit;
|
src->map->hw_blit = HWAccelBlit;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
src->map->video = NULL;
|
||||||
|
src->map->hw_blit = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return(accelerated);
|
return(accelerated);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +270,6 @@ void FB_MatroxAccel(_THIS, __u32 card)
|
|||||||
*/
|
*/
|
||||||
if ( card != FB_ACCEL_MATROX_MGA2064W ) {
|
if ( card != FB_ACCEL_MATROX_MGA2064W ) {
|
||||||
this->info.blit_hw_CC = 1;
|
this->info.blit_hw_CC = 1;
|
||||||
this->SetHWColorKey = SetHWColorKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* Not yet implemented? */
|
#if 0 /* Not yet implemented? */
|
||||||
|
|||||||
@@ -95,12 +95,6 @@ static void WaitIdle(_THIS)
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set video mem colorkey and accelerated blit function */
|
|
||||||
static int SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void validate_dst (_THIS, GAL_Surface* dst)
|
static inline void validate_dst (_THIS, GAL_Surface* dst)
|
||||||
{
|
{
|
||||||
int bltMode = 0;
|
int bltMode = 0;
|
||||||
@@ -121,7 +115,7 @@ static inline void validate_dst (_THIS, GAL_Surface* dst)
|
|||||||
neo2200->pitch = (dst->pitch << 16) | (dst->pitch & 0xFFFF);
|
neo2200->pitch = (dst->pitch << 16) | (dst->pitch & 0xFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
static int FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
|
||||||
{
|
{
|
||||||
char *dst_base;
|
char *dst_base;
|
||||||
|
|
||||||
@@ -195,9 +189,11 @@ static void make_rects (GAL_Rect *src, GAL_Rect* dst, const RECT* rc, Uint32 x,
|
|||||||
dst->h = src->h;
|
dst->h = src->h;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
static int HWAccelBlit (_THIS, GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
GAL_Surface *dst, GAL_Rect *dstrect)
|
GAL_Surface *dst, GAL_Rect *dstrect)
|
||||||
{
|
{
|
||||||
|
(void)this;
|
||||||
|
|
||||||
RECT rc_src = {srcrect->x, srcrect->y, srcrect->x + srcrect->w, srcrect->y + srcrect->h};
|
RECT rc_src = {srcrect->x, srcrect->y, srcrect->x + srcrect->w, srcrect->y + srcrect->h};
|
||||||
RECT rc_dst = {dstrect->x, dstrect->y, dstrect->x + dstrect->w, dstrect->y + dstrect->h};
|
RECT rc_dst = {dstrect->x, dstrect->y, dstrect->x + dstrect->w, dstrect->y + dstrect->h};
|
||||||
RECT rc_inter, rc_sub [4];
|
RECT rc_inter, rc_sub [4];
|
||||||
@@ -241,8 +237,11 @@ static int HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CheckHWBlit (_THIS, GAL_Surface *src, GAL_Surface *dst)
|
static int CheckHWBlit(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||||
|
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||||
{
|
{
|
||||||
|
(void)srcrc;
|
||||||
|
(void)dstrc;
|
||||||
int accelerated;
|
int accelerated;
|
||||||
|
|
||||||
/* Set initial acceleration on */
|
/* Set initial acceleration on */
|
||||||
@@ -260,14 +259,27 @@ static int CheckHWBlit (_THIS, GAL_Surface *src, GAL_Surface *dst)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* color blend, logical operation, and scaling filter are not supported */
|
||||||
|
if ((op & COLOR_BLEND_MASK) ||
|
||||||
|
((op & COLOR_LOGICOP_MASK) != COLOR_LOGICOP_COPY) ||
|
||||||
|
(op & SCALING_FILTER_MASK)) {
|
||||||
|
src->flags &= ~GAL_HWACCEL;
|
||||||
|
}
|
||||||
|
|
||||||
if (src->format->BitsPerPixel > 16)
|
if (src->format->BitsPerPixel > 16)
|
||||||
src->flags &= ~GAL_HWACCEL;
|
src->flags &= ~GAL_HWACCEL;
|
||||||
|
|
||||||
/* Check to see if final surface blit is accelerated */
|
/* Check to see if final surface blit is accelerated */
|
||||||
accelerated = !!(src->flags & GAL_HWACCEL);
|
accelerated = !!(src->flags & GAL_HWACCEL);
|
||||||
if ( accelerated ) {
|
if ( accelerated ) {
|
||||||
|
src->map->video = this;
|
||||||
src->map->hw_blit = HWAccelBlit;
|
src->map->hw_blit = HWAccelBlit;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
src->map->video = NULL;
|
||||||
|
src->map->hw_blit = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return(accelerated);
|
return(accelerated);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +299,6 @@ void FB_NeoMagicAccel(_THIS, __u32 card)
|
|||||||
/* The NeoMagic has accelerated normal and colorkey blits */
|
/* The NeoMagic has accelerated normal and colorkey blits */
|
||||||
this->info.blit_hw = 1;
|
this->info.blit_hw = 1;
|
||||||
this->info.blit_hw_CC = 1;
|
this->info.blit_hw_CC = 1;
|
||||||
this->SetHWColorKey = SetHWColorKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FB_ACCEL_NEOMAGIC_NM2070 */
|
#endif /* FB_ACCEL_NEOMAGIC_NM2070 */
|
||||||
|
|||||||
+347
-77
File diff suppressed because it is too large
Load Diff
@@ -47,6 +47,8 @@
|
|||||||
#ifndef _GAL_fbvideo_h
|
#ifndef _GAL_fbvideo_h
|
||||||
#define _GAL_fbvideo_h
|
#define _GAL_fbvideo_h
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <semaphore.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
@@ -90,11 +92,24 @@ struct GAL_PrivateVideoData {
|
|||||||
/* end of header for shadow screen */
|
/* end of header for shadow screen */
|
||||||
|
|
||||||
int console_fd;
|
int console_fd;
|
||||||
struct fb_var_screeninfo cache_vinfo;
|
struct fb_var_screeninfo currt_vinfo;
|
||||||
struct fb_var_screeninfo saved_vinfo;
|
struct fb_var_screeninfo saved_vinfo;
|
||||||
int saved_cmaplen;
|
int saved_cmaplen;
|
||||||
__u16 *saved_cmap;
|
__u16 *saved_cmap;
|
||||||
|
|
||||||
|
/* Since 5.0.13, async updater */
|
||||||
|
int updater_ready;
|
||||||
|
int update_interval;
|
||||||
|
RECT update_rect;
|
||||||
|
pthread_t update_thd;
|
||||||
|
pthread_mutex_t update_lock;
|
||||||
|
sem_t sync_sem;
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
struct timespec ts_start;
|
||||||
|
unsigned frames;
|
||||||
|
|
||||||
|
#endif
|
||||||
#ifdef _MGHAVE_PCIACCESS
|
#ifdef _MGHAVE_PCIACCESS
|
||||||
int pci_accel_driver;
|
int pci_accel_driver;
|
||||||
#endif
|
#endif
|
||||||
@@ -115,13 +130,7 @@ struct GAL_PrivateVideoData {
|
|||||||
|
|
||||||
/* Old variable names */
|
/* Old variable names */
|
||||||
#define console_fd (this->hidden->console_fd)
|
#define console_fd (this->hidden->console_fd)
|
||||||
#define current_vt (this->hidden->current_vt)
|
#define currt_vinfo (this->hidden->currt_vinfo)
|
||||||
#define saved_vt (this->hidden->saved_vt)
|
|
||||||
#define keyboard_fd (this->hidden->keyboard_fd)
|
|
||||||
#define saved_kbd_mode (this->hidden->saved_kbd_mode)
|
|
||||||
#define saved_kbd_termios (this->hidden->saved_kbd_termios)
|
|
||||||
#define mouse_fd (this->hidden->mouse_fd)
|
|
||||||
#define cache_vinfo (this->hidden->cache_vinfo)
|
|
||||||
#define saved_vinfo (this->hidden->saved_vinfo)
|
#define saved_vinfo (this->hidden->saved_vinfo)
|
||||||
#define saved_cmaplen (this->hidden->saved_cmaplen)
|
#define saved_cmaplen (this->hidden->saved_cmaplen)
|
||||||
#define saved_cmap (this->hidden->saved_cmap)
|
#define saved_cmap (this->hidden->saved_cmap)
|
||||||
|
|||||||
+20
-10
@@ -715,7 +715,7 @@ static void SMI_SubsequentScreenToScreenCopy (int x1, int y1, int x2,
|
|||||||
WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
|
WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SMI_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
static int SMI_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
|
||||||
{
|
{
|
||||||
SMIPtr pSmi = &smi_rec;
|
SMIPtr pSmi = &smi_rec;
|
||||||
int x = rect->x;
|
int x = rect->x;
|
||||||
@@ -770,9 +770,11 @@ static void SMI_BlitTransRect (int srcx, int srcy, int w, int h, int dstx,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SMI_HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
static int SMI_HWAccelBlit (_THIS, GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
GAL_Surface *dst, GAL_Rect *dstrect)
|
GAL_Surface *dst, GAL_Rect *dstrect)
|
||||||
{
|
{
|
||||||
|
(void)this;
|
||||||
|
|
||||||
SMIPtr pSmi = &smi_rec;
|
SMIPtr pSmi = &smi_rec;
|
||||||
int srcx = srcrect->x;
|
int srcx = srcrect->x;
|
||||||
int srcy = srcrect->y;
|
int srcy = srcrect->y;
|
||||||
@@ -825,14 +827,11 @@ static void SMI_WaitIdle (_THIS)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set video mem colorkey and accelerated blit function */
|
static int SMI_CheckHWBlit (_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||||
static int SMI_SetHWColorKey (_THIS, GAL_Surface *surface, Uint32 key)
|
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int SMI_CheckHWBlit (_THIS, GAL_Surface *src, GAL_Surface *dst)
|
|
||||||
{
|
{
|
||||||
|
(void)srcrc;
|
||||||
|
(void)dstrc;
|
||||||
int accelerated;
|
int accelerated;
|
||||||
|
|
||||||
/* Set initial acceleration on */
|
/* Set initial acceleration on */
|
||||||
@@ -851,11 +850,23 @@ static int SMI_CheckHWBlit (_THIS, GAL_Surface *src, GAL_Surface *dst)
|
|||||||
src->flags &= ~GAL_HWACCEL;
|
src->flags &= ~GAL_HWACCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* color blend, logical operation, and scaling filter are not supported */
|
||||||
|
if ((op & COLOR_BLEND_MASK) ||
|
||||||
|
((op & COLOR_LOGICOP_MASK) != COLOR_LOGICOP_COPY) ||
|
||||||
|
(op & SCALING_FILTER_MASK)) {
|
||||||
|
src->flags &= ~GAL_HWACCEL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check to see if final surface blit is accelerated */
|
/* Check to see if final surface blit is accelerated */
|
||||||
accelerated = !!(src->flags & GAL_HWACCEL);
|
accelerated = !!(src->flags & GAL_HWACCEL);
|
||||||
if (accelerated) {
|
if (accelerated) {
|
||||||
|
src->map->video = this;
|
||||||
src->map->hw_blit = SMI_HWAccelBlit;
|
src->map->hw_blit = SMI_HWAccelBlit;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
src->map->video = NULL;
|
||||||
|
src->map->hw_blit = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return (accelerated);
|
return (accelerated);
|
||||||
}
|
}
|
||||||
@@ -898,7 +909,6 @@ static int SMI_Init (_THIS, const GAL_Surface* current)
|
|||||||
this->info.blit_hw = 1;
|
this->info.blit_hw = 1;
|
||||||
this->info.blit_hw_A = 0;
|
this->info.blit_hw_A = 0;
|
||||||
this->info.blit_hw_CC = 1;
|
this->info.blit_hw_CC = 1;
|
||||||
this->SetHWColorKey = SMI_SetHWColorKey;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,8 +116,6 @@ static GAL_VideoDevice *GDL_CreateDevice (int devindex)
|
|||||||
|
|
||||||
this->CheckHWBlit = NULL;
|
this->CheckHWBlit = NULL;
|
||||||
this->FillHWRect = NULL;
|
this->FillHWRect = NULL;
|
||||||
this->SetHWColorKey = NULL;
|
|
||||||
this->SetHWAlpha = NULL;
|
|
||||||
|
|
||||||
this->free = GDL_DeleteDevice;
|
this->free = GDL_DeleteDevice;
|
||||||
|
|
||||||
|
|||||||
@@ -242,8 +242,6 @@ static GAL_VideoDevice *HI3560A_CreateDevice(int devindex)
|
|||||||
device->AllocHWSurface = HI3560A_AllocHWSurface;
|
device->AllocHWSurface = HI3560A_AllocHWSurface;
|
||||||
device->CheckHWBlit = HI3560A_CheckHWBlit;
|
device->CheckHWBlit = HI3560A_CheckHWBlit;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FillHWRect = HI3560A_FillHWRect;
|
device->FillHWRect = HI3560A_FillHWRect;
|
||||||
device->FreeHWSurface = HI3560A_FreeHWSurface;
|
device->FreeHWSurface = HI3560A_FreeHWSurface;
|
||||||
|
|
||||||
@@ -994,7 +992,7 @@ static int HI3560A_AllocHWSurface(_THIS, GAL_Surface *surface)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int HI3560A_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
static int HI3560A_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
|
||||||
{
|
{
|
||||||
TDE_HANDLE tdeHandle;
|
TDE_HANDLE tdeHandle;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|||||||
@@ -501,7 +501,7 @@ static int HI3510_CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Fills a surface rectangle with the given color */
|
/* Fills a surface rectangle with the given color */
|
||||||
static int HI3510_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
static int HI3510_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
|
||||||
{
|
{
|
||||||
Uint8 r,g,b;
|
Uint8 r,g,b;
|
||||||
Uint8* pvirtual_addr;
|
Uint8* pvirtual_addr;
|
||||||
@@ -1863,8 +1863,6 @@ static GAL_VideoDevice *HI3510_CreateDevice (int devindex)
|
|||||||
#endif
|
#endif
|
||||||
this->FreeHWSurface = HI3510_FreeHWSurface;
|
this->FreeHWSurface = HI3510_FreeHWSurface;
|
||||||
this->free = HI3510_DeleteDevice;
|
this->free = HI3510_DeleteDevice;
|
||||||
this->SetHWAlpha = NULL;
|
|
||||||
this->SetHWColorKey = NULL;
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -675,7 +675,7 @@ static int HI3560_CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Sint32 Hi3560_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
static Sint32 Hi3560_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
|
||||||
{
|
{
|
||||||
TDE_SURFACE_S surface ={0};
|
TDE_SURFACE_S surface ={0};
|
||||||
TDE_OPT_S param;
|
TDE_OPT_S param;
|
||||||
@@ -1855,8 +1855,6 @@ static GAL_VideoDevice *HI3560_CreateDevice (int devindex)
|
|||||||
//#endif
|
//#endif
|
||||||
#endif
|
#endif
|
||||||
this->FreeHWSurface = HI3560_FreeHWSurface;
|
this->FreeHWSurface = HI3560_FreeHWSurface;
|
||||||
this->SetHWAlpha = NULL;
|
|
||||||
this->SetHWColorKey = NULL;
|
|
||||||
this->free = HI3560_DeleteDevice;
|
this->free = HI3560_DeleteDevice;
|
||||||
//this->SetAttr = HI3560_SetLayerAttr;
|
//this->SetAttr = HI3560_SetLayerAttr;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -251,8 +251,6 @@ static GAL_VideoDevice *MB93493_CreateDevice(int devindex)
|
|||||||
device->AllocHWSurface = MB93493_AllocHWSurface;
|
device->AllocHWSurface = MB93493_AllocHWSurface;
|
||||||
device->CheckHWBlit = NULL;
|
device->CheckHWBlit = NULL;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = MB93493_FreeHWSurface;
|
device->FreeHWSurface = MB93493_FreeHWSurface;
|
||||||
device->UpdateRects = MB93493_UpdateRects;
|
device->UpdateRects = MB93493_UpdateRects;
|
||||||
device->free = MB93493_DeleteDevice;
|
device->free = MB93493_DeleteDevice;
|
||||||
|
|||||||
@@ -335,8 +335,6 @@ static GAL_VideoDevice *MLSHADOW_CreateDevice (int devindex)
|
|||||||
device->AllocHWSurface = MLSHADOW_AllocHWSurface;
|
device->AllocHWSurface = MLSHADOW_AllocHWSurface;
|
||||||
device->CheckHWBlit = NULL;
|
device->CheckHWBlit = NULL;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = MLSHADOW_FreeHWSurface;
|
device->FreeHWSurface = MLSHADOW_FreeHWSurface;
|
||||||
device->UpdateRects = MLSHADOW_UpdateRects;
|
device->UpdateRects = MLSHADOW_UpdateRects;
|
||||||
device->DeleteSurface = MLSHADOW_DeleteSurface;
|
device->DeleteSurface = MLSHADOW_DeleteSurface;
|
||||||
|
|||||||
@@ -485,8 +485,6 @@ static GAL_VideoDevice *MLSHADOW_CreateDevice (int devindex)
|
|||||||
device->AllocHWSurface = MLSHADOW_AllocHWSurface;
|
device->AllocHWSurface = MLSHADOW_AllocHWSurface;
|
||||||
device->CheckHWBlit = NULL;
|
device->CheckHWBlit = NULL;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = MLSHADOW_FreeHWSurface;
|
device->FreeHWSurface = MLSHADOW_FreeHWSurface;
|
||||||
device->UpdateRects = MLSHADOW_UpdateRects;
|
device->UpdateRects = MLSHADOW_UpdateRects;
|
||||||
device->DeleteSurface = MLSHADOW_DeleteSurface;
|
device->DeleteSurface = MLSHADOW_DeleteSurface;
|
||||||
|
|||||||
@@ -106,12 +106,10 @@ static void MStar_VideoQuit(_THIS);
|
|||||||
/* Hardware surface functions */
|
/* Hardware surface functions */
|
||||||
static int MStar_InitHWSurfaces(_THIS, GAL_Surface *screen, char *base, int size);
|
static int MStar_InitHWSurfaces(_THIS, GAL_Surface *screen, char *base, int size);
|
||||||
static int MStar_AllocHWSurface(_THIS, GAL_Surface *surface);
|
static int MStar_AllocHWSurface(_THIS, GAL_Surface *surface);
|
||||||
static int MStar_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *dstrect, Uint32 color);
|
static int MStar_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *dstrect, Uint32 color);
|
||||||
static void MStar_FreeHWSurface(_THIS, GAL_Surface *surface);
|
static void MStar_FreeHWSurface(_THIS, GAL_Surface *surface);
|
||||||
static int MStar_CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst);
|
static int MStar_CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst);
|
||||||
static int MStar_HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
|
static int MStar_HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
|
||||||
static int MStar_SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key);
|
|
||||||
static int MStar_SetHWAlpha(_THIS, GAL_Surface *surface, Uint8 alpha);
|
|
||||||
|
|
||||||
/* Various screen update functions available */
|
/* Various screen update functions available */
|
||||||
static void MStar_DirectUpdate(_THIS, int numrects, GAL_Rect *rects);
|
static void MStar_DirectUpdate(_THIS, int numrects, GAL_Rect *rects);
|
||||||
@@ -190,8 +188,10 @@ static GAL_VideoDevice * MStar_CreateDevice(int devindex)
|
|||||||
device->AllocHWSurface = MStar_AllocHWSurface;
|
device->AllocHWSurface = MStar_AllocHWSurface;
|
||||||
device->CheckHWBlit = MStar_CheckHWBlit;
|
device->CheckHWBlit = MStar_CheckHWBlit;
|
||||||
device->FillHWRect = MStar_FillHWRect;
|
device->FillHWRect = MStar_FillHWRect;
|
||||||
|
#if 0
|
||||||
device->SetHWColorKey = MStar_SetHWColorKey;
|
device->SetHWColorKey = MStar_SetHWColorKey;
|
||||||
device->SetHWAlpha = MStar_SetHWAlpha;
|
device->SetHWAlpha = MStar_SetHWAlpha;
|
||||||
|
#endif
|
||||||
device->FreeHWSurface = MStar_FreeHWSurface;
|
device->FreeHWSurface = MStar_FreeHWSurface;
|
||||||
device->UpdateRects = MStar_DirectUpdate;
|
device->UpdateRects = MStar_DirectUpdate;
|
||||||
device->UpdateSurfaceRects = NULL;
|
device->UpdateSurfaceRects = NULL;
|
||||||
@@ -725,7 +725,7 @@ void cleanEngineState(MSTARDeviceData *sdev)
|
|||||||
sdev->dst_ge_format = GFX_FMT_ARGB8888;
|
sdev->dst_ge_format = GFX_FMT_ARGB8888;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MStar_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
|
static int MStar_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
|
||||||
{
|
{
|
||||||
GFX_RectFillInfo rectInfo;
|
GFX_RectFillInfo rectInfo;
|
||||||
GFX_Point v0, v1;
|
GFX_Point v0, v1;
|
||||||
@@ -773,6 +773,7 @@ static int MStar_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 colo
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static int MStar_SetHWColorKey(_THIS, GAL_Surface *src, Uint32 key)
|
static int MStar_SetHWColorKey(_THIS, GAL_Surface *src, Uint32 key)
|
||||||
{
|
{
|
||||||
FUNC_ENTER();
|
FUNC_ENTER();
|
||||||
@@ -790,6 +791,7 @@ static int MStar_SetHWAlpha(_THIS, GAL_Surface *surface, Uint8 alpha)
|
|||||||
FUNC_LEAVE();
|
FUNC_LEAVE();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void MStar_DirectUpdate(_THIS, int numrects, GAL_Rect *rects)
|
static void MStar_DirectUpdate(_THIS, int numrects, GAL_Rect *rects)
|
||||||
{
|
{
|
||||||
|
|||||||
+4
-3
@@ -240,12 +240,14 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
|
|||||||
req.len_data = strlen (SYSSF_WALLPAPER_PATTER) + 1;
|
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)) {
|
||||||
|
_WRN_PRINTF ("creating an empty wallpaper pattern surface\n");
|
||||||
goto empty;
|
goto empty;
|
||||||
|
}
|
||||||
|
|
||||||
_DBG_PRINTF ("REQID_GETSHAREDSURFACE: size (%lu), flags (0x%x), fd: %d\n",
|
_DBG_PRINTF ("REQID_GETSHAREDSURFACE: size (%lu), flags (0x%x), fd: %d\n",
|
||||||
info.size, info.flags, fd);
|
info.size, info.flags, fd);
|
||||||
wp_surf = GAL_AttachSharedRGBSurface (fd, info.size,
|
wp_surf = GAL_AttachSharedRGBSurface (NULL, fd, info.size,
|
||||||
info.flags, TRUE);
|
info.flags, TRUE);
|
||||||
close (fd);
|
close (fd);
|
||||||
|
|
||||||
@@ -253,7 +255,6 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
empty:
|
empty:
|
||||||
_DBG_PRINTF ("creating an empty wallpaper pattern surface\n");
|
|
||||||
if (IsServer()) {
|
if (IsServer()) {
|
||||||
return GAL_CreateRGBSurface (GAL_SWSURFACE, 0, 0,
|
return GAL_CreateRGBSurface (GAL_SWSURFACE, 0, 0,
|
||||||
screen->format->BitsPerPixel,
|
screen->format->BitsPerPixel,
|
||||||
|
|||||||
@@ -83,9 +83,9 @@ static REP_NEXUS_GETSURFACE reply_primary_surface_info;
|
|||||||
/* Initialization/Query functions */
|
/* Initialization/Query functions */
|
||||||
static int NEXUS_VideoInit(_THIS, GAL_PixelFormat * vformat);
|
static int NEXUS_VideoInit(_THIS, GAL_PixelFormat * vformat);
|
||||||
static GAL_Rect **NEXUS_ListModes(_THIS, GAL_PixelFormat * format,
|
static GAL_Rect **NEXUS_ListModes(_THIS, GAL_PixelFormat * format,
|
||||||
Uint32 flags);
|
Uint32 flags);
|
||||||
static GAL_Surface *NEXUS_SetVideoMode(_THIS, GAL_Surface * current, int width,
|
static GAL_Surface *NEXUS_SetVideoMode(_THIS, GAL_Surface *current,
|
||||||
int height, int bpp, Uint32 flags);
|
int width, int height, int bpp, Uint32 flags);
|
||||||
static int NEXUS_SetColors(_THIS, int firstcolor, int ncolors,
|
static int NEXUS_SetColors(_THIS, int firstcolor, int ncolors,
|
||||||
GAL_Color * colors);
|
GAL_Color * colors);
|
||||||
static void NEXUS_VideoQuit(_THIS);
|
static void NEXUS_VideoQuit(_THIS);
|
||||||
@@ -93,8 +93,8 @@ static void NEXUS_VideoQuit(_THIS);
|
|||||||
/* Hardware surface functions */
|
/* Hardware surface functions */
|
||||||
static int NEXUS_AllocHWSurface(_THIS, GAL_Surface * surface);
|
static int NEXUS_AllocHWSurface(_THIS, GAL_Surface * surface);
|
||||||
static void NEXUS_FreeHWSurface(_THIS, GAL_Surface * surface);
|
static void NEXUS_FreeHWSurface(_THIS, GAL_Surface * surface);
|
||||||
static int NEXUS_FillHWRect(_THIS, GAL_Surface * dst, GAL_Rect * rect,
|
static int NEXUS_FillHWRect(_THIS, GAL_Surface * dst, const GAL_Rect * rect,
|
||||||
Uint32 color);
|
Uint32 color);
|
||||||
static void NEXUS_UpdateSurfaceRects(_THIS, GAL_Surface* surface,
|
static void NEXUS_UpdateSurfaceRects(_THIS, GAL_Surface* surface,
|
||||||
int numrects, GAL_Rect *rects);
|
int numrects, GAL_Rect *rects);
|
||||||
static int NEXUS_CheckHWBlit(_THIS, GAL_Surface * src, GAL_Surface * dst);
|
static int NEXUS_CheckHWBlit(_THIS, GAL_Surface * src, GAL_Surface * dst);
|
||||||
@@ -114,11 +114,6 @@ NEXUS_DeleteDevice(GAL_VideoDevice * device)
|
|||||||
free(device);
|
free(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int NEXUS_SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GAL_VideoDevice *
|
static GAL_VideoDevice *
|
||||||
NEXUS_CreateDevice(int devindex)
|
NEXUS_CreateDevice(int devindex)
|
||||||
{
|
{
|
||||||
@@ -152,8 +147,6 @@ NEXUS_CreateDevice(int devindex)
|
|||||||
device->AllocHWSurface = NEXUS_AllocHWSurface;
|
device->AllocHWSurface = NEXUS_AllocHWSurface;
|
||||||
device->CheckHWBlit = NEXUS_CheckHWBlit;
|
device->CheckHWBlit = NEXUS_CheckHWBlit;
|
||||||
device->FillHWRect = NEXUS_FillHWRect;
|
device->FillHWRect = NEXUS_FillHWRect;
|
||||||
device->SetHWColorKey = NEXUS_SetHWColorKey;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = NEXUS_FreeHWSurface;
|
device->FreeHWSurface = NEXUS_FreeHWSurface;
|
||||||
device->UpdateRects = NULL;
|
device->UpdateRects = NULL;
|
||||||
device->UpdateSurfaceRects = NEXUS_UpdateSurfaceRects;
|
device->UpdateSurfaceRects = NEXUS_UpdateSurfaceRects;
|
||||||
@@ -455,7 +448,7 @@ NEXUS_FreeHWSurface(_THIS, GAL_Surface * surface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
NEXUS_FillHWRect(_THIS, GAL_Surface * dst, GAL_Rect * rect, Uint32 color)
|
NEXUS_FillHWRect(_THIS, GAL_Surface * dst, const GAL_Rect * rect, Uint32 color)
|
||||||
{
|
{
|
||||||
return NexusPrivate_FillRect(this->hidden->privateData,
|
return NexusPrivate_FillRect(this->hidden->privateData,
|
||||||
(NexusPrivate_HWSurface_hwdata *) dst->hwdata,
|
(NexusPrivate_HWSurface_hwdata *) dst->hwdata,
|
||||||
|
|||||||
@@ -266,11 +266,11 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
|
|||||||
{
|
{
|
||||||
RECT dirty_rc;
|
RECT dirty_rc;
|
||||||
|
|
||||||
if (IsRectEmpty (&this->hidden->dirty_rc))
|
if (IsRectEmpty(&this->hidden->dirty_rc))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
win_PCXVFbLock ();
|
win_PCXVFbLock();
|
||||||
#else
|
#else
|
||||||
shm_lock(semid);
|
shm_lock(semid);
|
||||||
#endif
|
#endif
|
||||||
@@ -282,10 +282,10 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
|
|||||||
if (dirty_rc.right == -1) dirty_rc.right = 0;
|
if (dirty_rc.right == -1) dirty_rc.right = 0;
|
||||||
if (dirty_rc.bottom == -1) dirty_rc.bottom = 0;
|
if (dirty_rc.bottom == -1) dirty_rc.bottom = 0;
|
||||||
|
|
||||||
GetBoundRect (&this->hidden->dirty_rc, &dirty_rc,
|
GetBoundRect(&this->hidden->dirty_rc, &dirty_rc,
|
||||||
&this->hidden->dirty_rc);
|
&this->hidden->dirty_rc);
|
||||||
|
|
||||||
shadowScreen_BlitToReal (this);
|
shadowScreen_BlitToReal(this, NULL);
|
||||||
|
|
||||||
this->hidden->hdr->dirty_rc_l = this->hidden->dirty_rc.left;
|
this->hidden->hdr->dirty_rc_l = this->hidden->dirty_rc.left;
|
||||||
this->hidden->hdr->dirty_rc_t = this->hidden->dirty_rc.top;
|
this->hidden->hdr->dirty_rc_t = this->hidden->dirty_rc.top;
|
||||||
@@ -293,10 +293,10 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
|
|||||||
this->hidden->hdr->dirty_rc_b = this->hidden->dirty_rc.bottom;
|
this->hidden->hdr->dirty_rc_b = this->hidden->dirty_rc.bottom;
|
||||||
this->hidden->hdr->dirty = TRUE;
|
this->hidden->hdr->dirty = TRUE;
|
||||||
|
|
||||||
SetRectEmpty (&this->hidden->dirty_rc);
|
SetRectEmpty(&this->hidden->dirty_rc);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
win_PCXVFbUnlock ();
|
win_PCXVFbUnlock();
|
||||||
#else
|
#else
|
||||||
shm_unlock(semid);
|
shm_unlock(semid);
|
||||||
#endif
|
#endif
|
||||||
@@ -350,8 +350,6 @@ static GAL_VideoDevice *PCXVFB_CreateDevice (int devindex)
|
|||||||
|
|
||||||
this->CheckHWBlit = NULL;
|
this->CheckHWBlit = NULL;
|
||||||
this->FillHWRect = NULL;
|
this->FillHWRect = NULL;
|
||||||
this->SetHWColorKey = NULL;
|
|
||||||
this->SetHWAlpha = NULL;
|
|
||||||
|
|
||||||
this->free = PCXVFB_DeleteDevice;
|
this->free = PCXVFB_DeleteDevice;
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -617,7 +617,8 @@ void GAL_InvalidateMap(GAL_BlitMap *map)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GAL_MapSurface (GAL_Surface *src, GAL_Surface *dst)
|
int GAL_MapSurface (GAL_Surface *src, const GAL_Rect *srcrc,
|
||||||
|
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||||
{
|
{
|
||||||
GAL_PixelFormat *srcfmt;
|
GAL_PixelFormat *srcfmt;
|
||||||
GAL_PixelFormat *dstfmt;
|
GAL_PixelFormat *dstfmt;
|
||||||
@@ -698,7 +699,7 @@ int GAL_MapSurface (GAL_Surface *src, GAL_Surface *dst)
|
|||||||
map->format_version = (++dst->format_version);
|
map->format_version = (++dst->format_version);
|
||||||
|
|
||||||
/* Choose your blitters wisely */
|
/* Choose your blitters wisely */
|
||||||
return(GAL_CalculateBlit(src));
|
return(GAL_CalculateBlit(src, srcrc, dstrc, op));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GAL_FreeBlitMap(GAL_BlitMap *map)
|
void GAL_FreeBlitMap(GAL_BlitMap *map)
|
||||||
|
|||||||
@@ -59,11 +59,14 @@ extern void GAL_FreeFormat(GAL_PixelFormat *format);
|
|||||||
/* Blit mapping functions */
|
/* Blit mapping functions */
|
||||||
extern GAL_BlitMap *GAL_AllocBlitMap(void);
|
extern GAL_BlitMap *GAL_AllocBlitMap(void);
|
||||||
extern void GAL_InvalidateMap(GAL_BlitMap *map);
|
extern void GAL_InvalidateMap(GAL_BlitMap *map);
|
||||||
extern int GAL_MapSurface (GAL_Surface *src, GAL_Surface *dst);
|
extern int GAL_MapSurface (GAL_Surface *src, const GAL_Rect *srcrc,
|
||||||
|
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op);
|
||||||
extern void GAL_FreeBlitMap(GAL_BlitMap *map);
|
extern void GAL_FreeBlitMap(GAL_BlitMap *map);
|
||||||
|
|
||||||
/* Miscellaneous functions */
|
/* Miscellaneous functions */
|
||||||
extern Uint32 GAL_CalculatePitch(GAL_Surface *surface);
|
extern Uint32 GAL_CalculatePitch(GAL_Surface *surface);
|
||||||
extern void GAL_DitherColors(GAL_Color *colors, int bpp);
|
extern void GAL_DitherColors(GAL_Color *colors, int bpp);
|
||||||
extern Uint8 GAL_FindColor(GAL_Palette *pal, Uint8 r, Uint8 g, Uint8 b);
|
extern Uint8 GAL_FindColor(GAL_Palette *pal, Uint8 r, Uint8 g, Uint8 b);
|
||||||
extern void GAL_ApplyGamma(Uint16 *gamma, GAL_Color *colors, GAL_Color *output, int ncolors);
|
extern void GAL_ApplyGamma(Uint16 *gamma, GAL_Color *colors, GAL_Color *output,
|
||||||
|
int ncolors);
|
||||||
|
|
||||||
|
|||||||
@@ -171,8 +171,6 @@ static GAL_VideoDevice *QVFB_CreateDevice (int devindex)
|
|||||||
|
|
||||||
this->CheckHWBlit = NULL;
|
this->CheckHWBlit = NULL;
|
||||||
this->FillHWRect = NULL;
|
this->FillHWRect = NULL;
|
||||||
this->SetHWColorKey = NULL;
|
|
||||||
this->SetHWAlpha = NULL;
|
|
||||||
|
|
||||||
this->free = QVFB_DeleteDevice;
|
this->free = QVFB_DeleteDevice;
|
||||||
|
|
||||||
|
|||||||
@@ -208,8 +208,6 @@ static GAL_VideoDevice *RTOS_XVFB_CreateDevice (int devindex)
|
|||||||
|
|
||||||
this->CheckHWBlit = NULL;
|
this->CheckHWBlit = NULL;
|
||||||
this->FillHWRect = NULL;
|
this->FillHWRect = NULL;
|
||||||
this->SetHWColorKey = NULL;
|
|
||||||
this->SetHWAlpha = NULL;
|
|
||||||
|
|
||||||
this->free = RTOS_XVFB_DeleteDevice;
|
this->free = RTOS_XVFB_DeleteDevice;
|
||||||
|
|
||||||
|
|||||||
@@ -196,8 +196,6 @@ static GAL_VideoDevice *S3C6410_CreateDevice(int devindex)
|
|||||||
device->AllocHWSurface = S3C6410_AllocHWSurface;
|
device->AllocHWSurface = S3C6410_AllocHWSurface;
|
||||||
device->CheckHWBlit = S3C6410_CheckHWBlit;
|
device->CheckHWBlit = S3C6410_CheckHWBlit;
|
||||||
device->FillHWRect = NULL;
|
device->FillHWRect = NULL;
|
||||||
device->SetHWColorKey = NULL;
|
|
||||||
device->SetHWAlpha = NULL;
|
|
||||||
device->FreeHWSurface = S3C6410_FreeHWSurface;
|
device->FreeHWSurface = S3C6410_FreeHWSurface;
|
||||||
|
|
||||||
device->free = S3C6410_DeleteDevice;
|
device->free = S3C6410_DeleteDevice;
|
||||||
|
|||||||
@@ -231,13 +231,16 @@ void shadowScreen_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Blit dirty content from shadow surface to ultimate surface */
|
/* Blit dirty content from shadow surface to ultimate surface */
|
||||||
int shadowScreen_BlitToReal (_THIS)
|
int shadowScreen_BlitToReal (_THIS, const RECT *dirty_rc)
|
||||||
{
|
{
|
||||||
RECT bound;
|
RECT bound;
|
||||||
|
|
||||||
CHECK_VERSION_RETVAL (this, -1);
|
CHECK_VERSION_RETVAL (this, -1);
|
||||||
|
|
||||||
bound = this->hidden->dirty_rc;
|
if (dirty_rc == NULL)
|
||||||
|
bound = this->hidden->dirty_rc;
|
||||||
|
else
|
||||||
|
bound = *dirty_rc;
|
||||||
|
|
||||||
if (this->hidden->real_screen) {
|
if (this->hidden->real_screen) {
|
||||||
GAL_Rect src_rect, dst_rect;
|
GAL_Rect src_rect, dst_rect;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ extern "C" {
|
|||||||
int shadowScreen_SetCursor (_THIS, GAL_Surface *surface, int hot_x, int hot_y);
|
int shadowScreen_SetCursor (_THIS, GAL_Surface *surface, int hot_x, int hot_y);
|
||||||
int shadowScreen_MoveCursor (_THIS, int x, int y);
|
int shadowScreen_MoveCursor (_THIS, int x, int y);
|
||||||
void shadowScreen_UpdateRects (_THIS, int numrects, GAL_Rect *rects);
|
void shadowScreen_UpdateRects (_THIS, int numrects, GAL_Rect *rects);
|
||||||
int shadowScreen_BlitToReal (_THIS);
|
int shadowScreen_BlitToReal (_THIS, const RECT *dirty_rc);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user