mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-28 16:17:09 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
70535c6cb4 | ||
|
|
4013dbf70a | ||
|
|
b288e29eef | ||
|
|
871a99e22b | ||
|
|
a965f1023c | ||
|
|
a6af326b48 | ||
|
|
754b8f3014 | ||
|
|
a85386499e | ||
|
|
fe48d1cc64 | ||
|
|
c1aab8bf69 | ||
|
|
65d8a31a35 | ||
|
|
e97ae8bcdb | ||
|
|
883410eb14 | ||
|
|
0cb72162e4 | ||
|
|
2cb6c4bc9c | ||
|
|
5b111d3300 | ||
|
|
820689f5f9 | ||
|
|
2ae51d70fb | ||
|
|
86158f938d | ||
|
|
3f99c7b960 | ||
|
|
b266bd8e0a | ||
|
|
f6d25f58aa | ||
|
|
ccbccc2020 | ||
|
|
736193d355 | ||
|
|
47e32a812e | ||
|
|
ac769be3cb | ||
|
|
4de7e09c22 | ||
|
|
e787c6fbde | ||
|
|
a0a0330a6c | ||
|
|
46854579be | ||
|
|
d31af448ff | ||
|
|
91062be2ac | ||
|
|
6907dba86d | ||
|
|
d4cadc47e0 | ||
|
|
0904ae5dc7 | ||
|
|
a431b2ae56 | ||
|
|
4c7e1bcecf | ||
|
|
7364a960bc | ||
|
|
77bb2f4433 | ||
|
|
75077509d6 | ||
|
|
9ebf59e4ad | ||
|
|
20a50bc094 | ||
|
|
180bd4480f | ||
|
|
947ce61805 | ||
|
|
270648fc73 | ||
|
|
4ebd23bf56 | ||
|
|
0ea195a7a2 | ||
|
|
5978175ef8 | ||
|
|
f8e144d1f2 | ||
|
|
8c92b16d04 | ||
|
|
a9129c5772 | ||
|
|
72551be6b0 | ||
|
|
7d4cf8a47d | ||
|
|
b967f2f18f | ||
|
|
af3ff13513 | ||
|
|
d543f17606 | ||
|
|
e3e79aaf86 | ||
|
|
44bb22925f | ||
|
|
e88a3cd3d8 | ||
|
|
1340a8b81e | ||
|
|
d07e797f92 | ||
|
|
cdf4ca3612 | ||
|
|
ac50ae71c4 | ||
|
|
88ec285dc5 | ||
|
|
d5f637f206 | ||
|
|
f35c63482f | ||
|
|
940060c724 | ||
|
|
2466167c93 | ||
|
|
8e556e6ce1 | ||
|
|
9c44c1eccb | ||
|
|
70aa7516fc | ||
|
|
fcdeea30d9 | ||
|
|
b4fb53b3c3 | ||
|
|
4e752a6f8b | ||
|
|
a2183ed53a | ||
|
|
182f195a57 | ||
|
|
a0214a2956 | ||
|
|
51da6b7204 | ||
|
|
285a8e1101 | ||
|
|
de315cf780 | ||
|
|
7642ead8ce | ||
|
|
666fba74cd | ||
|
|
4d1077b759 | ||
|
|
561b4c3ffc | ||
|
|
f970fd377e | ||
|
|
383d70b446 | ||
|
|
82edb53d22 | ||
|
|
bf127a3f4d | ||
|
|
c089adf2b7 | ||
|
|
6a5c9ba048 | ||
|
|
c9c55c74bf | ||
|
|
5f854d75c7 | ||
|
|
3a3d77042a | ||
|
|
49e714431a | ||
|
|
f64680082c | ||
|
|
f3c1ea0bc4 | ||
|
|
31a2d3c185 | ||
|
|
1621cb7bf5 | ||
|
|
89fcfe3979 | ||
|
|
5dd702017f | ||
|
|
0f1b251c91 | ||
|
|
1fab00bf85 | ||
|
|
c8fcbd1864 | ||
|
|
7802d000fe | ||
|
|
9978a89991 | ||
|
|
87637f68dd | ||
|
|
727f4ad5c5 | ||
|
|
30f1488c5c | ||
|
|
28b04af4f5 | ||
|
|
62cb29a435 | ||
|
|
86d6e12f9e | ||
|
|
30147e9e01 | ||
|
|
a966689e88 | ||
|
|
42e1d5db2c | ||
|
|
877ed4c382 | ||
|
|
5ccb57c19d | ||
|
|
80d03b2f6f | ||
|
|
b31d3860e6 | ||
|
|
697177266b | ||
|
|
48b84e3100 | ||
|
|
27122b421d | ||
|
|
a305dd85da | ||
|
|
7bc4ae81dc | ||
|
|
8675244823 | ||
|
|
af7df5bcea | ||
|
|
0ceee74091 | ||
|
|
0b023c27de | ||
|
|
e1ea9b7209 | ||
|
|
9fa7401542 | ||
|
|
df65816504 | ||
|
|
62bcaebe14 | ||
|
|
d88d508180 | ||
|
|
0178f28f66 | ||
|
|
c226242d6d | ||
|
|
9a09deee91 | ||
|
|
2190256165 | ||
|
|
cdba9dbd17 | ||
|
|
df3be3bde0 | ||
|
|
4e43c9cfee | ||
|
|
a2d733392f | ||
|
|
7a5ad30a92 | ||
|
|
d894080582 | ||
|
|
8bfc65f88f | ||
|
|
fbf02782a6 | ||
|
|
1e88954b79 | ||
|
|
4e0cd74552 | ||
|
|
7530c4b5bd | ||
|
|
b47d207bd2 | ||
|
|
9ff29ccb94 | ||
|
|
6da322ed49 | ||
|
|
6e21fed525 | ||
|
|
74747f383c | ||
|
|
bde7d74f02 | ||
|
|
cdc818d936 | ||
|
|
8694a342b9 | ||
|
|
dd9e59d82f | ||
|
|
1b2b87d187 | ||
|
|
36c1f15894 | ||
|
|
c3877bad13 | ||
|
|
a118a062ec | ||
|
|
5e34e98b28 | ||
|
|
60ed1c9b3c | ||
|
|
e148806743 | ||
|
|
cd0dd795c8 | ||
|
|
e6468d960c | ||
|
|
219d72074d | ||
|
|
56779b033d | ||
|
|
73dc293c76 | ||
|
|
abaee60a55 | ||
|
|
2b99ac28eb | ||
|
|
f86fa9d483 | ||
|
|
529c78ef90 | ||
|
|
bc20a11744 | ||
|
|
6a2f28543d |
+174
-78
File diff suppressed because it is too large
Load Diff
+174
-78
File diff suppressed because it is too large
Load Diff
+174
-78
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,11 @@
|
|||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
|
- [Version 5.0.6](#version-506)
|
||||||
|
+ [What's new in version 5.0.6](#whats-new-in-version-506)
|
||||||
|
- [Version 5.0.5](#version-505)
|
||||||
|
+ [What's new in version 5.0.5](#whats-new-in-version-505)
|
||||||
|
- [Version 5.0.4](#version-504)
|
||||||
|
+ [What's new in version 5.0.4](#whats-new-in-version-504)
|
||||||
- [Version 5.0.3](#version-503)
|
- [Version 5.0.3](#version-503)
|
||||||
+ [What's new in version 5.0.3](#whats-new-in-version-503)
|
+ [What's new in version 5.0.3](#whats-new-in-version-503)
|
||||||
- [Version 5.0.2](#version-502)
|
- [Version 5.0.2](#version-502)
|
||||||
@@ -14,6 +20,74 @@
|
|||||||
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
||||||
+ [Deprecated APIs](#deprecated-apis)
|
+ [Deprecated APIs](#deprecated-apis)
|
||||||
|
|
||||||
|
## Version 5.0.6
|
||||||
|
|
||||||
|
The MiniGUI development team announces the availability of MiniGUI 5.0.6,
|
||||||
|
which is the bug fixing release of MiniGUI 5.0.x.
|
||||||
|
|
||||||
|
### What's new in version 5.0.6
|
||||||
|
|
||||||
|
In this version, we fixed some bugs and made some optimizations and enhancements:
|
||||||
|
|
||||||
|
* BUGFIXING:
|
||||||
|
- Fix bugs of switching layers under MiniGUI-Processes.
|
||||||
|
- Fix bugs of `FBCon` and `PC_XVFB` engines: the dirty rectangles are
|
||||||
|
not set empty after calling `SyncUpdate`.
|
||||||
|
- Fix memory leaks when using block heap.
|
||||||
|
- Fix a bug in ServerGetWinZNodeRegion.
|
||||||
|
* ENHANCEMENTS:
|
||||||
|
- Enhance `GetGlyphInfo` to return the FreeType face, font file path, and glyph
|
||||||
|
index.
|
||||||
|
- NEW API `StretchBltEx` to support different scaling filters and rotation.
|
||||||
|
- Use Pixman to support color blending methods for `BitBlt` and `StretchBlt`.
|
||||||
|
- Enhance fallback compositor to support animation when switching among layers.
|
||||||
|
- New API `SetMainWindowGestureFlags` and `MSG_GESTURETEST` message for
|
||||||
|
gesture test and setting the gesture flags of a specific main window.
|
||||||
|
- Tune implementation of Tooltip window.
|
||||||
|
* OPTIMIZATIONS:
|
||||||
|
- Optimize the fallback compositor for lucent windows.
|
||||||
|
- Use Pixman to optimize `FillBox`, `BitBlt`, and `StretchBlt`.
|
||||||
|
- Optimize the management of BLOCKHEAP.
|
||||||
|
- Optimize the `__mg_lookfor_unused_slot`.
|
||||||
|
|
||||||
|
Note that the binary backward-compatibility was broken, two operations added to
|
||||||
|
`CompositorOps`. You should rebuild all MiniGUI applications.
|
||||||
|
|
||||||
|
Also note that the compositing schema is now enabled by default.
|
||||||
|
|
||||||
|
## Version 5.0.5
|
||||||
|
|
||||||
|
The MiniGUI development team announces the availability of MiniGUI 5.0.5,
|
||||||
|
which is the bug fixing release of MiniGUI 5.0.x.
|
||||||
|
|
||||||
|
### What's new in version 5.0.5
|
||||||
|
|
||||||
|
In this version, we fixed some bugs and made some minor enhancements:
|
||||||
|
|
||||||
|
* BUGFIXING:
|
||||||
|
- Adjust the constants for `WS_XXXX` macros to avoid duplicated values.
|
||||||
|
|
||||||
|
Note that the binary backward-compatibility was broken. You should
|
||||||
|
rebuild all MiniGUI applications.
|
||||||
|
|
||||||
|
## Version 5.0.4
|
||||||
|
|
||||||
|
The MiniGUI development team announces the availability of MiniGUI 5.0.4,
|
||||||
|
which is the bug fixing release of MiniGUI 5.0.x.
|
||||||
|
|
||||||
|
### What's new in version 5.0.4
|
||||||
|
|
||||||
|
In this version, we fixed some bugs and made some minor enhancements:
|
||||||
|
|
||||||
|
* BUGFIXING:
|
||||||
|
- Fix bugs in ServerGetWinZNodeRegion: must check for possible empty mask rect
|
||||||
|
and bad assignment of maskrect
|
||||||
|
- Fix a potential bug: only increase `nr_mask_rects` for not empty mask rectangle.
|
||||||
|
- Fix a bug: update surface of controls surface in `travel_children_with_priv_cdc`.
|
||||||
|
* ENHANCEMENTS:
|
||||||
|
- New IAL engine: `--enable-singletouchkeyial` to build the IAL engine for
|
||||||
|
single touch screen and key buttons.
|
||||||
|
|
||||||
## Version 5.0.3
|
## Version 5.0.3
|
||||||
|
|
||||||
The MiniGUI development team announces the availability of MiniGUI 5.0.3,
|
The MiniGUI development team announces the availability of MiniGUI 5.0.3,
|
||||||
|
|||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
Version 5.0.0 (2019/03/30)
|
Version 5.0.8 (2021/10/25)
|
||||||
|
|
||||||
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:
|
Other packages for MiniGUI resource, tools, components, and samples:
|
||||||
|
|
||||||
- GVFB: `gvfb-1.2.5.tar.gz`
|
- GVFB: `gvfb-1.2.5.tar.gz`
|
||||||
- The resource package: `minigui-res-5.0.0.tar.gz`
|
- The resource package: `minigui-res-5.0.6.tar.gz`
|
||||||
- mGUtils component: `libmgutils-1.5.0.tar.gz`
|
- mGUtils component: `libmgutils-1.5.0.tar.gz`
|
||||||
- mGPlus component: `libmgplus-1.5.0.tar.gz`
|
- mGPlus component: `libmgplus-1.5.0.tar.gz`
|
||||||
- mGEff component: `libmgeff-1.5.0.tar.gz`
|
- mGEff component: `libmgeff-1.5.0.tar.gz`
|
||||||
|
|||||||
+176
-163
File diff suppressed because it is too large
Load Diff
@@ -83,6 +83,19 @@ double_buffering=true
|
|||||||
exdriver=libhidrmdrivers-0.2.so.0
|
exdriver=libhidrmdrivers-0.2.so.0
|
||||||
#}}
|
#}}
|
||||||
|
|
||||||
|
#{{ifdef _MGIAL_SINGLETOUCHKEY
|
||||||
|
[singletouchkey]
|
||||||
|
# The touch device; use none to disable touch event.
|
||||||
|
touch_dev=/dev/input/event0
|
||||||
|
# The key device; use none to disable key event.
|
||||||
|
key_dev=none
|
||||||
|
# The number of keys; only valid if the key device is not `none` and can be opened.
|
||||||
|
nr_keys=2
|
||||||
|
# The maps from Linux keycode to MiniGUI scancode; only valid if `nr_keys` > 0.
|
||||||
|
keycode2scancode0=20,1
|
||||||
|
keycode2scancode1=50,2
|
||||||
|
#}}
|
||||||
|
|
||||||
#{{ifdef _MGIAL_LIBINPUT
|
#{{ifdef _MGIAL_LIBINPUT
|
||||||
[libinput]
|
[libinput]
|
||||||
seat=seat0
|
seat=seat0
|
||||||
|
|||||||
@@ -237,7 +237,6 @@ MG_EXPORT void GUIAPI NotifyParentEx (HWND hwnd, LINT id, int code,
|
|||||||
NotifyParentEx(hwnd, id, code, 0)
|
NotifyParentEx(hwnd, id, code, 0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \var typedef int (*STRCMP) (const char* s1, const char* s2, size_t n)
|
|
||||||
* \brief Type of general strncmp function.
|
* \brief Type of general strncmp function.
|
||||||
*
|
*
|
||||||
* The function compares the two strings \a s1 and \a s2. It returns
|
* The function compares the two strings \a s1 and \a s2. It returns
|
||||||
|
|||||||
@@ -698,7 +698,6 @@ extern "C" {
|
|||||||
#define EM_SETREADONLY 0xF0CF
|
#define EM_SETREADONLY 0xF0CF
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \var typedef int (*ED_DRAWSEL_FUNC) (HWND hWnd, HDC hdc, int startx, int starty, const char* content, int len, int selout)
|
|
||||||
* \brief Type of the edit control callback function on drawing selected strings.
|
* \brief Type of the edit control callback function on drawing selected strings.
|
||||||
*
|
*
|
||||||
* \param hWnd Handle of the edit control.
|
* \param hWnd Handle of the edit control.
|
||||||
|
|||||||
+212
-101
File diff suppressed because it is too large
Load Diff
+79
-6
@@ -82,10 +82,16 @@ extern "C" {
|
|||||||
#define ZOF_MAXIMIZED 0x00000004 // Since 5.0.0
|
#define ZOF_MAXIMIZED 0x00000004 // Since 5.0.0
|
||||||
#define ZOF_MINIMIZED 0x00000008 // Since 5.0.0
|
#define ZOF_MINIMIZED 0x00000008 // Since 5.0.0
|
||||||
|
|
||||||
|
/* Since 5.0.6 */
|
||||||
|
#define ZOF_GESTURE_FLAGS_MASK 0X000000F0
|
||||||
|
#define ZOF_GF_SWIPE_HORZ 0x00000010
|
||||||
|
#define ZOF_GF_SWIPE_VERT 0x00000020
|
||||||
|
|
||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
#define ZOF_INTERNAL_FLAGS_MASK 0X000F0000
|
#define ZOF_INTERNAL_FLAGS_MASK 0X000F0000
|
||||||
#define ZOF_IF_REFERENCE 0x00010000
|
#define ZOF_IF_REFERENCE 0x00010000
|
||||||
#define ZOF_IF_ALWAYSTOP 0x00020000
|
#define ZOF_IF_ALWAYSTOP 0x00020000
|
||||||
|
#define ZOF_IF_SPECIAL 0x00040000 // Since 5.0.6
|
||||||
|
|
||||||
#define ZOF_TW_FLAG_MASK 0x00F00000
|
#define ZOF_TW_FLAG_MASK 0x00F00000
|
||||||
#define ZOF_TW_TROUNDCNS 0x00100000
|
#define ZOF_TW_TROUNDCNS 0x00100000
|
||||||
@@ -351,9 +357,17 @@ extern MG_EXPORT MG_Client* mgClients;
|
|||||||
*/
|
*/
|
||||||
extern MG_EXPORT MG_Layer* mgTopmostLayer;
|
extern MG_EXPORT MG_Layer* mgTopmostLayer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \var MG_Layer* mgDefaultLayer
|
||||||
|
* \brief The pointer to the default layer.
|
||||||
|
*
|
||||||
|
* \sa MG_Layer
|
||||||
|
*/
|
||||||
|
extern MG_EXPORT MG_Layer* mgDefaultLayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \var MG_Layer* mgLayers
|
* \var MG_Layer* mgLayers
|
||||||
* \brief The pointer to the array of layers.
|
* \brief The pointer to the layer list.
|
||||||
*
|
*
|
||||||
* \sa MG_Layer
|
* \sa MG_Layer
|
||||||
*/
|
*/
|
||||||
@@ -562,6 +576,8 @@ MG_EXPORT BOOL GUIAPI DeleteLayer (BOOL handle_name,
|
|||||||
*
|
*
|
||||||
* \return TRUE on success, otherwise FALSE.
|
* \return TRUE on success, otherwise FALSE.
|
||||||
*
|
*
|
||||||
|
* \note Only one client which has no any window can be moved.
|
||||||
|
*
|
||||||
* \note The client which created a fixed main window
|
* \note The client which created a fixed main window
|
||||||
* (a main window acts as the screen lock, the docker, or the launcher) will
|
* (a main window acts as the screen lock, the docker, or the launcher) will
|
||||||
* be moved to the topmost layer automatically.
|
* be moved to the topmost layer automatically.
|
||||||
@@ -1491,7 +1507,9 @@ MG_EXPORT BOOL GUIAPI ServerDoZNodeOperation (MG_Layer* layer, int idx_znode,
|
|||||||
*
|
*
|
||||||
* \return TRUE on success, otherwise FALSE.
|
* \return TRUE on success, otherwise FALSE.
|
||||||
*
|
*
|
||||||
* \note Server-only function. The client which created a fixed main window
|
* \note Server-only function. Only one client which has no any window can be moved.
|
||||||
|
*
|
||||||
|
* \note The client which created a fixed main window
|
||||||
* (a main window acts as the screen lock, the docker, or the launcher) will
|
* (a main window acts as the screen lock, the docker, or the launcher) will
|
||||||
* be moved to the topmost layer automatically.
|
* be moved to the topmost layer automatically.
|
||||||
*
|
*
|
||||||
@@ -1600,7 +1618,7 @@ typedef struct _CompositorOps {
|
|||||||
* a main window with the extended style WS_EX_AUTOPOSITION.
|
* a main window with the extended style WS_EX_AUTOPOSITION.
|
||||||
*/
|
*/
|
||||||
void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer,
|
void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer,
|
||||||
DWORD zt_type, int first_for_type, CALCPOSINFO* info);
|
DWORD zt_type, int first_for_type, int cli, CALCPOSINFO* info);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation will be called when there was a layer operation.
|
* This operation will be called when there was a layer operation.
|
||||||
@@ -1729,6 +1747,20 @@ typedef struct _CompositorOps {
|
|||||||
void (*on_moved_win) (CompositorCtxt* ctxt, MG_Layer* layer,
|
void (*on_moved_win) (CompositorCtxt* ctxt, MG_Layer* layer,
|
||||||
int zidx, const RECT* rc_org);
|
int zidx, const RECT* rc_org);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This operation will composite multiple layers on the screen at the same
|
||||||
|
* time by using the combining paramemters.
|
||||||
|
*/
|
||||||
|
unsigned int (*composite_layers) (CompositorCtxt* ctxt, MG_Layer* layers[],
|
||||||
|
int nr_layers, void* combine_param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This operation will be called when transiting to a new topmost layer.
|
||||||
|
* The compositor can play an animation to transit from the current
|
||||||
|
* topmost layer to the new topmost layer.
|
||||||
|
*/
|
||||||
|
void (*transit_to_layer) (CompositorCtxt* ctxt, MG_Layer* to_layer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This operation will be called when the system is maximizing a window.
|
* This operation will be called when the system is maximizing a window.
|
||||||
* The compositor can play an animation in this operation.
|
* The compositor can play an animation in this operation.
|
||||||
@@ -1743,12 +1775,35 @@ typedef struct _CompositorOps {
|
|||||||
|
|
||||||
} CompositorOps;
|
} CompositorOps;
|
||||||
|
|
||||||
|
#define FCM_HORIZONTAL 0x0000
|
||||||
|
#define FCM_VERTICAL 0x0001
|
||||||
|
#define FCM_METHOD_MASK 0x00FF
|
||||||
|
#define FCM_SCALE 0x0100
|
||||||
|
|
||||||
|
/** The combining parameters for the callback compositor. */
|
||||||
|
typedef struct _CombParamsFallback {
|
||||||
|
/**
|
||||||
|
* The combining method, can be one of the following values:
|
||||||
|
* - FCM_HORIZONTAL
|
||||||
|
* - FCM_VERTICAL
|
||||||
|
* and/or OR'd with the following value:
|
||||||
|
* - FCM_SCALE
|
||||||
|
*/
|
||||||
|
unsigned int method;
|
||||||
|
|
||||||
|
/** The percentage of the screen occupied by the first layer. */
|
||||||
|
float percent;
|
||||||
|
|
||||||
|
/** The scale factor of non-global z-nodes. */
|
||||||
|
float scale;
|
||||||
|
} COMBPARAMS_FALLBACK;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the operations of a specific compositor.
|
* \brief Get the operations of a specific compositor.
|
||||||
*
|
*
|
||||||
* This function gets the operations of a specific compositor.
|
* This function gets the operations of a specific compositor.
|
||||||
*
|
*
|
||||||
* \param name The name of the compositor. MiniGUI reserved `default`
|
* \param name The name of the compositor. MiniGUI reserved `fallback`
|
||||||
* as the default compositor which is implemented in MiniGUI Core.
|
* as the default compositor which is implemented in MiniGUI Core.
|
||||||
* You can use some operations of the default compositor as the
|
* You can use some operations of the default compositor as the
|
||||||
* corresponding operations for your own compositor.
|
* corresponding operations for your own compositor.
|
||||||
@@ -1808,7 +1863,7 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
|
|||||||
* \brief Select a compositor as the current compositor.
|
* \brief Select a compositor as the current compositor.
|
||||||
*
|
*
|
||||||
* This function selects a compositor as the current compositor
|
* This function selects a compositor as the current compositor
|
||||||
* and returns the compositor object.
|
* and returns the compositor operations.
|
||||||
* It also destroies the old compositor object if there is old one.
|
* It also destroies the old compositor object if there is old one.
|
||||||
*
|
*
|
||||||
* \param name The name of the compositor. If the argument is NULL,
|
* \param name The name of the compositor. If the argument is NULL,
|
||||||
@@ -1826,7 +1881,25 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
|
|||||||
MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
|
MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
|
||||||
const char* name, CompositorCtxt** ctxt);
|
const char* name, CompositorCtxt** ctxt);
|
||||||
|
|
||||||
#define COMPSOR_OPS_VERSION 1
|
/**
|
||||||
|
* \brief Get the name and the context of the current compositor.
|
||||||
|
*
|
||||||
|
* This function gets the name and the context of the current
|
||||||
|
* compositor.
|
||||||
|
*
|
||||||
|
* \param ops The buffer used to return the compositor operations.
|
||||||
|
* \param ctxt The buffer used to return the compositor context.
|
||||||
|
*
|
||||||
|
* \return The name of the current compositor; NULL for error.
|
||||||
|
*
|
||||||
|
* \note Only called by the server.
|
||||||
|
*
|
||||||
|
* Since 5.0.6.
|
||||||
|
*/
|
||||||
|
MG_EXPORT const char* GUIAPI ServerGetCurrentCompositor (
|
||||||
|
const CompositorOps** ops, CompositorCtxt** ctxt);
|
||||||
|
|
||||||
|
#define COMPSOR_OPS_VERSION 2
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement this stub to return the compositor operations
|
* Implement this stub to return the compositor operations
|
||||||
|
|||||||
+138
-72
File diff suppressed because it is too large
Load Diff
+15
-24
@@ -1,28 +1,19 @@
|
|||||||
if MG_MINIMALGDI
|
|
||||||
COMMON_SUBDIRS = misc kernel sysres include
|
|
||||||
|
|
||||||
COMMON_LADD = \
|
|
||||||
kernel/libkernel.la \
|
|
||||||
sysres/libsysres.la \
|
|
||||||
misc/libmisc.la
|
|
||||||
else
|
|
||||||
COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit
|
COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit
|
||||||
|
|
||||||
COMMON_LADD = \
|
COMMON_LADD = \
|
||||||
libc/liblibc.la \
|
libc/liblibc.la \
|
||||||
misc/libmisc.la \
|
misc/libmisc.la \
|
||||||
control/libcontrol.la \
|
control/libcontrol.la \
|
||||||
ex_ctrl/libexctrl.la \
|
ex_ctrl/libexctrl.la \
|
||||||
font/libfont.la \
|
font/libfont.la \
|
||||||
font/in-core/libincore.la \
|
font/in-core/libincore.la \
|
||||||
ial/libial.la \
|
ial/libial.la \
|
||||||
gui/libgui.la \
|
gui/libgui.la \
|
||||||
main/libmain.la \
|
main/libmain.la \
|
||||||
mybmp/libmybmp.la \
|
mybmp/libmybmp.la \
|
||||||
kernel/libkernel.la \
|
kernel/libkernel.la \
|
||||||
sysres/libsysres.la \
|
sysres/libsysres.la \
|
||||||
textedit/libtextedit.la
|
textedit/libtextedit.la
|
||||||
endif
|
|
||||||
|
|
||||||
if MGRM_STANDALONE
|
if MGRM_STANDALONE
|
||||||
LITE_LADD = standalone/libstandalone.la
|
LITE_LADD = standalone/libstandalone.la
|
||||||
@@ -45,12 +36,12 @@ SUBDIRS = $(COMMON_SUBDIRS) $(NEWGAL_SUBDIRS) $(LITE_SUBDIRS)
|
|||||||
|
|
||||||
MGSOURCES = template.c template.h
|
MGSOURCES = template.c template.h
|
||||||
MGLIBADD = $(COMMON_LADD) \
|
MGLIBADD = $(COMMON_LADD) \
|
||||||
$(LITE_LADD) \
|
$(LITE_LADD) \
|
||||||
$(NEWGAL_LADD)
|
$(NEWGAL_LADD)
|
||||||
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||||
|
|
||||||
lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la
|
lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la
|
||||||
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD)
|
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD) @DEP_LIBS@
|
||||||
libminigui_@MGLIB_SUFFIX@_la_SOURCES=$(MGSOURCES)
|
libminigui_@MGLIB_SUFFIX@_la_SOURCES=$(MGSOURCES)
|
||||||
libminigui_@MGLIB_SUFFIX@_la_LDFLAGS=$(MGLDFLAGS)
|
libminigui_@MGLIB_SUFFIX@_la_LDFLAGS=$(MGLDFLAGS)
|
||||||
|
|
||||||
|
|||||||
+72
-27
@@ -154,9 +154,31 @@ int GUIAPI GetSockFD2Server (void)
|
|||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
static void check_live (BOOL woken)
|
||||||
|
{
|
||||||
|
static DWORD last_ticks;
|
||||||
|
REQUEST req;
|
||||||
|
|
||||||
|
__mg_update_tick_count (NULL);
|
||||||
|
|
||||||
|
// Since 5.0.6, only send IAMLIVE if the current ticks > (last_ticks + 100)
|
||||||
|
if (woken || __mg_tick_counter > last_ticks + 100) {
|
||||||
|
last_ticks = __mg_tick_counter;
|
||||||
|
|
||||||
|
/* Tell server that I am live */
|
||||||
|
req.id = REQID_IAMLIVE;
|
||||||
|
req.data = &__mg_tick_counter;
|
||||||
|
req.len_data = sizeof (unsigned int);
|
||||||
|
ClientRequest (&req, NULL, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void process_socket_message (MSG *msg)
|
static void process_socket_message (MSG *msg)
|
||||||
{
|
{
|
||||||
if (msg->message == MSG_UPDATECLIWIN &&
|
if (msg->message == MSG_WAKEUP_CLIENT) {
|
||||||
|
check_live (TRUE);
|
||||||
|
}
|
||||||
|
else if (msg->message == MSG_UPDATECLIWIN &&
|
||||||
__mg_client_check_hwnd (msg->hwnd, __mg_client_id)) {
|
__mg_client_check_hwnd (msg->hwnd, __mg_client_id)) {
|
||||||
__mg_update_window (msg->hwnd,
|
__mg_update_window (msg->hwnd,
|
||||||
LOSWORD(msg->wParam), HISWORD(msg->wParam),
|
LOSWORD(msg->wParam), HISWORD(msg->wParam),
|
||||||
@@ -366,27 +388,6 @@ sock_error:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void check_live (void)
|
|
||||||
{
|
|
||||||
REQUEST req;
|
|
||||||
|
|
||||||
#if 0 /* deprecated code */
|
|
||||||
/* Since 5.0.0, call __mg_update_tick_count instead */
|
|
||||||
if (__mg_tick_counter != SHAREDRES_TIMER_COUNTER) {
|
|
||||||
AlertDesktopTimerEvent ();
|
|
||||||
__mg_tick_counter = SHAREDRES_TIMER_COUNTER;
|
|
||||||
}
|
|
||||||
#endif /* deprecated code */
|
|
||||||
|
|
||||||
__mg_update_tick_count (NULL);
|
|
||||||
|
|
||||||
/* Tell server that I am live */
|
|
||||||
req.id = REQID_IAMLIVE;
|
|
||||||
req.data = &__mg_tick_counter;
|
|
||||||
req.len_data = sizeof (unsigned int);
|
|
||||||
ClientRequest (&req, NULL, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
|
BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
|
||||||
{
|
{
|
||||||
static DWORD old_timer;
|
static DWORD old_timer;
|
||||||
@@ -398,7 +399,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
|
|||||||
struct timeval sel_timeout;
|
struct timeval sel_timeout;
|
||||||
MSG Msg;
|
MSG Msg;
|
||||||
|
|
||||||
check_live ();
|
check_live (FALSE);
|
||||||
|
|
||||||
/* rset gets modified each time around */
|
/* rset gets modified each time around */
|
||||||
rset = msg_queue->rfdset;
|
rset = msg_queue->rfdset;
|
||||||
@@ -433,14 +434,14 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
|
|||||||
static unsigned int old_mouse_move_serial = 0xdeadbeef;
|
static unsigned int old_mouse_move_serial = 0xdeadbeef;
|
||||||
int flag = 0, mouse_x = -1, mouse_y = -1, buttons = -1;
|
int flag = 0, mouse_x = -1, mouse_y = -1, buttons = -1;
|
||||||
|
|
||||||
check_live ();
|
check_live (FALSE);
|
||||||
if (wait && (__mg_tick_counter - old_timer) >= repeat_timeout) {
|
if (wait && (__mg_tick_counter - old_timer) >= repeat_timeout) {
|
||||||
Msg.hwnd = HWND_DESKTOP;
|
Msg.hwnd = HWND_DESKTOP;
|
||||||
Msg.message = MSG_TIMEOUT;
|
Msg.message = MSG_TIMEOUT;
|
||||||
Msg.wParam = (WPARAM)__mg_tick_counter;
|
Msg.wParam = (WPARAM)__mg_tick_counter;
|
||||||
Msg.lParam = 0;
|
Msg.lParam = 0;
|
||||||
Msg.time = __mg_tick_counter;
|
Msg.time = __mg_tick_counter;
|
||||||
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
|
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
|
||||||
// kernel_QueueMessage (msg_queue, &Msg);
|
// kernel_QueueMessage (msg_queue, &Msg);
|
||||||
|
|
||||||
old_timer = __mg_tick_counter;
|
old_timer = __mg_tick_counter;
|
||||||
@@ -507,7 +508,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
|
|||||||
/* go through registered listen fds */
|
/* go through registered listen fds */
|
||||||
n += __mg_kernel_check_listen_fds (msg_queue, &rset, wsetptr, esetptr);
|
n += __mg_kernel_check_listen_fds (msg_queue, &rset, wsetptr, esetptr);
|
||||||
|
|
||||||
check_live ();
|
check_live (FALSE);
|
||||||
|
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
old_timer = __mg_tick_counter;
|
old_timer = __mg_tick_counter;
|
||||||
@@ -569,12 +570,23 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
|
|||||||
|
|
||||||
__mg_layer = layer_handle;
|
__mg_layer = layer_handle;
|
||||||
|
|
||||||
zi = (ZORDERINFO*) shmat (joined_info.zo_shmid, 0, SHM_RDONLY);
|
zi = (ZORDERINFO*) shmat (joined_info.zi_shmid, 0, SHM_RDONLY);
|
||||||
if (zi == (void*)-1) {
|
if (zi == (void*)-1) {
|
||||||
return INV_LAYER_HANDLE;
|
return INV_LAYER_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
__mg_zorder_info = zi;
|
__mg_zorder_info = zi;
|
||||||
|
if (joined_info.zi_shmid == joined_info.def_zi_shmid) {
|
||||||
|
__mg_def_zorder_info = zi;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
zi = (ZORDERINFO*) shmat (joined_info.def_zi_shmid, 0, SHM_RDONLY);
|
||||||
|
if (zi == (void*)-1) {
|
||||||
|
return INV_LAYER_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
__mg_def_zorder_info = zi;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__mg_tick_counter = SHAREDRES_TIMER_COUNTER;
|
__mg_tick_counter = SHAREDRES_TIMER_COUNTER;
|
||||||
@@ -711,6 +723,39 @@ BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid)
|
|||||||
|
|
||||||
__mg_layer = layer_handle;
|
__mg_layer = layer_handle;
|
||||||
__mg_zorder_info = zi;
|
__mg_zorder_info = zi;
|
||||||
|
|
||||||
|
#if 0 /* obsolete */
|
||||||
|
ZORDERNODE* nodes;
|
||||||
|
int slot;
|
||||||
|
|
||||||
|
nodes = GET_ZORDERNODE(zi);
|
||||||
|
slot = zi->first_tooltip;
|
||||||
|
for (; slot > 0; slot = nodes[slot].next) {
|
||||||
|
if (nodes [slot].cli == __mg_client_id) {
|
||||||
|
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
|
||||||
|
assert (win);
|
||||||
|
win->idx_znode = slot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
slot = zi->first_topmost;
|
||||||
|
for (; slot > 0; slot = nodes[slot].next) {
|
||||||
|
if (nodes [slot].cli == __mg_client_id) {
|
||||||
|
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
|
||||||
|
assert (win);
|
||||||
|
win->idx_znode = slot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
slot = zi->first_normal;
|
||||||
|
for (; slot > 0; slot = nodes[slot].next) {
|
||||||
|
if (nodes [slot].cli == __mg_client_id) {
|
||||||
|
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
|
||||||
|
assert (win);
|
||||||
|
win->idx_znode = slot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* obsolete */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,21 +63,17 @@
|
|||||||
#include "ctrlmisc.h"
|
#include "ctrlmisc.h"
|
||||||
|
|
||||||
#define _ID_TIMER 100
|
#define _ID_TIMER 100
|
||||||
|
#define _MARGIN 10
|
||||||
|
|
||||||
static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static int iBorder;
|
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case MSG_CREATE:
|
case MSG_CREATE:
|
||||||
{
|
{
|
||||||
const WINDOWINFO *info;
|
|
||||||
int timeout = (int)GetWindowAdditionalData (hWnd);
|
int timeout = (int)GetWindowAdditionalData (hWnd);
|
||||||
if (timeout >= 10)
|
if (timeout >= 10)
|
||||||
SetTimer (hWnd, _ID_TIMER, timeout / 10);
|
SetTimer (hWnd, _ID_TIMER, timeout / 10);
|
||||||
|
|
||||||
info = GetWindowInfo (hWnd);
|
|
||||||
iBorder =
|
|
||||||
info->we_rdr->calc_we_area (hWnd, LFRDR_METRICS_BORDER, NULL);
|
|
||||||
SetWindowFont (hWnd,
|
SetWindowFont (hWnd,
|
||||||
(PLOGFONT)GetWindowElementAttr(hWnd, WE_FONT_TOOLTIP));
|
(PLOGFONT)GetWindowElementAttr(hWnd, WE_FONT_TOOLTIP));
|
||||||
break;
|
break;
|
||||||
@@ -102,7 +98,7 @@ static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
|
|||||||
|
|
||||||
SetTextColor (hdc,
|
SetTextColor (hdc,
|
||||||
GetWindowElementPixelEx(hWnd, hdc, WE_FGC_TOOLTIP));
|
GetWindowElementPixelEx(hWnd, hdc, WE_FGC_TOOLTIP));
|
||||||
TabbedTextOut (hdc, iBorder, iBorder, text);
|
TabbedTextOut (hdc, _MARGIN, _MARGIN, text);
|
||||||
|
|
||||||
EndPaint (hWnd, hdc);
|
EndPaint (hWnd, hdc);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -164,6 +160,7 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
|
|||||||
|
|
||||||
CreateInfo.dwStyle = WS_VISIBLE;
|
CreateInfo.dwStyle = WS_VISIBLE;
|
||||||
CreateInfo.dwExStyle = WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_USEPARENTRDR;
|
CreateInfo.dwExStyle = WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_USEPARENTRDR;
|
||||||
|
CreateInfo.dwExStyle |= WS_EX_WINTYPE_TOOLTIP | WS_EX_TROUNDCNS | WS_EX_BROUNDCNS;
|
||||||
CreateInfo.spCaption = buf ? buf : text;
|
CreateInfo.spCaption = buf ? buf : text;
|
||||||
CreateInfo.hMenu = 0;
|
CreateInfo.hMenu = 0;
|
||||||
CreateInfo.hCursor = GetSystemCursor (IDC_ARROW);
|
CreateInfo.hCursor = GetSystemCursor (IDC_ARROW);
|
||||||
@@ -171,8 +168,8 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
|
|||||||
CreateInfo.MainWindowProc = ToolTipWinProc;
|
CreateInfo.MainWindowProc = ToolTipWinProc;
|
||||||
CreateInfo.lx = x;
|
CreateInfo.lx = x;
|
||||||
CreateInfo.ty = y;
|
CreateInfo.ty = y;
|
||||||
CreateInfo.rx = CreateInfo.lx + text_size.cx;
|
CreateInfo.rx = CreateInfo.lx + text_size.cx + _MARGIN * 2;
|
||||||
CreateInfo.by = CreateInfo.ty + text_size.cy;
|
CreateInfo.by = CreateInfo.ty + text_size.cy + _MARGIN * 2;
|
||||||
CreateInfo.iBkColor =
|
CreateInfo.iBkColor =
|
||||||
GetWindowElementPixelEx (hParentWnd, HDC_SCREEN, WE_BGC_TOOLTIP);
|
GetWindowElementPixelEx (hParentWnd, HDC_SCREEN, WE_BGC_TOOLTIP);
|
||||||
CreateInfo.dwAddData = (DWORD) timeout_ms;
|
CreateInfo.dwAddData = (DWORD) timeout_ms;
|
||||||
@@ -218,7 +215,8 @@ void ResetToolTipWin (HWND hwnd, int x, int y, const char* text, ...)
|
|||||||
if (y + text_size.cy > g_rcScr.bottom)
|
if (y + text_size.cy > g_rcScr.bottom)
|
||||||
y = g_rcScr.bottom - text_size.cy;
|
y = g_rcScr.bottom - text_size.cy;
|
||||||
|
|
||||||
MoveWindow (hwnd, x, y, text_size.cx, text_size.cy, TRUE);
|
MoveWindow (hwnd, x, y,
|
||||||
|
text_size.cx + _MARGIN * 2, text_size.cy + _MARGIN * 2, TRUE);
|
||||||
ShowWindow (hwnd, SW_SHOWNORMAL);
|
ShowWindow (hwnd, SW_SHOWNORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -735,9 +735,9 @@ get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
pcache->valid_advance = 1;
|
pcache->valid_advance = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
done:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
done:
|
|
||||||
FT_UNLOCK(&ft_lock);
|
FT_UNLOCK(&ft_lock);
|
||||||
|
|
||||||
if (px) {
|
if (px) {
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ typedef int (* MakeHashKeyFunc)(Glyph32 gv);
|
|||||||
typedef struct tagFTFACEINFO {
|
typedef struct tagFTFACEINFO {
|
||||||
char* filepathname;
|
char* filepathname;
|
||||||
FT_Face face;
|
FT_Face face;
|
||||||
BOOL valid;
|
|
||||||
#ifdef _MGFONT_TTF_CACHE
|
#ifdef _MGFONT_TTF_CACHE
|
||||||
int face_index;
|
int face_index;
|
||||||
int cmap_index;
|
int cmap_index;
|
||||||
@@ -163,13 +162,13 @@ extern void __mg_ttc_sys_deinit(void);
|
|||||||
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
|
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
|
||||||
extern void __mg_ttc_refer(HCACHE hCache);
|
extern void __mg_ttc_refer(HCACHE hCache);
|
||||||
|
|
||||||
|
#endif /* _MGFONT_TTF_CACHE */
|
||||||
|
|
||||||
#ifdef _MGCOMPLEX_SCRIPTS
|
#ifdef _MGCOMPLEX_SCRIPTS
|
||||||
extern void __mg_init_harzbuff_funcs(void);
|
extern void __mg_init_harzbuff_funcs(void);
|
||||||
extern void __mg_term_harzbuff_funcs(void);
|
extern void __mg_term_harzbuff_funcs(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
+27
-15
@@ -75,9 +75,6 @@
|
|||||||
#ifdef _MG_ENABLE_LICENSE
|
#ifdef _MG_ENABLE_LICENSE
|
||||||
# include "../sysres/license/c_files/04_progressbar-bk.dat.c"
|
# include "../sysres/license/c_files/04_progressbar-bk.dat.c"
|
||||||
#endif
|
#endif
|
||||||
#ifndef __TARGET_UNKNOWN__
|
|
||||||
unsigned int g_license_processor_id;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _MGHAVE_MENU
|
#ifdef _MGHAVE_MENU
|
||||||
/* function defined in menu module. */
|
/* function defined in menu module. */
|
||||||
@@ -2401,8 +2398,9 @@ static void wndDrawNCFrame(MAINWIN* pWin, HDC hdc, const RECT* prcInvalid)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fGetDC)
|
if (fGetDC) {
|
||||||
release_effective_dc (pWin, hdc);
|
release_effective_dc (pWin, hdc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this function is CONTROL safe. */
|
/* this function is CONTROL safe. */
|
||||||
@@ -3039,11 +3037,6 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
|
|||||||
while (hosted) {
|
while (hosted) {
|
||||||
PMAINWIN found;
|
PMAINWIN found;
|
||||||
|
|
||||||
ctxt->hosting = hosted;
|
|
||||||
if ((found = search_win_tree_dfs (ctxt))) {
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hosted->id == ctxt->id &&
|
if (hosted->id == ctxt->id &&
|
||||||
(((ctxt->flags & WIN_SEARCH_FILTER_MAIN) &&
|
(((ctxt->flags & WIN_SEARCH_FILTER_MAIN) &&
|
||||||
hosted->WinType == TYPE_MAINWIN) ||
|
hosted->WinType == TYPE_MAINWIN) ||
|
||||||
@@ -3052,6 +3045,11 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
|
|||||||
return hosted;
|
return hosted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctxt->hosting = hosted;
|
||||||
|
if ((found = search_win_tree_dfs (ctxt))) {
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
hosted = GetNextHosted (hosting, hosted);
|
hosted = GetNextHosted (hosting, hosted);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3074,12 +3072,13 @@ static PMAINWIN search_win_tree_bfs (struct _search_context *ctxt)
|
|||||||
return hosted;
|
return hosted;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctxt->hosting = hosted;
|
if ((ctxt->hosting = GetNextHosted (hosting, hosted))) {
|
||||||
if ((found = search_win_tree_bfs (ctxt))) {
|
if ((found = search_win_tree_bfs (ctxt))) {
|
||||||
return found;
|
return found;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hosted = GetNextHosted (hosting, hosted);
|
hosted = GetFirstHosted (hosted);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -3165,8 +3164,8 @@ HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild)
|
|||||||
|
|
||||||
HWND GUIAPI GetNextMainWindow (HWND hMainWnd)
|
HWND GUIAPI GetNextMainWindow (HWND hMainWnd)
|
||||||
{
|
{
|
||||||
MG_CHECK_RET (hMainWnd == HWND_NULL || MG_IS_NORMAL_MAIN_WINDOW (hMainWnd),
|
MG_CHECK_RET (hMainWnd != HWND_NULL &&
|
||||||
HWND_INVALID);
|
!MG_IS_NORMAL_MAIN_WINDOW (hMainWnd), HWND_INVALID);
|
||||||
|
|
||||||
return (HWND)SendMessage (HWND_DESKTOP,
|
return (HWND)SendMessage (HWND_DESKTOP,
|
||||||
MSG_GETNEXTMAINWIN, (WPARAM)hMainWnd, 0L);
|
MSG_GETNEXTMAINWIN, (WPARAM)hMainWnd, 0L);
|
||||||
@@ -7026,6 +7025,19 @@ BOOL GUIAPI SetMainWindowAlwaysTop (HWND hMainWnd, BOOL fSet)
|
|||||||
MSG_SETALWAYSTOP, (WPARAM)pMainWin, (LPARAM)fSet);
|
MSG_SETALWAYSTOP, (WPARAM)pMainWin, (LPARAM)fSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Since 5.0.6 */
|
||||||
|
BOOL GUIAPI SetMainWindowGestureFlags (HWND hMainWnd, DWORD dwFlags)
|
||||||
|
{
|
||||||
|
PMAINWIN pMainWin;
|
||||||
|
|
||||||
|
if (!(pMainWin = checkAndGetMainWinIfMainWin (hMainWnd))) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (BOOL)SendMessage (HWND_DESKTOP,
|
||||||
|
MSG_SETGESTUREFLAGS, (WPARAM)pMainWin, (LPARAM)dwFlags);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
BOOL GUIAPI SetMainWindowCompositing (HWND hMainWnd, int type, DWORD arg)
|
BOOL GUIAPI SetMainWindowCompositing (HWND hMainWnd, int type, DWORD arg)
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-1
@@ -50,6 +50,7 @@ DFB_SRCS = dfb.h dfb.c
|
|||||||
|
|
||||||
USVFB_SRCS = usvfbinput.c usvfbinput.h
|
USVFB_SRCS = usvfbinput.c usvfbinput.h
|
||||||
LIBINPUT_SRCS = linux-libinput.c linux-libinput.h
|
LIBINPUT_SRCS = linux-libinput.c linux-libinput.h
|
||||||
|
SINGLETOUCHKEY_SRCS = singletouchkey.c singletouchkey.h
|
||||||
|
|
||||||
if MGIAL_CONSOLE
|
if MGIAL_CONSOLE
|
||||||
native_libial_la_LIBADD = native/libnative.la
|
native_libial_la_LIBADD = native/libnative.la
|
||||||
@@ -76,4 +77,5 @@ libial_la_SOURCES = $(COMMON_SRCS) $(DUMMY_SRCS) $(JZ4740_SRCS) \
|
|||||||
$(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \
|
$(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \
|
||||||
$(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \
|
$(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \
|
||||||
$(TSLIB_SRCS) $(SHANDONG_LIDE_SRCS) $(CISCO_TOUCHPAD_SRCS) \
|
$(TSLIB_SRCS) $(SHANDONG_LIDE_SRCS) $(CISCO_TOUCHPAD_SRCS) \
|
||||||
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS)
|
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS) \
|
||||||
|
$(SINGLETOUCHKEY_SRCS)
|
||||||
|
|||||||
+7
-1
@@ -15,7 +15,7 @@
|
|||||||
* and Graphics User Interface (GUI) support system for embedded systems
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
* and smart IoT devices.
|
* and smart IoT devices.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
|
||||||
* Copyright (C) 1998~2002, WEI Yongming
|
* Copyright (C) 1998~2002, WEI Yongming
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@@ -133,6 +133,9 @@
|
|||||||
#ifdef _MGIAL_LIBINPUT
|
#ifdef _MGIAL_LIBINPUT
|
||||||
#include "linux-libinput.h"
|
#include "linux-libinput.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _MGIAL_SINGLETOUCHKEY
|
||||||
|
#include "singletouchkey.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static INPUT inputs [] =
|
static INPUT inputs [] =
|
||||||
{
|
{
|
||||||
@@ -212,6 +215,9 @@ static INPUT inputs [] =
|
|||||||
#ifdef _MGIAL_LIBINPUT
|
#ifdef _MGIAL_LIBINPUT
|
||||||
{"libinput", ial_InitLibInput, TermLibInput},
|
{"libinput", ial_InitLibInput, TermLibInput},
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _MGIAL_SINGLETOUCHKEY
|
||||||
|
{"singletouchkey", ial_InitSingleTouchKey, TermSingleTouchKey},
|
||||||
|
#endif
|
||||||
/* ... end of general IAL engines */
|
/* ... end of general IAL engines */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,6 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <linux/vt.h>
|
#include <linux/vt.h>
|
||||||
#include <linux/kd.h>
|
#include <linux/kd.h>
|
||||||
#include <linux/keyboard.h>
|
|
||||||
|
|
||||||
#include "gdi.h"
|
#include "gdi.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|||||||
@@ -67,8 +67,6 @@
|
|||||||
#include "gal.h"
|
#include "gal.h"
|
||||||
#include "native.h"
|
#include "native.h"
|
||||||
|
|
||||||
static const char* event_dev;
|
|
||||||
|
|
||||||
static int EVENT_Open(const char *);
|
static int EVENT_Open(const char *);
|
||||||
static void EVENT_Close(void);
|
static void EVENT_Close(void);
|
||||||
static void EVENT_GetModifierInfo(int *modifiers);
|
static void EVENT_GetModifierInfo(int *modifiers);
|
||||||
@@ -85,6 +83,7 @@ KBDDEVICE kbddev_event = {
|
|||||||
EVENT_Resume
|
EVENT_Resume
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static char* kbd_dev;
|
||||||
static int kbd_fd; /* file descriptor for keyboard */
|
static int kbd_fd; /* file descriptor for keyboard */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -144,6 +143,7 @@ static int EVENT_Open (const char *device)
|
|||||||
if (kbd_fd < 0)
|
if (kbd_fd < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
kbd_dev = strdup (device);
|
||||||
return kbd_fd;
|
return kbd_fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,8 +153,11 @@ static int EVENT_Open (const char *device)
|
|||||||
*/
|
*/
|
||||||
static void EVENT_Close(void)
|
static void EVENT_Close(void)
|
||||||
{
|
{
|
||||||
close(kbd_fd);
|
close (kbd_fd);
|
||||||
kbd_fd = -1;
|
kbd_fd = -1;
|
||||||
|
|
||||||
|
free (kbd_dev);
|
||||||
|
kbd_dev = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -203,7 +206,8 @@ static int EVENT_Read(unsigned char *buf, int *modifiers)
|
|||||||
*/
|
*/
|
||||||
static void EVENT_Suspend(void)
|
static void EVENT_Suspend(void)
|
||||||
{
|
{
|
||||||
EVENT_Close();
|
close (kbd_fd);
|
||||||
|
kbd_fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* deactivate_keyboard:
|
/* deactivate_keyboard:
|
||||||
@@ -211,10 +215,12 @@ static void EVENT_Suspend(void)
|
|||||||
*/
|
*/
|
||||||
static int EVENT_Resume(void)
|
static int EVENT_Resume(void)
|
||||||
{
|
{
|
||||||
kbd_fd = open (event_dev, O_NONBLOCK);
|
kbd_fd = open (kbd_dev, O_NONBLOCK);
|
||||||
if (kbd_fd < 0) {
|
if (kbd_fd < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}else{
|
}
|
||||||
|
else {
|
||||||
return kbd_fd;
|
return kbd_fd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,6 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <linux/kd.h>
|
#include <linux/kd.h>
|
||||||
#include <linux/keyboard.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT NOTICE
|
||||||
|
//
|
||||||
|
// The following open source license statement does not apply to any
|
||||||
|
// entity in the Exception List published by FMSoft.
|
||||||
|
//
|
||||||
|
// For more information, please visit:
|
||||||
|
//
|
||||||
|
// https://www.fmsoft.cn/exception-list
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
/*
|
||||||
|
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||||
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
|
* and smart IoT devices.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
|
||||||
|
* Copyright (C) 1998~2002, WEI Yongming
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* Or,
|
||||||
|
*
|
||||||
|
* As this program is a library, any link to this program must follow
|
||||||
|
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||||
|
* GPLv3, you need to be licensed from FMSoft.
|
||||||
|
*
|
||||||
|
* If you have got a commercial license of this program, please use it
|
||||||
|
* under the terms and conditions of the commercial license.
|
||||||
|
*
|
||||||
|
* For more information about the commercial license, please refer to
|
||||||
|
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
** linux-libinput.h: the head file of the IAL engine based on libinput.
|
||||||
|
**
|
||||||
|
** Created by Wei YongMing, 2019/06/10
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GUI_IAL_SINGLETOUCHKEY_H
|
||||||
|
#define GUI_IAL_SINGLETOUCHKEY_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype);
|
||||||
|
void TermSingleTouchKey (void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#endif /* GUI_IAL_SINGLETOUCHKEY_H */
|
||||||
|
|
||||||
|
|
||||||
+17
-10
@@ -52,21 +52,28 @@
|
|||||||
#ifndef GUI_BLOCKHEAP_H
|
#ifndef GUI_BLOCKHEAP_H
|
||||||
#define GUI_BLOCKHEAP_H
|
#define GUI_BLOCKHEAP_H
|
||||||
|
|
||||||
#define BDS_FREE 0x0000
|
|
||||||
#define BDS_SPECIAL 0x0001
|
|
||||||
#define BDS_USED 0x0002
|
|
||||||
|
|
||||||
#ifndef _MGUI_GDI_H /* included in include/gdi.h */
|
#ifndef _MGUI_GDI_H /* included in include/gdi.h */
|
||||||
|
|
||||||
typedef struct tagBLOCKHEAP {
|
struct _BLOCKHEAP {
|
||||||
#ifdef _MGRM_THREADS
|
#ifdef _MGRM_THREADS
|
||||||
pthread_mutex_t lock;
|
pthread_mutex_t lock;
|
||||||
#endif
|
#endif
|
||||||
size_t bd_size;
|
/* Size of one block element. */
|
||||||
size_t heap_size;
|
size_t sz_block;
|
||||||
int free;
|
/* Size of the heap in blocks. */
|
||||||
void* heap;
|
size_t sz_heap;
|
||||||
} BLOCKHEAP;
|
/* The first free element in the heap. */
|
||||||
|
size_t sz_usage_bmp;
|
||||||
|
/* The number of blocks extra allocated. */
|
||||||
|
size_t nr_alloc;
|
||||||
|
|
||||||
|
/* Pointer to the pre-allocated heap. */
|
||||||
|
unsigned char* heap;
|
||||||
|
/* Pointer to the usage bitmap. */
|
||||||
|
unsigned char* usage_bmp;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _BLOCKHEAP BLOCKHEAP;
|
||||||
typedef BLOCKHEAP* PBLOCKHEAP;
|
typedef BLOCKHEAP* PBLOCKHEAP;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -164,7 +164,8 @@ typedef struct JoinLayerInfo {
|
|||||||
typedef struct JoinedClientInfo {
|
typedef struct JoinedClientInfo {
|
||||||
GHANDLE layer;
|
GHANDLE layer;
|
||||||
int cli_id;
|
int cli_id;
|
||||||
int zo_shmid;
|
int def_zi_shmid;
|
||||||
|
int zi_shmid;
|
||||||
} JOINEDCLIENTINFO;
|
} JOINEDCLIENTINFO;
|
||||||
|
|
||||||
typedef struct LayerInfo {
|
typedef struct LayerInfo {
|
||||||
@@ -222,6 +223,8 @@ typedef struct _MovedClientInfo {
|
|||||||
#define ID_ZOOP_MASKRECT_SET 17
|
#define ID_ZOOP_MASKRECT_SET 17
|
||||||
#define ID_ZOOP_MASKRECT_FREE 18
|
#define ID_ZOOP_MASKRECT_FREE 18
|
||||||
|
|
||||||
|
#define ID_ZOOP_SETGESTUREFLAGS 19 /* since 5.0.6 */
|
||||||
|
|
||||||
#ifndef MAX_CAPTION_LEN
|
#ifndef MAX_CAPTION_LEN
|
||||||
#define MAX_CAPTION_LEN 39 //40
|
#define MAX_CAPTION_LEN 39 //40
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+15
-22
@@ -71,19 +71,24 @@
|
|||||||
#define NR_DIRTY_RECTS 16
|
#define NR_DIRTY_RECTS 16
|
||||||
|
|
||||||
/* constants for layers and z-order nodes */
|
/* constants for layers and z-order nodes */
|
||||||
#define MAX_NR_LAYERS 8
|
#define MAX_NR_LAYERS 16
|
||||||
|
|
||||||
/* Since 5.0.0: the number of the fixed znodes - DONOT adjust */
|
/* Since 5.0.0: the number of the fixed znodes - DONOT adjust */
|
||||||
#define NR_FIXED_ZNODES 1
|
#define NR_FIXED_ZNODES 1
|
||||||
|
|
||||||
/* the numbers of znodes in different levels - should be mulitples of 8 */
|
/* the numbers of znodes in different levels - should be mulitples of 8 */
|
||||||
#define DEF_NR_POPUPMENUS 16
|
#define DEF_NR_POPUPMENUS 16
|
||||||
#define DEF_NR_TOOLTIPS 8
|
#define DEF_NR_TOOLTIPS 16
|
||||||
#define DEF_NR_GLOBALS 15 // reserve slots for fixed znodes
|
#define DEF_NR_GLOBALS 15 // reserve one slot for fixed znode
|
||||||
#define DEF_NR_SCREENLOCKS 8
|
#define DEF_NR_SCREENLOCKS 8
|
||||||
#define DEF_NR_DOCKERS 8
|
#define DEF_NR_DOCKERS 8
|
||||||
#define DEF_NR_TOPMOSTS 16
|
#ifdef _MGRM_PROCESSES // per layer basis
|
||||||
#define DEF_NR_NORMALS 128
|
# define DEF_NR_TOPMOSTS 8
|
||||||
|
# define DEF_NR_NORMALS 32
|
||||||
|
#else
|
||||||
|
# define DEF_NR_TOPMOSTS 16
|
||||||
|
# define DEF_NR_NORMALS 128
|
||||||
|
#endif
|
||||||
#define DEF_NR_LAUNCHERS 8
|
#define DEF_NR_LAUNCHERS 8
|
||||||
|
|
||||||
/* Since 5.0.0: the number of the zorder levels - DONOT adjust */
|
/* Since 5.0.0: the number of the zorder levels - DONOT adjust */
|
||||||
@@ -102,10 +107,10 @@ enum {
|
|||||||
#define ZNIDX_DESKTOP 0
|
#define ZNIDX_DESKTOP 0
|
||||||
|
|
||||||
/* The heap size for mask rectangles */
|
/* The heap size for mask rectangles */
|
||||||
#define DEF_NR_MASKRECT 1024
|
#define DEF_NR_MASKRECTS 1024
|
||||||
|
|
||||||
#if IS_COMPOSITING_SCHEMA
|
#if IS_COMPOSITING_SCHEMA
|
||||||
/* max number of shared surfaces */
|
/* max number of shared surfaces (512) */
|
||||||
# define MAX_NR_SHARED_SURF (DEF_NR_NORMALS * (MAX_NR_LAYERS >> 1))
|
# define MAX_NR_SHARED_SURF (DEF_NR_NORMALS * (MAX_NR_LAYERS >> 1))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -150,21 +155,9 @@ enum {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* constants for fix string module */
|
/* constants for fix string module */
|
||||||
#if defined (__NOUNIX__) || defined (__uClinux__)
|
#define MAX_LEN_FIXSTR 64
|
||||||
#define MAX_LEN_FIXSTR 64
|
#define NR_HEAP 5
|
||||||
#define NR_HEAP 5
|
#define LEN_BITMAP (1+2+4+8+16)
|
||||||
#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
|
|
||||||
|
|
||||||
/* constants for engine name and video mode */
|
/* constants for engine name and video mode */
|
||||||
#define LEN_SO_NAME 127 // name length of a shared object (library)
|
#define LEN_SO_NAME 127 // name length of a shared object (library)
|
||||||
|
|||||||
@@ -713,6 +713,8 @@ void __mg_update_secondary_dc (PMAINWIN pWin, HDC secondary_dc,
|
|||||||
HDC __mg_get_common_rgba8888_dc (void);
|
HDC __mg_get_common_rgba8888_dc (void);
|
||||||
BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch,
|
BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch,
|
||||||
void* pixels);
|
void* pixels);
|
||||||
|
/* Since 5.0.6 */
|
||||||
|
void __mg_destroy_common_rgba8888_dc (void);
|
||||||
|
|
||||||
/* Since 5.0.0.
|
/* Since 5.0.0.
|
||||||
helpers to update the private client DC of window and it's descendants */
|
helpers to update the private client DC of window and it's descendants */
|
||||||
|
|||||||
@@ -527,7 +527,10 @@ int __mg_free_hook_wins (int cli);
|
|||||||
/************************* Initialization/Termination ************************/
|
/************************* Initialization/Termination ************************/
|
||||||
void __mg_init_local_sys_text (void);
|
void __mg_init_local_sys_text (void);
|
||||||
|
|
||||||
/* the zorder information of the server */
|
/* the zorder information for the default layer */
|
||||||
|
extern ZORDERINFO* __mg_def_zorder_info;
|
||||||
|
|
||||||
|
/* the zorder information for the current layer */
|
||||||
extern ZORDERINFO* __mg_zorder_info;
|
extern ZORDERINFO* __mg_zorder_info;
|
||||||
|
|
||||||
#ifdef _MGRM_STANDALONE
|
#ifdef _MGRM_STANDALONE
|
||||||
|
|||||||
+9
-111
@@ -54,26 +54,12 @@
|
|||||||
# define MG_LOCAL /* NULL */
|
# define MG_LOCAL /* NULL */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Common
|
|
||||||
*/
|
|
||||||
#if defined(_MG_ENABLE_SPLASH) || \
|
|
||||||
defined(_MG_ENABLE_SCREENSAVER) || \
|
|
||||||
defined(_MG_ENABLE_WATERMARK)
|
|
||||||
|
|
||||||
#define _MG_ENABLE_LICENSE 1
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SPLASH_MINIGUI,
|
SPLASH_MINIGUI,
|
||||||
SPLASH_FMSOFT,
|
SPLASH_FMSOFT,
|
||||||
SPLASH_FEIMAN,
|
SPLASH_FEIMAN,
|
||||||
SPLASH_PROGRESSBAR,
|
SPLASH_PROGRESSBAR,
|
||||||
SPLASH_PROGRESSBAR_BK,
|
SPLASH_PROGRESSBAR_BK,
|
||||||
#if 0
|
|
||||||
WATERMARK_1,
|
|
||||||
WATERMARK_2,
|
|
||||||
WATERMARK_3,
|
|
||||||
#endif /* _MG_ENABLE_WATERMARK */
|
|
||||||
LICENSE_BITMAP_NR
|
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 g_license_bitmaps[SPLASH_PROGRESSBAR]
|
||||||
#define g_bitmap_progressbar_bk g_license_bitmaps[SPLASH_PROGRESSBAR_BK]
|
#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_create(void);
|
||||||
MG_LOCAL void __mg_license_destroy(void);
|
MG_LOCAL void __mg_license_destroy(void);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# define __mg_license_create() /* NULL */
|
# define __mg_license_create() /* NULL */
|
||||||
# define __mg_license_destroy() /* NULL */
|
# define __mg_license_destroy() /* NULL */
|
||||||
#endif /* endif _MG_ENABLE_SPLASH or _MG_ENABLE_SCREENSAVER or _MG_ENABLE_WATERMARK*/
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef _MG_ENABLE_SCREENSAVER
|
#ifdef _MG_ENABLE_SCREENSAVER
|
||||||
MG_LOCAL void __mg_screensaver_create(void);
|
MG_LOCAL void __mg_screensaver_create(void);
|
||||||
@@ -102,9 +88,6 @@ MG_LOCAL void __mg_screensaver_destroy(void);
|
|||||||
# define __mg_screensaver_destroy() /* NULL */
|
# define __mg_screensaver_destroy() /* NULL */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Splash
|
|
||||||
*/
|
|
||||||
#ifdef _MG_ENABLE_SPLASH
|
#ifdef _MG_ENABLE_SPLASH
|
||||||
MG_LOCAL void __mg_splash_draw_framework(void);
|
MG_LOCAL void __mg_splash_draw_framework(void);
|
||||||
MG_LOCAL void __mg_splash_progress(void);
|
MG_LOCAL void __mg_splash_progress(void);
|
||||||
@@ -115,96 +98,11 @@ MG_LOCAL void __mg_splash_delay(void);
|
|||||||
# define __mg_splash_delay() /* NULL */
|
# define __mg_splash_delay() /* NULL */
|
||||||
#endif /* endif _MG_ENABLE_SPLASH */
|
#endif /* endif _MG_ENABLE_SPLASH */
|
||||||
|
|
||||||
/*
|
#define __mg_license_on_input() /* NULL */
|
||||||
* ScreenSaver & Watermark
|
#define __mg_license_on_timeout() /* NULL */
|
||||||
*/
|
#define LICENSE_CHECK_CUSTIMER_ID() /* NULL */
|
||||||
#if defined(_MG_ENABLE_SCREENSAVER) || defined(_MG_ENABLE_WATERMARK)
|
#define license_get_processor_id() /* NULL */
|
||||||
MG_LOCAL void __mg_license_on_input(void);
|
#define LICENSE_SET_MESSAGE_OFFSET() /* NULL */
|
||||||
MG_LOCAL void __mg_license_on_timeout(void);
|
#define LICENSE_MODIFY_MESSAGE(x) /* NULL */
|
||||||
#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__ */
|
|
||||||
|
|
||||||
#endif /* LICENSE_H */
|
#endif /* LICENSE_H */
|
||||||
|
|||||||
+34
-11
@@ -120,37 +120,60 @@ int __mg_alloc_sem_for_shared_surf (void);
|
|||||||
int __mg_free_sem_for_shared_surf (int sem_num);
|
int __mg_free_sem_for_shared_surf (int sem_num);
|
||||||
#endif /* _MGSCHEMA_COMPOSITING */
|
#endif /* _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set);
|
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set);
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
void __mg_slot_set_use (unsigned char* bitmap, int index) {
|
void __mg_slot_set_use (unsigned char* bitmap, size_t index) {
|
||||||
bitmap += index >> 3;
|
bitmap += index >> 3;
|
||||||
*bitmap &= (~(0x80 >> (index % 8)));
|
*bitmap &= (~(0x80 >> (index % 8)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
int __mg_slot_clear_use (unsigned char* bitmap, int index) {
|
int __mg_slot_clear_use (unsigned char* bitmap, size_t index) {
|
||||||
|
bitmap += index >> 3;
|
||||||
|
*bitmap |= (0x80 >> (index % 8));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline
|
||||||
|
int __mg_slot_is_used (unsigned char* bitmap, size_t index) {
|
||||||
bitmap += index >> 3;
|
bitmap += index >> 3;
|
||||||
if (*bitmap & (0x80 >> (index % 8)))
|
if (*bitmap & (0x80 >> (index % 8)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
*bitmap |= (0x80 >> (index % 8));
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the number of idle mask rectangles */
|
/* get the number of idle mask rectangles */
|
||||||
static inline
|
static inline
|
||||||
int __mg_get_nr_idle_slots (unsigned char* bitmap, int len_bmp)
|
size_t __mg_get_nr_idle_slots (unsigned char* bitmap, size_t len_bmp)
|
||||||
{
|
{
|
||||||
int idle = 0;
|
size_t idle = 0;
|
||||||
int i, j;
|
size_t i, j;
|
||||||
|
|
||||||
for (i = 0; i < len_bmp; i++) {
|
for (i = 0; i < len_bmp; i++) {
|
||||||
for (j = 0; j < 8; j++) {
|
if (*bitmap) {
|
||||||
if (*bitmap & (0x80 >> j))
|
if (*bitmap == 0xFF) {
|
||||||
idle++;
|
idle += 8;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (*bitmap & 0xF0) {
|
||||||
|
for (j = 0; j < 4; j++) {
|
||||||
|
if (*bitmap & (0x80 >> j))
|
||||||
|
idle++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (*bitmap & 0x0F) {
|
||||||
|
for (j = 0; j < 4; j++) {
|
||||||
|
if (*bitmap & (0x08 >> j))
|
||||||
|
idle++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bitmap++;
|
bitmap++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return idle;
|
return idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+114
-30
File diff suppressed because it is too large
Load Diff
@@ -138,6 +138,14 @@ int __mg_save_png (MG_RWops* fp, MYBITMAP* bmp, RGB* pal);
|
|||||||
BOOL __mg_check_png (MG_RWops* fp);
|
BOOL __mg_check_png (MG_RWops* fp);
|
||||||
#endif
|
#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);
|
int __mg_bmp_compute_pitch (int bpp, Uint32 width, Uint32 *pitch, BOOL does_round);
|
||||||
|
|
||||||
#define fp_getc(fp) MGUI_RWgetc(fp)
|
#define fp_getc(fp) MGUI_RWgetc(fp)
|
||||||
|
|||||||
@@ -154,7 +154,12 @@ int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd);
|
|||||||
int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info);
|
int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info);
|
||||||
int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
|
int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
int __mg_do_change_topmost_layer (void);
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
int __mg_prepare_layer_for_compositing (MG_Layer* layer);
|
||||||
|
int __mg_end_up_layer_for_compositing (MG_Layer* layer);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int __mg_do_change_topmost_layer (MG_Layer* new_topmost);
|
||||||
|
|
||||||
MG_Layer* __mg_find_layer_by_name (const char* name);
|
MG_Layer* __mg_find_layer_by_name (const char* name);
|
||||||
|
|
||||||
|
|||||||
+22
-17
@@ -87,7 +87,7 @@ typedef struct _ZORDERNODE {
|
|||||||
int nr_dirty_rcs; /* the number of dirty rects */
|
int nr_dirty_rcs; /* the number of dirty rects */
|
||||||
const RECT* dirty_rcs; /* the pointer to the dirty rectangles */
|
const RECT* dirty_rcs; /* the pointer to the dirty rectangles */
|
||||||
#else /* defined _MGSCHEMA_COMPOSITING */
|
#else /* defined _MGSCHEMA_COMPOSITING */
|
||||||
unsigned int age; /* znode age */
|
DWORD age; /* znode age */
|
||||||
RECT dirty_rc; /* dirty rectangle */
|
RECT dirty_rc; /* dirty rectangle */
|
||||||
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
@@ -133,6 +133,8 @@ typedef struct _ZORDERINFO {
|
|||||||
int first_launcher;
|
int first_launcher;
|
||||||
|
|
||||||
int active_win;
|
int active_win;
|
||||||
|
int old_active;
|
||||||
|
int next_active;
|
||||||
|
|
||||||
int cli_trackmenu;
|
int cli_trackmenu;
|
||||||
|
|
||||||
@@ -156,12 +158,13 @@ typedef struct _ZORDERINFO {
|
|||||||
typedef ZORDERINFO* PZORDERINFO;
|
typedef ZORDERINFO* PZORDERINFO;
|
||||||
|
|
||||||
#define MAX_NR_SPECIAL_ZNODES(zi) \
|
#define MAX_NR_SPECIAL_ZNODES(zi) \
|
||||||
(zi->max_nr_tooltips + zi->max_nr_globals + \
|
(zi->max_nr_globals + \
|
||||||
zi->max_nr_screenlocks + zi->max_nr_dockers + \
|
zi->max_nr_screenlocks + zi->max_nr_dockers + \
|
||||||
zi->max_nr_launchers + NR_FIXED_ZNODES)
|
zi->max_nr_launchers + NR_FIXED_ZNODES)
|
||||||
|
|
||||||
#define MAX_NR_GENERAL_ZNODES(zi) \
|
#define MAX_NR_GENERAL_ZNODES(zi) \
|
||||||
(zi->max_nr_topmosts + zi->max_nr_normals)
|
(zi->max_nr_tooltips + zi->max_nr_topmosts + \
|
||||||
|
zi->max_nr_normals)
|
||||||
|
|
||||||
#define MAX_NR_ZNODES(zi) \
|
#define MAX_NR_ZNODES(zi) \
|
||||||
MAX_NR_SPECIAL_ZNODES(zi) + MAX_NR_GENERAL_ZNODES(zi)
|
MAX_NR_SPECIAL_ZNODES(zi) + MAX_NR_GENERAL_ZNODES(zi)
|
||||||
@@ -178,7 +181,7 @@ typedef ZORDERINFO* PZORDERINFO;
|
|||||||
(ZORDERNODE*)((char*)((zi)+1)+ (zi)->size_usage_bmp)
|
(ZORDERNODE*)((char*)((zi)+1)+ (zi)->size_usage_bmp)
|
||||||
|
|
||||||
#define GET_MASKRECT_USAGEBMP(zi) \
|
#define GET_MASKRECT_USAGEBMP(zi) \
|
||||||
((char *)((zi) + 1) + (zi)->size_usage_bmp + \
|
((unsigned char *)((zi) + 1) + (zi)->size_usage_bmp + \
|
||||||
sizeof (ZORDERNODE) * (MAX_NR_ZNODES_WITH_PPP(zi)))
|
sizeof (ZORDERNODE) * (MAX_NR_ZNODES_WITH_PPP(zi)))
|
||||||
|
|
||||||
#define GET_MASKRECT(zi) \
|
#define GET_MASKRECT(zi) \
|
||||||
@@ -187,25 +190,25 @@ typedef ZORDERINFO* PZORDERINFO;
|
|||||||
|
|
||||||
/* round to multiple of 8 to aoivd alignment issue */
|
/* round to multiple of 8 to aoivd alignment issue */
|
||||||
#define SIZE_MASKRECT_USAGE_BMP \
|
#define SIZE_MASKRECT_USAGE_BMP \
|
||||||
ROUND_TO_MULTIPLE((DEF_NR_MASKRECT >> 3), 8)
|
ROUND_TO_MULTIPLE((DEF_NR_MASKRECTS >> 3), 8)
|
||||||
|
|
||||||
#define NR_SPECIAL_ZNODES(zi) \
|
#define NR_SPECIAL_ZNODES(zi) \
|
||||||
(zi->nr_tooltips + zi->nr_globals + \
|
(zi->nr_globals + \
|
||||||
zi->nr_screenlocks + zi->nr_dockers + \
|
zi->nr_screenlocks + zi->nr_dockers + \
|
||||||
zi->nr_launchers + NR_FIXED_ZNODES)
|
zi->nr_launchers + NR_FIXED_ZNODES)
|
||||||
|
|
||||||
#define NR_GENERAL_ZNODES(zi) \
|
#define NR_GENERAL_ZNODES(zi) \
|
||||||
(zi->nr_topmosts + zi->nr_normals)
|
(zi->nr_tooltips + zi->nr_topmosts + zi->nr_normals)
|
||||||
|
|
||||||
#define NR_ZNODES(zi) \
|
#define NR_ZNODES(zi) \
|
||||||
NR_SPECIAL_ZNODES(zi) + NR_GENERAL_ZNODES(zi)
|
NR_SPECIAL_ZNODES(zi) + NR_GENERAL_ZNODES(zi)
|
||||||
|
|
||||||
/* Since 5.0.0: more levels */
|
/* Since 5.0.0: more levels */
|
||||||
#define SIZE_USAGE_BMP_GENERAL(max_nr_t, max_nr_n) \
|
#define SIZE_USAGE_BMP_GENERAL(max_nr_t, max_nr_n) \
|
||||||
((7 + (max_nr_t) + (max_nr_n)) >> 3)
|
((7 + DEF_NR_TOOLTIPS + (max_nr_t) + (max_nr_n)) >> 3)
|
||||||
|
|
||||||
#define SIZE_USAGE_BMP_SPECIAL(max_nr_g) \
|
#define SIZE_USAGE_BMP_SPECIAL(max_nr_g) \
|
||||||
((7 + DEF_NR_TOOLTIPS + max_nr_g + \
|
((7 + max_nr_g + \
|
||||||
DEF_NR_SCREENLOCKS + DEF_NR_DOCKERS + \
|
DEF_NR_SCREENLOCKS + DEF_NR_DOCKERS + \
|
||||||
DEF_NR_LAUNCHERS + NR_FIXED_ZNODES) >> 3)
|
DEF_NR_LAUNCHERS + NR_FIXED_ZNODES) >> 3)
|
||||||
|
|
||||||
@@ -234,15 +237,15 @@ typedef ZORDERINFO* PZORDERINFO;
|
|||||||
MG_UNLIKELY ((idx) > MAX_NR_ZNODES(zi))
|
MG_UNLIKELY ((idx) > MAX_NR_ZNODES(zi))
|
||||||
|
|
||||||
#define IS_TYPE_GENERAL(type) \
|
#define IS_TYPE_GENERAL(type) \
|
||||||
(type == ZOF_TYPE_HIGHER || \
|
((type) == ZOF_TYPE_TOOLTIP || \
|
||||||
type == ZOF_TYPE_NORMAL)
|
(type) == ZOF_TYPE_HIGHER || \
|
||||||
|
(type) == ZOF_TYPE_NORMAL)
|
||||||
|
|
||||||
#define IS_TYPE_SPECIAL(type) \
|
#define IS_TYPE_SPECIAL(type) \
|
||||||
(type == ZOF_TYPE_TOOLTIP || \
|
((type) == ZOF_TYPE_GLOBAL || \
|
||||||
type == ZOF_TYPE_GLOBAL || \
|
(type) == ZOF_TYPE_SCREENLOCK || \
|
||||||
type == ZOF_TYPE_SCREENLOCK || \
|
(type) == ZOF_TYPE_DOCKER || \
|
||||||
type == ZOF_TYPE_DOCKER || \
|
(type) == ZOF_TYPE_LAUNCHER)
|
||||||
type == ZOF_TYPE_LAUNCHER)
|
|
||||||
|
|
||||||
#define ZOF_TYPE_TO_LEVEL_IDX(type) ((int)(8 - ((type) >> 28)))
|
#define ZOF_TYPE_TO_LEVEL_IDX(type) ((int)(8 - ((type) >> 28)))
|
||||||
|
|
||||||
@@ -250,12 +253,14 @@ typedef ZORDERINFO* PZORDERINFO;
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals);
|
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_maskrc_heap);
|
||||||
void __kernel_free_z_order_info (ZORDERINFO* zi);
|
void __kernel_free_z_order_info (ZORDERINFO* zi);
|
||||||
int __kernel_get_window_region (HWND pWin, CLIPRGN* region);
|
int __kernel_get_window_region (HWND pWin, CLIPRGN* region);
|
||||||
int __kernel_get_next_znode (const ZORDERINFO* zi, int from);
|
int __kernel_get_next_znode (const ZORDERINFO* zi, int from);
|
||||||
int __kernel_get_prev_znode (const ZORDERINFO* zi, int from);
|
int __kernel_get_prev_znode (const ZORDERINFO* zi, int from);
|
||||||
|
|
||||||
|
void __mg_sync_special_nodes (ZORDERINFO* from, ZORDERINFO* to);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
@@ -3,17 +3,12 @@ AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
|||||||
|
|
||||||
noinst_LTLIBRARIES = libkernel.la
|
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 \
|
libkernel_la_SOURCES = timer.c init.c init-lite.c \
|
||||||
desktop-ths.c desktop-sa.c desktop-procs.c \
|
desktop-ths.c desktop-sa.c desktop-procs.c \
|
||||||
cursor.c cursor-procs.c cursor-sa.c \
|
cursor.c cursor-procs.c cursor-sa.c \
|
||||||
sharedres.c message.c event.c listenfd.c \
|
sharedres.c message.c event.c listenfd.c \
|
||||||
blockheap.c fixstr.c slotset.c zorder.c sem-manager.c \
|
blockheap.c fixstr.c slotset.c zorder.c sem-manager.c \
|
||||||
compsor-manager.c compsor-fallback.c
|
compsor-manager.c compsor-fallback.c
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DIST= desktop.c desktop-comm.c cursor-comm.c makefile.ng makefile.msvc
|
EXTRA_DIST= desktop.c desktop-comm.c cursor-comm.c makefile.ng makefile.msvc
|
||||||
|
|
||||||
|
|||||||
+85
-62
File diff suppressed because it is too large
Load Diff
+1207
-732
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
|||||||
* and Graphics User Interface (GUI) support system for embedded systems
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
* and smart IoT devices.
|
* and smart IoT devices.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
|
* Copyright (C) 2002~2021, Beijing FMSoft Technologies Co., Ltd.
|
||||||
* Copyright (C) 1998~2002, WEI Yongming
|
* Copyright (C) 1998~2002, WEI Yongming
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@@ -489,7 +489,7 @@ const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
|
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
|
||||||
if (strcmp (compositors [i].name, name) == 0) {
|
if (compositors [i].name && strcmp (compositors [i].name, name) == 0) {
|
||||||
return compositors [i].ops;
|
return compositors [i].ops;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -583,5 +583,24 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* GUIAPI ServerGetCurrentCompositor (
|
||||||
|
const CompositorOps** ops, CompositorCtxt** ctxt)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
const CompositorOps* the_ops;
|
||||||
|
|
||||||
|
the_ops = ServerSelectCompositor (NULL, ctxt);
|
||||||
|
if (ops) {
|
||||||
|
*ops = the_ops;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
|
||||||
|
if (compositors [i].ops == the_ops)
|
||||||
|
return compositors [i].name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING) */
|
#endif /* defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING) */
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
|
|||||||
{
|
{
|
||||||
FILE* fp;
|
FILE* fp;
|
||||||
WORD16 wTemp;
|
WORD16 wTemp;
|
||||||
int w, h, xhot, yhot, colornum;
|
int w=0, h=0, xhot=0, yhot=0, colornum=0;
|
||||||
#if 0
|
#if 0
|
||||||
DWORD32 size;
|
DWORD32 size;
|
||||||
#endif
|
#endif
|
||||||
@@ -152,7 +152,7 @@ static HCURSOR load_cursor_from_mem (const void* area)
|
|||||||
const Uint8* p = (Uint8*)area;
|
const Uint8* p = (Uint8*)area;
|
||||||
WORD16 wTemp;
|
WORD16 wTemp;
|
||||||
|
|
||||||
int w, h, xhot, yhot, colornum;
|
int w=0, h=0, xhot=0, yhot=0, colornum=0;
|
||||||
#if 0
|
#if 0
|
||||||
DWORD32 size;
|
DWORD32 size;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+20
-10
@@ -104,7 +104,7 @@ static PMAINWIN dskSetActiveWindow (PMAINWIN pWin)
|
|||||||
if (pWin == pOldActive)
|
if (pWin == pOldActive)
|
||||||
return pOldActive;
|
return pOldActive;
|
||||||
|
|
||||||
pOldActive = (PMAINWIN) dskSetActiveZOrderNode (0, pWin?pWin->idx_znode:0);
|
pOldActive = (PMAINWIN) dskSetActiveZOrderNode (__mg_zorder_info, 0, pWin?pWin->idx_znode:0);
|
||||||
|
|
||||||
#ifndef _MGRM_PROCESSES /*for MiniGUI-Threads, not for MiniGUI-StandAlone*/
|
#ifndef _MGRM_PROCESSES /*for MiniGUI-Threads, not for MiniGUI-StandAlone*/
|
||||||
if (pOldActive != (PMAINWIN)HWND_INVALID && __mg_ime_wnd)
|
if (pOldActive != (PMAINWIN)HWND_INVALID && __mg_ime_wnd)
|
||||||
@@ -368,6 +368,15 @@ static BOOL dskSetMainWindowAlwaysTop (PMAINWIN pWin, BOOL fSet)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Since 5.0.6 */
|
||||||
|
static inline int dskSetMainWindowGestureFlags (PMAINWIN pWin, DWORD dwFlags)
|
||||||
|
{
|
||||||
|
if (dskSetZNodeGestureFlags (0, pWin->idx_znode, dwFlags))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
static int dskSetWindowMask (HWND pWin, const WINMASKINFO* mask_info)
|
static int dskSetWindowMask (HWND pWin, const WINMASKINFO* mask_info)
|
||||||
{
|
{
|
||||||
@@ -667,7 +676,7 @@ static LRESULT KeyMessageHandler (UINT message, int scancode, DWORD status)
|
|||||||
|
|
||||||
if (next_node) {
|
if (next_node) {
|
||||||
dskMove2Top (0, next_node);
|
dskMove2Top (0, next_node);
|
||||||
dskSetActiveZOrderNode (0, next_node);
|
dskSetActiveZOrderNode (__mg_zorder_info, 0, next_node);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1424,7 +1433,11 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
|
|||||||
|
|
||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
case MSG_SETALWAYSTOP:
|
case MSG_SETALWAYSTOP:
|
||||||
return dskSetMainWindowAlwaysTop(pWin, (BOOL)lParam);
|
return dskSetMainWindowAlwaysTop (pWin, (BOOL)lParam);
|
||||||
|
|
||||||
|
/* Since 5.0.6 */
|
||||||
|
case MSG_SETGESTUREFLAGS:
|
||||||
|
return dskSetMainWindowGestureFlags (pWin, (DWORD)lParam);
|
||||||
|
|
||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
case MSG_SETWINDOWMASK:
|
case MSG_SETWINDOWMASK:
|
||||||
@@ -1855,7 +1868,7 @@ void GUIAPI DesktopUpdateAllWindow(void)
|
|||||||
SendMessage(HWND_DESKTOP, MSG_PAINT, 0, 0);
|
SendMessage(HWND_DESKTOP, MSG_PAINT, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dskOnTimer (void)
|
static void dskOnTimeout (void)
|
||||||
{
|
{
|
||||||
static DWORD uCounter = 0;
|
static DWORD uCounter = 0;
|
||||||
static DWORD blink_counter = 0;
|
static DWORD blink_counter = 0;
|
||||||
@@ -2137,7 +2150,10 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Since 5.0.6, the desktop handles caret blinking in MSG_TIMEOUT
|
||||||
|
message, and the interval for this message changes to about 0.05s. */
|
||||||
case MSG_TIMEOUT:
|
case MSG_TIMEOUT:
|
||||||
|
dskOnTimeout ();
|
||||||
// Since 5.0.0: MSG_IDLE messages will be generated by PeekMessage.
|
// Since 5.0.0: MSG_IDLE messages will be generated by PeekMessage.
|
||||||
// BroadcastMessageInThisThread (MSG_IDLE, wParam, 0);
|
// BroadcastMessageInThisThread (MSG_IDLE, wParam, 0);
|
||||||
break;
|
break;
|
||||||
@@ -2171,12 +2187,6 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
|
|||||||
dsk_ops->mouse_handler(dt_context, message, wParam, lParam);
|
dsk_ops->mouse_handler(dt_context, message, wParam, lParam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
|
|
||||||
message, and the interval for this MSG_TIMER changes to about 0.05s. */
|
|
||||||
case MSG_TIMER:
|
|
||||||
dskOnTimer ();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+484
-187
File diff suppressed because it is too large
Load Diff
@@ -113,7 +113,8 @@ BOOL mg_InitDesktop (void)
|
|||||||
/*
|
/*
|
||||||
* Init ZOrderInfo here.
|
* Init ZOrderInfo here.
|
||||||
*/
|
*/
|
||||||
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
|
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS,
|
||||||
|
TRUE);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
|
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ BOOL mg_InitDesktop (void)
|
|||||||
/*
|
/*
|
||||||
* Init ZOrderInfo here.
|
* Init ZOrderInfo here.
|
||||||
*/
|
*/
|
||||||
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
|
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS,
|
||||||
|
TRUE);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
|
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
+458
-229
File diff suppressed because it is too large
Load Diff
@@ -611,6 +611,10 @@ void TerminateGUI (int rcByGUI)
|
|||||||
if (_is_server) {
|
if (_is_server) {
|
||||||
mg_TerminateDesktop ();
|
mg_TerminateDesktop ();
|
||||||
|
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
mg_TerminateCompositor ();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Cleanup UNIX domain socket and other IPC objects. */
|
/* Cleanup UNIX domain socket and other IPC objects. */
|
||||||
server_ServerCleanup ();
|
server_ServerCleanup ();
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -112,7 +112,7 @@ static void ParseEvent (PLWEVENT lwe)
|
|||||||
Msg.message = MSG_TIMEOUT;
|
Msg.message = MSG_TIMEOUT;
|
||||||
Msg.wParam = (WPARAM)lwe->count;
|
Msg.wParam = (WPARAM)lwe->count;
|
||||||
Msg.lParam = 0;
|
Msg.lParam = 0;
|
||||||
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
|
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
|
||||||
// QueueDeskMessage (&Msg);
|
// QueueDeskMessage (&Msg);
|
||||||
}
|
}
|
||||||
else if (lwe->type == LWETYPE_KEY) {
|
else if (lwe->type == LWETYPE_KEY) {
|
||||||
|
|||||||
@@ -860,7 +860,7 @@ checkagain:
|
|||||||
/* handle desktop timer here */
|
/* handle desktop timer here */
|
||||||
if (pMsgQueue == __mg_dsk_msg_queue && pMsgQueue->dwState & QS_DESKTIMER) {
|
if (pMsgQueue == __mg_dsk_msg_queue && pMsgQueue->dwState & QS_DESKTIMER) {
|
||||||
pMsg->hwnd = HWND_DESKTOP;
|
pMsg->hwnd = HWND_DESKTOP;
|
||||||
pMsg->message = MSG_TIMER;
|
pMsg->message = MSG_TIMEOUT;
|
||||||
pMsg->wParam = 0;
|
pMsg->wParam = 0;
|
||||||
pMsg->lParam = 0;
|
pMsg->lParam = 0;
|
||||||
|
|
||||||
|
|||||||
+31
-8
@@ -51,17 +51,40 @@
|
|||||||
** Create date: 2005/08/16
|
** Create date: 2005/08/16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set)
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set)
|
||||||
{
|
{
|
||||||
int unused = 0;
|
size_t unused = 0;
|
||||||
int i, j;
|
size_t i, j;
|
||||||
|
|
||||||
for (i = 0; i < len_bmp; i++) {
|
for (i = 0; i < len_bmp; i++) {
|
||||||
for (j = 0; j < 8; j++) {
|
if (*bitmap) {
|
||||||
if (*bitmap & (0x80 >> j)) {
|
unsigned char half_byte = *bitmap & 0xF0;
|
||||||
if (set)
|
unsigned char test_byte = 0x80;
|
||||||
*bitmap &= (~(0x80 >> j));
|
|
||||||
return unused + j;
|
if (half_byte) {
|
||||||
|
for (j = 0; j < 4; j++) {
|
||||||
|
if (half_byte & test_byte) {
|
||||||
|
if (set)
|
||||||
|
*bitmap ^= test_byte;
|
||||||
|
return unused + j;
|
||||||
|
}
|
||||||
|
|
||||||
|
test_byte = test_byte >> 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
half_byte = *bitmap & 0x0F;
|
||||||
|
test_byte = 0x08;
|
||||||
|
for (j = 4; j < 8; j++) {
|
||||||
|
if (half_byte & test_byte) {
|
||||||
|
if (set)
|
||||||
|
*bitmap ^= test_byte;
|
||||||
|
return unused + j;
|
||||||
|
}
|
||||||
|
|
||||||
|
test_byte = test_byte >> 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -94,7 +94,7 @@ void __mg_update_tick_count (void *data)
|
|||||||
__mg_tick_counter = __mg_os_get_time_ticks ();
|
__mg_tick_counter = __mg_os_get_time_ticks ();
|
||||||
#endif /* not defined _MGRM_PROCESSES */
|
#endif /* not defined _MGRM_PROCESSES */
|
||||||
|
|
||||||
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
|
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
|
||||||
message, and the interval for the timer of desktop changes to 0.05s. */
|
message, and the interval for the timer of desktop changes to 0.05s. */
|
||||||
if (__mg_tick_counter >
|
if (__mg_tick_counter >
|
||||||
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
|
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
|
||||||
@@ -129,7 +129,7 @@ void __mg_update_tick_count (void *data)
|
|||||||
__mg_tick_counter += elapsed_ticks;
|
__mg_tick_counter += elapsed_ticks;
|
||||||
#endif /* not defined _MGRM_PROCESSES */
|
#endif /* not defined _MGRM_PROCESSES */
|
||||||
|
|
||||||
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
|
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
|
||||||
message, and the interval for the timer of desktop changes to 0.05s. */
|
message, and the interval for the timer of desktop changes to 0.05s. */
|
||||||
if (__mg_tick_counter >
|
if (__mg_tick_counter >
|
||||||
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
|
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
|
||||||
|
|||||||
+7
-135
@@ -67,9 +67,6 @@
|
|||||||
#ifdef _MG_ENABLE_LICENSE
|
#ifdef _MG_ENABLE_LICENSE
|
||||||
# include "../sysres/license/c_files/03_progressbar.dat.c"
|
# include "../sysres/license/c_files/03_progressbar.dat.c"
|
||||||
#endif
|
#endif
|
||||||
#ifndef __TARGET_UNKNOWN__
|
|
||||||
unsigned int g_license_message_offset;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _MGRM_PROCESSES
|
#ifdef _MGRM_PROCESSES
|
||||||
# include "ourhdr.h"
|
# include "ourhdr.h"
|
||||||
@@ -100,7 +97,7 @@ inline static key_t get_layer_shm_key (void)
|
|||||||
}
|
}
|
||||||
#endif /* defined _MGRM_PROCESSES */
|
#endif /* defined _MGRM_PROCESSES */
|
||||||
|
|
||||||
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_maskrc_heap)
|
||||||
{
|
{
|
||||||
#ifdef _MGRM_PROCESSES
|
#ifdef _MGRM_PROCESSES
|
||||||
int size_usage_bmp = SIZE_USAGE_BMP (SHAREDRES_NR_GLOBALS,
|
int size_usage_bmp = SIZE_USAGE_BMP (SHAREDRES_NR_GLOBALS,
|
||||||
@@ -125,8 +122,8 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
|||||||
nr_normals + /* for the normal windows */
|
nr_normals + /* for the normal windows */
|
||||||
DEF_NR_LAUNCHERS + /* for the launcher ones */
|
DEF_NR_LAUNCHERS + /* for the launcher ones */
|
||||||
NR_FIXED_ZNODES) + /* for the fixed znodes */
|
NR_FIXED_ZNODES) + /* for the fixed znodes */
|
||||||
SIZE_MASKRECT_USAGE_BMP +
|
with_maskrc_heap ? (SIZE_MASKRECT_USAGE_BMP +
|
||||||
sizeof (MASKRECT) * DEF_NR_MASKRECT,
|
sizeof (MASKRECT) * DEF_NR_MASKRECTS) : 0,
|
||||||
SHM_PARAM | IPC_CREAT | IPC_EXCL);
|
SHM_PARAM | IPC_CREAT | IPC_EXCL);
|
||||||
|
|
||||||
return zorder_shmid;
|
return zorder_shmid;
|
||||||
@@ -150,7 +147,7 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
|||||||
DEF_NR_LAUNCHERS + /* for the launcher ones */
|
DEF_NR_LAUNCHERS + /* for the launcher ones */
|
||||||
NR_FIXED_ZNODES) + /* for the fixed znodes */
|
NR_FIXED_ZNODES) + /* for the fixed znodes */
|
||||||
SIZE_MASKRECT_USAGE_BMP +
|
SIZE_MASKRECT_USAGE_BMP +
|
||||||
sizeof (MASKRECT) * DEF_NR_MASKRECT);
|
sizeof (MASKRECT) * DEF_NR_MASKRECTS);
|
||||||
|
|
||||||
if (!__mg_zorder_info) {
|
if (!__mg_zorder_info) {
|
||||||
_MG_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
|
_MG_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
|
||||||
@@ -214,6 +211,8 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
|||||||
__mg_slot_set_use ((unsigned char*)(__mg_zorder_info + 1), 0);
|
__mg_slot_set_use ((unsigned char*)(__mg_zorder_info + 1), 0);
|
||||||
__mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0);
|
__mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0);
|
||||||
|
|
||||||
|
__mg_def_zorder_info = __mg_zorder_info;
|
||||||
|
|
||||||
#if 0 /* deprecated code */
|
#if 0 /* deprecated code */
|
||||||
/* Since 5.0.0; allocate znodes for other fixed main windows */
|
/* Since 5.0.0; allocate znodes for other fixed main windows */
|
||||||
{
|
{
|
||||||
@@ -270,134 +269,7 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
|
|||||||
#endif
|
#endif
|
||||||
free (zi);
|
free (zi);
|
||||||
__mg_zorder_info = NULL;
|
__mg_zorder_info = NULL;
|
||||||
|
__mg_def_zorder_info = NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* deprecated code */
|
|
||||||
#if IS_SHAREDFB_SCHEMA_PROCS
|
|
||||||
|
|
||||||
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
|
||||||
{
|
|
||||||
key_t shm_key;
|
|
||||||
int zorder_shmid;
|
|
||||||
|
|
||||||
if ((shm_key = get_layer_shm_key ()) == -1) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
zorder_shmid = shmget (shm_key,
|
|
||||||
sizeof (ZORDERINFO) + SIZE_USAGE_BMP +
|
|
||||||
sizeof (ZORDERNODE) *
|
|
||||||
(DEF_NR_POPUPMENUS + /* for the popup menus */
|
|
||||||
SHAREDRES_NR_GLOBALS + /* for the global windows */
|
|
||||||
nr_topmosts + /* for the topmost windows */
|
|
||||||
nr_normals)+ /* for the normal windows */
|
|
||||||
SIZE_MASKRECT_USAGE_BMP +
|
|
||||||
sizeof (MASKRECT) * DEF_NR_MASKRECT,
|
|
||||||
SHM_PARAM | IPC_CREAT | IPC_EXCL);
|
|
||||||
|
|
||||||
return zorder_shmid;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
|
|
||||||
|
|
||||||
ZORDERINFO* __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
|
|
||||||
{
|
|
||||||
ZORDERINFO* zi;
|
|
||||||
ZORDERNODE* znodes;
|
|
||||||
void* maskrect_usage_bmp;
|
|
||||||
|
|
||||||
zi = (PZORDERINFO) calloc (1,
|
|
||||||
sizeof (ZORDERINFO) + SIZE_USAGE_BMP +
|
|
||||||
sizeof (ZORDERNODE) *
|
|
||||||
(DEF_NR_POPUPMENUS + /* for the popup menus */
|
|
||||||
SHAREDRES_NR_GLOBALS + /* for global window: 0 */
|
|
||||||
nr_topmosts + /* for the topmost windows */
|
|
||||||
nr_normals)+ /* for the normal windows */
|
|
||||||
SIZE_MASKRECT_USAGE_BMP +
|
|
||||||
sizeof (MASKRECT) * DEF_NR_MASKRECT);
|
|
||||||
|
|
||||||
if (!zi) {
|
|
||||||
_WRN_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
zi->size_usage_bmp = SIZE_USAGE_BMP;
|
|
||||||
zi->size_maskrect_usage_bmp = SIZE_MASKRECT_USAGE_BMP;
|
|
||||||
|
|
||||||
zi->max_nr_popupmenus = DEF_NR_POPUPMENUS;
|
|
||||||
zi->max_nr_globals = 0;
|
|
||||||
zi->max_nr_topmosts = nr_topmosts;
|
|
||||||
zi->max_nr_normals = nr_normals;
|
|
||||||
|
|
||||||
zi->nr_popupmenus = 0;
|
|
||||||
zi->nr_globals = 0;
|
|
||||||
zi->nr_topmosts = 0;
|
|
||||||
zi->nr_normals = 0;
|
|
||||||
|
|
||||||
zi->first_global = 0;
|
|
||||||
zi->first_topmost = 0;
|
|
||||||
zi->first_normal = 0;
|
|
||||||
|
|
||||||
zi->active_win = 0;
|
|
||||||
|
|
||||||
zi->cli_trackmenu = -1;
|
|
||||||
zi->ptmi_in_cli = (HWND)-1;
|
|
||||||
|
|
||||||
/* Set zorder node usage map. */
|
|
||||||
memset (zi + 1, 0xFF, SIZE_USAGE_BMP);
|
|
||||||
|
|
||||||
/* Set zorder mask rect usage map. */
|
|
||||||
maskrect_usage_bmp = GET_MASKRECT_USAGEBMP(zi);
|
|
||||||
memset (maskrect_usage_bmp, 0xFF,
|
|
||||||
zi->size_maskrect_usage_bmp);
|
|
||||||
|
|
||||||
/* init z-order node for desktop */
|
|
||||||
znodes = GET_ZORDERNODE(zi);
|
|
||||||
|
|
||||||
znodes [0].flags = ZOF_TYPE_DESKTOP | ZOF_VISIBLE;
|
|
||||||
znodes [0].rc = g_rcScr;
|
|
||||||
znodes [0].age = 0;
|
|
||||||
znodes [0].cli = 0;
|
|
||||||
znodes [0].hwnd = HWND_DESKTOP;
|
|
||||||
znodes [0].next = 0;
|
|
||||||
znodes [0].prev = 0;
|
|
||||||
znodes [0].idx_mask_rect = 0;
|
|
||||||
|
|
||||||
__mg_slot_set_use ((unsigned char*)(zi + 1), 0);
|
|
||||||
__mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0);
|
|
||||||
|
|
||||||
#ifdef _MGRM_THREADS
|
|
||||||
#ifndef __NOUNIX__
|
|
||||||
pthread_rwlock_init(&zi->rwlock, NULL);
|
|
||||||
#else
|
|
||||||
pthread_mutex_init(&zi->rwlock, NULL);
|
|
||||||
#endif
|
|
||||||
#endif /* _MGRM_THREADS */
|
|
||||||
|
|
||||||
return zi;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
|
|
||||||
|
|
||||||
void __kernel_free_z_order_info (ZORDERINFO* zi)
|
|
||||||
{
|
|
||||||
#if IS_SHAREDFB_SCHEMA_PROCS
|
|
||||||
if (shmdt (zi) < 0)
|
|
||||||
perror ("Detaches shared zorder nodes");
|
|
||||||
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
|
|
||||||
|
|
||||||
#ifdef _MGRM_THREADS
|
|
||||||
#ifndef __NOUNIX__
|
|
||||||
pthread_rwlock_destroy(&zi->rwlock);
|
|
||||||
#else
|
|
||||||
pthread_mutex_destroy(&zi->rwlock);
|
|
||||||
#endif
|
|
||||||
#endif /* _MGRM_THREADS */
|
|
||||||
|
|
||||||
free (zi);
|
|
||||||
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* deprecated code */
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1472,7 +1472,7 @@ void mg_slice_debug_tree_statistics (void)
|
|||||||
su / bf, en, ex);
|
su / bf, en, ex);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_MG_PRINTF("MGSlice: MemChecker: root=NULL\n");
|
_DBG_PRINTF("MGSlice: MemChecker: root=NULL\n");
|
||||||
|
|
||||||
pthread_mutex_unlock (&smc_tree_mutex);
|
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 \
|
math.c about.c error.c sockio.c rc4.c rc4.h \
|
||||||
makefile.ng makefile.msvc
|
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 \
|
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||||
math.c about.c license.c anon_file.c rbtree.c map.c \
|
math.c about.c license.c anon_file.c rbtree.c map.c \
|
||||||
error.c sockio.c
|
error.c sockio.c
|
||||||
endif
|
|
||||||
|
|
||||||
SRC_FILES = $(libmisc_la_SOURCES)
|
SRC_FILES = $(libmisc_la_SOURCES)
|
||||||
LIB_NAME=libmisc
|
LIB_NAME=libmisc
|
||||||
|
|||||||
+1
-1
@@ -228,7 +228,7 @@ HWND GUIAPI OpenAboutDialog (HWND hHosting)
|
|||||||
SysPixelColor[IDX_COLOR_darkgray].g,
|
SysPixelColor[IDX_COLOR_darkgray].g,
|
||||||
SysPixelColor[IDX_COLOR_darkgray].b,
|
SysPixelColor[IDX_COLOR_darkgray].b,
|
||||||
0xA0),
|
0xA0),
|
||||||
CT_ALPHAPIXEL, 0x80);
|
CT_ALPHAPIXEL, COLOR_BLEND_LEGACY);
|
||||||
|
|
||||||
if (hMainWnd == HWND_INVALID)
|
if (hMainWnd == HWND_INVALID)
|
||||||
return HWND_INVALID;
|
return HWND_INVALID;
|
||||||
|
|||||||
@@ -69,6 +69,8 @@
|
|||||||
#include <linux/memfd.h>
|
#include <linux/memfd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#else
|
#else
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+8
-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
|
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)
|
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;
|
struct my_error_mgr *jerr;
|
||||||
jpeg_init_info_t* init_info;
|
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*/
|
goto err; /* not JPEG image*/
|
||||||
|
|
||||||
MGUI_RWseek (fp, 0, SEEK_SET);
|
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 */
|
/* 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;
|
cinfo->quantize_colors = FALSE;
|
||||||
|
|
||||||
if (!(mybmp->flags & MYBMP_LOAD_GRAYSCALE)) {
|
if (!(mybmp->flags & MYBMP_LOAD_GRAYSCALE)) {
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ static BITMAP_TYPE_INFO bitmap_types [MAX_BITMAP_TYPES] =
|
|||||||
#ifdef _MGIMAGE_PNG
|
#ifdef _MGIMAGE_PNG
|
||||||
{ "png", __mg_init_png, __mg_load_png, __mg_cleanup_png, NULL, __mg_check_png },
|
{ "png", __mg_init_png, __mg_load_png, __mg_cleanup_png, NULL, __mg_check_png },
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _MGIMAGE_WEBP
|
||||||
|
{ "webp", __mg_init_webp, __mg_load_webp, __mg_cleanup_webp, NULL, __mg_check_webp },
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
## Makefile.am for the NEWGAL library
|
## Makefile.am for the NEWGAL library
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include $(PIXMAN_CFLAGS)
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libnewgal.la
|
noinst_LTLIBRARIES = libnewgal.la
|
||||||
|
|
||||||
@@ -17,6 +17,9 @@ DRIVERS = @VIDEO_DRIVERS@
|
|||||||
|
|
||||||
# Include the architecture-independent sources
|
# Include the architecture-independent sources
|
||||||
COMMON_SRCS = \
|
COMMON_SRCS = \
|
||||||
|
video.c \
|
||||||
|
newgal.c \
|
||||||
|
surface.c \
|
||||||
RLEaccel.c \
|
RLEaccel.c \
|
||||||
RLEaccel_c.h \
|
RLEaccel_c.h \
|
||||||
blit.c \
|
blit.c \
|
||||||
@@ -29,12 +32,9 @@ COMMON_SRCS = \
|
|||||||
leaks.h \
|
leaks.h \
|
||||||
pixels.c \
|
pixels.c \
|
||||||
pixels_c.h \
|
pixels_c.h \
|
||||||
surface.c \
|
|
||||||
stretch.c \
|
stretch.c \
|
||||||
stretch_c.h \
|
stretch_c.h \
|
||||||
sysvideo.h \
|
sysvideo.h \
|
||||||
video.c \
|
|
||||||
newgal.c \
|
|
||||||
videomem-bucket.h \
|
videomem-bucket.h \
|
||||||
videomem-bucket.c \
|
videomem-bucket.c \
|
||||||
surface-shared.c \
|
surface-shared.c \
|
||||||
|
|||||||
+123
-1
@@ -162,6 +162,13 @@ static void GAL_BlitCopyOverlap(GAL_BlitInfo *info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
#include <pixman.h>
|
||||||
|
|
||||||
|
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
|
struct GAL_Surface *dst, GAL_Rect *dstrect);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Figure out which of many blit routines to set up on a surface */
|
/* Figure out which of many blit routines to set up on a surface */
|
||||||
int GAL_CalculateBlit(GAL_Surface *surface)
|
int GAL_CalculateBlit(GAL_Surface *surface)
|
||||||
{
|
{
|
||||||
@@ -255,7 +262,7 @@ int GAL_CalculateBlit(GAL_Surface *surface)
|
|||||||
|
|
||||||
/* Handle overlapping blits on the same surface */
|
/* Handle overlapping blits on the same surface */
|
||||||
if ( surface == surface->map->dst ) {
|
if ( surface == surface->map->dst ) {
|
||||||
surface->map->sw_data->blit = GAL_BlitCopyOverlap;
|
surface->map->sw_data->blit = GAL_BlitCopyOverlap;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( surface->format->BitsPerPixel < 8 ) {
|
if ( surface->format->BitsPerPixel < 8 ) {
|
||||||
@@ -301,8 +308,123 @@ int GAL_CalculateBlit(GAL_Surface *surface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( surface->map->sw_blit == NULL ) {
|
if ( surface->map->sw_blit == NULL ) {
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
if (blit_index & 1) {
|
||||||
|
// have colorkey
|
||||||
|
surface->map->sw_blit = GAL_SoftBlit;
|
||||||
|
}
|
||||||
|
else if (surface->pix_img && surface->map->dst->pix_img &&
|
||||||
|
surface != surface->map->dst) {
|
||||||
|
surface->map->sw_blit = GAL_PixmanBlit;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
surface->map->sw_blit = GAL_SoftBlit;
|
||||||
|
}
|
||||||
|
#else
|
||||||
surface->map->sw_blit = GAL_SoftBlit;
|
surface->map->sw_blit = GAL_SoftBlit;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
|
||||||
|
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
|
||||||
|
{
|
||||||
|
if (GAL_CheckPixmanFormats (src, dst)) {
|
||||||
|
if ((src->flags & GAL_SRCALPHA) && src->format->alpha != GAL_ALPHA_OPAQUE) {
|
||||||
|
memset (&src->pix_alpha_bits, src->format->alpha, sizeof(uint32_t));
|
||||||
|
src->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
|
||||||
|
&src->pix_alpha_bits, 4);
|
||||||
|
if (src->msk_img)
|
||||||
|
pixman_image_set_repeat (src->msk_img, PIXMAN_REPEAT_NORMAL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
src->msk_img = NULL;
|
||||||
|
|
||||||
|
ops &= COLOR_BLEND_FLAGS_MASK;
|
||||||
|
if (ops == COLOR_BLEND_LEGACY) {
|
||||||
|
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
|
||||||
|
src->pix_op = PIXMAN_OP_OVER;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
src->pix_op = PIXMAN_OP_SRC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
src->pix_op = ops;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (src->pix_op > PIXMAN_OP_HSL_LUMINOSITY ||
|
||||||
|
src->pix_op < PIXMAN_OP_CLEAR) {
|
||||||
|
src->pix_op = PIXMAN_OP_SRC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* reset transform and filter */
|
||||||
|
pixman_image_set_transform (src->pix_img, NULL);
|
||||||
|
pixman_image_set_filter (src->pix_img, PIXMAN_FILTER_NEAREST, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst)
|
||||||
|
{
|
||||||
|
if (src->msk_img) {
|
||||||
|
pixman_image_unref (src->msk_img);
|
||||||
|
src->msk_img = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
|
||||||
|
struct GAL_Surface *dst, GAL_Rect *dstrect)
|
||||||
|
{
|
||||||
|
pixman_image_t *src_img = src->pix_img, *dst_img = dst->pix_img;
|
||||||
|
pixman_image_t *msk_img;
|
||||||
|
pixman_op_t op;
|
||||||
|
|
||||||
|
msk_img = src->msk_img;
|
||||||
|
op = (pixman_op_t)src->pix_op;
|
||||||
|
|
||||||
|
_DBG_PRINTF ("srcrect: %d, %d, %dx%d; dstrect: %d, %d, %dx%d\n",
|
||||||
|
srcrect->x, srcrect->y, srcrect->w, srcrect->h,
|
||||||
|
dstrect->x, dstrect->y, dstrect->w, dstrect->h);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
pixman_region32_t clip_region;
|
||||||
|
pixman_region32_init_rect (&clip_region,
|
||||||
|
dst->clip_rect.x, dst->clip_rect.y, dst->clip_rect.w, dst->clip_rect.h);
|
||||||
|
pixman_image_set_clip_region32 (dst_img, &clip_region);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// pixman_blt does not work
|
||||||
|
if (pixman_image_get_format (src_img) == pixman_image_get_format (dst_img) &&
|
||||||
|
op == PIXMAN_OP_SRC && msk_img == NULL) {
|
||||||
|
pixman_blt ((uint32_t *)((char*)src->pixels + src->pixels_off),
|
||||||
|
(uint32_t *)((char*)dst->pixels + dst->pixels_off),
|
||||||
|
src->pitch, dst->pitch,
|
||||||
|
GAL_BytesPerPixel (src),
|
||||||
|
GAL_BytesPerPixel (dst),
|
||||||
|
srcrect->x, srcrect->y,
|
||||||
|
dstrect->x, dstrect->y,
|
||||||
|
srcrect->w, srcrect->h);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
pixman_image_composite32 (op, src_img, msk_img, dst_img,
|
||||||
|
srcrect->x, srcrect->y,
|
||||||
|
0, 0,
|
||||||
|
dstrect->x, dstrect->y,
|
||||||
|
srcrect->w, srcrect->h);
|
||||||
|
}
|
||||||
|
|
||||||
|
//pixman_region32_fini (&clip_region);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif // _MGUSE_PIXMAN
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -77,16 +77,16 @@ struct private_swaccel {
|
|||||||
/* Blit mapping definition */
|
/* Blit mapping definition */
|
||||||
typedef struct GAL_BlitMap {
|
typedef struct GAL_BlitMap {
|
||||||
GAL_Surface *dst;
|
GAL_Surface *dst;
|
||||||
int identity;
|
|
||||||
Uint8 *table;
|
Uint8 *table;
|
||||||
GAL_blit hw_blit;
|
GAL_blit hw_blit;
|
||||||
GAL_blit sw_blit;
|
GAL_blit sw_blit;
|
||||||
struct private_hwaccel *hw_data;
|
struct private_hwaccel *hw_data;
|
||||||
struct private_swaccel *sw_data;
|
struct private_swaccel *sw_data;
|
||||||
|
|
||||||
|
int identity;
|
||||||
/* the version count matches the destination; mismatch indicates
|
/* the version count matches the destination; mismatch indicates
|
||||||
an invalid mapping */
|
an invalid mapping */
|
||||||
unsigned int format_version;
|
unsigned int format_version;
|
||||||
} GAL_BlitMap;
|
} GAL_BlitMap;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
-83
@@ -52,28 +52,10 @@
|
|||||||
|
|
||||||
/* Function to check the CPU flags */
|
/* Function to check the CPU flags */
|
||||||
#define MMX_CPU 0x800000
|
#define MMX_CPU 0x800000
|
||||||
#ifdef USE_ASMBLIT
|
|
||||||
#define CPU_Flags() Hermes_X86_CPU()
|
|
||||||
#else
|
|
||||||
#define CPU_Flags() 0L
|
#define CPU_Flags() 0L
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Functions to blit from N-bit surfaces to other surfaces */
|
/* Functions to blit from N-bit surfaces to other surfaces */
|
||||||
|
|
||||||
#ifdef USE_ASMBLIT
|
|
||||||
|
|
||||||
/* Heheheh, we coerce Hermes into using GAL blit information */
|
|
||||||
#define X86_ASSEMBLER
|
|
||||||
#define HermesConverterInterface GAL_BlitInfo
|
|
||||||
#define HermesClearInterface void
|
|
||||||
#define STACKCALL
|
|
||||||
typedef Uint32 int32;
|
|
||||||
|
|
||||||
#include "HeadMMX.h"
|
|
||||||
#include "HeadX86.h"
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* This is now endian dependent */
|
/* This is now endian dependent */
|
||||||
#if ( GAL_BYTEORDER == GAL_LIL_ENDIAN )
|
#if ( GAL_BYTEORDER == GAL_LIL_ENDIAN )
|
||||||
#define HI 1
|
#define HI 1
|
||||||
@@ -428,9 +410,6 @@ static void Blit_RGB888_RGB565(GAL_BlitInfo *info)
|
|||||||
#endif /* USE_DUFFS_LOOP */
|
#endif /* USE_DUFFS_LOOP */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_ASMBLIT */
|
|
||||||
|
|
||||||
|
|
||||||
/* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */
|
/* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */
|
||||||
#if ( GAL_BYTEORDER == GAL_LIL_ENDIAN )
|
#if ( GAL_BYTEORDER == GAL_LIL_ENDIAN )
|
||||||
#define RGB565_32(dst, src, map) (map[src[0]*2] + map[src[1]*2+1])
|
#define RGB565_32(dst, src, map) (map[src[0]*2] + map[src[1]*2+1])
|
||||||
@@ -1458,14 +1437,6 @@ static const struct blit_table normal_blit_1[] = {
|
|||||||
{ 0,0,0, 0, 0,0,0, 0, NULL, NULL },
|
{ 0,0,0, 0, 0,0,0, 0, NULL, NULL },
|
||||||
};
|
};
|
||||||
static const struct blit_table normal_blit_2[] = {
|
static const struct blit_table normal_blit_2[] = {
|
||||||
#ifdef USE_ASMBLIT
|
|
||||||
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800,
|
|
||||||
0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x00007C00,0x000003E0,0x0000001F,
|
|
||||||
0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000003E0,0x00007C00,
|
|
||||||
0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA },
|
|
||||||
#endif
|
|
||||||
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x00FF0000,0x0000FF00,0x000000FF,
|
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x00FF0000,0x0000FF00,0x000000FF,
|
||||||
0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA },
|
0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA },
|
||||||
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x000000FF,0x0000FF00,0x00FF0000,
|
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x000000FF,0x0000FF00,0x00FF0000,
|
||||||
@@ -1483,39 +1454,10 @@ static const struct blit_table normal_blit_3[] = {
|
|||||||
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
||||||
};
|
};
|
||||||
static const struct blit_table normal_blit_4[] = {
|
static const struct blit_table normal_blit_4[] = {
|
||||||
#ifdef USE_ASMBLIT
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
|
|
||||||
MMX_CPU, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
|
|
||||||
0, ConvertX86p32_16RGB565, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
|
|
||||||
MMX_CPU, ConvertMMXpII32_16BGR565, ConvertMMX, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
|
|
||||||
0, ConvertX86p32_16BGR565, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
|
|
||||||
MMX_CPU, ConvertMMXpII32_16RGB555, ConvertMMX, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
|
|
||||||
0, ConvertX86p32_16RGB555, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
|
|
||||||
MMX_CPU, ConvertMMXpII32_16BGR555, ConvertMMX, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
|
|
||||||
0, ConvertX86p32_16BGR555, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF,
|
|
||||||
0, ConvertX86p32_24RGB888, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x000000FF,0x0000FF00,0x00FF0000,
|
|
||||||
0, ConvertX86p32_24BGR888, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x000000FF,0x0000FF00,0x00FF0000,
|
|
||||||
0, ConvertX86p32_32BGR888, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0xFF000000,0x00FF0000,0x0000FF00,
|
|
||||||
0, ConvertX86p32_32RGBA888, ConvertX86, NO_ALPHA },
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x0000FF00,0x00FF0000,0xFF000000,
|
|
||||||
0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA },
|
|
||||||
#else
|
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
|
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
|
||||||
0, NULL, Blit_RGB888_RGB565, NO_ALPHA },
|
0, NULL, Blit_RGB888_RGB565, NO_ALPHA },
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
|
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
|
||||||
0, NULL, Blit_RGB888_RGB555, NO_ALPHA },
|
0, NULL, Blit_RGB888_RGB555, NO_ALPHA },
|
||||||
#endif
|
|
||||||
/* Default for 32-bit RGB source, used if no other blitter matches */
|
/* Default for 32-bit RGB source, used if no other blitter matches */
|
||||||
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
||||||
};
|
};
|
||||||
@@ -1575,24 +1517,19 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
|
|||||||
if ( surface->map->table ) {
|
if ( surface->map->table ) {
|
||||||
blitfun = Blit_RGB888_index8_map;
|
blitfun = Blit_RGB888_index8_map;
|
||||||
} else {
|
} else {
|
||||||
#ifdef USE_ASMBLIT
|
|
||||||
sdata->aux_data = ConvertX86p32_8RGB332;
|
|
||||||
blitfun = ConvertX86;
|
|
||||||
#else
|
|
||||||
blitfun = Blit_RGB888_index8;
|
blitfun = Blit_RGB888_index8;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
blitfun = BlitNto1;
|
blitfun = BlitNto1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Now the meat, choose the blitter we want */
|
/* Now the meat, choose the blitter we want */
|
||||||
int a_need = 0;
|
int a_need = 0;
|
||||||
if(dstfmt->Amask)
|
if (dstfmt->Amask)
|
||||||
a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
|
a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
|
||||||
table = normal_blit[srcfmt->BytesPerPixel-1];
|
table = normal_blit[srcfmt->BytesPerPixel-1];
|
||||||
for ( which=0; table[which].srcR; ++which ) {
|
for (which=0; table[which].srcR; ++which) {
|
||||||
if ( srcfmt->Rmask == table[which].srcR &&
|
if (srcfmt->Rmask == table[which].srcR &&
|
||||||
srcfmt->Gmask == table[which].srcG &&
|
srcfmt->Gmask == table[which].srcG &&
|
||||||
srcfmt->Bmask == table[which].srcB &&
|
srcfmt->Bmask == table[which].srcB &&
|
||||||
dstfmt->BytesPerPixel == table[which].dstbpp &&
|
dstfmt->BytesPerPixel == table[which].dstbpp &&
|
||||||
@@ -1601,7 +1538,7 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
|
|||||||
dstfmt->Bmask == table[which].dstB &&
|
dstfmt->Bmask == table[which].dstB &&
|
||||||
(a_need & table[which].alpha) == a_need &&
|
(a_need & table[which].alpha) == a_need &&
|
||||||
(CPU_Flags()&table[which].cpu_flags) ==
|
(CPU_Flags()&table[which].cpu_flags) ==
|
||||||
table[which].cpu_flags )
|
table[which].cpu_flags)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sdata->aux_data = table[which].aux_data;
|
sdata->aux_data = table[which].aux_data;
|
||||||
@@ -1610,21 +1547,6 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
|
|||||||
blitfun = BlitNtoNCopyAlpha;
|
blitfun = BlitNtoNCopyAlpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_ASM
|
|
||||||
#ifdef USE_ASMBLIT
|
|
||||||
if ( blitfun == ConvertMMX )
|
|
||||||
fprintf(stderr, "Using mmx blit\n");
|
|
||||||
else
|
|
||||||
if ( blitfun == ConvertX86 )
|
|
||||||
fprintf(stderr, "Using asm blit\n");
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
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);
|
return(blitfun);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -794,6 +794,10 @@ static GAL_Surface* create_surface_from_buffer (_THIS,
|
|||||||
surface->h = surface_buffer->height;
|
surface->h = surface_buffer->height;
|
||||||
surface->pitch = surface_buffer->pitch;
|
surface->pitch = surface_buffer->pitch;
|
||||||
surface->pixels_off = 0;
|
surface->pixels_off = 0;
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
surface->pix_img = NULL;
|
||||||
|
surface->msk_img = NULL;
|
||||||
|
#endif
|
||||||
#if IS_COMPOSITING_SCHEMA
|
#if IS_COMPOSITING_SCHEMA
|
||||||
surface->shared_header = NULL;
|
surface->shared_header = NULL;
|
||||||
surface->dirty_info = NULL;
|
surface->dirty_info = NULL;
|
||||||
@@ -948,6 +952,11 @@ static void DRM_DeleteDevice(GAL_VideoDevice *device)
|
|||||||
free(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)
|
static char* find_driver_for_device (const char *dev_name)
|
||||||
{
|
{
|
||||||
char *driver;
|
char *driver;
|
||||||
@@ -992,6 +1001,7 @@ static char* find_driver_for_device (const char *dev_name)
|
|||||||
|
|
||||||
return strdup (driver + strlen ("/"));
|
return strdup (driver + strlen ("/"));
|
||||||
}
|
}
|
||||||
|
#endif /* not defined __TARGET_PX30__ */
|
||||||
|
|
||||||
static DrmDriverOps* load_external_driver (DrmVideoData* vdata,
|
static DrmDriverOps* load_external_driver (DrmVideoData* vdata,
|
||||||
const char* driver_name, int device_fd)
|
const char* driver_name, int device_fd)
|
||||||
@@ -1091,6 +1101,7 @@ static int open_drm_device(GAL_VideoDevice *device)
|
|||||||
_DBG_PRINTF("Try to load DRM driver: %s\n", driver_name);
|
_DBG_PRINTF("Try to load DRM driver: %s\n", driver_name);
|
||||||
|
|
||||||
fd = drmOpen(driver_name, NULL);
|
fd = drmOpen(driver_name, NULL);
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
_ERR_PRINTF("NEWGAL>DRM: drmOpen failed\n");
|
_ERR_PRINTF("NEWGAL>DRM: drmOpen failed\n");
|
||||||
free(driver_name);
|
free(driver_name);
|
||||||
@@ -1244,16 +1255,43 @@ static GAL_VideoDevice *DRM_CreateDevice(int devindex)
|
|||||||
strcasecmp (tmp, "yes") == 0) {
|
strcasecmp (tmp, "yes") == 0) {
|
||||||
device->hidden->dbl_buff = 1;
|
device->hidden->dbl_buff = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _MGSCHEMA_COMPOSITING
|
||||||
|
#ifndef _MGRM_STANDALONE
|
||||||
|
if (device->hidden->dbl_buff) {
|
||||||
|
mode_t old_mask = umask (0000);
|
||||||
|
sem_unlink (SEM_UPDATE_LOCK);
|
||||||
|
device->hidden->update_lock = sem_open (SEM_UPDATE_LOCK,
|
||||||
|
O_CREAT | O_RDWR | O_EXCL, 0666, 1);
|
||||||
|
umask (old_mask);
|
||||||
|
if (device->hidden->update_lock == SEM_FAILED) {
|
||||||
|
_WRN_PRINTF ("Failed to create update lock: %s\n", strerror (errno));
|
||||||
|
device->hidden->dbl_buff = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else /* not defined _MGRM_STANDALONE */
|
||||||
|
device->hidden->update_lock = SEM_FAILED;
|
||||||
|
#endif /* defined _MGRM_STANDALONE */
|
||||||
|
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
}
|
}
|
||||||
#ifdef _MGRM_PROCESSES
|
#ifdef _MGRM_PROCESSES
|
||||||
else {
|
else {
|
||||||
device->hidden->dbl_buff = SHAREDRES_VIDEO_DBL_BUFF;
|
device->hidden->dbl_buff = SHAREDRES_VIDEO_DBL_BUFF;
|
||||||
|
#ifdef _MGSCHEMA_SHAREDFB
|
||||||
|
if (device->hidden->dbl_buff) {
|
||||||
|
device->hidden->update_lock = sem_open (SEM_UPDATE_LOCK, O_RDWR);
|
||||||
|
if (device->hidden->update_lock == SEM_FAILED) {
|
||||||
|
_WRN_PRINTF ("Failed to open update lock: %s\n", strerror (errno));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* defined _MGRM_PROCESSES */
|
#endif /* defined _MGRM_PROCESSES */
|
||||||
|
|
||||||
/* override double buffering */
|
/* override double buffering */
|
||||||
#if IS_COMPOSITING_SCHEMA
|
#if IS_COMPOSITING_SCHEMA
|
||||||
/* force to use double buffering to compositing schema */
|
/* force to use double buffering for compositing schema */
|
||||||
if (mgIsServer) {
|
if (mgIsServer) {
|
||||||
device->hidden->dbl_buff = 1;
|
device->hidden->dbl_buff = 1;
|
||||||
#if 0 /* test code */
|
#if 0 /* test code */
|
||||||
@@ -1646,6 +1684,18 @@ static void DRM_VideoQuit(_THIS)
|
|||||||
this->screen->pixels = NULL;
|
this->screen->pixels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
|
if (mgIsServer)
|
||||||
|
#endif
|
||||||
|
#ifndef _MGSCHEMA_COMPOSITING
|
||||||
|
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
|
||||||
|
if (sem_unlink (SEM_UPDATE_LOCK)) {
|
||||||
|
_ERR_PRINTF ("Failed to unlink the update lock semaphore: %s\n",
|
||||||
|
strerror (errno));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
#if 0 /* test code */
|
#if 0 /* test code */
|
||||||
#ifdef _MBSCHEMA_COMPOSITING
|
#ifdef _MBSCHEMA_COMPOSITING
|
||||||
if (this->hidden->update_th) {
|
if (this->hidden->update_th) {
|
||||||
@@ -3197,6 +3247,12 @@ static void DRM_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
|
|||||||
RECT* dirty_rc;
|
RECT* dirty_rc;
|
||||||
RECT bound;
|
RECT bound;
|
||||||
|
|
||||||
|
#ifndef _MGSCHEMA_COMPOSITING
|
||||||
|
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
|
||||||
|
sem_wait (this->hidden->update_lock);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if IS_SHAREDFB_SCHEMA_PROCS
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
GAL_ShadowSurfaceHeader* hdr;
|
GAL_ShadowSurfaceHeader* hdr;
|
||||||
if (this->hidden->shadow_screen->flags & GAL_HWSURFACE) {
|
if (this->hidden->shadow_screen->flags & GAL_HWSURFACE) {
|
||||||
@@ -3229,6 +3285,12 @@ static void DRM_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
|
|||||||
bound = GetScreenRect();
|
bound = GetScreenRect();
|
||||||
if (!IntersectRect (dirty_rc, dirty_rc, &bound))
|
if (!IntersectRect (dirty_rc, dirty_rc, &bound))
|
||||||
SetRectEmpty (dirty_rc);
|
SetRectEmpty (dirty_rc);
|
||||||
|
|
||||||
|
#ifndef _MGSCHEMA_COMPOSITING
|
||||||
|
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
|
||||||
|
sem_post (this->hidden->update_lock);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL DRM_SyncUpdate (_THIS)
|
static BOOL DRM_SyncUpdate (_THIS)
|
||||||
@@ -3237,6 +3299,12 @@ static BOOL DRM_SyncUpdate (_THIS)
|
|||||||
RECT* dirty_rc;
|
RECT* dirty_rc;
|
||||||
RECT bound;
|
RECT bound;
|
||||||
|
|
||||||
|
#ifndef _MGSCHEMA_COMPOSITING
|
||||||
|
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
|
||||||
|
sem_wait (this->hidden->update_lock);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if IS_SHAREDFB_SCHEMA_PROCS
|
#if IS_SHAREDFB_SCHEMA_PROCS
|
||||||
GAL_ShadowSurfaceHeader* hdr;
|
GAL_ShadowSurfaceHeader* hdr;
|
||||||
if (this->hidden->shadow_screen->flags & GAL_HWSURFACE) {
|
if (this->hidden->shadow_screen->flags & GAL_HWSURFACE) {
|
||||||
@@ -3289,8 +3357,12 @@ static BOOL DRM_SyncUpdate (_THIS)
|
|||||||
src_rect.h = RECTH (bound);
|
src_rect.h = RECTH (bound);
|
||||||
dst_rect = src_rect;
|
dst_rect = src_rect;
|
||||||
|
|
||||||
|
GAL_SetupBlitting (this->hidden->shadow_screen,
|
||||||
|
this->hidden->real_screen, 0);
|
||||||
GAL_BlitSurface (this->hidden->shadow_screen, &src_rect,
|
GAL_BlitSurface (this->hidden->shadow_screen, &src_rect,
|
||||||
this->hidden->real_screen, &dst_rect);
|
this->hidden->real_screen, &dst_rect);
|
||||||
|
GAL_CleanupBlitting (this->hidden->shadow_screen,
|
||||||
|
this->hidden->real_screen);
|
||||||
#endif /* use blitting */
|
#endif /* use blitting */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3313,8 +3385,12 @@ static BOOL DRM_SyncUpdate (_THIS)
|
|||||||
dst_rect.y = eff_rc.top;
|
dst_rect.y = eff_rc.top;
|
||||||
dst_rect.w = src_rect.w;
|
dst_rect.w = src_rect.w;
|
||||||
dst_rect.h = src_rect.h;
|
dst_rect.h = src_rect.h;
|
||||||
|
GAL_SetupBlitting (this->hidden->cursor,
|
||||||
|
this->hidden->real_screen, 0);
|
||||||
GAL_BlitSurface (this->hidden->cursor, &src_rect,
|
GAL_BlitSurface (this->hidden->cursor, &src_rect,
|
||||||
this->hidden->real_screen, &dst_rect);
|
this->hidden->real_screen, &dst_rect);
|
||||||
|
GAL_CleanupBlitting (this->hidden->cursor,
|
||||||
|
this->hidden->real_screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* _MGSCHEMA_COMPOSITING */
|
#endif /* _MGSCHEMA_COMPOSITING */
|
||||||
@@ -3332,7 +3408,14 @@ static BOOL DRM_SyncUpdate (_THIS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetRectEmpty (dirty_rc);
|
SetRectEmpty (dirty_rc);
|
||||||
|
|
||||||
ret:
|
ret:
|
||||||
|
#ifndef _MGSCHEMA_COMPOSITING
|
||||||
|
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
|
||||||
|
sem_post (this->hidden->update_lock);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,14 @@
|
|||||||
|
|
||||||
#include "sysvideo.h"
|
#include "sysvideo.h"
|
||||||
|
|
||||||
|
#ifndef _MGSCHEMA_COMPOSITING
|
||||||
|
#include <fcntl.h> /* For O_* constants */
|
||||||
|
#include <sys/stat.h> /* For mode constants */
|
||||||
|
#include <semaphore.h>
|
||||||
|
|
||||||
|
#define SEM_UPDATE_LOCK "mginit-drm-update"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Hidden "this" pointer for the video functions */
|
/* Hidden "this" pointer for the video functions */
|
||||||
#define _THIS GAL_VideoDevice *this
|
#define _THIS GAL_VideoDevice *this
|
||||||
|
|
||||||
@@ -69,13 +77,6 @@ typedef struct GAL_PrivateVideoData {
|
|||||||
GAL_Surface *cursor;
|
GAL_Surface *cursor;
|
||||||
int csr_x, csr_y;
|
int csr_x, csr_y;
|
||||||
int hot_x, hot_y;
|
int hot_x, hot_y;
|
||||||
|
|
||||||
#if 0 /* test code */
|
|
||||||
/* for asynchronous update */
|
|
||||||
pthread_t update_th;
|
|
||||||
pthread_mutex_t update_lock;
|
|
||||||
sem_t sem_update;
|
|
||||||
#endif /* test code */
|
|
||||||
#else /* defined _MGSCHEMA_COMPOSITING */
|
#else /* defined _MGSCHEMA_COMPOSITING */
|
||||||
/* When double buffering supported, the real surface represents the ultimate
|
/* When double buffering supported, the real surface represents the ultimate
|
||||||
* scan-out frame buffer, and the shadow screen represents the rendering
|
* scan-out frame buffer, and the shadow screen represents the rendering
|
||||||
@@ -84,6 +85,7 @@ typedef struct GAL_PrivateVideoData {
|
|||||||
|
|
||||||
/* the global names of real screen and shadow screen */
|
/* the global names of real screen and shadow screen */
|
||||||
uint32_t real_name, shadow_name;
|
uint32_t real_name, shadow_name;
|
||||||
|
sem_t *update_lock;
|
||||||
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
#if !IS_SHAREDFB_SCHEMA_PROCS
|
#if !IS_SHAREDFB_SCHEMA_PROCS
|
||||||
|
|||||||
@@ -59,13 +59,9 @@
|
|||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include <linux/vt.h>
|
#include <linux/vt.h>
|
||||||
#include <linux/kd.h>
|
#include <linux/kd.h>
|
||||||
#include <linux/keyboard.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "minigui.h"
|
#include "minigui.h"
|
||||||
#ifdef _MGRM_PROCESSES
|
|
||||||
#include "client.h"
|
|
||||||
#endif
|
|
||||||
#include "newgal.h"
|
#include "newgal.h"
|
||||||
#include "sysvideo.h"
|
#include "sysvideo.h"
|
||||||
#include "pixels_c.h"
|
#include "pixels_c.h"
|
||||||
@@ -74,6 +70,11 @@
|
|||||||
#include "fbmatrox.h"
|
#include "fbmatrox.h"
|
||||||
#include "fbneomagic.h"
|
#include "fbneomagic.h"
|
||||||
|
|
||||||
|
#ifdef _MGRM_PROCESSES
|
||||||
|
#include "client.h"
|
||||||
|
#include "sharedres.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// #define FBCON_DEBUG 1
|
// #define FBCON_DEBUG 1
|
||||||
// #define FBACCEL_DEBUG 1
|
// #define FBACCEL_DEBUG 1
|
||||||
|
|
||||||
@@ -106,13 +107,29 @@ static void FB_WaitIdle(_THIS);
|
|||||||
#include "../shadow-screen.h"
|
#include "../shadow-screen.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
#if defined(__TARGET_R818__)
|
||||||
|
#define FBIO_CACHE_SYNC 0x4630
|
||||||
|
#define FBIO_ENABLE_CACHE 0x4631
|
||||||
|
#endif
|
||||||
|
|
||||||
static BOOL FB_SyncUpdate (_THIS)
|
static BOOL FB_SyncUpdate (_THIS)
|
||||||
{
|
{
|
||||||
if (IsRectEmpty (&this->hidden->dirty_rc))
|
if (IsRectEmpty (&this->hidden->dirty_rc))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (shadowScreen_BlitToReal (this) == 0)
|
if (shadowScreen_BlitToReal (this) == 0) {
|
||||||
|
#if defined(__TARGET_R818__)
|
||||||
|
uintptr_t args[2];
|
||||||
|
args[0] = (uintptr_t)this->hidden->real_screen->pixels;
|
||||||
|
args[0] += this->hidden->real_screen->pitch * this->hidden->dirty_rc.top;
|
||||||
|
args[1] = this->hidden->real_screen->pitch * RECTH(this->hidden->dirty_rc);
|
||||||
|
if (ioctl (console_fd, FBIO_CACHE_SYNC, args) < 0) {
|
||||||
|
_WRN_PRINTF ("failed to sync cache\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
SetRectEmpty (&this->hidden->dirty_rc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -343,6 +360,18 @@ static int FB_VideoInit(_THIS, GAL_PixelFormat *vformat)
|
|||||||
int i;
|
int i;
|
||||||
const char *GAL_fbdev;
|
const char *GAL_fbdev;
|
||||||
|
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
if (!mgIsServer) {
|
||||||
|
vformat->Amask = SHAREDRES_VIDEO_AMASK;
|
||||||
|
vformat->Rmask = SHAREDRES_VIDEO_RMASK;
|
||||||
|
vformat->Gmask = SHAREDRES_VIDEO_GMASK;
|
||||||
|
vformat->Bmask = SHAREDRES_VIDEO_BMASK;
|
||||||
|
vformat->BitsPerPixel = SHAREDRES_VIDEO_DEPTH;
|
||||||
|
vformat->BytesPerPixel = (SHAREDRES_VIDEO_DEPTH + 7) >> 3;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize the library */
|
/* Initialize the library */
|
||||||
GAL_fbdev = getenv("FRAMEBUFFER");
|
GAL_fbdev = getenv("FRAMEBUFFER");
|
||||||
if (GAL_fbdev == NULL) {
|
if (GAL_fbdev == NULL) {
|
||||||
@@ -392,6 +421,16 @@ static int FB_VideoInit(_THIS, GAL_PixelFormat *vformat)
|
|||||||
(((long)finfo.smem_start)&~(getpagesize () - 1)));
|
(((long)finfo.smem_start)&~(getpagesize () - 1)));
|
||||||
mapped_memlen = finfo.smem_len+mapped_offset;
|
mapped_memlen = finfo.smem_len+mapped_offset;
|
||||||
|
|
||||||
|
#if defined(__TARGET_R818__) && defined(_MGSCHEMA_COMPOSITING)
|
||||||
|
if (mgIsServer) {
|
||||||
|
uintptr_t args[2] = { 1, 0 };
|
||||||
|
if (ioctl(console_fd, FBIO_ENABLE_CACHE, args) < 0) {
|
||||||
|
GAL_SetError("NEWGAL/FBCON: FBIO_ENABLE_CACHE failed\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __uClinux__
|
#ifdef __uClinux__
|
||||||
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||||
mapped_mem = mmap(NULL, mapped_memlen,
|
mapped_mem = mmap(NULL, mapped_memlen,
|
||||||
@@ -996,11 +1035,16 @@ static int FB_AllocHWSurface (_THIS, GAL_Surface *surface)
|
|||||||
REP_HWSURFACE reply = {0, 0, NULL};
|
REP_HWSURFACE reply = {0, 0, NULL};
|
||||||
|
|
||||||
#ifdef _MGRM_PROCESSES
|
#ifdef _MGRM_PROCESSES
|
||||||
if (mgIsServer)
|
if (mgIsServer) {
|
||||||
FB_RequestHWSurface (this, &request, &reply);
|
FB_RequestHWSurface (this, &request, &reply);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
REQUEST req;
|
REQUEST req;
|
||||||
|
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
if (!mgIsServer)
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
req.id = REQID_HWSURFACE;
|
req.id = REQID_HWSURFACE;
|
||||||
req.data = &request;
|
req.data = &request;
|
||||||
req.len_data = sizeof (REQ_HWSURFACE);
|
req.len_data = sizeof (REQ_HWSURFACE);
|
||||||
@@ -1031,11 +1075,18 @@ static void FB_FreeHWSurface(_THIS, GAL_Surface *surface)
|
|||||||
request.offset = (char*)surface->pixels - (char*)mapped_mem;
|
request.offset = (char*)surface->pixels - (char*)mapped_mem;
|
||||||
|
|
||||||
#ifdef _MGRM_PROCESSES
|
#ifdef _MGRM_PROCESSES
|
||||||
if (mgIsServer)
|
if (mgIsServer) {
|
||||||
FB_RequestHWSurface (this, &request, &reply);
|
FB_RequestHWSurface (this, &request, &reply);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
REQUEST req;
|
REQUEST req;
|
||||||
|
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
surface->pixels = NULL;
|
||||||
|
surface->hwdata = NULL;
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (surface->hwdata == NULL) {
|
if (surface->hwdata == NULL) {
|
||||||
surface->pixels = NULL;
|
surface->pixels = NULL;
|
||||||
return;
|
return;
|
||||||
@@ -1131,7 +1182,7 @@ static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo,
|
|||||||
|
|
||||||
/* Allocate new identity colormap */
|
/* Allocate new identity colormap */
|
||||||
for (i=0; i<256; ++i) {
|
for (i=0; i<256; ++i) {
|
||||||
new_entries[(0*256)+i] =
|
new_entries[(0*256)+i] =
|
||||||
new_entries[(1*256)+i] =
|
new_entries[(1*256)+i] =
|
||||||
new_entries[(2*256)+i] = (i<<8)|i;
|
new_entries[(2*256)+i] = (i<<8)|i;
|
||||||
}
|
}
|
||||||
@@ -1217,6 +1268,12 @@ static int FB_SetColors(_THIS, int firstcolor, int ncolors, GAL_Color *colors)
|
|||||||
*/
|
*/
|
||||||
static void FB_VideoQuit(_THIS)
|
static void FB_VideoQuit(_THIS)
|
||||||
{
|
{
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
if (!mgIsServer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MGRM_PROCESSES
|
#ifdef _MGRM_PROCESSES
|
||||||
if (mgIsServer && this->screen) {
|
if (mgIsServer && this->screen) {
|
||||||
#else
|
#else
|
||||||
|
|||||||
+51
-37
@@ -138,17 +138,36 @@ static int shm_init_lock (key_t key)
|
|||||||
}
|
}
|
||||||
sem.val = 1;
|
sem.val = 1;
|
||||||
semctl (semid, 0, SETVAL, sem);
|
semctl (semid, 0, SETVAL, sem);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shm_lock (int semid) {
|
static void shm_lock (int semid)
|
||||||
|
{
|
||||||
struct sembuf sops = {0, -1, SEM_UNDO};
|
struct sembuf sops = {0, -1, SEM_UNDO};
|
||||||
return (semop (semid, &sops, 1));
|
|
||||||
|
try_again:
|
||||||
|
if (semop (semid, &sops, 1) < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
goto try_again;
|
||||||
|
else
|
||||||
|
_WRN_PRINTF ("NEWGAL>PCXVFB: failed to lock sempahore id: %d; pid (%d): %s\n",
|
||||||
|
semid, getpid(), strerror (errno));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shm_unlock (int semid) {
|
static void shm_unlock (int semid)
|
||||||
|
{
|
||||||
struct sembuf sops = {0, +1, SEM_UNDO};
|
struct sembuf sops = {0, +1, SEM_UNDO};
|
||||||
return (semop (semid, &sops, 1));
|
|
||||||
|
try_again:
|
||||||
|
if (semop (semid, &sops, 1)) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
goto try_again;
|
||||||
|
else
|
||||||
|
_WRN_PRINTF ("NEWGAL>PCXVFB: failed to unlock sempahore id: %d; pid (%d): %s\n",
|
||||||
|
semid, getpid(), strerror (errno));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int execl_pcxvfb (void)
|
static int execl_pcxvfb (void)
|
||||||
@@ -224,40 +243,16 @@ static void PCXVFB_DeleteDevice (GAL_VideoDevice *device)
|
|||||||
free (device);
|
free (device);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* deprecated code: call common helpers for shadow screen */
|
#if 0 // deprecated code
|
||||||
static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
|
static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
RECT bound;
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
win_PCXVFbLock ();
|
win_PCXVFbLock ();
|
||||||
#else
|
#else
|
||||||
shm_lock(semid);
|
shm_lock(semid);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bound.left = this->hidden->hdr->dirty_rc_l;
|
shadowScreen_UpdateRects (this, numrects, rects);
|
||||||
bound.top = this->hidden->hdr->dirty_rc_t;
|
|
||||||
bound.right = this->hidden->hdr->dirty_rc_r;
|
|
||||||
bound.bottom = this->hidden->hdr->dirty_rc_b;
|
|
||||||
|
|
||||||
if (bound.right == -1) bound.right = 0;
|
|
||||||
if (bound.bottom == -1) bound.bottom = 0;
|
|
||||||
|
|
||||||
bound = this->hidden->dirty_rc;
|
|
||||||
|
|
||||||
for (i = 0; i < numrects; i++) {
|
|
||||||
RECT rc;
|
|
||||||
|
|
||||||
SetRect (&rc, rects[i].x, rects[i].y,
|
|
||||||
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
|
|
||||||
if (IsRectEmpty (&bound))
|
|
||||||
bound = rc;
|
|
||||||
else
|
|
||||||
GetBoundRect (&bound, &bound, &rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
this->hidden->dirty_rc = bound;
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
win_PCXVFbUnlock ();
|
win_PCXVFbUnlock ();
|
||||||
@@ -265,7 +260,7 @@ static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
|
|||||||
shm_unlock(semid);
|
shm_unlock(semid);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* deprecated code */
|
#endif // deprecated code
|
||||||
|
|
||||||
static BOOL PCXVFB_SyncUpdate (_THIS)
|
static BOOL PCXVFB_SyncUpdate (_THIS)
|
||||||
{
|
{
|
||||||
@@ -298,6 +293,8 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
|
|||||||
this->hidden->hdr->dirty_rc_b = this->hidden->dirty_rc.bottom;
|
this->hidden->hdr->dirty_rc_b = this->hidden->dirty_rc.bottom;
|
||||||
this->hidden->hdr->dirty = TRUE;
|
this->hidden->hdr->dirty = TRUE;
|
||||||
|
|
||||||
|
SetRectEmpty (&this->hidden->dirty_rc);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
win_PCXVFbUnlock ();
|
win_PCXVFbUnlock ();
|
||||||
#else
|
#else
|
||||||
@@ -337,8 +334,19 @@ static GAL_VideoDevice *PCXVFB_CreateDevice (int devindex)
|
|||||||
this->AllocHWSurface = PCXVFB_AllocHWSurface;
|
this->AllocHWSurface = PCXVFB_AllocHWSurface;
|
||||||
this->FreeHWSurface = PCXVFB_FreeHWSurface;
|
this->FreeHWSurface = PCXVFB_FreeHWSurface;
|
||||||
|
|
||||||
|
#if IS_COMPOSITING_SCHEMA
|
||||||
|
if (mgIsServer) {
|
||||||
|
this->UpdateRects = shadowScreen_UpdateRects;
|
||||||
|
this->SyncUpdate = PCXVFB_SyncUpdate;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this->UpdateRects = NULL;
|
||||||
|
this->SyncUpdate = NULL;
|
||||||
|
}
|
||||||
|
#else
|
||||||
this->UpdateRects = shadowScreen_UpdateRects;
|
this->UpdateRects = shadowScreen_UpdateRects;
|
||||||
this->SyncUpdate = PCXVFB_SyncUpdate;
|
this->SyncUpdate = PCXVFB_SyncUpdate;
|
||||||
|
#endif
|
||||||
|
|
||||||
this->CheckHWBlit = NULL;
|
this->CheckHWBlit = NULL;
|
||||||
this->FillHWRect = NULL;
|
this->FillHWRect = NULL;
|
||||||
@@ -487,8 +495,6 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
|
|||||||
|
|
||||||
listen (__mg_pcxvfb_server_sockfd, 3);
|
listen (__mg_pcxvfb_server_sockfd, 3);
|
||||||
|
|
||||||
//shm_init_lock(getpid());
|
|
||||||
|
|
||||||
if ((pid = fork()) < 0) {
|
if ((pid = fork()) < 0) {
|
||||||
_ERR_PRINTF ("NEWGAL>PCXVFB: fork() error.\n");
|
_ERR_PRINTF ("NEWGAL>PCXVFB: fork() error.\n");
|
||||||
}
|
}
|
||||||
@@ -618,8 +624,8 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
|
|||||||
GAL_SetError ("NEWGAL>PCXVFB: failed to open tmp file\n");
|
GAL_SetError ("NEWGAL>PCXVFB: failed to open tmp file\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite (&shmid, sizeof(int), 1, fp);
|
fwrite (&shmid, sizeof(int), 1, fp);
|
||||||
|
fwrite (&semid, sizeof(int), 1, fp);
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
#endif /* _MGRM_PROCESSES */
|
#endif /* _MGRM_PROCESSES */
|
||||||
}
|
}
|
||||||
@@ -634,11 +640,16 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fread (&shmid, sizeof(int), 1, fp) < 1) {
|
if (fread (&shmid, sizeof(int), 1, fp) < 1) {
|
||||||
GAL_SetError ("NEWGAL>PCXVFB: can't read from tmp file\n");
|
GAL_SetError ("NEWGAL>PCXVFB: can't read shmid from tmp file\n");
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fread (&semid, sizeof(int), 1, fp) < 1) {
|
||||||
|
GAL_SetError ("NEWGAL>PCXVFB: can't read semid from tmp file\n");
|
||||||
|
fclose (fp);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
if (shmid != -1) {
|
if (shmid != -1) {
|
||||||
@@ -832,11 +843,14 @@ static void PCXVFB_VideoQuit (_THIS)
|
|||||||
munmap (this->hidden->shmrgn, size);
|
munmap (this->hidden->shmrgn, size);
|
||||||
close (fd);
|
close (fd);
|
||||||
remove (mapFile);
|
remove (mapFile);
|
||||||
semctl (semid, 0, IPC_RMID);
|
|
||||||
#else // linux
|
#else // linux
|
||||||
shmdt (this->hidden->shmrgn);
|
shmdt (this->hidden->shmrgn);
|
||||||
semctl (semid, 0, IPC_RMID);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_MGRM_PROCESSES)
|
||||||
|
if (mgIsServer)
|
||||||
|
#endif
|
||||||
|
semctl (semid, 0, IPC_RMID);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _MGGAL_PCXVFB*/
|
#endif /* _MGGAL_PCXVFB*/
|
||||||
|
|||||||
@@ -247,8 +247,12 @@ int shadowScreen_BlitToReal (_THIS)
|
|||||||
src_rect.h = RECTH (bound);
|
src_rect.h = RECTH (bound);
|
||||||
dst_rect = src_rect;
|
dst_rect = src_rect;
|
||||||
|
|
||||||
|
GAL_SetupBlitting (this->hidden->shadow_screen,
|
||||||
|
this->hidden->real_screen, 0);
|
||||||
GAL_BlitSurface (this->hidden->shadow_screen, &src_rect,
|
GAL_BlitSurface (this->hidden->shadow_screen, &src_rect,
|
||||||
this->hidden->real_screen, &dst_rect);
|
this->hidden->real_screen, &dst_rect);
|
||||||
|
GAL_CleanupBlitting (this->hidden->shadow_screen,
|
||||||
|
this->hidden->real_screen);
|
||||||
#ifdef _MGSCHEMA_COMPOSITING
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
if (this->hidden->cursor) {
|
if (this->hidden->cursor) {
|
||||||
RECT csr_rc, eff_rc;
|
RECT csr_rc, eff_rc;
|
||||||
@@ -267,8 +271,12 @@ int shadowScreen_BlitToReal (_THIS)
|
|||||||
dst_rect.y = eff_rc.top;
|
dst_rect.y = eff_rc.top;
|
||||||
dst_rect.w = src_rect.w;
|
dst_rect.w = src_rect.w;
|
||||||
dst_rect.h = src_rect.h;
|
dst_rect.h = src_rect.h;
|
||||||
|
GAL_SetupBlitting (this->hidden->cursor,
|
||||||
|
this->hidden->real_screen, 0);
|
||||||
GAL_BlitSurface (this->hidden->cursor, &src_rect,
|
GAL_BlitSurface (this->hidden->cursor, &src_rect,
|
||||||
this->hidden->real_screen, &dst_rect);
|
this->hidden->real_screen, &dst_rect);
|
||||||
|
GAL_CleanupBlitting (this->hidden->cursor,
|
||||||
|
this->hidden->real_screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* _MGSCHEMA_COMPOSITING */
|
#endif /* _MGSCHEMA_COMPOSITING */
|
||||||
|
|||||||
+229
-142
File diff suppressed because it is too large
Load Diff
@@ -103,6 +103,10 @@ GAL_Surface * GAL_CreateCursorSurface (GAL_VideoDevice *video,
|
|||||||
surface->hwdata = NULL;
|
surface->hwdata = NULL;
|
||||||
surface->map = NULL;
|
surface->map = NULL;
|
||||||
surface->format_version = 0;
|
surface->format_version = 0;
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
surface->pix_img = NULL;
|
||||||
|
surface->msk_img = NULL;
|
||||||
|
#endif
|
||||||
surface->shared_header = NULL;
|
surface->shared_header = NULL;
|
||||||
surface->dirty_info = NULL;
|
surface->dirty_info = NULL;
|
||||||
GAL_SetClipRect (surface, NULL);
|
GAL_SetClipRect (surface, NULL);
|
||||||
|
|||||||
@@ -136,6 +136,10 @@ GAL_Surface * GAL_CreateSharedRGBSurface (GAL_VideoDevice *video,
|
|||||||
surface->hwdata = NULL;
|
surface->hwdata = NULL;
|
||||||
surface->map = NULL;
|
surface->map = NULL;
|
||||||
surface->format_version = 0;
|
surface->format_version = 0;
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
surface->pix_img = NULL;
|
||||||
|
surface->msk_img = NULL;
|
||||||
|
#endif
|
||||||
surface->shared_header = NULL;
|
surface->shared_header = NULL;
|
||||||
surface->dirty_info = NULL;
|
surface->dirty_info = NULL;
|
||||||
GAL_SetClipRect (surface, NULL);
|
GAL_SetClipRect (surface, NULL);
|
||||||
@@ -272,6 +276,10 @@ error:
|
|||||||
surface->shared_header->map_size);
|
surface->shared_header->map_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
surface->pix_img = NULL;
|
||||||
|
surface->msk_img = NULL;
|
||||||
|
#endif
|
||||||
surface->shared_header = NULL;
|
surface->shared_header = NULL;
|
||||||
surface->dirty_info = NULL;
|
surface->dirty_info = NULL;
|
||||||
}
|
}
|
||||||
@@ -318,6 +326,10 @@ void GAL_FreeSharedSurfaceData (GAL_Surface *surface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
surface->pixels = NULL;
|
surface->pixels = NULL;
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
surface->pix_img = NULL;
|
||||||
|
surface->msk_img = NULL;
|
||||||
|
#endif
|
||||||
surface->shared_header = NULL;
|
surface->shared_header = NULL;
|
||||||
surface->dirty_info = NULL;
|
surface->dirty_info = NULL;
|
||||||
}
|
}
|
||||||
@@ -358,7 +370,7 @@ GAL_Surface * GAL_AttachSharedRGBSurface (int fd, size_t map_size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
surface->video = video;
|
surface->video = video;
|
||||||
surface->flags = flags;
|
surface->flags = flags & ~GAL_FORMAT_CHECKED;
|
||||||
|
|
||||||
surface->shared_header = NULL;
|
surface->shared_header = NULL;
|
||||||
surface->hwdata = NULL;
|
surface->hwdata = NULL;
|
||||||
@@ -410,6 +422,10 @@ GAL_Surface * GAL_AttachSharedRGBSurface (int fd, size_t map_size,
|
|||||||
surface->dpi = GDCAP_DPI_DEFAULT;
|
surface->dpi = GDCAP_DPI_DEFAULT;
|
||||||
surface->map = NULL;
|
surface->map = NULL;
|
||||||
surface->format_version = 0;
|
surface->format_version = 0;
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
surface->pix_img = NULL;
|
||||||
|
surface->msk_img = NULL;
|
||||||
|
#endif
|
||||||
GAL_SetClipRect (surface, NULL);
|
GAL_SetClipRect (surface, NULL);
|
||||||
|
|
||||||
#ifdef _MGUSE_UPDATE_REGION
|
#ifdef _MGUSE_UPDATE_REGION
|
||||||
@@ -463,6 +479,10 @@ void GAL_DettachSharedSurfaceData (GAL_Surface *surface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
surface->pixels = NULL;
|
surface->pixels = NULL;
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
surface->pix_img = NULL;
|
||||||
|
surface->msk_img = NULL;
|
||||||
|
#endif
|
||||||
surface->shared_header = NULL;
|
surface->shared_header = NULL;
|
||||||
surface->dirty_info = NULL;
|
surface->dirty_info = NULL;
|
||||||
}
|
}
|
||||||
@@ -538,6 +558,14 @@ GAL_Surface *GAL_CreateSurfaceForZNode (unsigned surf_flag, int width, int heigh
|
|||||||
Bmask = 0x000000FF;
|
Bmask = 0x000000FF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ST_PIXEL_XRGB565:
|
||||||
|
bpp = 16;
|
||||||
|
Amask = 0x0000;
|
||||||
|
Rmask = 0xF800;
|
||||||
|
Gmask = 0x07E0;
|
||||||
|
Bmask = 0x001F;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bpp = __gal_screen->format->BitsPerPixel;
|
bpp = __gal_screen->format->BitsPerPixel;
|
||||||
Amask = __gal_screen->format->Amask;
|
Amask = __gal_screen->format->Amask;
|
||||||
|
|||||||
+239
-128
File diff suppressed because it is too large
Load Diff
@@ -1255,6 +1255,10 @@ static GAL_Surface *Slave_CreateSurface (GAL_VideoDevice *this,
|
|||||||
surface->hwdata = NULL;
|
surface->hwdata = NULL;
|
||||||
surface->map = NULL;
|
surface->map = NULL;
|
||||||
surface->format_version = 0;
|
surface->format_version = 0;
|
||||||
|
#ifdef _MGUSE_PIXMAN
|
||||||
|
surface->pix_img = NULL;
|
||||||
|
surface->msk_img = NULL;
|
||||||
|
#endif
|
||||||
#if IS_COMPOSITING_SCHEMA
|
#if IS_COMPOSITING_SCHEMA
|
||||||
surface->shared_header = NULL;
|
surface->shared_header = NULL;
|
||||||
surface->dirty_info = NULL;
|
surface->dirty_info = NULL;
|
||||||
|
|||||||
@@ -118,21 +118,7 @@
|
|||||||
|
|
||||||
/* Function to check the CPU flags */
|
/* Function to check the CPU flags */
|
||||||
#define MMX_CPU 0x800000
|
#define MMX_CPU 0x800000
|
||||||
#ifdef USE_ASMBLIT
|
|
||||||
#define CPU_Flags() Hermes_X86_CPU()
|
|
||||||
#else
|
|
||||||
#define CPU_Flags() 0L
|
#define CPU_Flags() 0L
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_ASMBLIT
|
|
||||||
#define X86_ASSEMBLER
|
|
||||||
#define HermesConverterInterface void
|
|
||||||
#define HermesClearInterface void
|
|
||||||
#define STACKCALL
|
|
||||||
typedef Uint32 int32;
|
|
||||||
|
|
||||||
#include "HeadX86.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The functions used to manipulate software video overlays */
|
/* The functions used to manipulate software video overlays */
|
||||||
static struct private_yuvhwfuncs sw_yuvfuncs = {
|
static struct private_yuvhwfuncs sw_yuvfuncs = {
|
||||||
@@ -1105,21 +1091,7 @@ GAL_Overlay *GAL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, GAL_S
|
|||||||
case GAL_IYUV_OVERLAY:
|
case GAL_IYUV_OVERLAY:
|
||||||
cpu_mmx = CPU_Flags() & MMX_CPU;
|
cpu_mmx = CPU_Flags() & MMX_CPU;
|
||||||
if ( display->format->BytesPerPixel == 2 ) {
|
if ( display->format->BytesPerPixel == 2 ) {
|
||||||
#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
|
|
||||||
/* inline assembly functions */
|
|
||||||
if ( cpu_mmx && (Rmask == 0xF800) &&
|
|
||||||
(Gmask == 0x07E0) &&
|
|
||||||
(Bmask == 0x001F) &&
|
|
||||||
(width & 15) == 0) {
|
|
||||||
/*printf("Using MMX 16-bit 565 dither\n");*/
|
|
||||||
swdata->Display1X = Color565DitherYV12MMX1X;
|
|
||||||
} else {
|
|
||||||
/*printf("Using C 16-bit dither\n");*/
|
|
||||||
swdata->Display1X = Color16DitherYV12Mod1X;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
swdata->Display1X = Color16DitherYV12Mod1X;
|
swdata->Display1X = Color16DitherYV12Mod1X;
|
||||||
#endif
|
|
||||||
swdata->Display2X = Color16DitherYV12Mod2X;
|
swdata->Display2X = Color16DitherYV12Mod2X;
|
||||||
}
|
}
|
||||||
if ( display->format->BytesPerPixel == 3 ) {
|
if ( display->format->BytesPerPixel == 3 ) {
|
||||||
@@ -1127,21 +1099,7 @@ GAL_Overlay *GAL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, GAL_S
|
|||||||
swdata->Display2X = Color24DitherYV12Mod2X;
|
swdata->Display2X = Color24DitherYV12Mod2X;
|
||||||
}
|
}
|
||||||
if ( display->format->BytesPerPixel == 4 ) {
|
if ( display->format->BytesPerPixel == 4 ) {
|
||||||
#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
|
|
||||||
/* inline assembly functions */
|
|
||||||
if ( cpu_mmx && (Rmask == 0x00FF0000) &&
|
|
||||||
(Gmask == 0x0000FF00) &&
|
|
||||||
(Bmask == 0x000000FF) &&
|
|
||||||
(width & 15) == 0) {
|
|
||||||
/*printf("Using MMX 32-bit dither\n");*/
|
|
||||||
swdata->Display1X = ColorRGBDitherYV12MMX1X;
|
|
||||||
} else {
|
|
||||||
/*printf("Using C 32-bit dither\n");*/
|
|
||||||
swdata->Display1X = Color32DitherYV12Mod1X;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
swdata->Display1X = Color32DitherYV12Mod1X;
|
swdata->Display1X = Color32DitherYV12Mod1X;
|
||||||
#endif
|
|
||||||
swdata->Display2X = Color32DitherYV12Mod2X;
|
swdata->Display2X = Color32DitherYV12Mod2X;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
AM_CPPFLAGS = $(FT2_INC_DIR) $(HB_INC_DIR)
|
AM_CPPFLAGS = $(FT2_INC_DIR) $(HB_INC_DIR) $(PIXMAN_CFLAGS)
|
||||||
AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libnewgdi.la
|
noinst_LTLIBRARIES = libnewgdi.la
|
||||||
|
|
||||||
if MG_MINIMALGDI
|
|
||||||
SRC_FILES = gdi.c attr.c clip.c coor.c rect.c \
|
|
||||||
bitmap.c pixel.c pixel_ops.c \
|
|
||||||
region.c polygon.c
|
|
||||||
else
|
|
||||||
SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \
|
SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \
|
||||||
palette.c readbmp.c icon.c screen.c bitmap.c \
|
palette.c readbmp.c icon.c screen.c bitmap.c \
|
||||||
pixel.c line.c arc.c pixel_ops.c \
|
pixel.c line.c arc.c pixel_ops.c \
|
||||||
@@ -20,7 +15,6 @@ SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \
|
|||||||
textruns.c \
|
textruns.c \
|
||||||
shape-glyphs-basic.c shape-glyphs-complex.c \
|
shape-glyphs-basic.c shape-glyphs-complex.c \
|
||||||
layout.c layout-utils.c layout-ellipsize.c
|
layout.c layout-utils.c layout-ellipsize.c
|
||||||
endif
|
|
||||||
|
|
||||||
HDR_FILES = glyph.h drawtext.h mi.h midc.h mistruct.h miwideline.h \
|
HDR_FILES = glyph.h drawtext.h mi.h midc.h mistruct.h miwideline.h \
|
||||||
pixel_ops.h mifillarc.h mispans.h polygon.h mifpoly.h \
|
pixel_ops.h mifillarc.h mispans.h polygon.h mifpoly.h \
|
||||||
|
|||||||
+173
-137
File diff suppressed because it is too large
Load Diff
+31
-4
@@ -116,8 +116,15 @@ static pthread_mutex_t dcslot;
|
|||||||
BLOCKHEAP __mg_FreeClipRectList;
|
BLOCKHEAP __mg_FreeClipRectList;
|
||||||
|
|
||||||
/************************* static functions declaration **********************/
|
/************************* static functions declaration **********************/
|
||||||
static void dc_InitClipRgnInfo (void);
|
static inline void dc_InitClipRgnInfo (void)
|
||||||
static void dc_DeinitClipRgnInfo(void);
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
static inline void dc_DeinitClipRgnInfo(void)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient);
|
static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient);
|
||||||
static void dc_InitMemDCFrom (PDC pdc, const PDC pdc_ref);
|
static void dc_InitMemDCFrom (PDC pdc, const PDC pdc_ref);
|
||||||
static void dc_InitScreenDC (PDC pdc, GAL_Surface* surface);
|
static void dc_InitScreenDC (PDC pdc, GAL_Surface* surface);
|
||||||
@@ -260,7 +267,12 @@ static BOOL RestrictControlMemDCECRGNEx (RECT* minimal,
|
|||||||
/******************* Initialization and termination of GDI *******************/
|
/******************* Initialization and termination of GDI *******************/
|
||||||
BOOL mg_InitScreenDC (void)
|
BOOL mg_InitScreenDC (void)
|
||||||
{
|
{
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
InitFreeClipRectList (&__mg_FreeClipRectList,
|
||||||
|
mgIsServer ? SIZE_CLIPRECTHEAP * 8 : SIZE_CLIPRECTHEAP);
|
||||||
|
#else
|
||||||
InitFreeClipRectList (&__mg_FreeClipRectList, SIZE_CLIPRECTHEAP);
|
InitFreeClipRectList (&__mg_FreeClipRectList, SIZE_CLIPRECTHEAP);
|
||||||
|
#endif
|
||||||
|
|
||||||
INIT_LOCK (&__mg_gdilock, NULL);
|
INIT_LOCK (&__mg_gdilock, NULL);
|
||||||
INIT_LOCK (&dcslot, NULL);
|
INIT_LOCK (&dcslot, NULL);
|
||||||
@@ -317,6 +329,9 @@ void mg_TerminateScreenDC (void)
|
|||||||
|
|
||||||
dc_DeinitClipRgnInfo();
|
dc_DeinitClipRgnInfo();
|
||||||
|
|
||||||
|
/* Since 5.0.6 */
|
||||||
|
__mg_destroy_common_rgba8888_dc ();
|
||||||
|
|
||||||
DESTROY_LOCK (&__mg_gdilock);
|
DESTROY_LOCK (&__mg_gdilock);
|
||||||
DESTROY_LOCK (&dcslot);
|
DESTROY_LOCK (&dcslot);
|
||||||
|
|
||||||
@@ -517,6 +532,7 @@ Uint32 GUIAPI GetGDCapability (HDC hdc, int iItem)
|
|||||||
return iret;
|
return iret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* Since 5.0.6: deprecated */
|
||||||
/* This function init clip region in all DC slots. */
|
/* This function init clip region in all DC slots. */
|
||||||
static void dc_InitClipRgnInfo(void)
|
static void dc_InitClipRgnInfo(void)
|
||||||
{
|
{
|
||||||
@@ -547,7 +563,7 @@ static void dc_DeinitClipRgnInfo(void)
|
|||||||
EmptyClipRgn (&DCSlot[i].ecrgn);
|
EmptyClipRgn (&DCSlot[i].ecrgn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* Since 5.0.6: deprecated */
|
||||||
|
|
||||||
static inline void dc_CalculateDevRC4GenDC (PDC pdc);
|
static inline void dc_CalculateDevRC4GenDC (PDC pdc);
|
||||||
|
|
||||||
@@ -4248,9 +4264,9 @@ HDC drmCreateDCFromPrimeFdEx (GHANDLE video, int prime_fd, size_t size,
|
|||||||
#endif /* defined _MGGAL_DRM */
|
#endif /* defined _MGGAL_DRM */
|
||||||
|
|
||||||
/* Since 5.0.0 */
|
/* Since 5.0.0 */
|
||||||
|
static HDC _dc_common_rgba8888 = HDC_INVALID;
|
||||||
HDC __mg_get_common_rgba8888_dc (void)
|
HDC __mg_get_common_rgba8888_dc (void)
|
||||||
{
|
{
|
||||||
static HDC _dc_common_rgba8888 = HDC_INVALID;
|
|
||||||
static char fake_bits [4];
|
static char fake_bits [4];
|
||||||
|
|
||||||
if (_dc_common_rgba8888 == HDC_INVALID) {
|
if (_dc_common_rgba8888 == HDC_INVALID) {
|
||||||
@@ -4304,6 +4320,14 @@ BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __mg_destroy_common_rgba8888_dc (void)
|
||||||
|
{
|
||||||
|
if (_dc_common_rgba8888 != HDC_INVALID) {
|
||||||
|
DeleteMemDC (_dc_common_rgba8888);
|
||||||
|
_dc_common_rgba8888 = HDC_INVALID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct _travel_context;
|
struct _travel_context;
|
||||||
typedef void (*on_control_fn) (struct _travel_context* ctxt, PCONTROL child);
|
typedef void (*on_control_fn) (struct _travel_context* ctxt, PCONTROL child);
|
||||||
|
|
||||||
@@ -4413,6 +4437,9 @@ static void travel_children_with_priv_cdc (struct _travel_context* ctxt)
|
|||||||
|
|
||||||
child = (PCONTROL)(ctxt->parent->children);
|
child = (PCONTROL)(ctxt->parent->children);
|
||||||
while (child) {
|
while (child) {
|
||||||
|
#ifdef _MGSCHEMA_COMPOSITING
|
||||||
|
child->surf = ctxt->surface;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (child->privCDC) {
|
if (child->privCDC) {
|
||||||
ctxt->cb (ctxt, child);
|
ctxt->cb (ctxt, child);
|
||||||
|
|||||||
+29
-2
@@ -149,9 +149,12 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
|||||||
{
|
{
|
||||||
/* get the relative device font */
|
/* get the relative device font */
|
||||||
DEVFONT* devfont = SELECT_DEVFONT_BY_GLYPH(logfont, glyph_value);
|
DEVFONT* devfont = SELECT_DEVFONT_BY_GLYPH(logfont, glyph_value);
|
||||||
glyph_value = REAL_GLYPH (glyph_value);
|
|
||||||
SIZE sz;
|
SIZE sz;
|
||||||
|
|
||||||
|
if (glyph_value == INV_GLYPH_VALUE)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH (glyph_value);
|
||||||
/* get metrics of the glyph */
|
/* get metrics of the glyph */
|
||||||
if ((glyph_info->mask & GLYPH_INFO_METRICS) ||
|
if ((glyph_info->mask & GLYPH_INFO_METRICS) ||
|
||||||
(glyph_info->mask & GLYPH_INFO_BMP)) {
|
(glyph_info->mask & GLYPH_INFO_BMP)) {
|
||||||
@@ -161,7 +164,7 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
|||||||
glyph_info->bbox_y = 0;
|
glyph_info->bbox_y = 0;
|
||||||
|
|
||||||
_font_get_glyph_advance (logfont, devfont, glyph_value, TRUE,
|
_font_get_glyph_advance (logfont, devfont, glyph_value, TRUE,
|
||||||
0, 0, 0, &glyph_info->advance_x, &glyph_info->advance_x,
|
0, 0, 0, &glyph_info->advance_x, &glyph_info->advance_y,
|
||||||
(BBOX*)(&glyph_info->bbox_x));
|
(BBOX*)(&glyph_info->bbox_x));
|
||||||
|
|
||||||
sz.cx = glyph_info->bbox_w;
|
sz.cx = glyph_info->bbox_w;
|
||||||
@@ -198,6 +201,30 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get FreeType face and glyph index */
|
||||||
|
if (glyph_info->mask & GLYPH_INFO_FACE) {
|
||||||
|
glyph_info->index = glyph_value;
|
||||||
|
if (devfont->font_ops->get_ft_face) {
|
||||||
|
|
||||||
|
/* keep sync with tagFTFACEINFO in freetype2.h */
|
||||||
|
struct _FTFACEINFO {
|
||||||
|
char* path;
|
||||||
|
void* face;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _FTFACEINFO* face_info = (struct _FTFACEINFO*)
|
||||||
|
devfont->font_ops->get_ft_face (logfont, devfont);
|
||||||
|
assert (face_info);
|
||||||
|
|
||||||
|
glyph_info->ft_face = face_info->face;
|
||||||
|
glyph_info->file_path = face_info->path;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
glyph_info->ft_face = NULL;
|
||||||
|
glyph_info->file_path = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
glyph_info->bmp_width = sz.cx;
|
glyph_info->bmp_width = sz.cx;
|
||||||
glyph_info->bmp_height = sz.cy;
|
glyph_info->bmp_height = sz.cy;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+58
-54
File diff suppressed because it is too large
Load Diff
@@ -338,6 +338,10 @@ static int move_to_layer (int cli, int clifd, void* buff, size_t len)
|
|||||||
moved_info.layer = dst_layer;
|
moved_info.layer = dst_layer;
|
||||||
moved_info.zo_shmid = dst_layer->zorder_shmid;
|
moved_info.zo_shmid = dst_layer->zorder_shmid;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
moved_info.layer = INV_LAYER_HANDLE;
|
||||||
|
moved_info.zo_shmid = 0;
|
||||||
|
}
|
||||||
|
|
||||||
ret:
|
ret:
|
||||||
return ServerSendReply (clifd, &moved_info, sizeof (MOVEDCLIENTINFO));
|
return ServerSendReply (clifd, &moved_info, sizeof (MOVEDCLIENTINFO));
|
||||||
@@ -570,9 +574,8 @@ static int sigma8654_client_get_surface(int cli, int clifd, void* buff, size_t l
|
|||||||
REQ_SIGMA8654_GETSURFACE *request;
|
REQ_SIGMA8654_GETSURFACE *request;
|
||||||
REP_SIGMA8654_GETSURFACE reply;
|
REP_SIGMA8654_GETSURFACE reply;
|
||||||
|
|
||||||
if (Sigma8654_ServerOnGetSurface(request, &reply) < 0)
|
if (Sigma8654_ServerOnGetSurface(request, &reply) < 0) {
|
||||||
{
|
_ERR_PRINTF ("Nexus_ServerOnGetSurface() failed\n");
|
||||||
fprintf(stderr, "Nexus_ServerOnGetSurface() failed\n");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return ServerSendReply (clifd, &reply, sizeof (reply));
|
return ServerSendReply (clifd, &reply, sizeof (reply));
|
||||||
@@ -590,7 +593,7 @@ static int nexus_client_get_surface(int cli, int clifd, void* buff, size_t len)
|
|||||||
|
|
||||||
if (Nexus_ServerOnGetSurface(request, &reply) < 0)
|
if (Nexus_ServerOnGetSurface(request, &reply) < 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Nexus_ServerOnGetSurface() failed\n");
|
_ERR_PRINTF ("Nexus_ServerOnGetSurface() failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return ServerSendReply (clifd, &reply, sizeof (reply));
|
return ServerSendReply (clifd, &reply, sizeof (reply));
|
||||||
|
|||||||
+1
-2
@@ -125,7 +125,7 @@ static void ParseEvent (PMSGQUEUE msg_que, int event)
|
|||||||
Msg.wParam = (WPARAM)lwe.count;
|
Msg.wParam = (WPARAM)lwe.count;
|
||||||
Msg.lParam = 0;
|
Msg.lParam = 0;
|
||||||
|
|
||||||
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
|
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
|
||||||
// kernel_QueueMessage (msg_que, &Msg);
|
// kernel_QueueMessage (msg_que, &Msg);
|
||||||
}
|
}
|
||||||
else if (lwe.type == LWETYPE_KEY) {
|
else if (lwe.type == LWETYPE_KEY) {
|
||||||
@@ -334,7 +334,6 @@ BOOL GUIAPI ServerStartup (int nr_globals,
|
|||||||
_ERR_PRINTF ("mginit: failed to initialize compositor!\n");
|
_ERR_PRINTF ("mginit: failed to initialize compositor!\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
atexit (mg_TerminateCompositor);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
@@ -2,9 +2,5 @@ AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
|||||||
|
|
||||||
noinst_LTLIBRARIES = libstandalone.la
|
noinst_LTLIBRARIES = libstandalone.la
|
||||||
|
|
||||||
if MG_MINIMALGDI
|
|
||||||
libstandalone_la_SOURCES =
|
|
||||||
else
|
|
||||||
libstandalone_la_SOURCES = standalone.c
|
libstandalone_la_SOURCES = standalone.c
|
||||||
endif
|
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ static void ParseEvent (PMSGQUEUE msg_que, int event)
|
|||||||
Msg.wParam = (WPARAM)lwe.count;
|
Msg.wParam = (WPARAM)lwe.count;
|
||||||
Msg.lParam = 0;
|
Msg.lParam = 0;
|
||||||
|
|
||||||
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
|
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
|
||||||
// kernel_QueueMessage (msg_que, &Msg);
|
// kernel_QueueMessage (msg_que, &Msg);
|
||||||
}
|
}
|
||||||
else if (lwe.type == LWETYPE_KEY) {
|
else if (lwe.type == LWETYPE_KEY) {
|
||||||
|
|||||||
@@ -2,18 +2,14 @@ AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
|||||||
|
|
||||||
SUBDIRS = bmp icon font cursor
|
SUBDIRS = bmp icon font cursor
|
||||||
if MG_ENABLE_SPLASH
|
if MG_ENABLE_SPLASH
|
||||||
if MG_ENABLE_SCREENSAVER
|
if MG_ENABLE_SCREENSAVER
|
||||||
SUBDIRS+=license
|
SUBDIRS+=license
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libsysres.la
|
noinst_LTLIBRARIES = libsysres.la
|
||||||
|
|
||||||
if MG_MINIMALGDI
|
|
||||||
libsysres_la_SOURCES = mgetc.c
|
|
||||||
else
|
|
||||||
libsysres_la_SOURCES = resource.c incoreres.c mgetc.c resmgr.c resmgr.h
|
libsysres_la_SOURCES = resource.c incoreres.c mgetc.c resmgr.c resmgr.h
|
||||||
endif
|
|
||||||
|
|
||||||
SRC_FILES=$(libsysres_la_SOURCES)
|
SRC_FILES=$(libsysres_la_SOURCES)
|
||||||
LIB_NAME=libsysres
|
LIB_NAME=libsysres
|
||||||
|
|||||||
Reference in New Issue
Block a user