mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-25 02:33:59 +08:00
Compare commits
133
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59a6a1369d | ||
|
|
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 | ||
|
|
e0cc3b5580 | ||
|
|
e33d98a702 | ||
|
|
84f3cf048a | ||
|
|
ea579771a7 | ||
|
|
4db97ead1f | ||
|
|
2338501d21 | ||
|
|
81c061c3c8 | ||
|
|
356bf08c4b | ||
|
|
09a27e508f | ||
|
|
0b636032ee | ||
|
|
5f78f6bb37 | ||
|
|
272bc39c84 | ||
|
|
1e006c0589 | ||
|
|
7158eaee0f | ||
|
|
abfc47159e | ||
|
|
deade3d887 | ||
|
|
cf3e0b3d4d | ||
|
|
614deba4b7 | ||
|
|
53d40508a4 | ||
|
|
39f96f407f | ||
|
|
c8c6f470ce | ||
|
|
d78b493aad | ||
|
|
26f415f3db | ||
|
|
b66ef7a2f5 | ||
|
|
9b89614569 | ||
|
|
0d170a6f74 | ||
|
|
f0dd4a74d2 | ||
|
|
692a6b81e0 | ||
|
|
cf49cf2b64 | ||
|
|
b26accf037 | ||
|
|
5913d95ff2 | ||
|
|
e1b94799a2 | ||
|
|
385db01097 | ||
|
|
d787dea652 | ||
|
|
0adddb422b | ||
|
|
c444030334 | ||
|
|
a9da4ddfba | ||
|
|
57cc74410f |
@@ -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.
|
||||
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.
|
||||
|
||||
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 |
|
||||
|-----------------------------------------------|
|
||||
| | (Graphics Stack) |
|
||||
| | ---------------------|
|
||||
| | | hiMesa |
|
||||
| | hiCairo | ------------------|
|
||||
| | MiniGUI | | EGL for MiniGUI |
|
||||
| C++ libs | hiDRMDrivers | | GL, GLES, VG |
|
||||
| C libs | libDRM | | GPU drivers |
|
||||
| | (Graphics Stack) |
|
||||
| | --------------------|
|
||||
| | | Mesa-HBD |
|
||||
| | Cairo-HBD | ------------------|
|
||||
| | MiniGUI | | EGL for MiniGUI |
|
||||
| C++ libs | HBDDRMDrivers | | GL, GLES, VG |
|
||||
| C libs | libDRM | | GPU drivers |
|
||||
|-----------------------------------------------|
|
||||
| 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:
|
||||
|
||||
- `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
|
||||
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
|
||||
(versions 1, 2, 3), OpenCL, OpenMAX, and Vulkan. It contains the following
|
||||
components:
|
||||
@@ -113,13 +113,17 @@ As shown in the chart above, the HybridOS graphics stack consists of the followi
|
||||
graphics APIs.
|
||||
+ The EGL implementation for MiniGUI platform.
|
||||
+ The graphics drivers for various GPUs and a software driver called `swrast`.
|
||||
- `hiCairo` is the Cairo derivative for HybridOS. Cairo is a 2D vector graphics
|
||||
- `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`.
|
||||
|
||||
For more information about HybridOS, please refer to:
|
||||
|
||||
<https://hybridos.fmsoft.cn/>
|
||||
|
||||
For more information about HVML, please refer to:
|
||||
|
||||
<https://hvml.fmsoft.cn/> or <https://www.hvml.org>
|
||||
|
||||
### Source Code Repositories
|
||||
|
||||
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. Jan., 2022: FMSoft released MiniGUI version 5.0.9.
|
||||
1. Sep., 2022: FMSoft released MiniGUI version 5.0.10.
|
||||
1. Aug., 2023: FMSoft released MiniGUI version 5.0.13.
|
||||
|
||||
## AUTHORS AND COPYING
|
||||
|
||||
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>.
|
||||
|
||||
Copyright (C) 2002 ~ 2022, Beijing FMSoft Technologies Co., Ltd.
|
||||
Copyright (C) 2002 ~ 2023, Beijing FMSoft Technologies Co., Ltd.
|
||||
Copyright (C) 1998 ~ 2002, Vincent Wei
|
||||
|
||||
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]: https://www.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
|
||||
[Vincent Wei]: https://github.com/VincentWei
|
||||
|
||||
[MiniGUI]: https://github.com/VincentWei/MiniGUI
|
||||
[HybridOS]: https://github.com/FMSoftCN/HybridOS
|
||||
|
||||
[MiniGUI]: https://github.com/VincentWei
|
||||
[HybridOS]: https://github.com/HybridOS2
|
||||
[HVML]: https://github.com/HVML
|
||||
[PurC]: https://github.com/HVML/PurC
|
||||
[xGUI Pro]: https://github.com/HVML/xGUI-Pro
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# 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)
|
||||
+ [What's new in version 5.0.11](#whats-new-in-version-5011)
|
||||
- [Version 5.0.10](#version-5010)
|
||||
+ [What's new in version 5.0.10](#whats-new-in-version-5010)
|
||||
- [Version 5.0.9](#version-508)
|
||||
@@ -26,6 +34,78 @@
|
||||
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
||||
+ [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
|
||||
|
||||
On Dec. 31, 2022, FMSoft announces the availability of MiniGUI 5.0.11,
|
||||
which is a bug fixing release with bug fixes and some minor enhancements
|
||||
of MiniGUI 5.0.x.
|
||||
|
||||
### What's new in version 5.0.11
|
||||
|
||||
In this version, we made some enhancements
|
||||
|
||||
* ENHANCEMENTS:
|
||||
* BUGFIXING:
|
||||
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/94
|
||||
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/96
|
||||
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/105
|
||||
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/106
|
||||
* OPTIMIZATIONS:
|
||||
- Optimize the refresh of scrolled.
|
||||
* TUNING:
|
||||
- Call `mg_FreeMsgQueueForThisThread` immediately in `TerminateGUI()`.
|
||||
- Use `CreateLogFontEx` instead of `CreateLogFont` to follow the new style convention of font name when creating the system logfonts,
|
||||
but the orientation is ignored for the system logfont.
|
||||
|
||||
## Version 5.0.10
|
||||
|
||||
On Sep. 30, 2022, FMSoft announces the availability of MiniGUI 5.0.10,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Version 5.0.9 (2022/01/14)
|
||||
Version 5.0.13 (2023/08/31)
|
||||
|
||||
This is a minor enhancement and bugfix release of MiniGUI 5.0.x, the stable version.
|
||||
|
||||
|
||||
+8
-7
@@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT(libminigui, 5.0.10)
|
||||
AC_INIT(libminigui, 5.0.14)
|
||||
AC_CONFIG_SRCDIR(src/main/main.c)
|
||||
|
||||
dnl Set various version strings - taken gratefully from the SDL sources
|
||||
@@ -16,7 +16,7 @@ dnl Set various version strings - taken gratefully from the SDL sources
|
||||
#
|
||||
MINIGUI_MAJOR_VERSION=5
|
||||
MINIGUI_MINOR_VERSION=0
|
||||
MINIGUI_MICRO_VERSION=10
|
||||
MINIGUI_MICRO_VERSION=14
|
||||
MINIGUI_INTERFACE_AGE=0
|
||||
MINIGUI_BINARY_AGE=0
|
||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||
@@ -95,7 +95,7 @@ message_string="no"
|
||||
osname="unspecified"
|
||||
runtime_mode="procs"
|
||||
compositing_schema="yes"
|
||||
virtual_window="no"
|
||||
virtual_window="yes"
|
||||
use_shmopen="no"
|
||||
mgslice_use_fallback="no"
|
||||
|
||||
@@ -1704,12 +1704,12 @@ fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -D__MINIGUI_LIB__"
|
||||
|
||||
surface_schema="shared frame buffer"
|
||||
surface_schema="shared"
|
||||
case "$runtime_mode" in
|
||||
sa)
|
||||
AC_DEFINE(_MGRM_STANDALONE, 1,
|
||||
[Define if build MiniGUI-Standalone])
|
||||
MINIGUI_RUNMODE="sa"
|
||||
MINIGUI_RUNMODE="standalone"
|
||||
RUNMODE_LADD="standalone/libstandalone.la"
|
||||
RUNMODE_SUBDIRS="standalone"
|
||||
;;
|
||||
@@ -1717,13 +1717,13 @@ case "$runtime_mode" in
|
||||
AC_DEFINE(_MGRM_THREADS, 1,
|
||||
[Define if build MiniGUI-Threads])
|
||||
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
|
||||
MINIGUI_RUNMODE="ths"
|
||||
MINIGUI_RUNMODE="threads"
|
||||
virtual_window="yes"
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE(_MGRM_PROCESSES, 1,
|
||||
[Define if build MiniGUI-Processes])
|
||||
MINIGUI_RUNMODE="procs"
|
||||
MINIGUI_RUNMODE="processes"
|
||||
RUNMODE_LADD="server/libserver.la client/libclient.la"
|
||||
RUNMODE_SUBDIRS="server client"
|
||||
if test "x$compositing_schema" = "xyes"; then
|
||||
@@ -2664,6 +2664,7 @@ if test "x$no_math" = "xno"; then
|
||||
fi
|
||||
|
||||
DEP_LIBS="$DEP_LIBS -lpthread"
|
||||
MINIGUI_RUNMODE="$MINIGUI_RUNMODE-${surface_schema}"
|
||||
|
||||
AC_SUBST(VIDEO_SUBDIRS)
|
||||
AC_SUBST(VIDEO_DRIVERS)
|
||||
|
||||
+53
-8
@@ -55,6 +55,36 @@ wallpaper_pattern_size=full
|
||||
# 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
|
||||
[drm]
|
||||
defaultmode=1024x768-32bpp
|
||||
@@ -78,9 +108,21 @@ dpi=96
|
||||
# Since 5.0.0.
|
||||
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 equivalent environment variable: MG_GAL_DRM_DRIVER
|
||||
exdriver=libhidrmdrivers-0.2.so.0
|
||||
exdriver=libdrmdrivers.so
|
||||
#}}
|
||||
|
||||
#{{ifdef _MGIAL_SINGLETOUCHKEY
|
||||
@@ -111,6 +153,16 @@ dpi=96
|
||||
# Note that under compositing schema, double buffering is always enabled.
|
||||
# Since 5.0.10.
|
||||
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
|
||||
@@ -123,13 +175,6 @@ exec_file=/usr/local/bin/gvfb
|
||||
[rtos_xvfb]
|
||||
defaultmode=800x600-16bpp
|
||||
|
||||
#{{ifdef _MGGAL_SHADOW
|
||||
[shadow]
|
||||
real_engine=pc_xvfb
|
||||
defaultmode=800x600-16bpp
|
||||
rotate_screen=ccw
|
||||
#}}
|
||||
|
||||
#{{ifdef _MGGAL_MLSHADOW
|
||||
[mlshadow]
|
||||
real_engine=qvfb
|
||||
|
||||
@@ -2347,6 +2347,7 @@ int init_minigui_printf (int (*output_char) (int ch),
|
||||
#define _ERR_PRINTF(fmt, ...) \
|
||||
do { \
|
||||
TCS_RED (stderr); \
|
||||
fprintf (stderr, "%s: ", __FUNCTION__); \
|
||||
fprintf (stderr, fmt, ##__VA_ARGS__); \
|
||||
TCS_NONE (stderr); \
|
||||
} while (0)
|
||||
|
||||
+57
-77
@@ -84,6 +84,14 @@ extern "C" {
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** The current version of DRM driver. */
|
||||
#define DRM_DRIVER_VERSION 2
|
||||
|
||||
#define DRM_SURBUF_TYPE_OFFSCREEN 0x0000
|
||||
#define DRM_SURBUF_TYPE_SHADOW 0x0001
|
||||
#define DRM_SURBUF_TYPE_SCANOUT 0x0002
|
||||
#define DRM_SURBUF_TYPE_MASK 0x000F
|
||||
|
||||
/**
|
||||
* The struct type represents the DRI sub driver.
|
||||
* The concrete struct should be defined by the driver.
|
||||
@@ -129,6 +137,8 @@ typedef struct _DrmSurfaceBuffer {
|
||||
uint32_t dumb:1;
|
||||
/** Is it a scanout buffer. Since 5.0.0. */
|
||||
uint32_t scanout:1;
|
||||
/** The buffer is also a dma-buf. Since 5.0.13. */
|
||||
uint32_t dma_buf:1;
|
||||
|
||||
/** The width of the buffer. */
|
||||
uint32_t width;
|
||||
@@ -154,11 +164,23 @@ typedef struct _DrmSurfaceBuffer {
|
||||
* The address of the pixel data:
|
||||
* uint8_t* pixels = this->buff + this->offset;
|
||||
*/
|
||||
uint8_t* buff;
|
||||
uint8_t* vaddr;
|
||||
} DrmSurfaceBuffer;
|
||||
|
||||
typedef struct _DrmBlitOperations {
|
||||
BlitCopyOperation cpy;
|
||||
BlitKeyOperation key;
|
||||
BlitAlphaOperation alf;
|
||||
ColorBlendMethod bld;
|
||||
ColorLogicalOp rop;
|
||||
ScalingFilter scl;
|
||||
|
||||
uint32_t key_min, key_max;
|
||||
uint8_t alpha;
|
||||
} DrmBlitOperations;
|
||||
|
||||
/**
|
||||
* The structure type defines the operations for a DRM driver.
|
||||
* The structure type defines the operations for a userland DRM driver.
|
||||
*/
|
||||
typedef struct _DrmDriverOps {
|
||||
/**
|
||||
@@ -176,12 +198,13 @@ typedef struct _DrmDriverOps {
|
||||
void (*destroy_driver) (DrmDriver *driver);
|
||||
|
||||
/**
|
||||
* This operation flushes the batch buffer of the driver or
|
||||
* the hardware cache.
|
||||
* This operation flushes the batch buffer of the driver and/or
|
||||
* the specified buffer.
|
||||
*
|
||||
* \note This operation can be NULL.
|
||||
*/
|
||||
void (* flush_driver) (DrmDriver *driver);
|
||||
void (* flush) (DrmDriver *driver, DrmSurfaceBuffer* buff,
|
||||
const GAL_Rect *dirty_rect);
|
||||
|
||||
/**
|
||||
* This operation creates a surface buffer with the specified pixel format,
|
||||
@@ -194,7 +217,7 @@ typedef struct _DrmDriverOps {
|
||||
*/
|
||||
DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver,
|
||||
uint32_t drm_format, uint32_t hdr_size,
|
||||
uint32_t width, uint32_t height);
|
||||
uint32_t width, uint32_t height, unsigned flags);
|
||||
|
||||
/**
|
||||
* This operation creates a buffer from a given and possibly foreign handle
|
||||
@@ -207,7 +230,9 @@ typedef struct _DrmDriverOps {
|
||||
* DrmSurfaceBuffer object.
|
||||
*/
|
||||
DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver,
|
||||
uint32_t handle, size_t size);
|
||||
uint32_t handle, size_t size,
|
||||
uint32_t drm_format, uint32_t hdr_size,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
/**
|
||||
* This operation creates a buffer for the given system global name
|
||||
@@ -219,7 +244,9 @@ typedef struct _DrmDriverOps {
|
||||
* DrmSurfaceBuffer object.
|
||||
*/
|
||||
DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver,
|
||||
uint32_t name);
|
||||
uint32_t name,
|
||||
uint32_t drm_format, uint32_t hdr_size,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
/**
|
||||
* This operation creates a buffer for the given PRIME file descriptor
|
||||
@@ -231,21 +258,19 @@ typedef struct _DrmDriverOps {
|
||||
* DrmSurfaceBuffer object.
|
||||
*/
|
||||
DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver,
|
||||
int prime_fd, size_t size);
|
||||
int prime_fd, size_t size,
|
||||
uint32_t drm_format, uint32_t hdr_size,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
/**
|
||||
* This operation maps the buffer into the current process's virtual memory
|
||||
* space, and returns the virtual address. If failed, it returns NULL.
|
||||
*
|
||||
* When \a for_scanout is not zero, the buffer will be used for scan out
|
||||
* frame buffer.
|
||||
*
|
||||
* \note The driver must implement this operation. The driver must
|
||||
* set a valid value for buff field of the DrmSurfaceBuffer object
|
||||
* on success.
|
||||
*/
|
||||
uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer,
|
||||
int for_scanout);
|
||||
uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
|
||||
|
||||
/**
|
||||
* This operation un-maps a buffer.
|
||||
@@ -264,96 +289,51 @@ typedef struct _DrmDriverOps {
|
||||
void (* destroy_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
|
||||
|
||||
/**
|
||||
* This operation clears the specific rectangle area of a buffer
|
||||
* This operation fills the specific rectangle area of a buffer
|
||||
* with the specific pixel value. If succeed, it returns 0.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated clear operation.
|
||||
* hardware accelerated filling operation.
|
||||
*/
|
||||
int (* clear_buffer) (DrmDriver *driver,
|
||||
int (* fill_rect) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value);
|
||||
|
||||
/**
|
||||
* This operation checks whether a hardware accelerated blit
|
||||
* This operation checks whether a specified hardware accelerated blit
|
||||
* can be done between the source buffer and the destination buffer.
|
||||
* If succeed, it returns 0.
|
||||
* If succeed, it returns zero, otherwise for failure.
|
||||
* If succeed, it is safe to call do_blit operation.
|
||||
*
|
||||
* \note If this operation is set as NULL, it will be supposed that
|
||||
* the driver does not support any hardware accelerated blitting operation.
|
||||
*/
|
||||
int (* check_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
|
||||
|
||||
/**
|
||||
* This operation copies bits from a source buffer to a destination buffer.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated copy blitting.
|
||||
*
|
||||
* \note Currently, the logical operation is ignored.
|
||||
*/
|
||||
int (* copy_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
ColorLogicalOp logic_op);
|
||||
const DrmBlitOperations *ops);
|
||||
|
||||
/**
|
||||
* This operation blits pixels from a source buffer with the source alpha
|
||||
* value specified to a destination buffer.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blitting with alpha.
|
||||
* This operation does the real blit. It should not be NULL if check_blit
|
||||
* is not NULL.
|
||||
*/
|
||||
int (* alpha_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
uint8_t alpha);
|
||||
int (* do_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer *src_buf, const GAL_Rect *src_rc,
|
||||
DrmSurfaceBuffer *dst_buf, const GAL_Rect *dst_rc,
|
||||
const DrmBlitOperations *blit_ops);
|
||||
|
||||
/**
|
||||
* This operation blits pixels from a source buffer to a destination buffer,
|
||||
* but skipping the pixel value specified by \a color_key.
|
||||
* This operation copies the pixels from the source buffer to
|
||||
* the destination buffer, with or without scaling, rotation, and flip.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blitting with color key.
|
||||
* hardware accelerated copy operation between buffers.
|
||||
*/
|
||||
int (* key_blit) (DrmDriver *driver,
|
||||
int (* copy_buff) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
uint32_t color_key);
|
||||
|
||||
/**
|
||||
* This operation blits pixels from a source buffer with the source alpha
|
||||
* value specified to a destination buffer, but skipping the pixel value
|
||||
* specified.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blitting with alpha and color key.
|
||||
*/
|
||||
int (* alpha_key_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
uint8_t alpha, uint32_t color_key);
|
||||
|
||||
/**
|
||||
* This operation blits pixels from a source buffer with the source alpha
|
||||
* value of pixels to the destination buffer, and with the specified color
|
||||
* compositing/blending method (\a ColorBlendMethod).
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blitting with alpha on basis per pixel.
|
||||
*
|
||||
* \note Currently, the color compositing/blending method is ignored.
|
||||
*/
|
||||
int (* alpha_pixel_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
ColorBlendMethod blend_method);
|
||||
|
||||
BlitCopyOperation op);
|
||||
} DrmDriverOps;
|
||||
|
||||
/** The current version of DRM driver. */
|
||||
#define DRM_DRIVER_VERSION 1
|
||||
|
||||
/**
|
||||
* Implement this stub to return the DRI driver operations
|
||||
*
|
||||
|
||||
+445
-33
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1958,7 +1958,7 @@ const CompositorOps* __ex_compositor_get (const char* name,
|
||||
*
|
||||
* \sa RegisterRequestHandler
|
||||
*/
|
||||
#define MAX_SYS_REQID 0x0023
|
||||
#define MAX_SYS_REQID 0x0024
|
||||
|
||||
/**
|
||||
* \def MAX_REQID
|
||||
|
||||
@@ -7237,6 +7237,29 @@ MG_EXPORT BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags);
|
||||
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI GetWindowSharedSurfaceFD (HWND hwnd)
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \fn BOOL GUIAPI SetMainWindowCompositing (HWND hWnd,
|
||||
int type, DWORD arg)
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
runmode=@MINIGUI_RUNMODE@
|
||||
libsuffix=@MGLIB_SUFFIX@
|
||||
|
||||
Name: MiniGUI
|
||||
Description: A mature cross-platform windowing and GUI system for embedded systems and IoT smart devices.
|
||||
Version: @MINIGUI_VERSION@
|
||||
Runmode: @MINIGUI_RUNMODE@
|
||||
Requires:
|
||||
Libs: -L${libdir} -lminigui_@MGLIB_SUFFIX@ @DEP_LIBS@
|
||||
Libs.private:
|
||||
|
||||
+56
-46
@@ -210,6 +210,7 @@ static void setup_dc (HWND hWnd, BIDISLEDITDATA *sled, HDC hdc, BOOL bSel)
|
||||
DWORD dwStyle = GetWindowStyle (hWnd);
|
||||
|
||||
if (!bSel) {
|
||||
SetBkMode (hdc, BM_TRANSPARENT);
|
||||
|
||||
if (dwStyle & WS_DISABLED)
|
||||
SetTextColor (hdc,
|
||||
@@ -583,7 +584,7 @@ static void slePaint (HWND hWnd, HDC hdc, PBIDISLEDITDATA sled)
|
||||
|
||||
/* draw selected chars */
|
||||
setup_dc (hWnd, sled, hdc, TRUE);
|
||||
outw += DrawACharString (hdc, startx + outw, starty,
|
||||
outw += DrawACharString (hdc, startx + outw, starty,
|
||||
achar_string, sled->selEnd - sled->selStart, NULL, NULL);
|
||||
achar_string += sled->selEnd - sled->selStart;
|
||||
|
||||
@@ -1069,6 +1070,7 @@ static int ascii_bidi_type[] = {
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
|
||||
|
||||
/*0x60~0x6f*/
|
||||
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
@@ -1085,21 +1087,23 @@ static int ascii_bidi_type[] = {
|
||||
static int inline get_char_bidi_type (LOGFONT* logfont, Achar32 chv)
|
||||
{
|
||||
DEVFONT* devfont;
|
||||
int bidi_type = BIDI_TYPE_LTR;
|
||||
|
||||
if (IS_MBCHV(chv)) {
|
||||
devfont = logfont->devfonts[1];
|
||||
|
||||
if (devfont->charset_ops->bidi_char_type) {
|
||||
return devfont->charset_ops->bidi_char_type (chv);
|
||||
}
|
||||
else {
|
||||
return BIDI_TYPE_LTR;
|
||||
bidi_type = devfont->charset_ops->bidi_char_type (chv);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return ascii_bidi_type[chv];
|
||||
assert(chv < 0x80);
|
||||
bidi_type = ascii_bidi_type[chv];
|
||||
}
|
||||
|
||||
_DBG_PRINTF("chv: %X: bidi_type: %x\n", chv, bidi_type);
|
||||
return bidi_type;
|
||||
|
||||
}
|
||||
static int get_text_rl_type (PLOGFONT logfont, char* newtext, int l_char_type,
|
||||
int r_char_type, int line_type)
|
||||
@@ -1108,53 +1112,60 @@ static int get_text_rl_type (PLOGFONT logfont, char* newtext, int l_char_type,
|
||||
Achar32 chv;
|
||||
chv = GetACharValue (logfont, newtext, strlen(newtext), NULL, 0);
|
||||
|
||||
if (chv == INV_ACHAR_VALUE)
|
||||
return -1;
|
||||
int type = CHAR_TYPE_UNKKOWN;
|
||||
|
||||
if (chv == INV_ACHAR_VALUE) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
bidi_type = get_char_bidi_type (logfont, chv);
|
||||
|
||||
if (BIDI_IS_STRONG(bidi_type))
|
||||
{
|
||||
if (BIDI_IS_RTL(bidi_type))
|
||||
{
|
||||
return CHAR_TYPE_RTL;
|
||||
if (BIDI_IS_STRONG(bidi_type)) {
|
||||
if (BIDI_IS_RTL(bidi_type)) {
|
||||
type = CHAR_TYPE_RTL;
|
||||
goto done;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CHAR_TYPE_LTR;
|
||||
else {
|
||||
type = CHAR_TYPE_LTR;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (BIDI_IS_NUMBER(bidi_type))
|
||||
{
|
||||
return CHAR_TYPE_LTR;
|
||||
if (BIDI_IS_NUMBER(bidi_type)) {
|
||||
type = CHAR_TYPE_LTR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (l_char_type == r_char_type)
|
||||
{
|
||||
return l_char_type;
|
||||
if (l_char_type == r_char_type) {
|
||||
type = l_char_type;
|
||||
goto done;
|
||||
}
|
||||
/* no left char */
|
||||
else if (l_char_type == -1)
|
||||
{
|
||||
else if (l_char_type == CHAR_TYPE_UNKKOWN) {
|
||||
if (BIDI_IS_WEAK (bidi_type))
|
||||
return r_char_type;
|
||||
type = r_char_type;
|
||||
else
|
||||
return line_type;
|
||||
type = line_type;
|
||||
goto done;
|
||||
}
|
||||
/* no right char */
|
||||
else if (r_char_type == -1)
|
||||
{
|
||||
else if (r_char_type == CHAR_TYPE_UNKKOWN) {
|
||||
if (BIDI_IS_WEAK (bidi_type))
|
||||
return l_char_type;
|
||||
type = l_char_type;
|
||||
else
|
||||
return line_type;
|
||||
type = line_type;
|
||||
goto done;
|
||||
}
|
||||
else
|
||||
{
|
||||
return line_type;
|
||||
else {
|
||||
type = line_type;
|
||||
}
|
||||
|
||||
_DBG_PRINTF("l_char_type: %d, r_char_type: %d, line_type: %d, "
|
||||
"type for %X: %d\n",
|
||||
l_char_type, r_char_type, line_type, chv, type);
|
||||
|
||||
done:
|
||||
return type;
|
||||
}
|
||||
|
||||
static int get_line_rl_type (ACHARMAPINFO* map, int len)
|
||||
@@ -2133,7 +2144,7 @@ esright_input_char_refresh (HWND hWnd,
|
||||
scroll_rc.right = cur_caret_x;
|
||||
|
||||
ScrollWindow(hWnd, -scroll_len, 0, &scroll_rc, NULL);
|
||||
UpdateWindow(hWnd, FALSE);
|
||||
UpdateInvalidClient(hWnd, TRUE);
|
||||
edtSetCaretPos (hWnd, sled);
|
||||
|
||||
sled->changed = TRUE;
|
||||
@@ -2504,8 +2515,6 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
unsigned char charBuffer [4];
|
||||
int chars;
|
||||
|
||||
_DBG_PRINTF("get char-----------------char----%p\n", (PVOID)wParam);
|
||||
|
||||
if (dwStyle & ES_READONLY)
|
||||
return 0;
|
||||
|
||||
@@ -2526,9 +2535,6 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
else {
|
||||
chars = 1;
|
||||
|
||||
if (charBuffer [0] == 127) // BS
|
||||
charBuffer [0] = '\b';
|
||||
|
||||
if (dwStyle & ES_UPPERCASE) {
|
||||
charBuffer [0] = toupper (charBuffer[0]);
|
||||
}
|
||||
@@ -2537,12 +2543,12 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
}
|
||||
|
||||
if (chars == 1) {
|
||||
if (charBuffer [0] < 0x20 && charBuffer[0] != '\b') //FIXME
|
||||
return 0;
|
||||
if (chars > 1) {
|
||||
_WRN_PRINTF("BIDISLEDIT only support ISO8859-6 charset\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (wParam == '\b') { // backspace
|
||||
else if (charBuffer [0] == '\b' || charBuffer [0] == 0x7F) {
|
||||
// BS or DEL
|
||||
int del = 1;
|
||||
|
||||
if (sled->editPos == 0 && sled->selStart == sled->selEnd)
|
||||
@@ -2564,9 +2570,12 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
sleBackspaceText (hWnd, sled, del, FALSE, FALSE);
|
||||
}
|
||||
}
|
||||
else{
|
||||
else if (charBuffer [0] < 0x20) {
|
||||
// ignore all other control characters.
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
if (dwStyle & ES_LEFT) {
|
||||
//if ((dwStyle&0xffff) == ES_LEFT) {
|
||||
esleft_input_char_refresh(hWnd, sled, (char*)charBuffer, chars);
|
||||
set_edit_caret_pos(hWnd, sled);
|
||||
|
||||
@@ -2586,6 +2595,7 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
sleInsertText (hWnd, sled, (char* )charBuffer, chars, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+8
-11
@@ -1678,7 +1678,7 @@ esright_input_char_refresh (HWND hWnd,
|
||||
scroll_rc.right = cur_caret_x;
|
||||
|
||||
ScrollWindow(hWnd, -scroll_len, 0, &scroll_rc, NULL);
|
||||
UpdateWindow(hWnd, FALSE);
|
||||
UpdateInvalidClient(hWnd, TRUE);
|
||||
edtSetCaretPos (hWnd, sled);
|
||||
|
||||
sled->changed = TRUE;
|
||||
@@ -2143,9 +2143,6 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
else {
|
||||
chars = 1;
|
||||
|
||||
if (charBuffer [0] == 127) // BS
|
||||
charBuffer [0] = '\b';
|
||||
|
||||
if (dwStyle & ES_UPPERCASE) {
|
||||
charBuffer [0] = toupper (charBuffer[0]);
|
||||
}
|
||||
@@ -2154,12 +2151,8 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
}
|
||||
|
||||
if (chars == 1) {
|
||||
if (charBuffer [0] < 0x20 && charBuffer[0] != '\b') //FIXME
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (charBuffer[0] == '\b') { //backspace
|
||||
if (chars == 1 && (charBuffer[0] == '\b' || charBuffer[0] == 0x7F)) {
|
||||
// ASCII BS or DEL
|
||||
int del;
|
||||
|
||||
if (sled->editPos == 0 && sled->selStart == sled->selEnd)
|
||||
@@ -2184,7 +2177,11 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
sleInsertText (hWnd, sled, NULL, del);
|
||||
}
|
||||
}
|
||||
else{
|
||||
else if (chars == 1 && charBuffer [0] < 0x20) {
|
||||
// ignore all other ASCII control characters.
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
if (dwStyle & ES_LEFT) {
|
||||
esleft_input_char_refresh(hWnd, sled, (char*)charBuffer, chars);
|
||||
set_edit_caret_pos(hWnd, sled);
|
||||
|
||||
@@ -404,7 +404,7 @@ void mglist_set_itemops (MgList *mglst, PMGITEMOPS 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)
|
||||
{
|
||||
switch (message) {
|
||||
|
||||
@@ -140,7 +140,7 @@ struct _MgList
|
||||
|
||||
/* ------------------------- 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);
|
||||
|
||||
MG_EXPORT SVITEM_DRAWFUNC mglist_set_itemdraw (MgList *mglst, SVITEM_DRAWFUNC draw_func);
|
||||
|
||||
@@ -172,6 +172,10 @@ BOOL scrolled_set_cont_pos (HWND hWnd, PSCRDATA pscrdata, int cont_x, int cont_y
|
||||
SetScrollPos (hWnd, SB_VERT, cont_y);
|
||||
bChange = TRUE;
|
||||
}
|
||||
|
||||
if (bChange)
|
||||
UpdateInvalidClient(hWnd, FALSE);
|
||||
|
||||
return bChange;
|
||||
}
|
||||
|
||||
@@ -585,7 +589,7 @@ int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h)
|
||||
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;
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ typedef struct _scrdata
|
||||
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 void scrolled_destroy (PSCRDATA pscrdata);
|
||||
MG_EXPORT void scrolled_hscroll (HWND hWnd, PSCRDATA pscrdata, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
@@ -2096,7 +2096,6 @@ static void teOnChar (HWND hWnd, PTEDATA ptedata, WPARAM wParam)
|
||||
rcInv.right = ptedata->svdata.scrdata.nContWidth;
|
||||
rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH;
|
||||
REFRESH_NODE_EX(node, &rcInv);
|
||||
// UpdateWindow(hWnd, FALSE);
|
||||
|
||||
newlinenr = NODE_LINENR(node);
|
||||
rcInv.left = 0;
|
||||
@@ -2104,12 +2103,10 @@ static void teOnChar (HWND hWnd, PTEDATA ptedata, WPARAM wParam)
|
||||
rcInv.top += ptedata->nLineHeight;
|
||||
rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH;
|
||||
REFRESH_NODE_EX(node, &rcInv);
|
||||
// UpdateWindow(hWnd, FALSE);
|
||||
}
|
||||
/* houhh 20090814, UpdataWindow will invalidate all edit area, but
|
||||
* erase area is not same with msg_paint area.*/
|
||||
UpdateWindow(hWnd, FALSE);
|
||||
//SendMessage(hWnd, MSG_PAINT, 0, 0);
|
||||
UpdateInvalidClient(hWnd, TRUE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -80,17 +80,17 @@ static void update_viewport (gvGridViewData *view, int from, int to, int is_row)
|
||||
{
|
||||
RECT r;
|
||||
|
||||
GetClientRect (view->hCtrl, &r);
|
||||
GetClientRect(view->hCtrl, &r);
|
||||
|
||||
if (is_row) {
|
||||
r.top = from;
|
||||
ScrollWindow (view->hCtrl, 0, to, &r, NULL);
|
||||
ScrollWindow(view->hCtrl, 0, to, &r, NULL);
|
||||
}
|
||||
else {
|
||||
r.left = from;
|
||||
ScrollWindow (view->hCtrl, to, 0, &r, NULL);
|
||||
ScrollWindow(view->hCtrl, to, 0, &r, NULL);
|
||||
}
|
||||
UpdateWindow(view->hCtrl, FALSE);
|
||||
UpdateInvalidClient(view->hCtrl, FALSE);
|
||||
}
|
||||
|
||||
// scroll function {{{
|
||||
|
||||
+10
-17
@@ -93,14 +93,15 @@ BOOL RegisterTreeViewControl (void)
|
||||
const WINDOW_ELEMENT_RENDERER * rdr =
|
||||
GetDefaultWindowElementRenderer();
|
||||
|
||||
|
||||
if (!(icon_fold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name, SYSICON_FOLD, szValue)))) {
|
||||
if (!(icon_fold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name,
|
||||
SYSICON_FOLD, szValue)))) {
|
||||
if (!(icon_fold = LoadSystemIcon (SYSICON_FOLD, 0))) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(icon_unfold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name, SYSICON_UNFOLD, szValue)))) {
|
||||
if (!(icon_unfold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name,
|
||||
SYSICON_UNFOLD, szValue)))) {
|
||||
if (!(icon_unfold = LoadSystemIcon (SYSICON_UNFOLD, 0))) {
|
||||
DestroyIcon (icon_fold);
|
||||
icon_fold = 0;
|
||||
@@ -180,6 +181,7 @@ static BOOL tvInitTVData (HWND hwnd, PTVDATA pData, DWORD dwStyle, PTVITEMINFO r
|
||||
tvRoot->hIconFold = root_ii->hIconFold;
|
||||
else
|
||||
tvRoot->hIconFold = ICON_FOLD;
|
||||
|
||||
if (root_ii && root_ii->hIconUnfold)
|
||||
tvRoot->hIconUnfold = root_ii->hIconUnfold;
|
||||
else
|
||||
@@ -632,22 +634,13 @@ static void tvDrawItem (HWND hWnd, HDC hdc, PTVDATA pData, int centerX, int cent
|
||||
centerX += (h>>1) + TV_BOXGAP;
|
||||
|
||||
if (pData->dwStyle & TVS_WITHICON) {
|
||||
if (!(pData->dwStyle & TVS_ICONFORSELECT)
|
||||
&& (!p->child || (p->dwFlags & TVIF_FOLD))) {
|
||||
if (p->child != NULL && (p->dwFlags & TVIF_FOLD)) {
|
||||
if ((p->hIconFold)) {
|
||||
DrawIcon (hdc, centerX, centerY - (h>>1),
|
||||
h, h, p->hIconFold);
|
||||
}
|
||||
} else if ((pData->dwStyle & TVS_ICONFORSELECT) && p->dwFlags & TVIF_SELECTED) {
|
||||
if ((p->hIconFold)) {
|
||||
DrawIcon (hdc, centerX, centerY - (h>>1),
|
||||
h, h, p->hIconFold);
|
||||
}
|
||||
} else
|
||||
if ((p->hIconUnfold)) {
|
||||
DrawIcon (hdc, centerX, centerY - (h>>1),
|
||||
h, h, p->hIconUnfold);
|
||||
DrawIcon (hdc, centerX, centerY - (h>>1), h, h, p->hIconFold);
|
||||
}
|
||||
} else if ((p->hIconUnfold)) {
|
||||
DrawIcon (hdc, centerX, centerY - (h>>1), h, h, p->hIconUnfold);
|
||||
}
|
||||
centerX += h + TV_ICONGAP;
|
||||
}
|
||||
|
||||
|
||||
@@ -202,6 +202,17 @@ static void destroy (GLYPHTREENODE *root)
|
||||
|
||||
/*** 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)
|
||||
{
|
||||
return DEVFONTGLYPHTYPE_PRERDRBMP;
|
||||
@@ -380,6 +391,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
|
||||
/**************************** Global data ************************************/
|
||||
FONTOPS __mg_bitmap_font_ops = {
|
||||
get_feature,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
|
||||
+19
-16
@@ -15,7 +15,7 @@
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* 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
|
||||
|
||||
/* must attetion the para s is arabic chv value.*/
|
||||
#if 0
|
||||
static int is_arabic_char_vowel(Uint8 c)
|
||||
{
|
||||
|
||||
@@ -240,6 +240,7 @@ static int is_arabic_char_vowel(Uint8 c)
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ISO8859-6 charset vowel relative define and judge */
|
||||
#define ISARABIC_VOWEL(s) ((s >= FATHATAN) && (s <= SUKUN))
|
||||
@@ -461,15 +462,18 @@ static int iso8859_6_len_first_char (const unsigned char* mstr, int len)
|
||||
return 2;
|
||||
else if (ignore == 2)
|
||||
return 3;
|
||||
else
|
||||
return 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define ISARABIC_LIG_HALF(s) ((s == 0xa5) || (s == 0xa6))
|
||||
|
||||
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;
|
||||
|
||||
if (is_arabic_char_vowel (chv)) { /* is vowel */
|
||||
@@ -480,10 +484,10 @@ static unsigned int iso8859_6_char_type (Achar32 chv)
|
||||
}
|
||||
|
||||
return ch_type;
|
||||
#endif
|
||||
}
|
||||
|
||||
static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
|
||||
#if 0
|
||||
/*0x00~0x0f*/
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
@@ -531,7 +535,6 @@ static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN,
|
||||
#endif
|
||||
|
||||
/*0x80~0x8f*/
|
||||
BIDI_TYPE_ON, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
|
||||
@@ -606,10 +609,9 @@ static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
|
||||
static BidiType iso8859_6_bidi_char_type (Achar32 chv)
|
||||
{
|
||||
chv = REAL_ACHAR(chv);
|
||||
if (chv > 0x7F)
|
||||
return (BidiType)__mg_iso8859_6_bidi_char_type_map[chv - 0x80];
|
||||
else
|
||||
return (BidiType)__mg_iso8859_1_bidi_char_type_map[chv];
|
||||
assert(chv < TABLESIZE(__mg_iso8859_6_bidi_char_type_map));
|
||||
|
||||
return (BidiType)__mg_iso8859_6_bidi_char_type_map[chv];
|
||||
}
|
||||
|
||||
static int get_table_index(Uint8 c)
|
||||
@@ -796,7 +798,7 @@ static const unsigned char* iso8859_6_get_next_word (const unsigned char* mstr,
|
||||
static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
|
||||
int cur_len, int shape_type)
|
||||
{
|
||||
Achar32 chv = -1;
|
||||
Achar32 chv = INV_ACHAR_VALUE;
|
||||
int ignore;
|
||||
int index;
|
||||
|
||||
@@ -811,15 +813,14 @@ static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
|
||||
}
|
||||
}
|
||||
|
||||
if (chv == -1 || chv == 0) {
|
||||
if (chv == INV_ACHAR_VALUE || chv == 0) {
|
||||
if (ISARABIC_VOWEL(*cur_mchar)){
|
||||
chv = fontset_68x_get_vowel_char(*cur_mchar);
|
||||
}
|
||||
|
||||
if (chv == 0 || chv == -1) {
|
||||
if (chv == 0 || chv == INV_ACHAR_VALUE) {
|
||||
index = get_table_index(*cur_mchar);
|
||||
if (index >=0)
|
||||
{
|
||||
if (index >=0 ) {
|
||||
switch (shape_type) {
|
||||
case ACHAR_ISOLATED:
|
||||
chv = shape_info[index].isolated;
|
||||
@@ -841,7 +842,7 @@ static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
|
||||
}
|
||||
|
||||
if (chv == 0)
|
||||
chv =-1;
|
||||
chv = INV_ACHAR_VALUE;
|
||||
|
||||
return chv;
|
||||
}
|
||||
@@ -862,6 +863,7 @@ static const BIDICHAR_MIRROR_MAP __mg_iso8859_68x_mirror_table [] =
|
||||
|
||||
static BOOL iso8859_6_bidi_mirror_char (Achar32 chv, Achar32* mirrored)
|
||||
{
|
||||
chv = REAL_ACHAR(chv);
|
||||
return get_mirror_char (__mg_iso8859_68x_mirror_table,
|
||||
TABLESIZE (__mg_iso8859_68x_mirror_table), chv, mirrored);
|
||||
}
|
||||
@@ -871,6 +873,7 @@ static CHARSETOPS CharsetOps_iso8859_6 = {
|
||||
3,
|
||||
FONT_CHARSET_ISO8859_6,
|
||||
0,
|
||||
1,
|
||||
iso8859_6_len_first_char,
|
||||
iso8859_6_get_char_value,
|
||||
iso8859_6_get_shaped_char_value,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* 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;
|
||||
else if (break_type == UCHAR_BREAK_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))
|
||||
mchar_type = ACHAR_BASIC_ZEROWIDTH;
|
||||
else if ((chv >= 0x1160 && chv < 0x1200)
|
||||
@@ -239,10 +241,36 @@ static const BidiType linear_enum_to_bidi_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)
|
||||
{
|
||||
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)
|
||||
@@ -628,6 +656,7 @@ CHARSETOPS __mg_CharsetOps_utf8 = {
|
||||
6,
|
||||
FONT_CHARSET_UTF8,
|
||||
0,
|
||||
0,
|
||||
utf8_len_first_char,
|
||||
utf8_get_char_value,
|
||||
NULL,
|
||||
@@ -854,6 +883,7 @@ CHARSETOPS __mg_CharsetOps_utf16le = {
|
||||
4,
|
||||
FONT_CHARSET_UTF16LE,
|
||||
0,
|
||||
0,
|
||||
utf16le_len_first_char,
|
||||
utf16le_get_char_value,
|
||||
NULL,
|
||||
@@ -1080,6 +1110,7 @@ CHARSETOPS __mg_CharsetOps_utf16be = {
|
||||
4,
|
||||
FONT_CHARSET_UTF16BE,
|
||||
0,
|
||||
0,
|
||||
utf16be_len_first_char,
|
||||
utf16be_get_char_value,
|
||||
NULL,
|
||||
|
||||
+30
-7
@@ -15,7 +15,7 @@
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -49,6 +49,8 @@
|
||||
** Create date: 2000/06/13
|
||||
*/
|
||||
|
||||
#undef NDEBUG
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -233,6 +235,7 @@ static CHARSETOPS CharsetOps_ascii = {
|
||||
1,
|
||||
FONT_CHARSET_US_ASCII,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -296,6 +299,7 @@ static CHARSETOPS CharsetOps_iso8859_1 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_1,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -407,6 +411,7 @@ static CHARSETOPS CharsetOps_iso8859_2 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_2,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -519,6 +524,7 @@ static CHARSETOPS CharsetOps_iso8859_3 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_3,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -632,6 +638,7 @@ static CHARSETOPS CharsetOps_iso8859_4 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_4,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -726,6 +733,7 @@ static CHARSETOPS CharsetOps_iso8859_5 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_5,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -884,6 +892,7 @@ static CHARSETOPS CharsetOps_iso8859_7 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_7,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -969,7 +978,6 @@ static const unsigned char* iso8859_8_get_next_word (const unsigned char* mstr,
|
||||
}
|
||||
|
||||
static BidiType __mg_iso8859_8_bidi_char_type_map[] = {
|
||||
#if 0
|
||||
/*0x00~0x0f*/
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
@@ -1017,7 +1025,6 @@ static BidiType __mg_iso8859_8_bidi_char_type_map[] = {
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN,
|
||||
#endif
|
||||
|
||||
/*0x80~0x8f*/
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
@@ -1072,10 +1079,9 @@ static BidiType __mg_iso8859_8_bidi_char_type_map[] = {
|
||||
static BidiType iso8859_8_bidi_char_type (Achar32 chv)
|
||||
{
|
||||
chv = REAL_ACHAR(chv);
|
||||
if (chv > 0x7F)
|
||||
return (BidiType)__mg_iso8859_8_bidi_char_type_map[chv - 0x80];
|
||||
else
|
||||
return (BidiType)__mg_iso8859_1_bidi_char_type_map[chv];
|
||||
assert(chv < TABLESIZE(__mg_iso8859_8_bidi_char_type_map));
|
||||
|
||||
return (BidiType)__mg_iso8859_8_bidi_char_type_map[chv];
|
||||
}
|
||||
|
||||
static const BIDICHAR_MIRROR_MAP __mg_iso8859_8_mirror_table [] =
|
||||
@@ -1160,6 +1166,7 @@ static CHARSETOPS CharsetOps_iso8859_8 = {
|
||||
2, // This is a trick for bidi reorder only implemented for MBC.
|
||||
FONT_CHARSET_ISO8859_8,
|
||||
0,
|
||||
1,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -1261,6 +1268,7 @@ static CHARSETOPS CharsetOps_iso8859_9 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_9,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -1374,6 +1382,7 @@ static CHARSETOPS CharsetOps_iso8859_10 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_10,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -1486,6 +1495,7 @@ static CHARSETOPS CharsetOps_iso8859_11 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_11,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -1598,6 +1608,7 @@ static CHARSETOPS CharsetOps_iso8859_13 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_13,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -1710,6 +1721,7 @@ static CHARSETOPS CharsetOps_iso8859_14 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_14,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -1821,6 +1833,7 @@ static CHARSETOPS CharsetOps_iso8859_15 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_15,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -1971,6 +1984,7 @@ static CHARSETOPS CharsetOps_iso8859_16 = {
|
||||
1,
|
||||
FONT_CHARSET_ISO8859_16,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -2168,6 +2182,7 @@ static CHARSETOPS CharsetOps_gb2312_0 = {
|
||||
2,
|
||||
FONT_CHARSET_GB2312_0,
|
||||
0,
|
||||
0,
|
||||
gb2312_0_len_first_char,
|
||||
gb2312_0_get_char_value,
|
||||
NULL,
|
||||
@@ -2325,6 +2340,7 @@ static CHARSETOPS CharsetOps_gbk = {
|
||||
2,
|
||||
FONT_CHARSET_GBK,
|
||||
0,
|
||||
0,
|
||||
gbk_len_first_char,
|
||||
gbk_get_char_value,
|
||||
NULL,
|
||||
@@ -2593,6 +2609,7 @@ static CHARSETOPS CharsetOps_gb18030_0 = {
|
||||
4,
|
||||
FONT_CHARSET_GB18030_0,
|
||||
0,
|
||||
0,
|
||||
gb18030_0_len_first_char,
|
||||
gb18030_0_get_char_value,
|
||||
NULL,
|
||||
@@ -2750,6 +2767,7 @@ static CHARSETOPS CharsetOps_big5 = {
|
||||
2,
|
||||
FONT_CHARSET_BIG5,
|
||||
0,
|
||||
0,
|
||||
big5_len_first_char,
|
||||
big5_get_char_value,
|
||||
NULL,
|
||||
@@ -2896,6 +2914,7 @@ static CHARSETOPS CharsetOps_ksc5601_0 = {
|
||||
2,
|
||||
FONT_CHARSET_EUCKR,
|
||||
0,
|
||||
0,
|
||||
ksc5601_0_len_first_char,
|
||||
ksc5601_0_get_char_value,
|
||||
NULL,
|
||||
@@ -3020,6 +3039,7 @@ static CHARSETOPS CharsetOps_jisx0201_0 = {
|
||||
1,
|
||||
FONT_CHARSET_JISX0201_0,
|
||||
0,
|
||||
0,
|
||||
jisx0201_0_len_first_char,
|
||||
jisx0201_0_get_char_value,
|
||||
NULL,
|
||||
@@ -3163,6 +3183,7 @@ static CHARSETOPS CharsetOps_jisx0208_0 = {
|
||||
2,
|
||||
FONT_CHARSET_JISX0208_0,
|
||||
0,
|
||||
0,
|
||||
jisx0208_0_len_first_char,
|
||||
jisx0208_0_get_char_value,
|
||||
NULL,
|
||||
@@ -3248,6 +3269,7 @@ static CHARSETOPS CharsetOps_jisx0201_1 = {
|
||||
1,
|
||||
FONT_CHARSET_JISX0201_1,
|
||||
0,
|
||||
0,
|
||||
sb_len_first_char,
|
||||
sb_get_char_value,
|
||||
NULL,
|
||||
@@ -3419,6 +3441,7 @@ static CHARSETOPS CharsetOps_jisx0208_1 = {
|
||||
2,
|
||||
FONT_CHARSET_JISX0208_1,
|
||||
0,
|
||||
0,
|
||||
jisx0208_1_len_first_char,
|
||||
jisx0208_1_get_char_value,
|
||||
NULL,
|
||||
|
||||
@@ -255,6 +255,17 @@ compute_kernval (TTFINSTANCEINFO* ttf_inst_info)
|
||||
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)
|
||||
{
|
||||
if (logfont->style & FS_WEIGHT_BOOK)
|
||||
@@ -792,6 +803,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
||||
}
|
||||
/**************************** Global data ************************************/
|
||||
FONTOPS __mg_ttf_ops = {
|
||||
get_feature,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
|
||||
@@ -197,6 +197,17 @@ print_bitmap_grey (const BYTE* buffer, int width, int rows, int pitch)
|
||||
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)
|
||||
{
|
||||
switch (logfont->style & FS_RENDER_MASK) {
|
||||
@@ -1265,6 +1276,7 @@ void font_TermFreetypeLibrary (void)
|
||||
|
||||
/**************************** Global data ************************************/
|
||||
FONTOPS __mg_ttf_ops = {
|
||||
get_feature,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
|
||||
+15
-9
@@ -703,21 +703,20 @@ void __mg_legacy_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
|
||||
print_hexstr(achars, len, TRUE);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void bidi_map_reverse (void* context, int len, int pos)
|
||||
{
|
||||
GLYPHMAPINFO* str = (GLYPHMAPINFO*)context + pos;
|
||||
ACHARMAPINFO* str = (ACHARMAPINFO*)context + pos;
|
||||
int i;
|
||||
for (i = 0; i < len / 2; i++)
|
||||
{
|
||||
GLYPHMAPINFO tmp = str[i];
|
||||
ACHARMAPINFO tmp = str[i];
|
||||
str[i] = str[len - 1 - i];
|
||||
str[len - 1 - i] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len, GLYPHMAPINFO* map, int pel)
|
||||
Achar32* achars, int len, int pel, ACHARMAPINFO* map)
|
||||
{
|
||||
BYTE max_level = 1;
|
||||
TYPERUN *type_rl_list = NULL;
|
||||
@@ -725,6 +724,7 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
|
||||
int i;
|
||||
int run_pos;
|
||||
int run_len;
|
||||
REORDER_CONTEXT rc;
|
||||
|
||||
print_hexstr(achars, len, FALSE);
|
||||
|
||||
@@ -735,14 +735,15 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
|
||||
run_pos = node_p->pos;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
bidi_reorder_cb(map, len, &type_rl_list, max_level,
|
||||
bidi_map_reverse);
|
||||
rc.achars = NULL;
|
||||
rc.extra = map;
|
||||
rc.cb = bidi_map_reverse;
|
||||
bidi_reorder(&rc, len, &type_rl_list, max_level);
|
||||
|
||||
/* free typerun list.*/
|
||||
free_typerun_list(type_rl_list);
|
||||
@@ -752,18 +753,23 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
|
||||
return achars;
|
||||
}
|
||||
|
||||
#if 0
|
||||
Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len, int* index_map, int pel)
|
||||
{
|
||||
BYTE max_level = 1;
|
||||
TYPERUN *type_rl_list = NULL;
|
||||
REORDER_CONTEXT rc;
|
||||
|
||||
print_hexstr(achars, len, FALSE);
|
||||
|
||||
/* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */
|
||||
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list, &max_level);
|
||||
|
||||
bidi_reorder_cb(index_map, len, &type_rl_list, max_level,
|
||||
rc.achars = achars;
|
||||
rc.extra = extra;
|
||||
rc.cb = cb_reverse_extra;
|
||||
bidi_reorder(index_map, len, &type_rl_list, max_level,
|
||||
bidi_string_reverse);
|
||||
|
||||
/* free typerun list.*/
|
||||
|
||||
@@ -66,6 +66,17 @@
|
||||
#define NUF_WIDTH 8
|
||||
#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)
|
||||
{
|
||||
return DEVFONTGLYPHTYPE_MONOBMP;
|
||||
@@ -171,6 +182,7 @@ static void unload_font_data (DEVFONT* devfont, void* data)
|
||||
}
|
||||
|
||||
FONTOPS __mg_null_font_ops = {
|
||||
get_feature,
|
||||
get_glyph_bmptype,
|
||||
get_ave_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_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)
|
||||
{
|
||||
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 ************************************/
|
||||
FONTOPS __mg_qpf_ops = {
|
||||
get_feature,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
|
||||
@@ -151,6 +151,17 @@ static void unload_font_data (DEVFONT* devfont, void* data)
|
||||
|
||||
/*************** 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)
|
||||
{
|
||||
return DEVFONTGLYPHTYPE_MONOBMP;
|
||||
@@ -280,6 +291,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
||||
|
||||
/**************************** Global data ************************************/
|
||||
FONTOPS __mg_rbf_ops = {
|
||||
get_feature,
|
||||
get_glyph_bmptype,
|
||||
get_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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (logfont->style & FS_WEIGHT_BOOK)
|
||||
@@ -598,6 +609,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
||||
|
||||
/**************************** Global data ************************************/
|
||||
static FONTOPS scripteasy_font_ops = {
|
||||
get_feature,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
|
||||
+4
-1
@@ -155,7 +155,10 @@ BOOL mg_InitSysFont (void)
|
||||
goto error_load;
|
||||
}
|
||||
|
||||
if ((sys_fonts[i] = CreateLogFont (type, family, charset,
|
||||
/* VW 20221003: use CreateLogFontEx instead of CreateLogFont to
|
||||
follow the new style convention of font name,
|
||||
but the orientation is ignored for the system logfont. */
|
||||
if ((sys_fonts[i] = CreateLogFontEx (type, family, charset,
|
||||
style [0], style [1], style [2],
|
||||
style [3], style [4], style [5],
|
||||
height, 0)) == NULL) {
|
||||
|
||||
@@ -377,8 +377,8 @@ static _GBType resolve_gbt(struct break_ctxt* ctxt,
|
||||
uc == 0x8E2 || uc == 0xD4E || uc == 0x110BD ||
|
||||
(uc >= 0x111C2 && uc <= 0x111C3)) {
|
||||
gbt = GB_Prepend;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case UCHAR_CATEGORY_CONTROL:
|
||||
case UCHAR_CATEGORY_LINE_SEPARATOR:
|
||||
@@ -393,8 +393,8 @@ static _GBType resolve_gbt(struct break_ctxt* ctxt,
|
||||
if ((uc >= 0xFFF0 && uc <= 0xFFF8) ||
|
||||
(uc >= 0xE0000 && uc <= 0xE0FFF)) {
|
||||
gbt = GB_ControlCRLF;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case UCHAR_CATEGORY_OTHER_LETTER:
|
||||
if (ctxt->makes_hangul_syllable)
|
||||
@@ -434,7 +434,6 @@ static _GBType resolve_gbt(struct break_ctxt* ctxt,
|
||||
gbt = GB_RI_Odd;
|
||||
else
|
||||
gbt = GB_RI_Odd;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -148,6 +148,17 @@ static void unload_font_data (DEVFONT* devfont, void* 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)
|
||||
{
|
||||
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 = {
|
||||
get_feature,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
|
||||
@@ -109,6 +109,17 @@ typedef struct _FONT_PROPT {
|
||||
int def_glyph;
|
||||
} 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)
|
||||
{
|
||||
return DEVFONTGLYPHTYPE_MONOBMP;
|
||||
@@ -477,6 +488,7 @@ static void unload_font_data (DEVFONT* devfont, void* data)
|
||||
}
|
||||
|
||||
FONTOPS __mg_vbf_ops = {
|
||||
get_feature,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
|
||||
+59
-18
@@ -59,17 +59,22 @@
|
||||
#include "cliprect.h"
|
||||
#include "gal.h"
|
||||
#include "internals.h"
|
||||
#include "dc.h"
|
||||
|
||||
BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
|
||||
{
|
||||
PMAINWIN pWin;
|
||||
|
||||
pWin = (PMAINWIN)hWnd;
|
||||
|
||||
if (!pWin->pCaretInfo) {
|
||||
HDC hdc;
|
||||
|
||||
if (!(pWin->pCaretInfo = malloc (sizeof (CARETINFO))))
|
||||
return FALSE;
|
||||
|
||||
/* Since 5.0.11: use client DC of the window instead of screen DC */
|
||||
hdc = GetClientDC(hWnd);
|
||||
|
||||
pWin->pCaretInfo->pBitmap = pBitmap;
|
||||
if (pBitmap) {
|
||||
nWidth = pBitmap->bmWidth;
|
||||
@@ -78,18 +83,22 @@ BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
|
||||
pWin->pCaretInfo->nWidth = nWidth;
|
||||
pWin->pCaretInfo->nHeight = nHeight;
|
||||
pWin->pCaretInfo->caret_bmp.bmType = BMP_TYPE_NORMAL;
|
||||
pWin->pCaretInfo->caret_bmp.bmBitsPerPixel = BITSPERPHYPIXEL;
|
||||
pWin->pCaretInfo->caret_bmp.bmBytesPerPixel = BYTESPERPHYPIXEL;
|
||||
pWin->pCaretInfo->caret_bmp.bmBitsPerPixel =
|
||||
GetGDCapability(hdc, GDCAP_BITSPP);
|
||||
pWin->pCaretInfo->caret_bmp.bmBytesPerPixel =
|
||||
GetGDCapability(hdc, GDCAP_BPP);
|
||||
pWin->pCaretInfo->caret_bmp.bmWidth = nWidth;
|
||||
pWin->pCaretInfo->caret_bmp.bmHeight = nHeight;
|
||||
pWin->pCaretInfo->caret_bmp.bmAlphaMask = NULL;
|
||||
pWin->pCaretInfo->caret_bmp.bmAlphaPitch = 0;
|
||||
|
||||
pWin->pCaretInfo->nBytesNr = GAL_GetBoxSize (__gal_screen,
|
||||
pWin->pCaretInfo->nBytesNr = GAL_GetBoxSize (dc_HDC2PDC(hdc)->surface,
|
||||
nWidth, nHeight, &pWin->pCaretInfo->caret_bmp.bmPitch);
|
||||
pWin->pCaretInfo->pNormal = malloc (pWin->pCaretInfo->nBytesNr);
|
||||
pWin->pCaretInfo->pXored = malloc (pWin->pCaretInfo->nBytesNr);
|
||||
|
||||
ReleaseDC(hdc);
|
||||
|
||||
if (pWin->pCaretInfo->pNormal == NULL ||
|
||||
pWin->pCaretInfo->pXored == NULL) {
|
||||
free (pWin->pCaretInfo);
|
||||
@@ -219,8 +228,8 @@ void GetCaretBitmaps (PCARETINFO pCaretInfo)
|
||||
int i;
|
||||
int sx, sy;
|
||||
HDC hdc;
|
||||
Uint32 amask;
|
||||
|
||||
// convert to screen coordinates
|
||||
sx = pCaretInfo->x;
|
||||
sy = pCaretInfo->y;
|
||||
|
||||
@@ -231,36 +240,68 @@ void GetCaretBitmaps (PCARETINFO pCaretInfo)
|
||||
pCaretInfo->caret_bmp.bmWidth,
|
||||
pCaretInfo->caret_bmp.bmHeight,
|
||||
&pCaretInfo->caret_bmp);
|
||||
amask = GetGDCapability(hdc, GDCAP_AMASK);
|
||||
ReleaseDC (hdc);
|
||||
|
||||
// generate XOR bitmap.
|
||||
if (pCaretInfo->pBitmap) {
|
||||
if (amask == 0) {
|
||||
BYTE* normal;
|
||||
BYTE* bitmap;
|
||||
BYTE* xored;
|
||||
|
||||
normal = pCaretInfo->pNormal;
|
||||
bitmap = pCaretInfo->pBitmap->bmBits;
|
||||
xored = pCaretInfo->pXored;
|
||||
|
||||
for (i = 0; i < pCaretInfo->nBytesNr; i++)
|
||||
xored[i] = normal[i] ^ bitmap[i];
|
||||
if (pCaretInfo->pBitmap) {
|
||||
bitmap = pCaretInfo->pBitmap->bmBits;
|
||||
for (i = 0; i < pCaretInfo->nBytesNr; i++)
|
||||
xored[i] = normal[i] ^ bitmap[i];
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < pCaretInfo->nBytesNr; i++)
|
||||
xored[i] = normal[i] ^ 0xFF;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Since 5.0.11: restore the alpha component if having alpha component.
|
||||
int x, y;
|
||||
BYTE* normal;
|
||||
BYTE* xored;
|
||||
BYTE xor_byte;
|
||||
BYTE* bitmap = NULL;
|
||||
gal_pixel pix_normal, pix_bitmap, pix_xored, bits_alpha;
|
||||
|
||||
if (BITSPERPHYPIXEL < 8)
|
||||
xor_byte = 0x0F;
|
||||
else
|
||||
xor_byte = 0xFF;
|
||||
for (y = 0; y < pCaretInfo->caret_bmp.bmHeight; y++) {
|
||||
normal = pCaretInfo->pNormal + pCaretInfo->caret_bmp.bmPitch * y;
|
||||
xored = pCaretInfo->pXored + pCaretInfo->caret_bmp.bmPitch * y;
|
||||
if (pCaretInfo->pBitmap)
|
||||
bitmap = pCaretInfo->pBitmap->bmBits +
|
||||
pCaretInfo->caret_bmp.bmPitch * y;
|
||||
|
||||
normal = pCaretInfo->pNormal;
|
||||
xored = pCaretInfo->pXored;
|
||||
for (x = 0; x < pCaretInfo->caret_bmp.bmWidth; x++) {
|
||||
|
||||
for (i = 0; i < pCaretInfo->nBytesNr; i++)
|
||||
xored[i] = normal[i] ^ xor_byte;
|
||||
pix_normal = _mem_get_pixel(normal,
|
||||
pCaretInfo->caret_bmp.bmBytesPerPixel);
|
||||
if (pCaretInfo->pBitmap) {
|
||||
pix_bitmap = _mem_get_pixel(bitmap,
|
||||
pCaretInfo->caret_bmp.bmBytesPerPixel);
|
||||
}
|
||||
else {
|
||||
pix_bitmap = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
bits_alpha = pix_normal & amask;
|
||||
pix_xored = pix_normal ^ pix_bitmap;
|
||||
pix_xored &= ~amask;
|
||||
pix_xored |= bits_alpha;
|
||||
_mem_set_pixel(xored,
|
||||
pCaretInfo->caret_bmp.bmBytesPerPixel, pix_xored);
|
||||
|
||||
normal += pCaretInfo->caret_bmp.bmBytesPerPixel;
|
||||
xored += pCaretInfo->caret_bmp.bmBytesPerPixel;
|
||||
if (pCaretInfo->pBitmap)
|
||||
bitmap += pCaretInfo->caret_bmp.bmBytesPerPixel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+22
-11
@@ -93,9 +93,8 @@ void GUIAPI SetAutoRepeatMessage (HWND hWnd, UINT uMsg,
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
if (hWnd) {
|
||||
if (!MG_IS_NORMAL_WINDOW(hWnd))
|
||||
return;
|
||||
if (hWnd && !MG_IS_NORMAL_WINDOW(hWnd)) {
|
||||
return;
|
||||
}
|
||||
|
||||
msg.hwnd = hWnd;
|
||||
@@ -138,7 +137,7 @@ static void RecalcClientArea (HWND hWnd)
|
||||
|
||||
if (pWin->secondaryDC == HDC_INVALID) {
|
||||
/* remove the flag of WS_EX_AUTOSECONDARYDC */
|
||||
pWin->dwExStyle = pWin->dwExStyle | WS_EX_AUTOSECONDARYDC;
|
||||
pWin->dwExStyle &= ~WS_EX_AUTOSECONDARYDC;
|
||||
pWin->secondaryDC = 0;
|
||||
}
|
||||
|
||||
@@ -365,11 +364,6 @@ HWND GUIAPI ChildWindowFromPointEx (HWND hParent, POINT pt, UINT uFlags)
|
||||
return pRet;
|
||||
}
|
||||
|
||||
/* NOTE:
|
||||
** this function is CONTROL mouse messages handler,
|
||||
** can automaticly capture mouse depend on HITTEST code.
|
||||
*/
|
||||
|
||||
static PCONTROL __mgs_captured_ctrl = NULL;
|
||||
|
||||
void __mg_reset_mainwin_capture_info (PCONTROL ctrl)
|
||||
@@ -388,6 +382,11 @@ void __mg_reset_mainwin_capture_info (PCONTROL ctrl)
|
||||
}
|
||||
}
|
||||
|
||||
/* NOTE:
|
||||
** this function is CONTROL mouse messages handler,
|
||||
** can automaticly capture mouse depend on HITTEST code.
|
||||
*/
|
||||
|
||||
static LRESULT DefaultDTMouseMsgHandler (PMAINWIN pWin, UINT message,
|
||||
WPARAM flags, int x, int y)
|
||||
{
|
||||
@@ -3245,7 +3244,7 @@ int GUIAPI ScrollWindowEx (HWND hWnd, int dx, int dy,
|
||||
rcScroll = rcClient;
|
||||
|
||||
/*
|
||||
* BUGFIX: if we scrolled all area, the all area must
|
||||
* BUGFIX: if we scrolled all area, the whole area must
|
||||
* be set as invalidate (dongjunjie 2010/7/28)
|
||||
*/
|
||||
if ((dx != 0 && abs(dx) >= RECTW(rcScroll)) ||
|
||||
@@ -3281,7 +3280,6 @@ int GUIAPI ScrollWindowEx (HWND hWnd, int dx, int dy,
|
||||
}
|
||||
|
||||
SendMessage (HWND_DESKTOP, MSG_SCROLLMAINWIN, (WPARAM)hWnd, (LPARAM)(&swi));
|
||||
UpdateInvalidClient(hWnd, FALSE);
|
||||
|
||||
/* show caret */
|
||||
if (fCaret) ShowCaretEx (hWnd, FALSE);
|
||||
@@ -6068,6 +6066,19 @@ error:
|
||||
return HWND_INVALID;
|
||||
}
|
||||
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
int GUIAPI GetWindowSharedSurfaceFD (HWND hWnd)
|
||||
{
|
||||
MG_CHECK_RET (MG_IS_APP_WINDOW (hWnd), -1);
|
||||
|
||||
PMAINWIN pWin = (PMAINWIN)hWnd;
|
||||
if (pWin->surf->shared_header)
|
||||
return pWin->surf->shared_header->fd;
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif /* _MGSCHEMA_COMPOSITING */
|
||||
|
||||
BOOL GUIAPI DestroyWindow (HWND hWnd)
|
||||
{
|
||||
PCONTROL pCtrl;
|
||||
|
||||
+50
-11
@@ -46,6 +46,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
@@ -65,14 +66,18 @@
|
||||
|
||||
#define LEN_TOUCH_DEV 127
|
||||
|
||||
#define AUTO_MOUSE_UP_TICKCOUNT 20
|
||||
|
||||
static int sg_tp_event_fd = -1, sg_key_event_fd = -1;
|
||||
static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0;
|
||||
static DWORD g_last_tickcount = 0;
|
||||
static bool g_has_auto_event = false;
|
||||
|
||||
static int get_touch_data (short *x, short *y, short *button)
|
||||
{
|
||||
struct input_event data;
|
||||
|
||||
while (read (sg_tp_event_fd, &data, sizeof (data)) == sizeof (data)) {
|
||||
if (read (sg_tp_event_fd, &data, sizeof (data)) == sizeof (data)) {
|
||||
|
||||
/* do nothing for EV_SYN due to non-blocking read.
|
||||
if (data.type == EV_SYN) {
|
||||
@@ -91,10 +96,12 @@ static int get_touch_data (short *x, short *y, short *button)
|
||||
if (data.type == EV_KEY) {
|
||||
switch (data.code) {
|
||||
case BTN_TOUCH:
|
||||
if (data.value > 0)
|
||||
*button = IAL_MOUSE_LEFTBUTTON;
|
||||
else
|
||||
if (data.value == 0) {
|
||||
*button = 0;
|
||||
g_last_tickcount = 0;
|
||||
return 0;
|
||||
}
|
||||
g_last_tickcount = GetTickCount();
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -103,6 +110,7 @@ static int get_touch_data (short *x, short *y, short *button)
|
||||
}
|
||||
}
|
||||
else if (data.type == EV_ABS) {
|
||||
g_last_tickcount = GetTickCount();
|
||||
switch (data.code) {
|
||||
case ABS_X:
|
||||
*x = data.value;
|
||||
@@ -110,7 +118,8 @@ static int get_touch_data (short *x, short *y, short *button)
|
||||
|
||||
case ABS_Y:
|
||||
*y = data.value;
|
||||
break;
|
||||
*button = IAL_MOUSE_LEFTBUTTON;
|
||||
return 0;
|
||||
|
||||
case ABS_MT_POSITION_X:
|
||||
*x = data.value;
|
||||
@@ -118,7 +127,8 @@ static int get_touch_data (short *x, short *y, short *button)
|
||||
|
||||
case ABS_MT_POSITION_Y:
|
||||
*y = data.value;
|
||||
break;
|
||||
*button = IAL_MOUSE_LEFTBUTTON;
|
||||
return 0;
|
||||
|
||||
case ABS_MT_TOUCH_MAJOR:
|
||||
break;
|
||||
@@ -136,13 +146,20 @@ static int get_touch_data (short *x, short *y, short *button)
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (g_has_auto_event) {
|
||||
g_has_auto_event = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int mouse_update (void)
|
||||
{
|
||||
if (get_touch_data (&MOUSEX, &MOUSEY, &MOUSEBUTTON) == 0)
|
||||
static int idx = 0;
|
||||
if (get_touch_data (&MOUSEX, &MOUSEY, &MOUSEBUTTON) == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -193,10 +210,32 @@ static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *ex
|
||||
}
|
||||
}
|
||||
else if (e < 0) {
|
||||
retvalue = -1;
|
||||
if (g_last_tickcount > 0) {
|
||||
DWORD tickcount = GetTickCount();
|
||||
if (tickcount - g_last_tickcount >= AUTO_MOUSE_UP_TICKCOUNT) {
|
||||
MOUSEBUTTON = 0;
|
||||
retvalue |= IAL_MOUSEEVENT;
|
||||
g_last_tickcount = 0;
|
||||
g_has_auto_event = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
retvalue = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
retvalue = 0;
|
||||
if (g_last_tickcount > 0) {
|
||||
DWORD tickcount = GetTickCount();
|
||||
if (tickcount - g_last_tickcount >= AUTO_MOUSE_UP_TICKCOUNT) {
|
||||
MOUSEBUTTON = 0;
|
||||
retvalue |= IAL_MOUSEEVENT;
|
||||
g_last_tickcount = 0;
|
||||
g_has_auto_event = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
retvalue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return retvalue;
|
||||
@@ -214,7 +253,7 @@ BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
sg_tp_event_fd = open (touch_dev, O_RDONLY | O_NONBLOCK);
|
||||
sg_tp_event_fd = open (touch_dev, O_RDONLY);
|
||||
if (sg_tp_event_fd < 0) {
|
||||
_WRN_PRINTF ("failed when opening touch event device: %s\n", touch_dev);
|
||||
return FALSE;
|
||||
|
||||
+3
-3
@@ -112,11 +112,11 @@ void __mg_legacy_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
|
||||
Uint32 __mg_legacy_bidi_str_base_dir (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len);
|
||||
|
||||
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len, int pel, ACHARMAPINFO* map);
|
||||
|
||||
#if 0
|
||||
// Deprecated
|
||||
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len, GLYPHMAPINFO* map, int pel);
|
||||
|
||||
Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len, int* index_map, int pel);
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,6 @@ struct _SCALER_INFO_FILLBMP
|
||||
typedef struct {
|
||||
struct _SCALER_INFO_FILLBMP scaler_info;
|
||||
GAL_Rect dst_rect;
|
||||
int old_bkmode;
|
||||
|
||||
BYTE* decoded_buff;
|
||||
BYTE* decoded_alpha_buff;
|
||||
|
||||
+20
-1
@@ -105,6 +105,10 @@
|
||||
#define REQID_GETSHAREDSURFACE 0x001C
|
||||
// for compositing schema
|
||||
#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
|
||||
#define SYSSF_REAL_SCREEN "syssf-real-screen"
|
||||
#define SYSSF_SHADOW_SCREEN "syssf-shadow-screen"
|
||||
@@ -126,7 +130,14 @@
|
||||
// Authenticate client
|
||||
#define REQID_AUTHCLIENT 0x0023
|
||||
|
||||
#define REQID_SYS_LAST REQID_AUTHCLIENT
|
||||
/* Since 5.2.0 */
|
||||
// Operate a shared surface to register/revoke the name and set the fd
|
||||
#define REQID_OPERATENAMEDSSURF 0x0024
|
||||
#define ID_NAMEDSSURFOP_REGISTER 1
|
||||
#define ID_NAMEDSSURFOP_SET 2
|
||||
#define ID_NAMEDSSURFOP_REVOKE 3
|
||||
|
||||
#define REQID_SYS_LAST REQID_OPERATENAMEDSSURF
|
||||
|
||||
/*
|
||||
* XXX: To fellows who need to add a new REQID,
|
||||
@@ -142,6 +153,14 @@ MGUI_COMPILE_TIME_ASSERT(sys_request_id, MAX_SYS_REQID >= REQID_SYS_LAST);
|
||||
|
||||
#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 */
|
||||
typedef struct _SharedSurfInfo {
|
||||
uint32_t flags; // the flags of the surface
|
||||
|
||||
+6
-1
@@ -167,6 +167,8 @@ struct tagDC
|
||||
/* surface of this DC */
|
||||
GAL_Surface* surface;
|
||||
|
||||
char __first_attr[0]; // just a zero-length field for the first attribute
|
||||
|
||||
/* background color */
|
||||
gal_pixel bkcolor;
|
||||
|
||||
@@ -179,7 +181,7 @@ struct tagDC
|
||||
/* text color */
|
||||
gal_pixel textcolor;
|
||||
|
||||
int bkmode;
|
||||
int bkmode_set; /* the background mode set by user (5.0.12, Issue #107) */
|
||||
|
||||
int tabstop;
|
||||
int cExtra; /* Character extra */
|
||||
@@ -213,6 +215,8 @@ struct tagDC
|
||||
size_t dash_list_len;
|
||||
#endif
|
||||
|
||||
char __last_attr[0]; // just a zero-length field for the last attribute
|
||||
|
||||
PLOGFONT pLogFont;
|
||||
|
||||
POINT CurPenPos;
|
||||
@@ -247,6 +251,7 @@ struct tagDC
|
||||
gal_pixel skip_pixel;
|
||||
gal_pixel cur_pixel;
|
||||
int step;
|
||||
int bkmode; /* the effective background mode */
|
||||
/* ====================================================================== */
|
||||
|
||||
CLIPRECT* cur_ban;
|
||||
|
||||
+12
-1
@@ -15,7 +15,7 @@
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -209,6 +209,9 @@ struct _CHARSETOPS
|
||||
/** Default character. */
|
||||
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. */
|
||||
int (*len_first_char) (const unsigned char* mstr, int mstrlen);
|
||||
|
||||
@@ -263,9 +266,17 @@ struct _CHARSETOPS
|
||||
|
||||
#define DEVFONTGLYPHTYPE_MASK_BMPTYPE 0x0F
|
||||
|
||||
enum devfont_feature {
|
||||
DEVFONT_FEATURE_MARK_BBOX = 0,
|
||||
};
|
||||
|
||||
/** The font operation structure. */
|
||||
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 . */
|
||||
DWORD (*get_glyph_bmptype) (LOGFONT* logfont, DEVFONT* devfont);
|
||||
|
||||
|
||||
@@ -127,6 +127,9 @@ typedef LWEVENT* PLWEVENT;
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
extern DWORD __mg_timeout_usec;
|
||||
extern DWORD __mg_repeat_usec;
|
||||
|
||||
// The entrance of low level event handling thread
|
||||
BOOL mg_InitLWEvent (void);
|
||||
void mg_TerminateLWEvent (void);
|
||||
|
||||
@@ -83,6 +83,11 @@ static inline int comp_key_string (const void *key1, const void *key2)
|
||||
return strcmp (key1, key2);
|
||||
}
|
||||
|
||||
static inline void free_val_alloc (void *val)
|
||||
{
|
||||
free (val);
|
||||
}
|
||||
|
||||
typedef struct _map_t map_t;
|
||||
typedef struct _map_entry_t {
|
||||
struct rb_node node;
|
||||
|
||||
+9
-11
@@ -117,8 +117,10 @@ void GAL_FreeFormat(GAL_PixelFormat *format);
|
||||
|
||||
/* typedef for private surface blitting functions */
|
||||
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
|
||||
typedef struct _DirtyInfo {
|
||||
@@ -670,7 +672,6 @@ void GAL_MoveCursor (GAL_Surface* surface, int x, int y);
|
||||
|
||||
#endif /* defined _MGSCHEMA_COMPOSITING */
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* GAL_LockSurface() sets up a surface for directly accessing the pixels.
|
||||
* Between calls to GAL_LockSurface()/GAL_UnlockSurface(), you can write
|
||||
@@ -680,9 +681,7 @@ void GAL_MoveCursor (GAL_Surface* surface, int x, int y);
|
||||
*
|
||||
* 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
|
||||
* pixel format of the surface will not change. In particular, if the
|
||||
* GAL_HWSURFACE flag is not given when calling GAL_SetVideoMode(), you
|
||||
* will not need to lock the display surface before accessing it.
|
||||
* pixel format of the surface will not change.
|
||||
*
|
||||
* No operating system or library calls should be made between lock/unlock
|
||||
* pairs, as critical system locks may be held during this time.
|
||||
@@ -691,7 +690,6 @@ void GAL_MoveCursor (GAL_Surface* surface, int x, int y);
|
||||
*/
|
||||
int GAL_LockSurface (GAL_Surface *surface);
|
||||
void GAL_UnlockSurface (GAL_Surface *surface);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set the color key (transparent pixel) in a blittable surface.
|
||||
@@ -735,10 +733,10 @@ GAL_bool GAL_IntersectRect (const GAL_Rect *A, const GAL_Rect *B,
|
||||
Bmin = B->x;
|
||||
Bmax = Bmin + B->w;
|
||||
if (Bmin > Amin)
|
||||
Amin = Bmin;
|
||||
Amin = Bmin;
|
||||
intersection->x = Amin;
|
||||
if (Bmax < Amax)
|
||||
Amax = Bmax;
|
||||
Amax = Bmax;
|
||||
intersection->w = Amax - Amin > 0 ? Amax - Amin : 0;
|
||||
|
||||
/* Vertical intersection */
|
||||
@@ -747,10 +745,10 @@ GAL_bool GAL_IntersectRect (const GAL_Rect *A, const GAL_Rect *B,
|
||||
Bmin = B->y;
|
||||
Bmax = Bmin + B->h;
|
||||
if (Bmin > Amin)
|
||||
Amin = Bmin;
|
||||
Amin = Bmin;
|
||||
intersection->y = Amin;
|
||||
if (Bmax < Amax)
|
||||
Amax = Bmax;
|
||||
Amax = Bmax;
|
||||
intersection->h = Amax - Amin > 0 ? Amax - Amin : 0;
|
||||
|
||||
return (intersection->w && intersection->h);
|
||||
|
||||
@@ -73,6 +73,8 @@
|
||||
|
||||
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
|
||||
/* union semun is defined by including <sys/sem.h> */
|
||||
#elif defined(__DARWIN__)
|
||||
/* union semun is defined by including <sys/sem.h> */
|
||||
#else
|
||||
/* according to X/OPEN we have to define it ourselves */
|
||||
union semun {
|
||||
|
||||
@@ -132,6 +132,10 @@ void __mg_client_del (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);
|
||||
|
||||
void __mg_remove_client (int cli, int clifd);
|
||||
|
||||
int __mg_handle_request (int clifd, int req_id, int cli);
|
||||
@@ -150,6 +154,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_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_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
@@ -228,6 +228,7 @@ static void composite_wallpaper_rect (CompositorCtxt* ctxt,
|
||||
}
|
||||
}
|
||||
else {
|
||||
SelectClipRect (HDC_SCREEN_SYS, dirty_rc);
|
||||
SetBrushColor (HDC_SCREEN_SYS,
|
||||
GetWindowElementPixelEx (HWND_DESKTOP, HDC_SCREEN_SYS,
|
||||
WE_BGC_DESKTOP));
|
||||
|
||||
+36
-14
@@ -1081,6 +1081,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
const RECT* prc;
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (!fShow) {
|
||||
GAL_LockSurface(cur_pdc->surface);
|
||||
}
|
||||
|
||||
if (cur_pdc->surface != __gal_screen) {
|
||||
if (fShow) {
|
||||
GAL_UpdateRect (cur_pdc->surface,
|
||||
@@ -1090,7 +1096,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
}
|
||||
else {
|
||||
if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) {
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!fShow) {
|
||||
@@ -1109,6 +1115,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
UNLOCK_CURSOR_SEM ();
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
/* Since 5.0.13 */
|
||||
if (fShow) {
|
||||
GAL_UnlockSurface(cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
#else /* defined _MGSCHEMA_SHAREDFB */
|
||||
@@ -1124,6 +1136,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
}
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (!fShow) {
|
||||
GAL_LockSurface(cur_pdc->surface);
|
||||
}
|
||||
|
||||
if (cur_pdc->surface == __gal_screen) {
|
||||
// Under compositing schema, we never call SyncUpdate in
|
||||
// kernel_ShowCursorForGDI for __gal_screen.
|
||||
@@ -1150,6 +1168,11 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
// For surface other than screen, we call SyncUpdate.
|
||||
GAL_SyncUpdate (cur_pdc->surface);
|
||||
}
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (fShow) {
|
||||
GAL_UnlockSurface(cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* not defined _MGSCHEMA_SHAREDFB */
|
||||
@@ -1228,26 +1251,25 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
PDC cur_pdc = (PDC)pdc;
|
||||
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)) {
|
||||
return;
|
||||
}
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (!fShow) {
|
||||
GAL_LockSurface(cur_pdc->surface);
|
||||
}
|
||||
|
||||
if (fShow)
|
||||
GAL_UpdateRect (cur_pdc->surface,
|
||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||
#endif
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (fShow) {
|
||||
GAL_UnlockSurface(cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _MGHAVE_CURSOR */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user