mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-28 16:17:09 +08:00
Compare commits
148
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3643606a7f | ||
|
|
3ef2340749 | ||
|
|
a583dc1cbb | ||
|
|
f0bae4444c | ||
|
|
0a5ace7f82 | ||
|
|
5b27cc70fc | ||
|
|
43101379ed | ||
|
|
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 | ||
|
|
3cc16ababb | ||
|
|
d4097b577b | ||
|
|
7ef6c14f3f | ||
|
|
cbb4e32992 | ||
|
|
6bc85062b9 | ||
|
|
b2dee57f4f | ||
|
|
a926754a6b | ||
|
|
7e470b0e78 | ||
|
|
9f81cac662 | ||
|
|
a14bdd894a | ||
|
|
7004e156b8 | ||
|
|
e293cf03ba | ||
|
|
07f226f024 | ||
|
|
4b2503e614 | ||
|
|
2df5352356 | ||
|
|
67ccb2aafd | ||
|
|
9a124dec50 | ||
|
|
d013822979 | ||
|
|
7f44e948d0 | ||
|
|
9a94fb9a7c | ||
|
|
dfc7e95fcd | ||
|
|
362b852ec2 | ||
|
|
9141e13640 | ||
|
|
4a22a38e63 | ||
|
|
c7ce12449b | ||
|
|
824557b4f1 | ||
|
|
022542ef1b | ||
|
|
3b12e71877 | ||
|
|
9593168196 | ||
|
|
b5c5c3f8ae | ||
|
|
492bd649ed | ||
|
|
bc1a880479 | ||
|
|
0748f26f42 | ||
|
|
2f72f24a49 | ||
|
|
43e174a604 | ||
|
|
13d36a2785 | ||
|
|
9ec3e9f7e6 | ||
|
|
148f1b1745 | ||
|
|
f76c9187a8 | ||
|
|
2e8eba7dd0 | ||
|
|
abeafa313d | ||
|
|
310c0f3e7a | ||
|
|
c426894ac9 | ||
|
|
bf6998672f | ||
|
|
ea83e92a16 | ||
|
|
d95e827e93 | ||
|
|
40f53732ff | ||
|
|
e2d2544ce6 | ||
|
|
7cefc7d5ab | ||
|
|
b59ed4b7d1 | ||
|
|
5e43b76753 | ||
|
|
894d0f64a2 | ||
|
|
c18e0f3479 | ||
|
|
8756b5de9f | ||
|
|
54a51ab02f | ||
|
|
741a93aebd | ||
|
|
aeb6642aad | ||
|
|
2fe23fa95b | ||
|
|
a6eb81e916 | ||
|
|
93ec7e48b6 | ||
|
|
956003092e | ||
|
|
96b75c41c1 | ||
|
|
d6933b83e3 | ||
|
|
e2ba3681a1 | ||
|
|
0b47b83849 | ||
|
|
08419c0c95 | ||
|
|
03bc5befd5 | ||
|
|
ed37fa4fc2 | ||
|
|
7268bcf92e | ||
|
|
2d462ec749 | ||
|
|
11a4941dc7 | ||
|
|
d6281fd804 | ||
|
|
550fb04731 | ||
|
|
e08a87fc93 | ||
|
|
cac16f1324 | ||
|
|
2efb66cae0 | ||
|
|
ad49fe0e0e | ||
|
|
ed0521df84 | ||
|
|
002a03c087 |
@@ -29,3 +29,4 @@ Makefile.in
|
||||
/src/font/utils/ucd/
|
||||
/src/sysres/font_list
|
||||
/src/sysres/license/dat_files/
|
||||
/configure~
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# Release Notes
|
||||
|
||||
- [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)
|
||||
+ [What's new in version 5.0.9](#whats-new-in-version-508)
|
||||
- [Version 5.0.8](#version-508)
|
||||
+ [What's new in version 5.0.8](#whats-new-in-version-508)
|
||||
- [Version 5.0.6](#version-506)
|
||||
+ [What's new in version 5.0.6](#whats-new-in-version-506)
|
||||
- [Version 5.0.5](#version-505)
|
||||
@@ -20,6 +32,128 @@
|
||||
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
||||
+ [Deprecated APIs](#deprecated-apis)
|
||||
|
||||
## 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,
|
||||
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.10
|
||||
|
||||
In this version, we made some enhancements
|
||||
|
||||
* ENHANCEMENTS:
|
||||
- Enhance `fbcon` engine to support double buffering for Threads and Standalone mode. (Runtime option: `fbcon.double_buffering`).
|
||||
- Cleanup and enhance `shadow` engine to use `SyncUpdate` method.
|
||||
- Relaying `MSG_IDLE` messages to the active descendant controls in every 0.5s.
|
||||
* BUGFIXING:
|
||||
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/83
|
||||
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/87
|
||||
- Fix bugs reported in https://github.com/VincentWei/minigui/issues/89
|
||||
- Fix some bugs when virtual window enabled under Standalone and Processes runtime modes.
|
||||
* OPTIMIZATIONS:
|
||||
* TUNING:
|
||||
- Fix some warnings reported by GCC 12.
|
||||
- Use inline functions for SetCursor and SetDefaultCursor instead of macros.
|
||||
|
||||
## Version 5.0.9
|
||||
|
||||
On Jan. 14, 2022, FMSoft announces the availability of MiniGUI 5.0.9,
|
||||
which is a bug fixing release with minor enhancements of MiniGUI 5.0.x.
|
||||
|
||||
### What's new in version 5.0.9
|
||||
|
||||
In this version, we fixed some bugs:
|
||||
|
||||
* BUGFIXING:
|
||||
- Fix a crash bug in `InitSubDC()` of `src/newgdi/gdi.c`.
|
||||
* ENHANCEMENTS:
|
||||
* OPTIMIZATIONS:
|
||||
* TUNING:
|
||||
- Change copyright year to 2022.
|
||||
|
||||
## Version 5.0.8
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 5.0.8,
|
||||
which is a bug fixing release with minor enhancements of MiniGUI 5.0.x.
|
||||
|
||||
### What's new in version 5.0.8
|
||||
|
||||
In this version, we fixed some bugs and made some optimizations and enhancements:
|
||||
|
||||
* BUGFIXING:
|
||||
* ENHANCEMENTS:
|
||||
- Support for WebP image format based on `libwebp`.
|
||||
- Support for two ARM64-based hardware platforms: PX30 and R818.
|
||||
- New surface pixel format for main window: `ST_PIXEL_XRGB565` under compositing schema.
|
||||
* OPTIMIZATIONS:
|
||||
- Shrink heap size for fixed string.
|
||||
- Optimize the memory use of blitting context.
|
||||
* TUNING:
|
||||
- Tune code of fbcon video engine for compositing schema.
|
||||
- Fix warnings and errors for conditional compilation.
|
||||
|
||||
## Version 5.0.6
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 5.0.6,
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
Version 5.0.6 (2021/05/20)
|
||||
Version 5.0.13 (2023/08/31)
|
||||
|
||||
This is the first official release of MiniGUI 5.0.x, the stable version.
|
||||
This is a minor enhancement and bugfix release of MiniGUI 5.0.x, the stable version.
|
||||
|
||||
Other packages for MiniGUI resource, tools, components, and samples:
|
||||
|
||||
|
||||
+132
-156
File diff suppressed because it is too large
Load Diff
+7
-1
@@ -105,6 +105,12 @@ seat=seat0
|
||||
[fbcon]
|
||||
defaultmode=1024x768-16bpp
|
||||
dpi=96
|
||||
|
||||
# Whether double buffering is enabled (only for threads and standalone runmodes).
|
||||
# Use `true` or `yes` for enabled, anything else for disabled.
|
||||
# Note that under compositing schema, double buffering is always enabled.
|
||||
# Since 5.0.10.
|
||||
double_buffering=true
|
||||
#}}
|
||||
|
||||
#{{ifdef _MGGAL_PCXVFB
|
||||
@@ -121,7 +127,7 @@ defaultmode=800x600-16bpp
|
||||
[shadow]
|
||||
real_engine=pc_xvfb
|
||||
defaultmode=800x600-16bpp
|
||||
rotate_screen=normal
|
||||
rotate_screen=ccw
|
||||
#}}
|
||||
|
||||
#{{ifdef _MGGAL_MLSHADOW
|
||||
|
||||
@@ -311,6 +311,7 @@ MGUI_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
||||
defined(__amd64) || \
|
||||
(defined(__alpha__) || defined(__alpha)) || \
|
||||
defined(__arm__) || defined(__aarch64__) || \
|
||||
defined(__loongarch__) || \
|
||||
defined(__riscv) || \
|
||||
(defined(__CC_ARM) && !defined(__BIG_ENDIAN)) || \
|
||||
(defined(__mips__) && defined(__MIPSEL__)) || \
|
||||
|
||||
+24
-25
@@ -131,7 +131,31 @@
|
||||
#define IAL_EVENT_GESTURE_PINCH_UPDATE 0x0084
|
||||
#define IAL_EVENT_GESTURE_PINCH_END 0x0085
|
||||
|
||||
#define TABLET_TOOL_CHANGED_X (1 << 0)
|
||||
#define TABLET_TOOL_CHANGED_Y (1 << 1)
|
||||
#define TABLET_TOOL_CHANGED_PRESSURE (1 << 2)
|
||||
#define TABLET_TOOL_CHANGED_DISTANCE (1 << 3)
|
||||
#define TABLET_TOOL_CHANGED_TILT_X (1 << 4)
|
||||
#define TABLET_TOOL_CHANGED_TILT_Y (1 << 5)
|
||||
#define TABLET_TOOL_CHANGED_ROTATION (1 << 6)
|
||||
#define TABLET_TOOL_CHANGED_SLIDER (1 << 7)
|
||||
#define TABLET_TOOL_CHANGED_SIZE_MAJOR (1 << 8)
|
||||
#define TABLET_TOOL_CHANGED_SIZE_MINOR (1 << 9)
|
||||
#define TABLET_TOOL_CHANGED_WHEEL (1 << 10)
|
||||
|
||||
#ifndef TABLET_TOOL_X
|
||||
#define TABLET_TOOL_X 0
|
||||
#define TABLET_TOOL_Y 1
|
||||
#define TABLET_TOOL_PRESSURE 2
|
||||
#define TABLET_TOOL_DISTANCE 3
|
||||
#define TABLET_TOOL_TILT_X 4
|
||||
#define TABLET_TOOL_TILT_Y 5
|
||||
#define TABLET_TOOL_ROTATION 6
|
||||
#define TABLET_TOOL_SLIDER 7
|
||||
#define TABLET_TOOL_SIZE_MAJOR 8
|
||||
#define TABLET_TOOL_SIZE_MINOR 9
|
||||
#define TABLET_TOOL_WHEEL 10
|
||||
|
||||
#define TABLET_TOOL_PROXIMITY_STATE_INVALID 0
|
||||
#define TABLET_TOOL_PROXIMITY_STATE_OUT 1
|
||||
#define TABLET_TOOL_PROXIMITY_STATE_IN 2
|
||||
@@ -149,31 +173,6 @@
|
||||
|
||||
#define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0
|
||||
#define TABLET_PAD_STRIP_SOURCE_FINGER 1
|
||||
|
||||
#define TABLET_TOOL_CHANGED_X (1 << 0)
|
||||
#define TABLET_TOOL_CHANGED_Y (1 << 1)
|
||||
#define TABLET_TOOL_CHANGED_PRESSURE (1 << 2)
|
||||
#define TABLET_TOOL_CHANGED_DISTANCE (1 << 3)
|
||||
#define TABLET_TOOL_CHANGED_TILT_X (1 << 4)
|
||||
#define TABLET_TOOL_CHANGED_TILT_Y (1 << 5)
|
||||
#define TABLET_TOOL_CHANGED_ROTATION (1 << 6)
|
||||
#define TABLET_TOOL_CHANGED_SLIDER (1 << 7)
|
||||
#define TABLET_TOOL_CHANGED_SIZE_MAJOR (1 << 8)
|
||||
#define TABLET_TOOL_CHANGED_SIZE_MINOR (1 << 9)
|
||||
#define TABLET_TOOL_CHANGED_WHEEL (1 << 10)
|
||||
|
||||
#define TABLET_TOOL_X 0
|
||||
#define TABLET_TOOL_Y 1
|
||||
#define TABLET_TOOL_PRESSURE 2
|
||||
#define TABLET_TOOL_DISTANCE 3
|
||||
#define TABLET_TOOL_TILT_X 4
|
||||
#define TABLET_TOOL_TILT_Y 5
|
||||
#define TABLET_TOOL_ROTATION 6
|
||||
#define TABLET_TOOL_SLIDER 7
|
||||
#define TABLET_TOOL_SIZE_MAJOR 8
|
||||
#define TABLET_TOOL_SIZE_MINOR 9
|
||||
#define TABLET_TOOL_WHEEL 10
|
||||
|
||||
#endif
|
||||
|
||||
#define IAL_EVENT_TABLET_TOOL_AXIS 0x0090
|
||||
|
||||
+127
-4
@@ -587,7 +587,7 @@ enum {
|
||||
* \sa InitBlockDataHeap, DestroyBlockDataHeap
|
||||
*/
|
||||
typedef struct _BLOCKHEAP {
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_t lock;
|
||||
#endif
|
||||
/** Size of one block element in bytes. */
|
||||
@@ -10713,7 +10713,10 @@ MG_EXPORT int GUIAPI GetTabbedTextExtent (HDC hdc,
|
||||
SetDCAttr (hdc, DC_ATTR_TEXT_ALIGN, (DWORD)ta_flags)
|
||||
|
||||
#define BIDI_FLAG_LTR 0x00
|
||||
#define BIDI_FLAG_RTL 0x10
|
||||
#define BIDI_FLAG_RTL 0x01
|
||||
|
||||
#define BIDI_FLAG_NONE BIDI_FLAG_LTR
|
||||
#define BIDI_FLAG_LEGACY 0x10
|
||||
|
||||
#define GetBIDIFlags(hdc) \
|
||||
GetDCAttr (hdc, DC_ATTR_BIDI_FLAGS)
|
||||
@@ -12632,7 +12635,7 @@ MG_EXPORT int GUIAPI BIDIGetTextVisualAChars (LOGFONT* log_font,
|
||||
* Achar32* achars, int nr_achars, int pel,
|
||||
* void* extra, CB_REVERSE_ARRAY cb_reverse_extra)
|
||||
* \brief Reorder the specified logical glyph string in visual order and
|
||||
* reorder an extra array to reflect the visule order of the achars.
|
||||
* reorder an extra array to reflect the visual order of the achars.
|
||||
*
|
||||
* This function reorders the logical glyph string in place to visual order.
|
||||
* If \a extra and \a cb_reverse_extra are both not NULL, it also reorders
|
||||
@@ -12837,6 +12840,105 @@ MG_EXPORT int GUIAPI GetACharsExtent (HDC hdc, Achar32* achars, int nr_achars,
|
||||
MG_EXPORT int GUIAPI GetACharsExtentPoint (HDC hdc, Achar32* achars,
|
||||
int nr_achars, int max_extent, SIZE* size);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI GetACharsExtentPointEx (HDC hdc, Achar32* achars, \
|
||||
* int nr_achars, int max_extent, int* dx_chars, SIZE* size)
|
||||
* \brief Get the visual extent value of an achar string.
|
||||
*
|
||||
* This function gets the visual extent value of a glpyh string.
|
||||
* Note that this function ignore all breaks in the achar string.
|
||||
*
|
||||
* \param hdc The device context.
|
||||
* \param achars The pointer to the achar string.
|
||||
* \param nr_achars The length of the achar string len.
|
||||
* \param max_extent The maximal output extent value.
|
||||
* \param dx_achars The output positions of each character in the text will be
|
||||
* returned through this pointer. It can be NULL.
|
||||
* \param size The real extent of all visual achars in the achar string.
|
||||
*
|
||||
* \return The index of the last achar which can be fit to the extent.
|
||||
*
|
||||
* \sa GetACharsExtentPoint
|
||||
*
|
||||
* Since 5.0.12
|
||||
*/
|
||||
MG_EXPORT int GUIAPI GetACharsExtentPointEx (HDC hdc, Achar32* achars,
|
||||
int nr_achars, int max_extent, int* dx_achars, SIZE* size);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI GetTabbedACharsExtent (HDC hdc, Achar32* achars,
|
||||
* int nr_achars, SIZE* size)
|
||||
* \brief Get visual extent value of an achar string.
|
||||
*
|
||||
* This function gets the extent value of an achar string on a DC. Note that
|
||||
* this function will ignore all breaks in the achar string.
|
||||
*
|
||||
* \param hdc The device context.
|
||||
* \param achars The pointer to the achar string.
|
||||
* \param nr_achars The length of the achar string.
|
||||
* \param size The buffer restoring the extents of the achar strings.
|
||||
*
|
||||
* \return The extent of the achar string.
|
||||
*
|
||||
* \sa GetTabbedACharsExtentPoint
|
||||
*
|
||||
* Since 5.0.12
|
||||
*/
|
||||
MG_EXPORT int GUIAPI GetTabbedACharsExtent (HDC hdc, Achar32* achars,
|
||||
int nr_achars, SIZE* size);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI GetTabbedACharsExtentPoint (HDC hdc, Achar32* achars,
|
||||
* int nr_achars, int max_extent, SIZE* size)
|
||||
* \brief Get the visual extent value of an achar string.
|
||||
*
|
||||
* This function gets the visual extent value of a glpyh string.
|
||||
* Note that this function ignore all breaks in the achar string.
|
||||
*
|
||||
* \param hdc The device context.
|
||||
* \param achars The pointer to the achar string.
|
||||
* \param nr_achars The length of the achar string len.
|
||||
* \param max_extent The maximal output extent value.
|
||||
* \param size The real extent of all visual achars in the achar string.
|
||||
*
|
||||
* \return The the index of the last achar which can be fit to the extent.
|
||||
*
|
||||
* \sa GetTabbedACharsExtentPointEx
|
||||
*
|
||||
* Since 5.0.12
|
||||
*/
|
||||
MG_EXPORT int GUIAPI GetTabbedACharsExtentPoint (HDC hdc, Achar32* achars,
|
||||
int nr_achars, int max_extent, SIZE* size);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI GetTabbedACharsExtentPointEx (HDC hdc,
|
||||
* Achar32* achars, int nr_achars, int max_extent,
|
||||
* int* dx_chars, int* dy_chars, SIZE* size)
|
||||
* \brief Get the visual extent value of an achar string.
|
||||
*
|
||||
* This function gets the visual extent value of a glpyh string.
|
||||
* Note that this function ignore all breaks in the achar string.
|
||||
*
|
||||
* \param hdc The device context.
|
||||
* \param achars The pointer to the achar string.
|
||||
* \param nr_achars The length of the achar string len.
|
||||
* \param max_extent The maximal output extent value.
|
||||
* \param dx_achars The output x-positions of each character in the text
|
||||
* will be returned through this pointer. It can be NULL.
|
||||
* \param dy_achars The output y-positions of each character in the text
|
||||
* will be returned through this pointer. It can be NULL.
|
||||
* \param size The real extent of all visual achars in the achar string.
|
||||
*
|
||||
* \return The index of the last achar which can be fit to the extent.
|
||||
*
|
||||
* \sa GetTabbedACharsExtentPoint
|
||||
*
|
||||
* Since 5.0.12
|
||||
*/
|
||||
MG_EXPORT int GUIAPI GetTabbedACharsExtentPointEx (HDC hdc,
|
||||
Achar32* achars, int nr_achars, int max_extent,
|
||||
int* dx_achars, int* dy_achars, SIZE* size);
|
||||
|
||||
/**
|
||||
* \fn Glyph32 GUIAPI GetGlyphValue (LOGFONT* logfont, const char* mchar, \
|
||||
* int mchar_len, const char* pre_mchar, int pre_len)
|
||||
@@ -12870,7 +12972,7 @@ MG_EXPORT Glyph32 GUIAPI GetGlyphValueAlt(LOGFONT* logfont, Achar32 chv);
|
||||
* int* adv_x, int* adv_y)
|
||||
* \brief Draw a glyph.
|
||||
*
|
||||
* This function draws a glyph to the specific postion of a DC.
|
||||
* This function draws a glyph to the specific position of a DC.
|
||||
*
|
||||
* \param hdc The device context.
|
||||
* \param x The output start x position.
|
||||
@@ -12886,6 +12988,27 @@ MG_EXPORT Glyph32 GUIAPI GetGlyphValueAlt(LOGFONT* logfont, Achar32 chv);
|
||||
MG_EXPORT int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
|
||||
int* adv_x, int* adv_y);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI DrawVowel (HDC hdc, int x, int y, Glyph32 glyph_value, \
|
||||
* int last_adv)
|
||||
* \brief Draw a glyph as vowel.
|
||||
*
|
||||
* This function draws a glyph as a vowel of the last glyph to
|
||||
* the specific position of a DC.
|
||||
*
|
||||
* \param hdc The device context.
|
||||
* \param x The output start x position.
|
||||
* \param y The output start y position.
|
||||
* \param glyph_value The glyph value.
|
||||
* \param last_adv The advance on the baseline of the last glyph.
|
||||
*
|
||||
* \return The advance on baseline of the vowel.
|
||||
*
|
||||
* Since 5.0.13
|
||||
*/
|
||||
MG_EXPORT int GUIAPI DrawVowel (HDC hdc, int x, int y, Glyph32 glyph_value,
|
||||
int last_adv);
|
||||
|
||||
/*
|
||||
* \fn int GUIAPI DrawGlyphString (HDC hdc, Glyph32* glyphs, int nr_glyphs,
|
||||
* const POINT* pts);
|
||||
|
||||
+8
-4
@@ -4097,7 +4097,7 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
|
||||
#endif /* !_MGHAVE_CURSOR */
|
||||
|
||||
/**
|
||||
* \def SetCursor(hcsr)
|
||||
* \fn HCURSOR SetCursor(HCURSOR hcsr)
|
||||
* \brief Changes the current cursor.
|
||||
*
|
||||
* This function changes the current cursor to be \a hcsr.
|
||||
@@ -4110,10 +4110,12 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
|
||||
*
|
||||
* \sa SetCursorEx, SetDefaultCursor
|
||||
*/
|
||||
#define SetCursor(hcsr) SetCursorEx (hcsr, FALSE)
|
||||
static inline HCURSOR SetCursor(HCURSOR hcsr) {
|
||||
return SetCursorEx (hcsr, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* \def SetDefaultCursor(hcsr)
|
||||
* \fn HCURSOR SetDefaultCursor(HCURSOR hcsr)
|
||||
* \brief Changes the current cursor, and set it as the default cursor.
|
||||
*
|
||||
* This function changes the current cursor to be \a hcsr, and set it as
|
||||
@@ -4127,7 +4129,9 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
|
||||
*
|
||||
* \sa SetCursorEx, SetCursor
|
||||
*/
|
||||
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE)
|
||||
static inline HCURSOR SetDefaultCursor(HCURSOR hcsr) {
|
||||
return SetCursorEx (hcsr, TRUE);
|
||||
}
|
||||
|
||||
/** @} end of cursor_fns */
|
||||
|
||||
|
||||
@@ -2905,6 +2905,9 @@ typedef struct _WINMASKINFO {
|
||||
*
|
||||
* This message is sent to the all main windows when the system
|
||||
* enters idle loop.
|
||||
*
|
||||
* Since 5.0.10, this messasge will be relayed to the active child control
|
||||
* if the main window is currently active.
|
||||
*/
|
||||
#define MSG_IDLE 0x0142
|
||||
|
||||
|
||||
+18
-43
@@ -1,52 +1,27 @@
|
||||
if MG_MINIMALGDI
|
||||
COMMON_SUBDIRS = misc kernel sysres include
|
||||
COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit newgal newgdi
|
||||
|
||||
COMMON_LADD = \
|
||||
kernel/libkernel.la \
|
||||
sysres/libsysres.la \
|
||||
misc/libmisc.la
|
||||
else
|
||||
COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit
|
||||
|
||||
COMMON_LADD = \
|
||||
libc/liblibc.la \
|
||||
misc/libmisc.la \
|
||||
control/libcontrol.la \
|
||||
ex_ctrl/libexctrl.la \
|
||||
font/libfont.la \
|
||||
COMMON_LADD = \
|
||||
libc/liblibc.la \
|
||||
misc/libmisc.la \
|
||||
control/libcontrol.la \
|
||||
ex_ctrl/libexctrl.la \
|
||||
font/libfont.la \
|
||||
font/in-core/libincore.la \
|
||||
ial/libial.la \
|
||||
gui/libgui.la \
|
||||
main/libmain.la \
|
||||
mybmp/libmybmp.la \
|
||||
kernel/libkernel.la \
|
||||
ial/libial.la \
|
||||
gui/libgui.la \
|
||||
main/libmain.la \
|
||||
mybmp/libmybmp.la \
|
||||
kernel/libkernel.la \
|
||||
sysres/libsysres.la \
|
||||
textedit/libtextedit.la
|
||||
endif
|
||||
textedit/libtextedit.la \
|
||||
newgal/libnewgal.la \
|
||||
newgdi/libnewgdi.la
|
||||
|
||||
if MGRM_STANDALONE
|
||||
LITE_LADD = standalone/libstandalone.la
|
||||
LITE_SUBDIRS = standalone
|
||||
else
|
||||
if MGRM_PROCESSES
|
||||
LITE_LADD = server/libserver.la client/libclient.la
|
||||
LITE_SUBDIRS = server client
|
||||
else
|
||||
LITE_LADD =
|
||||
LITE_SUBDIRS =
|
||||
endif
|
||||
endif
|
||||
|
||||
NEWGAL_LADD = newgal/libnewgal.la newgdi/libnewgdi.la
|
||||
NEWGAL_SUBDIRS = newgal newgdi
|
||||
|
||||
DIST_SUBDIRS = $(COMMON_SUBDIRS) newgal newgdi server client standalone
|
||||
SUBDIRS = $(COMMON_SUBDIRS) $(NEWGAL_SUBDIRS) $(LITE_SUBDIRS)
|
||||
DIST_SUBDIRS = $(COMMON_SUBDIRS) newgal newgdi server client standalone
|
||||
SUBDIRS = $(COMMON_SUBDIRS) @RUNMODE_SUBDIRS@
|
||||
|
||||
MGSOURCES = template.c template.h
|
||||
MGLIBADD = $(COMMON_LADD) \
|
||||
$(LITE_LADD) \
|
||||
$(NEWGAL_LADD)
|
||||
MGLIBADD = $(COMMON_LADD) @RUNMODE_LADD@
|
||||
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
|
||||
lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la
|
||||
|
||||
+56
-46
File diff suppressed because it is too large
Load Diff
+12
-14
@@ -299,7 +299,15 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
|
||||
}
|
||||
}
|
||||
|
||||
/*complete a click if the click if valid
|
||||
/* DK: When the radio or check button state changes do not erase the background,
|
||||
* and the prospects for direct rendering */
|
||||
btnGetRects (pctrl, &rcClient, &rcContent, &rcBitmap);
|
||||
if (BUTTON_IS_PUSHBTN(pctrl) || (pctrl->dwStyle & BS_PUSHLIKE))
|
||||
InvalidateRect((HWND)pctrl, NULL, TRUE);
|
||||
else
|
||||
InvalidateRect((HWND)pctrl, &rcBitmap, FALSE);
|
||||
|
||||
/* complete a click if the click if valid
|
||||
* (mouse lbutton up in button )*/
|
||||
if (old_pose == BST_PUSHED && new_pose != BST_DISABLE
|
||||
&& change_valid)
|
||||
@@ -312,14 +320,6 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
|
||||
|
||||
NotifyParent ((HWND)pctrl, pctrl->id, BN_CLICKED);
|
||||
}
|
||||
|
||||
/* DK: When the radio or check button state changes do not erase the background,
|
||||
* and the prospects for direct rendering */
|
||||
btnGetRects (pctrl, &rcClient, &rcContent, &rcBitmap);
|
||||
if (BUTTON_IS_PUSHBTN(pctrl) || (pctrl->dwStyle & BS_PUSHLIKE))
|
||||
InvalidateRect((HWND)pctrl, NULL, TRUE);
|
||||
else
|
||||
InvalidateRect((HWND)pctrl, &rcBitmap, FALSE);
|
||||
}
|
||||
|
||||
/*btnGetRects:
|
||||
@@ -423,8 +423,8 @@ static void draw_bitmap_button (PCONTROL pctrl, HDC hdc, DWORD dwStyle,
|
||||
|
||||
GetClientRect ((HWND)pctrl, &prcClient);
|
||||
if (dwStyle & BS_REALSIZEIMAGE) {
|
||||
x += (w - bmp->bmWidth) >> 1;
|
||||
y += (h - bmp->bmHeight) >> 1;
|
||||
x += (int)(w - bmp->bmWidth) >> 1;
|
||||
y += (int)(h - bmp->bmHeight) >> 1;
|
||||
w = h = 0;
|
||||
|
||||
if (bmp->bmWidth > RECTW(prcClient)){
|
||||
@@ -847,8 +847,6 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
case BM_SETSTYLE:
|
||||
pctrl->dwStyle &= 0xFFFF0000;
|
||||
pctrl->dwStyle |= (DWORD)(wParam & 0x0000FFFF);
|
||||
@@ -1054,7 +1052,7 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
return DefaultControlProc (hWnd, uMsg, wParam, lParam);
|
||||
|
||||
+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);
|
||||
|
||||
@@ -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~2022, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -493,10 +493,15 @@ LRESULT ScrollViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
|
||||
break;
|
||||
}
|
||||
|
||||
case MSG_DESTROY:
|
||||
scrollview_destroy (psvdata);
|
||||
free (psvdata);
|
||||
case MSG_DESTROY: {
|
||||
/* suppress a warning about calling free() before using the pointer */
|
||||
PSVDATA svdata = (PSVDATA) GetWindowAdditionalData2 (hWnd);
|
||||
if (svdata) {
|
||||
scrollview_destroy(svdata);
|
||||
free (svdata);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MSG_GETDLGCODE:
|
||||
return DLGC_WANTARROWS;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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~2022, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -283,7 +283,7 @@ static void DrawCoolBox (HWND hWnd, HDC hdc, PCOOLBARCTRL pdata)
|
||||
WINDOWINFO *info;
|
||||
RECT rc;
|
||||
|
||||
if (tmpdata->Caption == NULL || tmpdata->Caption [0] == '\0')
|
||||
if (tmpdata->Caption [0] == '\0')
|
||||
break;
|
||||
|
||||
GetTextExtent (hdc, tmpdata->Caption, -1, &size);
|
||||
|
||||
@@ -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 {{{
|
||||
|
||||
@@ -157,6 +157,8 @@ static int isInItem (MgList *mglst, int mouseX, int mouseY,
|
||||
|
||||
index = row * pivlist->nCol + col;
|
||||
pci = (IconviewItem *)mglist_getitem_byindex (mglst, index);
|
||||
if (pci == NULL)
|
||||
return -1;
|
||||
|
||||
if (pRet)
|
||||
*pRet = (MgItem*)pci;
|
||||
|
||||
+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,
|
||||
|
||||
+13
-15
@@ -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
|
||||
@@ -461,9 +461,8 @@ 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))
|
||||
@@ -472,6 +471,7 @@ static unsigned int iso8859_6_char_type (Achar32 chv)
|
||||
{
|
||||
unsigned int ch_type = ACHAR_BASIC_UNKNOWN;
|
||||
|
||||
chv = REAL_ACHAR(chv);
|
||||
if (is_arabic_char_vowel (chv)) { /* is vowel */
|
||||
ch_type = ACHAR_BASIC_VOWEL;
|
||||
}
|
||||
@@ -483,7 +483,6 @@ static unsigned int iso8859_6_char_type (Achar32 chv)
|
||||
}
|
||||
|
||||
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 +530,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 +604,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 +793,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 +808,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 +837,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 +858,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 +868,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
File diff suppressed because it is too large
Load Diff
@@ -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,
|
||||
|
||||
+13
-1
@@ -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) {
|
||||
@@ -735,9 +746,9 @@ get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
pcache->valid_advance = 1;
|
||||
}
|
||||
}
|
||||
done:
|
||||
#endif
|
||||
|
||||
done:
|
||||
FT_UNLOCK(&ft_lock);
|
||||
|
||||
if (px) {
|
||||
@@ -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,
|
||||
|
||||
@@ -162,13 +162,13 @@ extern void __mg_ttc_sys_deinit(void);
|
||||
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
|
||||
extern void __mg_ttc_refer(HCACHE hCache);
|
||||
|
||||
#endif /* _MGFONT_TTF_CACHE */
|
||||
|
||||
#ifdef _MGCOMPLEX_SCRIPTS
|
||||
extern void __mg_init_harzbuff_funcs(void);
|
||||
extern void __mg_term_harzbuff_funcs(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
+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,7 +59,6 @@
|
||||
#include "cliprect.h"
|
||||
#include "gal.h"
|
||||
#include "internals.h"
|
||||
#include "blockheap.h"
|
||||
#include "accelkey.h"
|
||||
|
||||
static BLOCKHEAP ACHeap;
|
||||
|
||||
+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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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~2022, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -803,7 +803,7 @@ BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
|
||||
char buff [20];
|
||||
DWORD rgba;
|
||||
|
||||
if (!rdr || !rdr->name || rdr->name[0] == '\0')
|
||||
if (!rdr || rdr->name[0] == '\0')
|
||||
return FALSE;
|
||||
|
||||
_DBG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n",
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
#include "cliprect.h"
|
||||
#include "gal.h"
|
||||
#include "internals.h"
|
||||
#include "blockheap.h"
|
||||
#include "menu.h"
|
||||
|
||||
#define SHORTEN 0
|
||||
|
||||
+82
-46
File diff suppressed because it is too large
Load Diff
@@ -319,6 +319,19 @@ static void flush_rec (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void close_rec (void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
/* TODO: */
|
||||
#else
|
||||
if (record_fd >= 0) {
|
||||
close(record_fd);
|
||||
record_fd = -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void do_record(AUTO_IAL_INPUT_EVENT *event)
|
||||
{
|
||||
@@ -744,6 +757,7 @@ void TermPCXVFBInput (void)
|
||||
remove("/tmp/.pcxvfb_tmp");
|
||||
}
|
||||
#endif
|
||||
close_rec();
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ noinst_HEADERS = \
|
||||
cursor.h dc.h event.h list.h element.h \
|
||||
ial.h inline.h internals.h zorder.h menu.h misc.h \
|
||||
msgstr.h sysfont.h timer.h devfont.h fontname.h \
|
||||
readbmp.h icon.h blockheap.h rbtree.h \
|
||||
readbmp.h icon.h rbtree.h \
|
||||
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
|
||||
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
|
||||
glyph.h license.h mgsock.h unicode-ops.h \
|
||||
|
||||
+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;
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
** blockheap.h: the head file of heap for block data.
|
||||
**
|
||||
** Create date: 2001/01/10
|
||||
**
|
||||
** DEPRECATED, USE window.h INSTEAD.
|
||||
*/
|
||||
|
||||
#ifndef GUI_BLOCKHEAP_H
|
||||
@@ -55,7 +57,7 @@
|
||||
#ifndef _MGUI_GDI_H /* included in include/gdi.h */
|
||||
|
||||
struct _BLOCKHEAP {
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_t lock;
|
||||
#endif
|
||||
/* Size of one block element. */
|
||||
+4
-20
@@ -107,11 +107,7 @@ enum {
|
||||
#define ZNIDX_DESKTOP 0
|
||||
|
||||
/* The heap size for mask rectangles */
|
||||
#ifdef _MGRM_PROCESSES
|
||||
# define DEF_NR_MASKRECTS 4096
|
||||
#else
|
||||
# define DEF_NR_MASKRECTS 1024
|
||||
#endif
|
||||
#define DEF_NR_MASKRECTS 1024
|
||||
|
||||
#if IS_COMPOSITING_SCHEMA
|
||||
/* max number of shared surfaces (512) */
|
||||
@@ -159,21 +155,9 @@ enum {
|
||||
#endif
|
||||
|
||||
/* constants for fix string module */
|
||||
#if defined (__NOUNIX__) || defined (__uClinux__)
|
||||
#define MAX_LEN_FIXSTR 64
|
||||
#define NR_HEAP 5
|
||||
#define LEN_BITMAP (1+2+4+8+16)
|
||||
#else
|
||||
#ifdef _MGRM_THREADS
|
||||
#define MAX_LEN_FIXSTR 2048
|
||||
#define NR_HEAP 10
|
||||
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256+512)
|
||||
#else
|
||||
#define MAX_LEN_FIXSTR 1024
|
||||
#define NR_HEAP 9
|
||||
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256)
|
||||
#endif
|
||||
#endif
|
||||
#define MAX_LEN_FIXSTR 64
|
||||
#define NR_HEAP 5
|
||||
#define LEN_BITMAP (1+2+4+8+16)
|
||||
|
||||
/* constants for engine name and video mode */
|
||||
#define LEN_SO_NAME 127 // name length of a shared object (library)
|
||||
|
||||
+7
-2
@@ -93,7 +93,7 @@ typedef struct tagDC* PDC;
|
||||
# else /* not defined _MGSCHEMA_COMPOSITING */
|
||||
void __mg_lock_recalc_gcrinfo (PDC pdc);
|
||||
void __mg_unlock_gcrinfo (PDC pdc);
|
||||
#define LOCK_GCRINFO(pdc) __mg_lock_recalc_gcrinfo (pdc)
|
||||
#define LOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_lock_recalc_gcrinfo (pdc)
|
||||
#define UNLOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_unlock_gcrinfo (pdc)
|
||||
# endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||
|
||||
@@ -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);
|
||||
|
||||
+17
-41
@@ -84,15 +84,18 @@
|
||||
#define WS_EX_MODALDISABLED 0x10000000L
|
||||
|
||||
/*
|
||||
* \def WS_EX_CTRLASMAINWIN
|
||||
* \brief The control can be displayed out of the main window
|
||||
* which contains the control.
|
||||
* Internal extended style:
|
||||
* The control can be displayed out of the main window
|
||||
* which contains the control.
|
||||
*/
|
||||
#define WS_EX_CTRLASMAINWIN 0x20000000L
|
||||
|
||||
/* Internal extended style. */
|
||||
/* Internal extended style: dialog box. */
|
||||
#define WS_EX_DIALOGBOX 0x40000000L
|
||||
|
||||
/* Internal extended style: activated. */
|
||||
#define WS_EX_ACTIVATED 0x80000000L
|
||||
|
||||
/* Make sure the internal window extended styles above are ok */
|
||||
#define MGUI_COMPILE_TIME_ASSERT(name, x) \
|
||||
typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1]
|
||||
@@ -101,6 +104,10 @@ MGUI_COMPILE_TIME_ASSERT(ws_ex_int_1,
|
||||
WS_EX_INTERNAL_MASK & WS_EX_MODALDISABLED);
|
||||
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_2,
|
||||
WS_EX_INTERNAL_MASK & WS_EX_CTRLASMAINWIN);
|
||||
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_3,
|
||||
WS_EX_INTERNAL_MASK & WS_EX_DIALOGBOX);
|
||||
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_4,
|
||||
WS_EX_INTERNAL_MASK & WS_EX_ACTIVATED);
|
||||
|
||||
#undef MGUI_COMPILE_TIME_ASSERT
|
||||
|
||||
@@ -251,7 +258,7 @@ struct _MSGQUEUE
|
||||
int loop_depth; // message loop depth, for dialog boxes
|
||||
|
||||
int idle_counter; // the idle connter for MSG_IDLE
|
||||
DWORD last_ticks_desktop; // the last tick count for desktop timer
|
||||
DWORD last_ticks; // the last tick count saved; since 5.0.14
|
||||
|
||||
/* Since 5.0.0, MiniGUI provides support for timers per message thread */
|
||||
int nr_timers; // the number of active timers
|
||||
@@ -772,8 +779,8 @@ static inline PMSGQUEUE getMsgQueue (HWND hWnd)
|
||||
}
|
||||
|
||||
|
||||
MSGQUEUE* mg_AllocMsgQueueForThisThread (void);
|
||||
void mg_FreeMsgQueueForThisThread (void);
|
||||
MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in);
|
||||
void mg_FreeMsgQueueForThisThread (BOOL sign_off);
|
||||
|
||||
/* Since 5.0.0 */
|
||||
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd);
|
||||
@@ -904,40 +911,9 @@ static inline MSGQUEUE* getMsgQueueIfMainWindowInThisThread (PMAINWIN pMainWin)
|
||||
|
||||
#endif /* defined _MGHAVE_VIRTUAL_WINDOW */
|
||||
|
||||
#if 0 /* deprecated code */
|
||||
/* since 5.0.0, we always use QS_DESKTIMER for desktop timer */
|
||||
/* since 5.0.0, we no longer use the timer thread */
|
||||
static inline void AlertDesktopTimerEvent (void)
|
||||
{
|
||||
if (__mg_dsk_msg_queue) {
|
||||
__mg_dsk_msg_queue->expired_timer_mask = 1;
|
||||
POST_MSGQ (__mg_dsk_msg_queue);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void AlertDesktopTimerEvent (void)
|
||||
{
|
||||
__mg_dsk_msg_queue->dwState |= QS_DESKTIMER;
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
if (getMsgQueueForThisThread() != __mg_dsk_msg_queue)
|
||||
POST_MSGQ (__mg_dsk_msg_queue);
|
||||
#endif /* defined _MGHAVE_VIRTUAL_WINDOW */
|
||||
}
|
||||
|
||||
static inline void setMsgQueueTimerFlag (PMSGQUEUE pMsgQueue, int slot)
|
||||
{
|
||||
pMsgQueue->expired_timer_mask |= (0x01UL << slot);
|
||||
POST_MSGQ (pMsgQueue);
|
||||
}
|
||||
|
||||
static inline void removeMsgQueueTimerFlag (PMSGQUEUE pMsgQueue, int slot)
|
||||
{
|
||||
pMsgQueue->expired_timer_mask &= ~(0x01UL << slot);
|
||||
}
|
||||
#endif /* deprecated code */
|
||||
|
||||
BOOL mg_InitTimer (BOOL use_sys_timer);
|
||||
void mg_TerminateTimer (BOOL use_sys_timer);
|
||||
/* Since 5.0.14, remove arg use_sys_timer */
|
||||
BOOL mg_InitTimer (void);
|
||||
void mg_TerminateTimer (void);
|
||||
|
||||
/*window element renderer manager interface*/
|
||||
extern WINDOW_ELEMENT_RENDERER * __mg_def_renderer;
|
||||
|
||||
+9
-111
@@ -54,26 +54,12 @@
|
||||
# define MG_LOCAL /* NULL */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Common
|
||||
*/
|
||||
#if defined(_MG_ENABLE_SPLASH) || \
|
||||
defined(_MG_ENABLE_SCREENSAVER) || \
|
||||
defined(_MG_ENABLE_WATERMARK)
|
||||
|
||||
#define _MG_ENABLE_LICENSE 1
|
||||
|
||||
enum {
|
||||
SPLASH_MINIGUI,
|
||||
SPLASH_FMSOFT,
|
||||
SPLASH_FEIMAN,
|
||||
SPLASH_PROGRESSBAR,
|
||||
SPLASH_PROGRESSBAR_BK,
|
||||
#if 0
|
||||
WATERMARK_1,
|
||||
WATERMARK_2,
|
||||
WATERMARK_3,
|
||||
#endif /* _MG_ENABLE_WATERMARK */
|
||||
LICENSE_BITMAP_NR
|
||||
};
|
||||
|
||||
@@ -85,14 +71,14 @@ extern MG_LOCAL BITMAP g_license_bitmaps[];
|
||||
#define g_bitmap_progressbar g_license_bitmaps[SPLASH_PROGRESSBAR]
|
||||
#define g_bitmap_progressbar_bk g_license_bitmaps[SPLASH_PROGRESSBAR_BK]
|
||||
|
||||
#if defined(_MG_ENABLE_SPLASH) || defined(_MG_ENABLE_SCREENSAVER)
|
||||
# define _MG_ENABLE_LICENSE 1
|
||||
MG_LOCAL void __mg_license_create(void);
|
||||
MG_LOCAL void __mg_license_destroy(void);
|
||||
|
||||
#else
|
||||
# define __mg_license_create() /* NULL */
|
||||
# define __mg_license_destroy() /* NULL */
|
||||
#endif /* endif _MG_ENABLE_SPLASH or _MG_ENABLE_SCREENSAVER or _MG_ENABLE_WATERMARK*/
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _MG_ENABLE_SCREENSAVER
|
||||
MG_LOCAL void __mg_screensaver_create(void);
|
||||
@@ -102,9 +88,6 @@ MG_LOCAL void __mg_screensaver_destroy(void);
|
||||
# define __mg_screensaver_destroy() /* NULL */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Splash
|
||||
*/
|
||||
#ifdef _MG_ENABLE_SPLASH
|
||||
MG_LOCAL void __mg_splash_draw_framework(void);
|
||||
MG_LOCAL void __mg_splash_progress(void);
|
||||
@@ -115,96 +98,11 @@ MG_LOCAL void __mg_splash_delay(void);
|
||||
# define __mg_splash_delay() /* NULL */
|
||||
#endif /* endif _MG_ENABLE_SPLASH */
|
||||
|
||||
/*
|
||||
* ScreenSaver & Watermark
|
||||
*/
|
||||
#if defined(_MG_ENABLE_SCREENSAVER) || defined(_MG_ENABLE_WATERMARK)
|
||||
MG_LOCAL void __mg_license_on_input(void);
|
||||
MG_LOCAL void __mg_license_on_timeout(void);
|
||||
#else
|
||||
# define __mg_license_on_input() /* NULL */
|
||||
# define __mg_license_on_timeout() /* NULL */
|
||||
#endif /* _MG_ENABLE_SCREENSAVER || _MG_ENABLE_WATERMARK */
|
||||
|
||||
/*
|
||||
* Product ID
|
||||
*/
|
||||
#ifdef _MG_PRODUCTID
|
||||
typedef struct _product_id {
|
||||
/* Fixed 8-byte code, help us to locate the struct in .so file */
|
||||
unsigned char prefix[8];
|
||||
/* the ID of the customer */
|
||||
int customer_id;
|
||||
/* svn version */
|
||||
int version;
|
||||
/* When does we compile the .so, in seconds */
|
||||
int compile_date;
|
||||
/* The size of the .so file */
|
||||
int file_size;
|
||||
/* The check sum of the .so file */
|
||||
unsigned char checksum[16];
|
||||
} product_id_t;
|
||||
|
||||
#define PRODUCT_ID_PREFIX 0xca, 0x3f, 0x2b, 0x43, 0x00, 0x33, 0xb0, 0xc3
|
||||
|
||||
MG_LOCAL int license_get_customer_id(void);
|
||||
|
||||
#endif /* _MG_PRODUCTID */
|
||||
|
||||
/*
|
||||
* Tools to encrypt const variables
|
||||
*/
|
||||
MG_LOCAL unsigned int LICENSE_ENCRYPTED_CONST_INT(unsigned int);
|
||||
MG_LOCAL char *LICENSE_ENCRYPTED_CONST_STRING(unsigned char *, int);
|
||||
|
||||
/*
|
||||
* Processor ID
|
||||
*/
|
||||
#ifdef _MG_PRODUCTID
|
||||
# define LICENSE_CHECK_CUSTIMER_ID() \
|
||||
do { \
|
||||
if (! license_get_customer_id()) { \
|
||||
return ERR_INVALID_ARGS; \
|
||||
} \
|
||||
} while(0)
|
||||
#else
|
||||
# define LICENSE_CHECK_CUSTIMER_ID() /* NULL */
|
||||
#endif
|
||||
|
||||
#ifdef __TARGET_UNKNOWN__
|
||||
|
||||
# define license_get_processor_id() /* NULL */
|
||||
# define LICENSE_SET_MESSAGE_OFFSET() /* NULL */
|
||||
# define LICENSE_MODIFY_MESSAGE(x) /* NULL */
|
||||
|
||||
#else /* not __TARGET_UNKNOWN__ */
|
||||
|
||||
extern MG_LOCAL unsigned int g_license_processor_id; /* window.c */
|
||||
MG_LOCAL void license_get_processor_id (void);
|
||||
#define LICENSE_PROCESSOR_ID_NONE (0xFC1D8B2A)
|
||||
|
||||
extern MG_LOCAL unsigned int g_license_message_offset; /* zorder.c */
|
||||
|
||||
#if defined (_WITH_TARGET_S3C6410)
|
||||
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x1AE2FDFD /* 0x36410101 */)
|
||||
#elif defined (_WITH_TARGET_S3C2440)
|
||||
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x3AA4FDFD /* 0x32440101 */)
|
||||
#elif defined (_WITH_TARGET_S3C2410)
|
||||
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x3AE2FDFD /* 0x32410101 */)
|
||||
#elif defined (_WITH_TARGET_HI3560A)
|
||||
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0xFC38C9AD /* 0x35600200 */)
|
||||
#else
|
||||
# define REAL_PROCESSOR_ID LICENSE_PROCESSOR_ID_NONE
|
||||
#endif
|
||||
|
||||
#define LICENSE_SET_MESSAGE_OFFSET() do {g_license_message_offset=g_license_processor_id-(REAL_PROCESSOR_ID);}while (0)
|
||||
|
||||
#define LICENSE_MODIFY_MESSAGE(pMsg) \
|
||||
do { \
|
||||
pMsg->message += g_license_message_offset; \
|
||||
pMsg->hwnd -= g_license_message_offset / 2; \
|
||||
} while (0)
|
||||
|
||||
#endif /* __TARGET_UNKNOWN__ */
|
||||
#define __mg_license_on_input() /* NULL */
|
||||
#define __mg_license_on_timeout() /* NULL */
|
||||
#define LICENSE_CHECK_CUSTIMER_ID() /* NULL */
|
||||
#define license_get_processor_id() /* NULL */
|
||||
#define LICENSE_SET_MESSAGE_OFFSET() /* NULL */
|
||||
#define LICENSE_MODIFY_MESSAGE(x) /* NULL */
|
||||
|
||||
#endif /* LICENSE_H */
|
||||
|
||||
+11
-15
@@ -55,9 +55,9 @@
|
||||
#ifndef GUI_NEWGAL_H
|
||||
#define GUI_NEWGAL_H
|
||||
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
#include "constants.h"
|
||||
#include "blockheap.h"
|
||||
|
||||
#if IS_COMPOSITING_SCHEMA
|
||||
#include <sys/types.h>
|
||||
@@ -216,7 +216,10 @@ typedef struct GAL_Surface {
|
||||
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
pixman_image_t *pix_img; /* The pixman image object for this surface */
|
||||
void *blit_ctxt; /* blitting context */
|
||||
pixman_image_t *msk_img;
|
||||
uint16_t pix_op;
|
||||
uint16_t pix_filter;
|
||||
uint32_t pix_alpha_bits;
|
||||
#endif
|
||||
|
||||
#if IS_COMPOSITING_SCHEMA
|
||||
@@ -732,10 +735,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 */
|
||||
@@ -744,10 +747,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);
|
||||
@@ -818,13 +821,6 @@ static inline BOOL GAL_CheckPixmanFormats (GAL_Surface *src, GAL_Surface *dst)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
typedef struct GAL_BlittingContext {
|
||||
uint16_t op;
|
||||
uint16_t filter;
|
||||
uint32_t alpha_bits;
|
||||
pixman_image_t *msk_img;
|
||||
} GAL_BlittingContext;
|
||||
|
||||
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops);
|
||||
|
||||
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst);
|
||||
@@ -1071,8 +1067,8 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
|
||||
uint32_t name, uint32_t drm_format, uint32_t pixels_off,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video,
|
||||
uint32_t handle, size_t size, uint32_t drm_format, uint32_t pixels_off,
|
||||
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
|
||||
size_t size, uint32_t drm_format, uint32_t pixels_off,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -138,6 +138,14 @@ int __mg_save_png (MG_RWops* fp, MYBITMAP* bmp, RGB* pal);
|
||||
BOOL __mg_check_png (MG_RWops* fp);
|
||||
#endif
|
||||
|
||||
#ifdef _MGIMAGE_WEBP
|
||||
void* __mg_init_webp (MG_RWops* fp, MYBITMAP *png, RGB *pal);
|
||||
int __mg_load_webp (MG_RWops* fp, void* init_info, MYBITMAP *png, CB_ONE_SCANLINE cb, void* context);
|
||||
void __mg_cleanup_webp (void* init_info);
|
||||
int __mg_save_webp (MG_RWops* fp, MYBITMAP* bmp, RGB* pal);
|
||||
BOOL __mg_check_webp (MG_RWops* fp);
|
||||
#endif
|
||||
|
||||
int __mg_bmp_compute_pitch (int bpp, Uint32 width, Uint32 *pitch, BOOL does_round);
|
||||
|
||||
#define fp_getc(fp) MGUI_RWgetc(fp)
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ typedef struct _MSGQUEUE MSGQUEUE;
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
void __mg_update_tick_count (void* data);
|
||||
DWORD __mg_update_tick_count (MSGQUEUE* msg_queue);
|
||||
int __mg_check_expired_timers (MSGQUEUE* msg_queue, DWORD inter);
|
||||
void __mg_remove_timers_by_msg_queue (MSGQUEUE* msg_queue);
|
||||
void __mg_remove_timer (MSGQUEUE* msg_queue, int slot);
|
||||
|
||||
@@ -141,11 +141,17 @@ typedef struct _ZORDERINFO {
|
||||
/* The size of usage bitmap for mask rect. */
|
||||
int size_maskrect_usage_bmp;
|
||||
|
||||
/* use read/write lock for Unix-like OS */
|
||||
#ifndef __NOUNIX__
|
||||
#define __ZI_USE_RWLOCK 1
|
||||
#endif
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
# ifndef __NOUNIX__
|
||||
# ifdef __ZI_USE_RWLOCK
|
||||
pthread_rwlock_t rwlock;
|
||||
pthread_t rwlock_owner;
|
||||
# else
|
||||
pthread_mutex_t rwlock;
|
||||
pthread_mutex_t mutex;
|
||||
# endif
|
||||
#elif defined(_MGRM_PROCESSES)
|
||||
int zi_semid;
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
# also for makefile.ng and makefile.msvc
|
||||
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
||||
AM_CFLAGS = -Wno-zero-length-bounds
|
||||
|
||||
noinst_LTLIBRARIES = libkernel.la
|
||||
|
||||
if MG_MINIMALGDI
|
||||
libkernel_la_SOURCES = init-lite.c fixstr.c \
|
||||
blockheap.c
|
||||
else
|
||||
libkernel_la_SOURCES = timer.c init.c init-lite.c \
|
||||
desktop-ths.c desktop-sa.c desktop-procs.c \
|
||||
cursor.c cursor-procs.c cursor-sa.c \
|
||||
sharedres.c message.c event.c listenfd.c \
|
||||
blockheap.c fixstr.c slotset.c zorder.c sem-manager.c \
|
||||
compsor-manager.c compsor-fallback.c
|
||||
endif
|
||||
|
||||
EXTRA_DIST= desktop.c desktop-comm.c cursor-comm.c makefile.ng makefile.msvc
|
||||
|
||||
|
||||
@@ -59,13 +59,13 @@
|
||||
#include "common.h"
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
#include "window.h"
|
||||
#include "constants.h"
|
||||
#include "blockheap.h"
|
||||
#include "misc.h"
|
||||
|
||||
BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap)
|
||||
{
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_init (&heap->lock, NULL);
|
||||
#endif
|
||||
|
||||
@@ -99,7 +99,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
|
||||
int free_slot;
|
||||
unsigned char* block_data = NULL;
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_lock (&heap->lock);
|
||||
#endif
|
||||
|
||||
@@ -118,7 +118,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
|
||||
|
||||
ret:
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_unlock (&heap->lock);
|
||||
#endif
|
||||
return block_data;
|
||||
@@ -128,7 +128,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
|
||||
{
|
||||
unsigned char* block_data = data;
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_lock (&heap->lock);
|
||||
#endif
|
||||
|
||||
@@ -146,7 +146,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
|
||||
heap, slot);
|
||||
}
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_unlock (&heap->lock);
|
||||
#endif
|
||||
}
|
||||
@@ -193,7 +193,7 @@ void DestroyBlockDataHeap (PBLOCKHEAP heap)
|
||||
free (heap->usage_bmp);
|
||||
heap->usage_bmp = NULL;
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_destroy (&heap->lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1303,7 +1303,7 @@ static void transit_to_layer (CompositorCtxt* ctxt, MG_Layer* to_layer)
|
||||
}
|
||||
}
|
||||
|
||||
_DBG_PRINTF ("Average time to composite the layers: %u (times: %u)\n", total_time_ms / total_times, total_times);
|
||||
_DBG_PRINTF ("Average time to composite the layers: %ums (times: %u)\n", total_time_ms / total_times, total_times);
|
||||
}
|
||||
|
||||
CompositorOps __mg_fallback_compositor = {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2002~2021, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -489,7 +489,7 @@ const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
|
||||
if (compositors [i].name && strcmp (compositors [i].name, name) == 0) {
|
||||
if (strcmp (compositors [i].name, name) == 0) {
|
||||
return compositors [i].ops;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ static int dskAddNewMainWindow (PMAINWIN pWin)
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1403,7 +1403,7 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
|
||||
else {
|
||||
from = 0;
|
||||
}
|
||||
|
||||
|
||||
lock_zi_for_read (zi);
|
||||
|
||||
from = __kernel_get_next_znode (zi, from);
|
||||
@@ -1429,6 +1429,8 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
|
||||
/* Since 5.0.0 */
|
||||
case MSG_SETAUTOREPEAT:
|
||||
sg_msgAutoRepeat = *(const MSG*)lParam;
|
||||
/* start auto-repeat after 300ms */
|
||||
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_timeout_usec/10000);
|
||||
break;
|
||||
|
||||
/* Since 5.0.0 */
|
||||
@@ -1743,11 +1745,6 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
|
||||
FreeZOrderNode (0, pCtrl->idx_znode, NULL);
|
||||
}
|
||||
|
||||
if (fFound) {
|
||||
pCtrl->pcci->nUseCount --;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((HWND)pCtrl == __mg_captured_wnd) {
|
||||
/* force release the capture */
|
||||
__mg_captured_wnd = 0;
|
||||
@@ -1762,6 +1759,11 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
|
||||
sg_msgAutoRepeat.hwnd = 0;
|
||||
}
|
||||
|
||||
if (fFound) {
|
||||
pCtrl->pcci->nUseCount--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1821,7 +1823,7 @@ static void dskRefreshAllWindow (const RECT* invrc)
|
||||
info.is_empty_invrc = TRUE;
|
||||
|
||||
#ifdef _MGHAVE_MENU
|
||||
dskForceCloseMenu ();
|
||||
dskForceCloseMenu ();
|
||||
#endif
|
||||
|
||||
SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0,
|
||||
@@ -1873,9 +1875,12 @@ static void dskOnTimeout (void)
|
||||
static DWORD uCounter = 0;
|
||||
static DWORD blink_counter = 0;
|
||||
|
||||
if (sg_msgAutoRepeat.hwnd != 0) {
|
||||
if (sg_msgAutoRepeat.hwnd != 0 &&
|
||||
__mg_tick_counter >= sg_msgAutoRepeat.time) {
|
||||
PostMessage (sg_msgAutoRepeat.hwnd, sg_msgAutoRepeat.message,
|
||||
sg_msgAutoRepeat.wParam, sg_msgAutoRepeat.lParam);
|
||||
/* next auto-repeat msg after 50ms */
|
||||
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_repeat_usec/10000);
|
||||
}
|
||||
|
||||
if (__mg_tick_counter < (blink_counter + 10))
|
||||
|
||||
+13
-15
@@ -78,6 +78,7 @@
|
||||
#include "server.h"
|
||||
#include "drawsemop.h"
|
||||
#include "devfont.h"
|
||||
#include "event.h"
|
||||
|
||||
/******************************* global data *********************************/
|
||||
PMSGQUEUE __mg_dsk_msg_queue;
|
||||
@@ -231,14 +232,6 @@ static void init_desktop_win (void)
|
||||
|
||||
BOOL mg_InitDesktop (void)
|
||||
{
|
||||
#if 0 /* move to init-lite.c */
|
||||
/* Since 5.0.0: allocate message queue for desktop thread */
|
||||
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
|
||||
_WRN_PRINTF ("failed to allocate message queue\n");
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* moved code */
|
||||
|
||||
#ifndef _MGSCHEMA_COMPOSITING
|
||||
/* Init heap of clipping rects. */
|
||||
InitFreeClipRectList (&sg_FreeClipRectList, SIZE_CLIPRECTHEAP);
|
||||
@@ -259,7 +252,7 @@ BOOL mg_InitDesktop (void)
|
||||
void mg_TerminateDesktop (void)
|
||||
{
|
||||
/* Since 5.0.0: message queue for desktop thread was dynamically allocated */
|
||||
mg_FreeMsgQueueForThisThread ();
|
||||
mg_FreeMsgQueueForThisThread (TRUE);
|
||||
__mg_dsk_msg_queue = NULL;
|
||||
|
||||
#ifndef _MGSCHEMA_COMPOSITING
|
||||
@@ -2756,6 +2749,8 @@ static LRESULT dskWindowMessageHandler (UINT message,
|
||||
/* Since 5.0.0 */
|
||||
case MSG_SETAUTOREPEAT:
|
||||
sg_msgAutoRepeat = *(const MSG*)lParam;
|
||||
/* start auto-repeat after 300ms */
|
||||
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_timeout_usec/10000);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3553,11 +3548,6 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
|
||||
cliFreeZOrderNode ((PMAINWIN)pCtrl);
|
||||
}
|
||||
|
||||
if (fFound) {
|
||||
pCtrl->pcci->nUseCount --;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((HWND)pCtrl == __mg_captured_wnd) {
|
||||
/* force release the capture */
|
||||
__mg_captured_wnd = 0;
|
||||
@@ -3572,6 +3562,11 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
|
||||
sg_msgAutoRepeat.hwnd = 0;
|
||||
}
|
||||
|
||||
if (fFound) {
|
||||
pCtrl->pcci->nUseCount--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -4212,9 +4207,12 @@ static void dskOnTimeout (void)
|
||||
static UINT uCounter = 0;
|
||||
static UINT blink_counter = 0;
|
||||
|
||||
if (sg_msgAutoRepeat.hwnd != 0) {
|
||||
if (sg_msgAutoRepeat.hwnd != 0 &&
|
||||
__mg_tick_counter >= sg_msgAutoRepeat.time) {
|
||||
PostMessage (sg_msgAutoRepeat.hwnd, sg_msgAutoRepeat.message,
|
||||
sg_msgAutoRepeat.wParam, sg_msgAutoRepeat.lParam);
|
||||
/* next auto-repeat msg after 50ms */
|
||||
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_repeat_usec/10000);
|
||||
}
|
||||
|
||||
if (__mg_tick_counter < (blink_counter + 10))
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#include "dc.h"
|
||||
#include "misc.h"
|
||||
#include "devfont.h"
|
||||
#include "event.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/termios.h>
|
||||
@@ -102,14 +103,6 @@ BOOL mg_InitDesktop (void)
|
||||
int ret;
|
||||
RECT rcScr = GetScreenRect();
|
||||
|
||||
#if 0 /* move to init-lite.c */
|
||||
/* Since 5.0.0: allocate message queue for desktop thread */
|
||||
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
|
||||
_WRN_PRINTF ("failed to allocate message queue\n");
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* moved code */
|
||||
|
||||
/*
|
||||
* Init ZOrderInfo here.
|
||||
*/
|
||||
@@ -153,7 +146,7 @@ BOOL mg_InitDesktop (void)
|
||||
void mg_TerminateDesktop (void)
|
||||
{
|
||||
if (__mg_dsk_msg_queue) {
|
||||
mg_FreeMsgQueueForThisThread ();
|
||||
mg_FreeMsgQueueForThisThread (TRUE);
|
||||
__mg_dsk_msg_queue = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include "dc.h"
|
||||
#include "misc.h"
|
||||
#include "devfont.h"
|
||||
#include "event.h"
|
||||
|
||||
/******************************* global data *********************************/
|
||||
/* pointer to desktop message queue */
|
||||
@@ -140,19 +141,29 @@ BOOL mg_InitDesktop (void)
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
static IDLEHANDLER std_idle_handler;
|
||||
|
||||
static BOOL idle_handler_for_desktop_thread (MSGQUEUE *msg_queue, BOOL wait)
|
||||
{
|
||||
__mg_update_tick_count (msg_queue);
|
||||
return std_idle_handler (msg_queue, wait);
|
||||
}
|
||||
|
||||
void* __kernel_desktop_main (void* data)
|
||||
{
|
||||
MSG Msg;
|
||||
|
||||
/* init message queue of desktop thread */
|
||||
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
|
||||
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread (TRUE)) ) {
|
||||
_ERR_PRINTF ("failed to allocate message queue\n");
|
||||
sem_post ((sem_t*)data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* for threads mode, the idle handler for desktop thread is NULL */
|
||||
__mg_dsk_msg_queue->OnIdle = NULL;
|
||||
/* For bug reported in Issue #116, under threads mode, the idle handler
|
||||
for the desktop thread should call __mg_update_tick_count () */
|
||||
std_idle_handler = __mg_dsk_msg_queue->OnIdle;
|
||||
__mg_dsk_msg_queue->OnIdle = idle_handler_for_desktop_thread;
|
||||
|
||||
/* init desktop window */
|
||||
init_desktop_win ();
|
||||
@@ -191,7 +202,7 @@ void* __kernel_desktop_main (void* data)
|
||||
#endif
|
||||
}
|
||||
|
||||
mg_FreeMsgQueueForThisThread ();
|
||||
mg_FreeMsgQueueForThisThread (TRUE);
|
||||
__mg_dsk_msg_queue = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+39
-29
@@ -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~2022, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -597,55 +597,63 @@ static void reset_window (PMAINWIN pWin, RECT* rcWin)
|
||||
#endif
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifndef __NOUNIX__
|
||||
/*for unix system, using read/write lock*/
|
||||
static inline void lock_zi_for_change (const ZORDERINFO* zi)
|
||||
# ifdef __ZI_USE_RWLOCK
|
||||
static inline void lock_zi_for_change (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_rwlock_wrlock(&((ZORDERINFO*)zi)->rwlock);
|
||||
pthread_rwlock_wrlock(&zi->rwlock);
|
||||
zi->rwlock_owner = pthread_self();
|
||||
}
|
||||
|
||||
static inline void unlock_zi_for_change (const ZORDERINFO* zi)
|
||||
static inline void unlock_zi_for_change (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_rwlock_unlock(&((ZORDERINFO*)zi)->rwlock);
|
||||
pthread_rwlock_unlock(&zi->rwlock);
|
||||
zi->rwlock_owner = 0;
|
||||
}
|
||||
|
||||
static inline void lock_zi_for_read (const ZORDERINFO* zi)
|
||||
static inline void lock_zi_for_read (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_rwlock_rdlock(&((ZORDERINFO*)zi)->rwlock);
|
||||
if (zi->rwlock_owner == pthread_self()) {
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_rwlock_rdlock(&zi->rwlock);
|
||||
}
|
||||
|
||||
static inline void unlock_zi_for_read (const ZORDERINFO* zi)
|
||||
static inline void unlock_zi_for_read (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_rwlock_unlock(&((ZORDERINFO*)zi)->rwlock);
|
||||
if (zi->rwlock_owner == pthread_self()) {
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_rwlock_unlock(&zi->rwlock);
|
||||
}
|
||||
#else /* __NOUNIX__ */
|
||||
/*for non-unix system, using mutex*/
|
||||
static inline void lock_zi_for_change (const ZORDERINFO* zi)
|
||||
# else /* __ZI_USE_RWLOCK */
|
||||
static inline void lock_zi_for_change (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_mutex_lock(&((ZORDERINFO*)zi)->rwlock);
|
||||
pthread_mutex_lock(&zi->mutex);
|
||||
}
|
||||
|
||||
static inline void unlock_zi_for_change (const ZORDERINFO* zi)
|
||||
static inline void unlock_zi_for_change (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_mutex_unlock(&((ZORDERINFO*)zi)->rwlock);
|
||||
pthread_mutex_unlock(&zi->mutex);
|
||||
}
|
||||
|
||||
static inline void lock_zi_for_read (const ZORDERINFO* zi)
|
||||
static inline void lock_zi_for_read (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_mutex_lock(&((ZORDERINFO*)zi)->rwlock);
|
||||
pthread_mutex_lock(&zi->mutex);
|
||||
}
|
||||
|
||||
static inline void unlock_zi_for_read (const ZORDERINFO* zi)
|
||||
static inline void unlock_zi_for_read (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_mutex_unlock(&((ZORDERINFO*)zi)->rwlock);
|
||||
pthread_mutex_unlock(&zi->mutex);
|
||||
}
|
||||
#endif /* __NOUNIX__ */
|
||||
# endif /* notdef __ZI_USE_RWLOCK */
|
||||
|
||||
#elif defined(_MGRM_STANDALONE)
|
||||
static inline void lock_zi_for_change (const ZORDERINFO* zi) { }
|
||||
static inline void unlock_zi_for_change (const ZORDERINFO* zi) { }
|
||||
static inline void lock_zi_for_read (const ZORDERINFO* zi) { }
|
||||
static inline void unlock_zi_for_read (const ZORDERINFO* zi) { }
|
||||
static inline void lock_zi_for_change (ZORDERINFO* zi) { }
|
||||
static inline void unlock_zi_for_change (ZORDERINFO* zi) { }
|
||||
static inline void lock_zi_for_read (ZORDERINFO* zi) { }
|
||||
static inline void unlock_zi_for_read (ZORDERINFO* zi) { }
|
||||
#else /* for procs */
|
||||
/* NULL. see desktop-procs.c */
|
||||
#endif /* _MGRM_THREADS */
|
||||
@@ -3641,6 +3649,9 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
||||
|
||||
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
|
||||
|
||||
/* unlock zi for change ... */
|
||||
unlock_zi_for_change (zi);
|
||||
|
||||
if (nodes [0].flags & ZOF_IF_REFERENCE) {
|
||||
SendMessage (HWND_DESKTOP,
|
||||
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
|
||||
@@ -3680,9 +3691,6 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
|
||||
|
||||
update_client_window_rgn (nodes [idx_znode].cli,
|
||||
nodes [idx_znode].hwnd);
|
||||
|
||||
/* unlock zi for change ... */
|
||||
unlock_zi_for_change (zi);
|
||||
}
|
||||
else {
|
||||
lock_zi_for_change (zi);
|
||||
@@ -4499,7 +4507,9 @@ int __mg_join_all_message_threads (void)
|
||||
|
||||
list_for_each (l, &msg_queue_list) {
|
||||
MSGQUEUE *msg_queue = (MSGQUEUE*)l;
|
||||
#ifndef NDEBUG
|
||||
dump_message_queue (msg_queue, __func__);
|
||||
#endif
|
||||
pthread_cancel (msg_queue->th);
|
||||
}
|
||||
|
||||
|
||||
+14
-13
@@ -89,8 +89,9 @@
|
||||
|
||||
struct timeval __mg_event_timeout;
|
||||
|
||||
static DWORD timeoutusec;
|
||||
static DWORD repeatusec;
|
||||
DWORD __mg_timeout_usec;
|
||||
DWORD __mg_repeat_usec;
|
||||
|
||||
static DWORD dblclicktime;
|
||||
|
||||
#ifndef _MGRM_THREADS
|
||||
@@ -121,8 +122,8 @@ static void GetTimeout (void)
|
||||
char szValue [11];
|
||||
int mytimeoutusec, myrepeatusec;
|
||||
|
||||
timeoutusec = DEF_USEC_TIMEOUT;
|
||||
repeatusec = DEF_REPEAT_TIME;
|
||||
__mg_timeout_usec = DEF_USEC_TIMEOUT;
|
||||
__mg_repeat_usec = DEF_REPEAT_TIME;
|
||||
|
||||
if (GetMgEtcValue (EVENTPARA, EVENTPARA_REPEATUSEC, szValue, 10) < 0)
|
||||
return;
|
||||
@@ -133,8 +134,8 @@ static void GetTimeout (void)
|
||||
mytimeoutusec = atoi(szValue);
|
||||
|
||||
if (myrepeatusec >= 0 && mytimeoutusec > 0) {
|
||||
timeoutusec = mytimeoutusec;
|
||||
repeatusec = myrepeatusec;
|
||||
__mg_timeout_usec = mytimeoutusec;
|
||||
__mg_repeat_usec = myrepeatusec;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +209,7 @@ static void ResetKeyEvent(void)
|
||||
IAL_SetLeds (slock | (numlock << 1) | (capslock << 2));
|
||||
|
||||
__mg_event_timeout.tv_sec = 0;
|
||||
__mg_event_timeout.tv_usec = timeoutusec;
|
||||
__mg_event_timeout.tv_usec = __mg_timeout_usec;
|
||||
|
||||
#ifndef _MGRM_THREADS
|
||||
#ifdef _MGRM_PROCESSES
|
||||
@@ -216,8 +217,8 @@ static void ResetKeyEvent(void)
|
||||
SHAREDRES_SHIFTSTATUS = status;
|
||||
#endif
|
||||
|
||||
timeout_threshold = timeoutusec / 10000;
|
||||
repeat_threshold = repeatusec / 10000;
|
||||
timeout_threshold = __mg_timeout_usec / 10000;
|
||||
repeat_threshold = __mg_repeat_usec / 10000;
|
||||
timeout_count = timeout_threshold;
|
||||
#endif
|
||||
}
|
||||
@@ -631,7 +632,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
||||
|
||||
// set repeat time
|
||||
__mg_event_timeout.tv_sec = 0;
|
||||
__mg_event_timeout.tv_usec = repeatusec;
|
||||
__mg_event_timeout.tv_usec = __mg_repeat_usec;
|
||||
|
||||
// repeat last event
|
||||
if (old_lwe.type == LWETYPE_KEY
|
||||
@@ -652,7 +653,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
||||
old_lwe.data.me.event == ME_MIDDLEDOWN))) {
|
||||
// reset delay time
|
||||
__mg_event_timeout.tv_sec = 0;
|
||||
__mg_event_timeout.tv_usec = timeoutusec;
|
||||
__mg_event_timeout.tv_usec = __mg_timeout_usec;
|
||||
}
|
||||
|
||||
lwe->type = LWETYPE_TIMEOUT;
|
||||
@@ -880,7 +881,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
||||
memcpy (oldkeystate, keystate, nr_keys);
|
||||
memcpy (&old_lwe, lwe, sizeof (LWEVENT));
|
||||
__mg_event_timeout.tv_sec = 0;
|
||||
__mg_event_timeout.tv_usec = timeoutusec;
|
||||
__mg_event_timeout.tv_usec = __mg_timeout_usec;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -899,7 +900,7 @@ mouseret:
|
||||
me->status = status;
|
||||
memcpy (&old_lwe, lwe, sizeof (LWEVENT));
|
||||
__mg_event_timeout.tv_sec = 0;
|
||||
__mg_event_timeout.tv_usec = timeoutusec;
|
||||
__mg_event_timeout.tv_usec = __mg_timeout_usec;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
+8
-8
@@ -66,7 +66,7 @@ static struct FIXSTR {
|
||||
BYTE bitmap[LEN_BITMAP];
|
||||
int offset[NR_HEAP];
|
||||
char* heap[NR_HEAP + 1];
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_t lock;
|
||||
#endif
|
||||
} FixStrHeap;
|
||||
@@ -98,7 +98,7 @@ BOOL mg_InitFixStr (void)
|
||||
offset += 1<<i;
|
||||
}
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_init (&FixStrHeap.lock, NULL);
|
||||
#endif
|
||||
return TRUE;
|
||||
@@ -106,7 +106,7 @@ BOOL mg_InitFixStr (void)
|
||||
|
||||
void mg_TerminateFixStr (void)
|
||||
{
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_destroy (&FixStrHeap.lock);
|
||||
#endif
|
||||
free (FixStrHeap.heap[0]);
|
||||
@@ -154,7 +154,7 @@ char* GUIAPI FixStrAlloc (int len)
|
||||
// ..
|
||||
// if i == 0; then bufflen = 512
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_lock (&FixStrHeap.lock);
|
||||
#endif
|
||||
|
||||
@@ -166,7 +166,7 @@ char* GUIAPI FixStrAlloc (int len)
|
||||
for(j = 0; j < 8; j++) {
|
||||
if (*bitmap & (0x80 >> j)) {
|
||||
*bitmap &= (~(0x80 >> j));
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_unlock (&FixStrHeap.lock);
|
||||
#endif
|
||||
#if 0
|
||||
@@ -181,7 +181,7 @@ char* GUIAPI FixStrAlloc (int len)
|
||||
bitmap++;
|
||||
}
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_unlock (&FixStrHeap.lock);
|
||||
#endif
|
||||
return (char*)malloc (len + 1);
|
||||
@@ -216,7 +216,7 @@ void GUIAPI FreeFixStr (char* str)
|
||||
// if i == 0; then bufflen = 512
|
||||
bufflen = 1 << (NR_HEAP + 1 - i);
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_lock (&FixStrHeap.lock);
|
||||
#endif
|
||||
heap = FixStrHeap.heap[i];
|
||||
@@ -236,7 +236,7 @@ void GUIAPI FreeFixStr (char* str)
|
||||
bitmap = bitmap + (stroff>>3);
|
||||
*bitmap |= (0x80 >> (stroff%8));
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifdef _MGHAVE_VIRTUAL_WINDOW
|
||||
pthread_mutex_unlock (&FixStrHeap.lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ int InitGUI (int argc, const char* agr[])
|
||||
|
||||
/* Since 5.0.0
|
||||
allocate message queue for desktop thread before starting client. */
|
||||
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
|
||||
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread (TRUE)) ) {
|
||||
err_message (step, "Failed to allocate message queue!");
|
||||
return step;
|
||||
}
|
||||
|
||||
+5
-18
@@ -391,14 +391,6 @@ static BOOL InstallSEGVHandler (void)
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
static IDLEHANDLER std_idle_handler;
|
||||
|
||||
static BOOL idle_handler_for_main_thread (MSGQUEUE *msg_queue, BOOL wait)
|
||||
{
|
||||
__mg_update_tick_count (NULL);
|
||||
return std_idle_handler (msg_queue, wait);
|
||||
}
|
||||
|
||||
int GUIAPI InitGUI (int args, const char *agr[])
|
||||
{
|
||||
char engine [LEN_ENGINE_NAME + 1];
|
||||
@@ -578,19 +570,14 @@ int GUIAPI InitGUI (int args, const char *agr[])
|
||||
|
||||
/* init message queue of main GUI thread */
|
||||
step++;
|
||||
if (!(msg_queue = mg_AllocMsgQueueForThisThread ())) {
|
||||
if (!(msg_queue = mg_AllocMsgQueueForThisThread (TRUE))) {
|
||||
_ERR_PRINTF ("KERNEL>InitGUI: failed to allocate message queue!\n");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
/* for threads mode, the idle handler for the main threads should
|
||||
call __mg_update_tick_count () */
|
||||
std_idle_handler = msg_queue->OnIdle;
|
||||
msg_queue->OnIdle = idle_handler_for_main_thread;
|
||||
|
||||
/* init timer for tick counter */
|
||||
step++;
|
||||
if (!mg_InitTimer (FALSE)) {
|
||||
if (!mg_InitTimer()) {
|
||||
_ERR_PRINTF ("KERNEL>InitGUI: failed to start time counter\n");
|
||||
goto failure;
|
||||
}
|
||||
@@ -615,7 +602,9 @@ failure1:
|
||||
|
||||
void GUIAPI TerminateGUI (int not_used)
|
||||
{
|
||||
mg_TerminateTimer (FALSE);
|
||||
mg_TerminateTimer ();
|
||||
|
||||
mg_FreeMsgQueueForThisThread (TRUE);
|
||||
|
||||
/* Since 5.0.0 */
|
||||
SendNotifyMessage (HWND_DESKTOP, MSG_ENDSESSION, 0, 0);
|
||||
@@ -655,8 +644,6 @@ void GUIAPI TerminateGUI (int not_used)
|
||||
miFreeArcCache ();
|
||||
#endif
|
||||
|
||||
mg_FreeMsgQueueForThisThread ();
|
||||
|
||||
deleteThreadInfoKey ();
|
||||
|
||||
mg_TerminateSliceAllocator();
|
||||
|
||||
+16
-17
@@ -60,7 +60,6 @@
|
||||
#include "gdi.h"
|
||||
#include "window.h"
|
||||
|
||||
#include "blockheap.h"
|
||||
#include "cliprect.h"
|
||||
#include "gal.h"
|
||||
#include "internals.h"
|
||||
@@ -159,7 +158,7 @@ void mg_DestroyFreeQMSGList (void)
|
||||
pthread_key_t __mg_threadinfo_key;
|
||||
#endif
|
||||
|
||||
MSGQUEUE* mg_AllocMsgQueueForThisThread (void)
|
||||
MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in)
|
||||
{
|
||||
MSGQUEUE* pMsgQueue;
|
||||
|
||||
@@ -177,13 +176,14 @@ MSGQUEUE* mg_AllocMsgQueueForThisThread (void)
|
||||
pthread_setspecific (__mg_threadinfo_key, pMsgQueue);
|
||||
#endif
|
||||
|
||||
// register this new message queue
|
||||
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
|
||||
MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue);
|
||||
if (sign_in) {
|
||||
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
|
||||
MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue);
|
||||
}
|
||||
return pMsgQueue;
|
||||
}
|
||||
|
||||
void mg_FreeMsgQueueForThisThread (void)
|
||||
void mg_FreeMsgQueueForThisThread (BOOL sign_off)
|
||||
{
|
||||
MSGQUEUE* pMsgQueue;
|
||||
|
||||
@@ -194,6 +194,11 @@ void mg_FreeMsgQueueForThisThread (void)
|
||||
_WRN_PRINTF ("there are still some windows not destroyed\n");
|
||||
}
|
||||
|
||||
if (sign_off) {
|
||||
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
|
||||
MSGTHREAD_SIGNOUT, (LPARAM)pMsgQueue);
|
||||
}
|
||||
|
||||
mg_DestroyMsgQueue (pMsgQueue);
|
||||
free (pMsgQueue);
|
||||
|
||||
@@ -823,8 +828,9 @@ checkagain:
|
||||
goto got_ret;
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
pMsgQueue->dwState &= ~QS_POSTMSG;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1410,6 +1416,9 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
|
||||
to the controls of the main window will be thrown away as well. */
|
||||
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
|
||||
{
|
||||
/* For a main window, we use pMainWin to check whether we
|
||||
should throw away a message for controls of the main window.
|
||||
Note that checkAndGetMainWindowIfControl returns NULL for non control. */
|
||||
PMAINWIN pMainWin = (PMAINWIN)hWnd;
|
||||
PMSG pMsg;
|
||||
PQMSG pQMsg;
|
||||
@@ -1421,16 +1430,6 @@ int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
|
||||
|
||||
LOCK_MSGQ (pMsgQueue);
|
||||
|
||||
/* for virtual window and main window, use pMainWin to check whether we
|
||||
should throw away a message for controls of a main window.
|
||||
checkAndGetMainWindowIfControl returns NULL for non control. */
|
||||
if (pMainWin != HWND_NULL && pMainWin != HWND_INVALID &&
|
||||
(pMainWin->WinType == TYPE_MAINWIN ||
|
||||
pMainWin->WinType == TYPE_VIRTWIN))
|
||||
pMainWin = (PMAINWIN)hWnd;
|
||||
else
|
||||
pMainWin = NULL;
|
||||
|
||||
if (pMsgQueue->pFirstNotifyMsg) {
|
||||
PQMSG pPrev = NULL, pNext;
|
||||
pQMsg = pMsgQueue->pFirstNotifyMsg;
|
||||
|
||||
+80
-306
File diff suppressed because it is too large
Load Diff
+20
-11
@@ -67,9 +67,6 @@
|
||||
#ifdef _MG_ENABLE_LICENSE
|
||||
# include "../sysres/license/c_files/03_progressbar.dat.c"
|
||||
#endif
|
||||
#ifndef __TARGET_UNKNOWN__
|
||||
unsigned int g_license_message_offset;
|
||||
#endif
|
||||
|
||||
#ifdef _MGRM_PROCESSES
|
||||
# include "ourhdr.h"
|
||||
@@ -246,11 +243,23 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_mask
|
||||
#endif /* deprecated code */
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifndef __NOUNIX__
|
||||
# ifdef __ZI_USE_RWLOCK
|
||||
pthread_rwlock_init(&__mg_zorder_info->rwlock, NULL);
|
||||
#else
|
||||
pthread_mutex_init(&__mg_zorder_info->rwlock, NULL);
|
||||
#endif
|
||||
__mg_zorder_info->rwlock_owner = 0;
|
||||
# else
|
||||
do {
|
||||
int ret;
|
||||
pthread_mutexattr_t my_attr;
|
||||
ret = pthread_mutexattr_init(&my_attr);
|
||||
assert(ret == 0);
|
||||
ret = pthread_mutexattr_settype(&my_attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
assert(ret == 0);
|
||||
pthread_mutex_init(&__mg_zorder_info->mutex, &my_attr);
|
||||
ret = pthread_mutexattr_destroy(&my_attr);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
} while (0);
|
||||
# endif
|
||||
#endif
|
||||
return 0;
|
||||
#endif
|
||||
@@ -264,11 +273,11 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
|
||||
#else
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
#ifndef __NOUNIX__
|
||||
# ifdef __ZI_USE_RWLOCK
|
||||
pthread_rwlock_destroy(&zi->rwlock);
|
||||
#else
|
||||
pthread_mutex_destroy(&zi->rwlock);
|
||||
#endif
|
||||
# else
|
||||
pthread_mutex_destroy(&zi->mutex);
|
||||
# endif
|
||||
#endif
|
||||
free (zi);
|
||||
__mg_zorder_info = NULL;
|
||||
|
||||
+1
-1
@@ -1472,7 +1472,7 @@ void mg_slice_debug_tree_statistics (void)
|
||||
su / bf, en, ex);
|
||||
}
|
||||
else
|
||||
_MG_PRINTF("MGSlice: MemChecker: root=NULL\n");
|
||||
_DBG_PRINTF("MGSlice: MemChecker: root=NULL\n");
|
||||
|
||||
pthread_mutex_unlock (&smc_tree_mutex);
|
||||
|
||||
|
||||
@@ -5,13 +5,9 @@ EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||
math.c about.c error.c sockio.c rc4.c rc4.h \
|
||||
makefile.ng makefile.msvc
|
||||
|
||||
if MG_MINIMALGDI
|
||||
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
|
||||
else
|
||||
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||
math.c about.c license.c anon_file.c rbtree.c map.c \
|
||||
error.c sockio.c
|
||||
endif
|
||||
|
||||
SRC_FILES = $(libmisc_la_SOURCES)
|
||||
LIB_NAME=libmisc
|
||||
|
||||
+7
-339
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,9 @@
|
||||
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
||||
AM_CPPFLAGS = $(WEBP_CFLAGS)
|
||||
AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
||||
|
||||
noinst_LTLIBRARIES = libmybmp.la
|
||||
|
||||
SRC_FILES = mybmp.c winbmp.c gif.c jpeg.c png12.c png16.c lbm.c pcx.c tga.c
|
||||
SRC_FILES = mybmp.c winbmp.c gif.c jpeg.c png12.c png16.c webp.c lbm.c pcx.c tga.c
|
||||
|
||||
libmybmp_la_SOURCES = $(SRC_FILES)
|
||||
|
||||
|
||||
+3
-2
@@ -309,7 +309,7 @@ void* __mg_init_jpg (MG_RWops *fp, MYBITMAP* mybmp, RGB* pal)
|
||||
struct my_error_mgr *jerr;
|
||||
jpeg_init_info_t* init_info;
|
||||
|
||||
if (!read_be16(fp,&soi_marker) || JMK_SOI != soi_marker)
|
||||
if (!read_be16(fp, &soi_marker) || JMK_SOI != soi_marker)
|
||||
goto err; /* not JPEG image*/
|
||||
|
||||
MGUI_RWseek (fp, 0, SEEK_SET);
|
||||
@@ -353,7 +353,8 @@ void* __mg_init_jpg (MG_RWops *fp, MYBITMAP* mybmp, RGB* pal)
|
||||
}
|
||||
|
||||
/* Step 4: set parameters for decompression */
|
||||
cinfo->out_color_space = (mybmp->flags & MYBMP_LOAD_GRAYSCALE) ? JCS_GRAYSCALE: JCS_RGB;
|
||||
cinfo->out_color_space =
|
||||
(mybmp->flags & MYBMP_LOAD_GRAYSCALE) ? JCS_GRAYSCALE: JCS_RGB;
|
||||
cinfo->quantize_colors = FALSE;
|
||||
|
||||
if (!(mybmp->flags & MYBMP_LOAD_GRAYSCALE)) {
|
||||
|
||||
+8
-1
@@ -98,6 +98,9 @@ static BITMAP_TYPE_INFO bitmap_types [MAX_BITMAP_TYPES] =
|
||||
#ifdef _MGIMAGE_PNG
|
||||
{ "png", __mg_init_png, __mg_load_png, __mg_cleanup_png, NULL, __mg_check_png },
|
||||
#endif
|
||||
#ifdef _MGIMAGE_WEBP
|
||||
{ "webp", __mg_init_webp, __mg_load_webp, __mg_cleanup_webp, NULL, __mg_check_webp },
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -184,7 +187,8 @@ int __mg_bmp_compute_pitch(int bpp, Uint32 width, Uint32 *pitch, BOOL does_round
|
||||
return bytespp;
|
||||
}
|
||||
|
||||
void* GUIAPI InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp, RGB* pal)
|
||||
void* GUIAPI
|
||||
InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp, RGB* pal)
|
||||
{
|
||||
int type;
|
||||
LOAD_MYBITMAP_INFO* load_info;
|
||||
@@ -206,8 +210,11 @@ void* GUIAPI InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp,
|
||||
my_bmp->frames = 1;
|
||||
my_bmp->depth = GetGDCapability (HDC_SCREEN, GDCAP_BPP) << 3;
|
||||
|
||||
// initialize the palette with the screen palette.
|
||||
if (my_bmp->depth <= 8)
|
||||
GetPalette (HDC_SCREEN, 0, 256, (GAL_Color*)pal);
|
||||
else
|
||||
memset (pal, 0, sizeof(RGB) * 256); // reset the palette.
|
||||
|
||||
/* This is just for gray screen. If your screen is gray,
|
||||
* please define this macro _GRAY_SCREEN.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+25
-40
@@ -141,6 +141,7 @@ static void GAL_BlitCopyOverlap(GAL_BlitInfo *info)
|
||||
|
||||
w = info->d_width*info->dst->BytesPerPixel;
|
||||
h = info->d_height;
|
||||
|
||||
src = info->s_pixels;
|
||||
dst = info->d_pixels;
|
||||
srcskip = w+info->s_skip;
|
||||
@@ -332,39 +333,37 @@ int GAL_CalculateBlit(GAL_Surface *surface)
|
||||
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
|
||||
{
|
||||
if (GAL_CheckPixmanFormats (src, dst)) {
|
||||
GAL_BlittingContext* ctxt;
|
||||
src->blit_ctxt = malloc (sizeof (GAL_BlittingContext));
|
||||
if (src->blit_ctxt == NULL)
|
||||
return -1;
|
||||
|
||||
ctxt = src->blit_ctxt;
|
||||
if ((src->flags & GAL_SRCALPHA) && src->format->alpha != GAL_ALPHA_OPAQUE) {
|
||||
memset (&ctxt->alpha_bits, src->format->alpha, sizeof(uint32_t));
|
||||
ctxt->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
|
||||
&ctxt->alpha_bits, 4);
|
||||
if (ctxt->msk_img)
|
||||
pixman_image_set_repeat (ctxt->msk_img, PIXMAN_REPEAT_NORMAL);
|
||||
memset (&src->pix_alpha_bits, src->format->alpha, sizeof(uint32_t));
|
||||
src->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
|
||||
&src->pix_alpha_bits, 4);
|
||||
if (src->msk_img)
|
||||
pixman_image_set_repeat (src->msk_img, PIXMAN_REPEAT_NORMAL);
|
||||
}
|
||||
else
|
||||
ctxt->msk_img = NULL;
|
||||
src->msk_img = NULL;
|
||||
|
||||
ops &= COLOR_BLEND_FLAGS_MASK;
|
||||
if (ops == COLOR_BLEND_LEGACY) {
|
||||
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
|
||||
ctxt->op = PIXMAN_OP_OVER;
|
||||
src->pix_op = PIXMAN_OP_OVER;
|
||||
}
|
||||
else {
|
||||
ctxt->op = PIXMAN_OP_SRC;
|
||||
src->pix_op = PIXMAN_OP_SRC;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ctxt->op = ops;
|
||||
src->pix_op = ops;
|
||||
}
|
||||
|
||||
if (ctxt->op > PIXMAN_OP_HSL_LUMINOSITY ||
|
||||
ctxt->op < PIXMAN_OP_CLEAR) {
|
||||
ctxt->op = PIXMAN_OP_SRC;
|
||||
if (src->pix_op > PIXMAN_OP_HSL_LUMINOSITY ||
|
||||
src->pix_op < PIXMAN_OP_CLEAR) {
|
||||
src->pix_op = PIXMAN_OP_SRC;
|
||||
}
|
||||
|
||||
/* reset transform and filter */
|
||||
pixman_image_set_transform (src->pix_img, NULL);
|
||||
pixman_image_set_filter (src->pix_img, PIXMAN_FILTER_NEAREST, NULL, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -372,14 +371,13 @@ int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
|
||||
|
||||
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst)
|
||||
{
|
||||
if (src->blit_ctxt) {
|
||||
GAL_BlittingContext* ctxt = src->blit_ctxt;
|
||||
if (ctxt->msk_img)
|
||||
pixman_image_unref (ctxt->msk_img);
|
||||
free (src->blit_ctxt);
|
||||
src->blit_ctxt = NULL;
|
||||
if (src->msk_img) {
|
||||
pixman_image_unref (src->msk_img);
|
||||
src->msk_img = NULL;
|
||||
}
|
||||
|
||||
pixman_image_set_clip_region32 (dst->pix_img, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -389,35 +387,22 @@ static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
|
||||
pixman_image_t *src_img = src->pix_img, *dst_img = dst->pix_img;
|
||||
pixman_image_t *msk_img;
|
||||
pixman_op_t op;
|
||||
|
||||
if (src->blit_ctxt) {
|
||||
GAL_BlittingContext* ctxt = src->blit_ctxt;
|
||||
msk_img = ctxt->msk_img;
|
||||
op = (pixman_op_t)ctxt->op;
|
||||
}
|
||||
else {
|
||||
msk_img = NULL;
|
||||
op = PIXMAN_OP_SRC;
|
||||
}
|
||||
|
||||
_DBG_PRINTF ("srcrect: %d, %d, %dx%d; dstrect: %d, %d, %dx%d\n",
|
||||
srcrect->x, srcrect->y, srcrect->w, srcrect->h,
|
||||
dstrect->x, dstrect->y, dstrect->w, dstrect->h);
|
||||
msk_img = src->msk_img;
|
||||
op = (pixman_op_t)src->pix_op;
|
||||
|
||||
#if 0
|
||||
pixman_region32_t clip_region;
|
||||
pixman_region32_init_rect (&clip_region,
|
||||
dst->clip_rect.x, dst->clip_rect.y, dst->clip_rect.w, dst->clip_rect.h);
|
||||
pixman_image_set_clip_region32 (dst_img, &clip_region);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
// pixman_blt does not work
|
||||
if (pixman_image_get_format (src_img) == pixman_image_get_format (dst_img) &&
|
||||
op == PIXMAN_OP_SRC && msk_img == NULL) {
|
||||
pixman_blt ((uint32_t *)((char*)src->pixels + src->pixels_off),
|
||||
(uint32_t *)((char*)dst->pixels + dst->pixels_off),
|
||||
src->pitch, dst->pitch,
|
||||
src->pitch, dst->pitch,
|
||||
GAL_BytesPerPixel (src),
|
||||
GAL_BytesPerPixel (dst),
|
||||
srcrect->x, srcrect->y,
|
||||
|
||||
+5
-12
@@ -1524,12 +1524,12 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
|
||||
}
|
||||
} else {
|
||||
/* Now the meat, choose the blitter we want */
|
||||
int a_need = 0;
|
||||
if(dstfmt->Amask)
|
||||
int a_need = 0;
|
||||
if (dstfmt->Amask)
|
||||
a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
|
||||
table = normal_blit[srcfmt->BytesPerPixel-1];
|
||||
for ( which=0; table[which].srcR; ++which ) {
|
||||
if ( srcfmt->Rmask == table[which].srcR &&
|
||||
for (which=0; table[which].srcR; ++which) {
|
||||
if (srcfmt->Rmask == table[which].srcR &&
|
||||
srcfmt->Gmask == table[which].srcG &&
|
||||
srcfmt->Bmask == table[which].srcB &&
|
||||
dstfmt->BytesPerPixel == table[which].dstbpp &&
|
||||
@@ -1538,7 +1538,7 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
|
||||
dstfmt->Bmask == table[which].dstB &&
|
||||
(a_need & table[which].alpha) == a_need &&
|
||||
(CPU_Flags()&table[which].cpu_flags) ==
|
||||
table[which].cpu_flags )
|
||||
table[which].cpu_flags)
|
||||
break;
|
||||
}
|
||||
sdata->aux_data = table[which].aux_data;
|
||||
@@ -1547,13 +1547,6 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
|
||||
blitfun = BlitNtoNCopyAlpha;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ASM
|
||||
if ( (blitfun == GAL_BlitNtoN) || (blitfun == GAL_BlitNto1) )
|
||||
fprintf(stderr, "Using C blit\n");
|
||||
else
|
||||
fprintf(stderr, "Using optimized C blit\n");
|
||||
#endif /* DEBUG_ASM */
|
||||
|
||||
return(blitfun);
|
||||
}
|
||||
|
||||
|
||||
@@ -796,7 +796,7 @@ static GAL_Surface* create_surface_from_buffer (_THIS,
|
||||
surface->pixels_off = 0;
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
surface->pix_img = NULL;
|
||||
surface->blit_ctxt = NULL;
|
||||
surface->msk_img = NULL;
|
||||
#endif
|
||||
#if IS_COMPOSITING_SCHEMA
|
||||
surface->shared_header = NULL;
|
||||
@@ -952,6 +952,11 @@ static void DRM_DeleteDevice(GAL_VideoDevice *device)
|
||||
free(device);
|
||||
}
|
||||
|
||||
#ifdef __TARGET_PX30__
|
||||
static inline char* find_driver_for_device (const char *dev_name) {
|
||||
return strdup ("rockchip");
|
||||
}
|
||||
#else /* __TARGET_PX30__ */
|
||||
static char* find_driver_for_device (const char *dev_name)
|
||||
{
|
||||
char *driver;
|
||||
@@ -996,6 +1001,7 @@ static char* find_driver_for_device (const char *dev_name)
|
||||
|
||||
return strdup (driver + strlen ("/"));
|
||||
}
|
||||
#endif /* not defined __TARGET_PX30__ */
|
||||
|
||||
static DrmDriverOps* load_external_driver (DrmVideoData* vdata,
|
||||
const char* driver_name, int device_fd)
|
||||
@@ -1095,6 +1101,7 @@ static int open_drm_device(GAL_VideoDevice *device)
|
||||
_DBG_PRINTF("Try to load DRM driver: %s\n", driver_name);
|
||||
|
||||
fd = drmOpen(driver_name, NULL);
|
||||
|
||||
if (fd < 0) {
|
||||
_ERR_PRINTF("NEWGAL>DRM: drmOpen failed\n");
|
||||
free(driver_name);
|
||||
@@ -3568,7 +3575,7 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
|
||||
|
||||
/* called by drmCreateDCFromHandle */
|
||||
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
|
||||
unsigned long size, uint32_t drm_format, uint32_t pixels_off,
|
||||
size_t size, uint32_t drm_format, uint32_t pixels_off,
|
||||
uint32_t width, uint32_t height, uint32_t pitch)
|
||||
{
|
||||
GAL_VideoDevice *this = (GAL_VideoDevice *)video;
|
||||
|
||||
@@ -323,11 +323,13 @@ static void DUMMY_VideoQuit(_THIS)
|
||||
if (mgIsServer) {
|
||||
shm_unlink (DUMMYVID_SHAREDMEM_NAME);
|
||||
}
|
||||
#else
|
||||
#elif !defined(_MGRM_PROCESSES)
|
||||
if (this->screen->pixels != NULL) {
|
||||
free (this->screen->pixels);
|
||||
this->screen->pixels = NULL;
|
||||
}
|
||||
#else
|
||||
// do nothing (COMPOSITING_SCHEMA)
|
||||
#endif /* not (defined(_MGRM_PROCESSES) && defined (_MGSCHEMA_SHAREDFB)) */
|
||||
}
|
||||
|
||||
|
||||
+207
-84
File diff suppressed because it is too large
Load Diff
+18
-18
@@ -68,26 +68,39 @@ typedef struct vidmem_bucket {
|
||||
|
||||
/* Private display data */
|
||||
struct GAL_PrivateVideoData {
|
||||
/* For compositing schema, we force to use double buffering */
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
/* When double buffering supported, the real surface represents the ultimate
|
||||
* scan-out frame buffer, and the shadow screen represents the rendering
|
||||
* surface. When double buffering disabled, shadow_screen is NULL.
|
||||
*
|
||||
* For compositing schema, we force to use double buffering.
|
||||
* For threads and standalone mode, controlled by `fbcon.double_buffering`
|
||||
* run-time option. Not supported for processes mode.
|
||||
*/
|
||||
/* start of header for shadow screen */
|
||||
int magic, version;
|
||||
GAL_Surface *real_screen, *shadow_screen;
|
||||
RECT dirty_rc;
|
||||
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
/* Used to simulate the hardware cursor. */
|
||||
GAL_Surface *cursor;
|
||||
int csr_x, csr_y;
|
||||
int hot_x, hot_y;
|
||||
#endif
|
||||
/* end of header for shadow screen */
|
||||
#endif /* _MGSCHEMA_COMPOSITING */
|
||||
|
||||
int console_fd;
|
||||
struct fb_var_screeninfo cache_vinfo;
|
||||
struct fb_var_screeninfo currt_vinfo;
|
||||
struct fb_var_screeninfo saved_vinfo;
|
||||
int saved_cmaplen;
|
||||
__u16 *saved_cmap;
|
||||
|
||||
/* Since 5.0.13, use FBIOPAN_DISPLAY if possible */
|
||||
int nr_buffers;
|
||||
int idx_buffer;
|
||||
unsigned len_buffer;
|
||||
char *buffers[2];
|
||||
|
||||
#ifdef _MGHAVE_PCIACCESS
|
||||
int pci_accel_driver;
|
||||
#endif
|
||||
@@ -104,24 +117,11 @@ struct GAL_PrivateVideoData {
|
||||
|
||||
void (*wait_vbl)(_THIS);
|
||||
void (*wait_idle)(_THIS);
|
||||
|
||||
#if 0 /* deprecated code */
|
||||
int flip_page;
|
||||
char *flip_address[2];
|
||||
#define flip_page (this->hidden->flip_page)
|
||||
#define flip_address (this->hidden->flip_address)
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Old variable names */
|
||||
#define console_fd (this->hidden->console_fd)
|
||||
#define current_vt (this->hidden->current_vt)
|
||||
#define saved_vt (this->hidden->saved_vt)
|
||||
#define keyboard_fd (this->hidden->keyboard_fd)
|
||||
#define saved_kbd_mode (this->hidden->saved_kbd_mode)
|
||||
#define saved_kbd_termios (this->hidden->saved_kbd_termios)
|
||||
#define mouse_fd (this->hidden->mouse_fd)
|
||||
#define cache_vinfo (this->hidden->cache_vinfo)
|
||||
#define currt_vinfo (this->hidden->currt_vinfo)
|
||||
#define saved_vinfo (this->hidden->saved_vinfo)
|
||||
#define saved_cmaplen (this->hidden->saved_cmaplen)
|
||||
#define saved_cmap (this->hidden->saved_cmap)
|
||||
|
||||
@@ -76,6 +76,14 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
|
||||
//memset(format, 0, sizeof(*format));
|
||||
format->alpha = GAL_ALPHA_OPAQUE;
|
||||
|
||||
/* Give defaults for the special case */
|
||||
if (bpp == 32 && Rmask == 0 && Gmask == 0 && Bmask == 0 && Amask == 0) {
|
||||
Amask = 0xFF000000;
|
||||
Rmask = 0x00FF0000;
|
||||
Gmask = 0x0000FF00;
|
||||
Bmask = 0x000000FF;
|
||||
}
|
||||
|
||||
/* Set up the format */
|
||||
format->BitsPerPixel = bpp;
|
||||
format->BytesPerPixel = (bpp+7)/8;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include \
|
||||
-I$(abs_top_srcdir)/src/newgal/
|
||||
-I$(abs_top_srcdir)/src/newgal/ $(PIXMAN_CFLAGS)
|
||||
|
||||
SRC_FILES = shadow.c shadow_refresh_msb_right.c shadow_refresh_msb_left.c
|
||||
|
||||
|
||||
+562
-261
File diff suppressed because it is too large
Load Diff
+64
-40
@@ -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
|
||||
@@ -47,6 +47,16 @@
|
||||
#ifndef _GAL_SHADOW_H
|
||||
#define _GAL_SHADOW_H
|
||||
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
#undef _MGUSE_PIXMAN
|
||||
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
#include <pixman.h>
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
//#include "sysvideo.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -56,65 +66,79 @@ extern "C" {
|
||||
/* Hidden "this" pointer for the video functions */
|
||||
#define _THIS GAL_VideoDevice *this
|
||||
|
||||
#define MAX_NR_UPDATERS 6
|
||||
#define MIN_PIXELS_USING_UPDATER 4096
|
||||
|
||||
typedef struct _ShadowFBHeader {
|
||||
unsigned int info_size;
|
||||
int width;
|
||||
int height;
|
||||
int depth;
|
||||
int pitch;
|
||||
int dirty; /* true for dirty, and should reset to false after refreshing the dirty area */
|
||||
RECT dirty_rect;
|
||||
int palette_changed; /* true for changed, and should reset to false after reflecting the change */
|
||||
int palette_offset;
|
||||
int fb_offset;
|
||||
Uint32 Rmask;
|
||||
Uint32 Gmask;
|
||||
Uint32 Bmask;
|
||||
Uint32 Amask;
|
||||
int firstcolor;
|
||||
int ncolors;
|
||||
unsigned int info_size;
|
||||
int width;
|
||||
int height;
|
||||
int depth;
|
||||
int pitch;
|
||||
|
||||
int dirty:1;
|
||||
int palette_changed:1;
|
||||
|
||||
RECT dirty_rect;
|
||||
|
||||
int palette_offset;
|
||||
int firstcolor;
|
||||
int ncolors;
|
||||
int fb_offset;
|
||||
|
||||
Uint32 Rmask;
|
||||
Uint32 Gmask;
|
||||
Uint32 Bmask;
|
||||
Uint32 Amask;
|
||||
|
||||
} ShadowFBHeader;
|
||||
|
||||
#define FLAG_REALFB_PREALLOC 0x01
|
||||
|
||||
|
||||
typedef struct _RealFBInfo {
|
||||
DWORD flags;
|
||||
int height, width;
|
||||
int depth;
|
||||
int pitch;
|
||||
void* fb;
|
||||
void * real_device;
|
||||
DWORD flags;
|
||||
int height, width;
|
||||
int depth;
|
||||
int pitch;
|
||||
void *fb;
|
||||
|
||||
GAL_VideoDevice *real_device;
|
||||
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
pixman_image_t *src_img;
|
||||
pixman_image_t *dst_img;
|
||||
pixman_transform_t transform;
|
||||
#endif
|
||||
|
||||
} RealFBInfo;
|
||||
|
||||
/* Private display data */
|
||||
|
||||
struct GAL_PrivateVideoData {
|
||||
RealFBInfo * realfb_info;
|
||||
/*GAL_VideoDevice *_real_device ;
|
||||
int w, h, pitch;
|
||||
void *fb;
|
||||
BOOL alloc_fb;
|
||||
BOOL dirty;
|
||||
RECT update;*/
|
||||
pthread_t update_th;
|
||||
#ifdef _MGRM_PROCESSES
|
||||
int semid;
|
||||
#else
|
||||
pthread_mutex_t update_lock;
|
||||
#endif
|
||||
|
||||
int nr_updaters;
|
||||
|
||||
/* only valid when nr_updaters > 0 */
|
||||
RECT dirty_rcs[MAX_NR_UPDATERS];
|
||||
sem_t update_sems[MAX_NR_UPDATERS];
|
||||
pthread_t update_thds[MAX_NR_UPDATERS];
|
||||
sem_t sync_sem;
|
||||
};
|
||||
|
||||
typedef struct _ShadowFBOps {
|
||||
int (*init) (void);
|
||||
int (*get_realfb_info) (RealFBInfo* realfb_info);
|
||||
int (*release) (RealFBInfo* realfb_info);
|
||||
int (*set_palette) (RealFBInfo* realfb_info, int firstcolor, int ncolors, void* colors);
|
||||
void (*sleep) (void);
|
||||
void (*refresh) (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb_info, void* update);
|
||||
int (*init) (void);
|
||||
int (*get_realfb_info) (RealFBInfo* realfb_info);
|
||||
int (*release) (RealFBInfo* realfb_info);
|
||||
int (*set_palette) (RealFBInfo* realfb_info, int firstcolor,
|
||||
int ncolors, void* colors);
|
||||
void (*refresh) (ShadowFBHeader* shadowfb_header,
|
||||
RealFBInfo* realfb_info, void* update);
|
||||
} ShadowFBOps;
|
||||
|
||||
ShadowFBOps * __mg_shadow_fb_ops;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#include "error.h"
|
||||
#include "shadow.h"
|
||||
|
||||
extern gal_uint8* __gal_a_line;
|
||||
extern gal_uint8* line_pixels;
|
||||
extern void round_rect (int depth, PRECT update_rect);
|
||||
|
||||
extern void _get_dst_rect_cw (RECT* dst_rect, const RECT* src_rect,
|
||||
@@ -230,6 +230,7 @@ void refresh_cw_msb_left (ShadowFBHeader *shadowfb_header, RealFBInfo *realfb_in
|
||||
BYTE* dst_line;
|
||||
int dst_width, dst_height;
|
||||
int x, y;
|
||||
BYTE line_pixels[realfb_info->pitch];
|
||||
|
||||
_get_dst_rect_cw (&dst_update, &src_update, realfb_info);
|
||||
|
||||
@@ -255,7 +256,7 @@ void refresh_cw_msb_left (ShadowFBHeader *shadowfb_header, RealFBInfo *realfb_in
|
||||
/* Copy the bits from vertical line to horizontal line */
|
||||
const BYTE* ver_bits = src_bits;
|
||||
|
||||
BYTE* hor_bits = __gal_a_line;
|
||||
BYTE* hor_bits = line_pixels;
|
||||
|
||||
switch (realfb_info->depth) {
|
||||
case 32:
|
||||
@@ -296,25 +297,25 @@ void refresh_cw_msb_left (ShadowFBHeader *shadowfb_header, RealFBInfo *realfb_in
|
||||
|
||||
switch (realfb_info->depth) {
|
||||
case 1:
|
||||
put_one_line_1bpp (__gal_a_line, dst_line, dst_update.left, dst_width);
|
||||
put_one_line_1bpp (line_pixels, dst_line, dst_update.left, dst_width);
|
||||
src_bits += 1;
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
put_one_line_2bpp (__gal_a_line, dst_line, dst_update.left, dst_width);
|
||||
put_one_line_2bpp (line_pixels, dst_line, dst_update.left, dst_width);
|
||||
src_bits +=1;
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
put_one_line_4bpp (__gal_a_line, dst_line, dst_update.left, dst_width);
|
||||
put_one_line_4bpp (line_pixels, dst_line, dst_update.left, dst_width);
|
||||
src_bits +=1;
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
default:
|
||||
put_one_line_8bpp (__gal_a_line, dst_line, dst_update.left, dst_width, realfb_info);
|
||||
put_one_line_8bpp (line_pixels, dst_line, dst_update.left, dst_width, realfb_info);
|
||||
src_bits += realfb_info->depth/8;
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
@@ -329,9 +330,9 @@ void refresh_ccw_msb_left (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb_i
|
||||
RECT dst_update;
|
||||
const BYTE* src_bits;
|
||||
BYTE* dst_line;
|
||||
|
||||
int dst_width, dst_height;
|
||||
int x, y;
|
||||
BYTE line_pixels[realfb_info->pitch];
|
||||
|
||||
_get_dst_rect_ccw (&dst_update, &src_update, realfb_info);
|
||||
|
||||
@@ -356,7 +357,7 @@ void refresh_ccw_msb_left (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb_i
|
||||
for (x = 0; x < dst_height; x++) {
|
||||
/* Copy the bits from vertical line to horizontal line */
|
||||
const BYTE* ver_bits = src_bits;
|
||||
BYTE* hor_bits = __gal_a_line;
|
||||
BYTE* hor_bits = line_pixels;
|
||||
|
||||
switch (realfb_info->depth) {
|
||||
case 32:
|
||||
@@ -398,25 +399,25 @@ void refresh_ccw_msb_left (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb_i
|
||||
|
||||
switch (realfb_info->depth) {
|
||||
case 1:
|
||||
put_one_line_1bpp (__gal_a_line, dst_line, dst_update.left, dst_width);
|
||||
put_one_line_1bpp (line_pixels, dst_line, dst_update.left, dst_width);
|
||||
src_bits += 1;
|
||||
dst_line -= realfb_info->pitch;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
put_one_line_2bpp (__gal_a_line, dst_line, dst_update.left, dst_width);
|
||||
put_one_line_2bpp (line_pixels, dst_line, dst_update.left, dst_width);
|
||||
src_bits += 1;
|
||||
dst_line -= realfb_info->pitch;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
put_one_line_4bpp (__gal_a_line, dst_line, dst_update.left, dst_width);
|
||||
put_one_line_4bpp (line_pixels, dst_line, dst_update.left, dst_width);
|
||||
src_bits += 1;
|
||||
dst_line -= realfb_info->pitch;
|
||||
break;
|
||||
|
||||
default:
|
||||
put_one_line_8bpp (__gal_a_line, dst_line, dst_update.left, dst_width,\
|
||||
put_one_line_8bpp (line_pixels, dst_line, dst_update.left, dst_width,\
|
||||
realfb_info);
|
||||
src_bits += realfb_info->depth/8;
|
||||
dst_line -= realfb_info->pitch;
|
||||
@@ -432,6 +433,7 @@ void refresh_hflip_msb_left (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb
|
||||
BYTE* dst_line;
|
||||
int src_width, src_height;
|
||||
int x, y;
|
||||
BYTE line_pixels[realfb_info->pitch];
|
||||
|
||||
/* Round the update rectangle. */
|
||||
round_rect(realfb_info->depth, &src_update);
|
||||
@@ -450,7 +452,7 @@ void refresh_hflip_msb_left (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb
|
||||
for (x = 0; x < src_height; x++) {
|
||||
/* Copy the bits from vertical line to horizontal line */
|
||||
const BYTE* ver_bits = src_bits;
|
||||
BYTE* hor_bits = __gal_a_line;
|
||||
BYTE* hor_bits = line_pixels;
|
||||
|
||||
switch (realfb_info->depth) {
|
||||
case 32:
|
||||
@@ -491,25 +493,25 @@ void refresh_hflip_msb_left (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb
|
||||
}
|
||||
switch (realfb_info->depth) {
|
||||
case 1:
|
||||
put_one_line_1bpp (__gal_a_line, dst_line, realfb_info->width - src_update.right, src_width);
|
||||
put_one_line_1bpp (line_pixels, dst_line, realfb_info->width - src_update.right, src_width);
|
||||
src_bits += shadowfb_header->pitch;
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
put_one_line_2bpp (__gal_a_line, dst_line, realfb_info->width - src_update.right, src_width);
|
||||
put_one_line_2bpp (line_pixels, dst_line, realfb_info->width - src_update.right, src_width);
|
||||
src_bits += shadowfb_header->pitch;
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
put_one_line_4bpp (__gal_a_line, dst_line, realfb_info->width - src_update.right, src_width);
|
||||
put_one_line_4bpp (line_pixels, dst_line, realfb_info->width - src_update.right, src_width);
|
||||
src_bits += shadowfb_header->pitch;/* realfb_info->depth;*/
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
default:
|
||||
put_one_line_8bpp (__gal_a_line, dst_line, realfb_info->width - src_update.right,
|
||||
put_one_line_8bpp (line_pixels, dst_line, realfb_info->width - src_update.right,
|
||||
src_width, realfb_info);
|
||||
src_bits += realfb_info->pitch;
|
||||
dst_line += realfb_info->pitch;
|
||||
@@ -525,6 +527,7 @@ void refresh_vflip_msb_left (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb
|
||||
BYTE* dst_line;
|
||||
int src_width, src_height;
|
||||
int x, y;
|
||||
BYTE line_pixels[realfb_info->pitch];
|
||||
|
||||
/* Round the update rectangle. */
|
||||
round_rect (realfb_info->depth, &src_update);
|
||||
@@ -543,7 +546,7 @@ void refresh_vflip_msb_left (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb
|
||||
for (x = 0; x < src_height; x++) {
|
||||
/* Copy the bits from vertical line to horizontal line */
|
||||
const BYTE* ver_bits = src_bits;
|
||||
BYTE* hor_bits = __gal_a_line;
|
||||
BYTE* hor_bits = line_pixels;
|
||||
|
||||
switch (realfb_info->depth) {
|
||||
case 32:
|
||||
@@ -585,25 +588,29 @@ void refresh_vflip_msb_left (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb
|
||||
|
||||
switch (realfb_info->depth) {
|
||||
case 1:
|
||||
put_one_line_1bpp (__gal_a_line, dst_line, src_update.left, src_width);
|
||||
put_one_line_1bpp(line_pixels, dst_line, src_update.left,
|
||||
src_width);
|
||||
src_bits -= shadowfb_header->pitch;
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
put_one_line_2bpp (__gal_a_line, dst_line, src_update.left, src_width);
|
||||
put_one_line_2bpp(line_pixels, dst_line, src_update.left,
|
||||
src_width);
|
||||
src_bits -= shadowfb_header->pitch;
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
put_one_line_4bpp (__gal_a_line, dst_line, src_update.left, src_width);
|
||||
put_one_line_4bpp(line_pixels, dst_line, src_update.left,
|
||||
src_width);
|
||||
src_bits -= shadowfb_header->pitch;/* realfb_info->depth;*/
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
default:
|
||||
put_one_line_8bpp (__gal_a_line, dst_line, src_update.left, src_width, realfb_info);
|
||||
put_one_line_8bpp(line_pixels, dst_line, src_update.left,
|
||||
src_width, realfb_info);
|
||||
src_bits -= realfb_info->pitch;
|
||||
dst_line += realfb_info->pitch;
|
||||
break;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+25
-44
@@ -273,44 +273,38 @@ int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
double rotation;
|
||||
pixman_f_transform_t ftransform;
|
||||
pixman_transform_t transform;
|
||||
GAL_BlittingContext* ctxt;
|
||||
|
||||
src->blit_ctxt = malloc (sizeof (GAL_BlittingContext));
|
||||
if (src->blit_ctxt == NULL)
|
||||
return -1;
|
||||
|
||||
ctxt = src->blit_ctxt;
|
||||
if ((src->flags & GAL_SRCALPHA) && src->format->alpha != GAL_ALPHA_OPAQUE) {
|
||||
memset (&ctxt->alpha_bits, src->format->alpha, sizeof(uint32_t));
|
||||
ctxt->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
|
||||
&ctxt->alpha_bits, 4);
|
||||
if (ctxt->msk_img)
|
||||
pixman_image_set_repeat (ctxt->msk_img, PIXMAN_REPEAT_NORMAL);
|
||||
memset (&src->pix_alpha_bits, src->format->alpha, sizeof(uint32_t));
|
||||
src->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
|
||||
&src->pix_alpha_bits, 4);
|
||||
if (src->msk_img)
|
||||
pixman_image_set_repeat (src->msk_img, PIXMAN_REPEAT_NORMAL);
|
||||
}
|
||||
else
|
||||
ctxt->msk_img = NULL;
|
||||
src->msk_img = NULL;
|
||||
|
||||
ctxt->filter = ops >> SCALING_FILTER_SHIFT;
|
||||
if (ctxt->filter > PIXMAN_FILTER_CONVOLUTION) {
|
||||
ctxt->filter = PIXMAN_FILTER_FAST;
|
||||
src->pix_filter = ops >> SCALING_FILTER_SHIFT;
|
||||
if (src->pix_filter > PIXMAN_FILTER_CONVOLUTION) {
|
||||
src->pix_filter = PIXMAN_FILTER_FAST;
|
||||
}
|
||||
|
||||
ops &= COLOR_BLEND_FLAGS_MASK;
|
||||
if (ops == COLOR_BLEND_LEGACY) {
|
||||
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
|
||||
ctxt->op = PIXMAN_OP_OVER;
|
||||
src->pix_op = PIXMAN_OP_OVER;
|
||||
}
|
||||
else {
|
||||
ctxt->op = PIXMAN_OP_SRC;
|
||||
src->pix_op = PIXMAN_OP_SRC;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ctxt->op = ops;
|
||||
src->pix_op = ops;
|
||||
}
|
||||
|
||||
if (ctxt->op > PIXMAN_OP_HSL_LUMINOSITY ||
|
||||
ctxt->op < PIXMAN_OP_CLEAR) {
|
||||
ctxt->op = PIXMAN_OP_SRC;
|
||||
if (src->pix_op > PIXMAN_OP_HSL_LUMINOSITY ||
|
||||
src->pix_op < PIXMAN_OP_CLEAR) {
|
||||
src->pix_op = PIXMAN_OP_SRC;
|
||||
}
|
||||
|
||||
pixman_f_transform_init_identity (&ftransform);
|
||||
@@ -350,7 +344,7 @@ int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
pixman_image_set_filter (src_img, (pixman_filter_t)filter, NULL, 0);
|
||||
}
|
||||
#else
|
||||
pixman_image_set_filter (src->pix_img, (pixman_filter_t)ctxt->filter, NULL, 0);
|
||||
pixman_image_set_filter (src->pix_img, (pixman_filter_t)src->pix_filter, NULL, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -359,21 +353,15 @@ int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
|
||||
int GAL_CleanupStretchBlit (GAL_Surface *src, GAL_Surface *dst)
|
||||
{
|
||||
if (src->blit_ctxt) {
|
||||
pixman_transform_t transform;
|
||||
|
||||
GAL_BlittingContext* ctxt = src->blit_ctxt;
|
||||
if (ctxt->msk_img)
|
||||
pixman_image_unref (ctxt->msk_img);
|
||||
free (src->blit_ctxt);
|
||||
src->blit_ctxt = NULL;
|
||||
|
||||
pixman_transform_init_identity (&transform);
|
||||
pixman_image_set_transform (src->pix_img, &transform);
|
||||
pixman_image_set_filter (src->pix_img, PIXMAN_FILTER_FAST, NULL, 0);
|
||||
pixman_image_set_clip_region32 (dst->pix_img, NULL);
|
||||
if (src->msk_img) {
|
||||
pixman_image_unref (src->msk_img);
|
||||
src->msk_img = NULL;
|
||||
}
|
||||
|
||||
pixman_image_set_transform (src->pix_img, NULL);
|
||||
pixman_image_set_filter (src->pix_img, PIXMAN_FILTER_NEAREST, NULL, 0);
|
||||
pixman_image_set_clip_region32 (dst->pix_img, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -390,15 +378,8 @@ int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
return GAL_StretchBltLegacy (src, srcrect, dst, dstrect,
|
||||
ops & COLOR_BLEND_FLAGS_MASK);
|
||||
|
||||
if (src->blit_ctxt) {
|
||||
GAL_BlittingContext* ctxt = src->blit_ctxt;
|
||||
msk_img = ctxt->msk_img;
|
||||
op = (pixman_op_t)ctxt->op;
|
||||
}
|
||||
else {
|
||||
msk_img = NULL;
|
||||
op = PIXMAN_OP_SRC;
|
||||
}
|
||||
msk_img = src->msk_img;
|
||||
op = (pixman_op_t)src->pix_op;
|
||||
|
||||
_DBG_PRINTF ("srcrect: %d,%d, %dx%d; dstrect: %d,%d, %dx%d; cliprect: %d,%d, %dx%d\n",
|
||||
srcrect->x, srcrect->y, srcrect->w, srcrect->h,
|
||||
|
||||
@@ -105,7 +105,7 @@ GAL_Surface * GAL_CreateCursorSurface (GAL_VideoDevice *video,
|
||||
surface->format_version = 0;
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
surface->pix_img = NULL;
|
||||
surface->blit_ctxt = NULL;
|
||||
surface->msk_img = NULL;
|
||||
#endif
|
||||
surface->shared_header = NULL;
|
||||
surface->dirty_info = NULL;
|
||||
|
||||
@@ -138,7 +138,7 @@ GAL_Surface * GAL_CreateSharedRGBSurface (GAL_VideoDevice *video,
|
||||
surface->format_version = 0;
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
surface->pix_img = NULL;
|
||||
surface->blit_ctxt = NULL;
|
||||
surface->msk_img = NULL;
|
||||
#endif
|
||||
surface->shared_header = NULL;
|
||||
surface->dirty_info = NULL;
|
||||
@@ -278,7 +278,7 @@ error:
|
||||
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
surface->pix_img = NULL;
|
||||
surface->blit_ctxt = NULL;
|
||||
surface->msk_img = NULL;
|
||||
#endif
|
||||
surface->shared_header = NULL;
|
||||
surface->dirty_info = NULL;
|
||||
@@ -328,7 +328,7 @@ void GAL_FreeSharedSurfaceData (GAL_Surface *surface)
|
||||
surface->pixels = NULL;
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
surface->pix_img = NULL;
|
||||
surface->blit_ctxt = NULL;
|
||||
surface->msk_img = NULL;
|
||||
#endif
|
||||
surface->shared_header = NULL;
|
||||
surface->dirty_info = NULL;
|
||||
@@ -424,7 +424,7 @@ GAL_Surface * GAL_AttachSharedRGBSurface (int fd, size_t map_size,
|
||||
surface->format_version = 0;
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
surface->pix_img = NULL;
|
||||
surface->blit_ctxt = NULL;
|
||||
surface->msk_img = NULL;
|
||||
#endif
|
||||
GAL_SetClipRect (surface, NULL);
|
||||
|
||||
@@ -481,7 +481,7 @@ void GAL_DettachSharedSurfaceData (GAL_Surface *surface)
|
||||
surface->pixels = NULL;
|
||||
#ifdef _MGUSE_PIXMAN
|
||||
surface->pix_img = NULL;
|
||||
surface->blit_ctxt = NULL;
|
||||
surface->msk_img = NULL;
|
||||
#endif
|
||||
surface->shared_header = NULL;
|
||||
surface->dirty_info = NULL;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user