Compare commits

...
179 Commits
Author SHA1 Message Date
xueshuming 59a6a1369d singletouchkey :do not used O_NONBLOCK 2023-09-08 09:13:42 +08:00
Vincent Wei d06ce0683b call __mg_nssurf_map_delete() in server_ServerCleanup 2023-08-28 20:12:50 +08:00
Vincent Wei 5a9b08fe94 initial implementation for named shared surface 2023-08-28 16:51:46 +08:00
Vincent Wei c7569e9d32 add default options to fbcon section in MiniGUI.cfg 2023-08-28 11:25:57 +08:00
Vincent Wei 06fcf2eaa0 New APIs: GetWindowSurfaceBufferFD() and CreateMemDCFromSurfaceBufferFD() for compositing schema. 2023-08-22 11:29:36 +08:00
Vincent Wei 33e5d62da8 Merge remote-tracking branch 'origin/rel-5-0' into drm-dma 2023-08-21 10:19:14 +08:00
Vincent Wei f0bae4444c update version 2023-08-10 09:23:56 +08:00
Vincent Wei 0a5ace7f82 add a new method for DEVFONTOPS: get_feature(). currently used for check whether a devfont contains correct bounding box values for marks 2023-08-09 14:08:40 +08:00
Vincent Wei 5b27cc70fc use draw_one_vowel and DrawVowel for vowel 2023-08-09 11:13:40 +08:00
Vincent Wei cf3340c01d update 2023-08-02 15:29:00 +08:00
Vincent Wei 950f73716a use libsuffix to define the library suffix; use processes-compositing style for runmode 2023-08-02 15:08:45 +08:00
Vincent Wei 295c993d50 make Runmode in pc file as a variable in order that we can use pkg_get_variable() in cmake files to determinate the runtime mode of MiniGUI. 2023-08-02 14:39:23 +08:00
Vincent Wei 95ab7dad2a fix a bug and call sem_wait within retry_syscall_for_eintr() 2023-08-01 19:13:49 +08:00
Vincent Wei 3d42f72e21 debug 2023-08-01 18:00:41 +08:00
Vincent Wei 59d9d08158 debug 2023-08-01 17:55:34 +08:00
Vincent Wei 3a9cbfdd9b initialize last_x and last_y 2023-08-01 16:55:11 +08:00
Vincent Wei bc7d5f6ce0 fix a compositing bug when the wallpaper is empty 2023-08-01 16:33:27 +08:00
Vincent Wei 1131973f7a Fix a bug in PeekMessageEx 2023-08-01 16:14:12 +08:00
Vincent Wei a46804080e Fix a bug in PeekMessageEx 2023-08-01 16:12:31 +08:00
Vincent Wei 81b25968ca do not return ARCH_TYPE_BASIC_VOWEL for Arabic chars 2023-08-01 15:57:27 +08:00
Vincent Wei f1463f41de fix some compilation errors 2023-08-01 14:54:09 +08:00
Vincent Wei 0a10b81499 Merge branch 'rel-5-0' into drm-dma 2023-08-01 14:22:39 +08:00
Vincent Wei fd07118939 enhance fbcon engine to support async updater; tune internal interface shadowScreen_BlitToReal() 2023-08-01 11:33:30 +08:00
Vincent Wei a0a757a621 tune DRM engine for procs runmode and compositing schema 2023-08-01 10:03:19 +08:00
Vincent Wei 7cd7f954c6 make virtual-window enabled by default 2023-08-01 10:02:49 +08:00
Vincent Wei e673452b7d debug 2023-07-31 10:15:14 +08:00
Vincent Wei e24490e92f debug 2023-07-30 12:17:02 +08:00
Vincent Wei 0c2345aed1 change method flush_driver to flush of DrmDriverOps; change member buff to vaddr of DrmSurfaceBuffer 2023-07-30 11:57:02 +08:00
Vincent Wei 95b9def0d5 rename dma_buff to dma_buf 2023-07-28 21:20:18 +08:00
Vincent Wei 563fe9232c remove methods OnBeforeUpdate and OnAfterUpdate 2023-07-28 21:08:44 +08:00
Vincent Wei 5ad525c1d8 fix a bug 2023-07-27 10:58:58 +08:00
Vincent Wei fcde9eb405 Add OnBeforeUpdate() and OnAfterUpdate() operations for Shadow engine 2023-07-27 10:46:58 +08:00
Vincent Wei 39d03be6d7 use DMA_BUF_IOCTL_SYNC 2023-07-27 10:04:53 +08:00
Vincent Wei 43101379ed Support for vowels to fix Issue #121 2023-07-26 16:49:01 +08:00
Vincent Wei bce5b73e1c call pthread_testcancel() in task_do_update 2023-07-25 10:58:27 +08:00
Vincent Wei 0b4a5a1c17 tune 2023-07-25 10:43:20 +08:00
Vincent Wei c609e2e5b1 check number of pixels before calling hardware accecelation operations 2023-07-24 09:56:10 +08:00
Vincent Wei f6bf02aa5c add new operation do_blit in DrmDriverOps; use do_blit instead of returning callback of check_blit 2023-07-24 08:22:10 +08:00
Vincent Wei d52aa4c1a4 do cleanup for free surfaces 2023-07-23 16:03:08 +08:00
Vincent Wei d6a961aa6c enhance GAL_blit to have a pointer to GAL_VideoDevice for hardware acceleration blits 2023-07-23 15:05:54 +08:00
Vincent Wei 2665200eee add new runtime configuration option: min_pixels_using_hwaccl 2023-07-23 13:02:45 +08:00
Vincent Wei 469eb1c05a use hardware accelerated copy_buff 2023-07-23 12:45:24 +08:00
Vincent Wei 6a83f2efbf Remove SetHWColorKey, SetHWAlpha; Tune prototype of FillHWRect; Add CopyHWSurface() 2023-07-23 12:01:18 +08:00
Vincent Wei 6422cb8568 tune 2023-07-22 20:27:52 +08:00
Vincent Wei 6be4b719c8 If FillHWRect() retruns non-zero, use GAL_SoftFillRect() 2023-07-22 19:02:41 +08:00
Vincent Wei 0f566d0342 tune DRM_SURBUF_TYPE 2023-07-22 17:28:20 +08:00
Vincent Wei 1de19f9bee Upgrade DrmDriverOps to version 2 and enhance ChechHWBlit 2023-07-22 16:15:09 +08:00
Vincent Wei 5f8a88c0a2 check euid when creating update thread 2023-07-21 11:52:52 +08:00
Vincent Wei 1611a56754 tune 2023-07-21 11:20:30 +08:00
Vincent Wei 73fcb8d2c3 tune shadow and drm video engines to show FPS 2023-07-21 10:40:31 +08:00
Vincent Wei bc0efac21f cleanup 2023-07-14 18:56:50 +08:00
xueshuming 26341b162e debug 2023-07-14 17:06:54 +08:00
Vincent Wei c6957bec23 debug 2023-07-14 16:32:16 +08:00
Vincent Wei 56ddd87189 debug 2023-07-14 14:38:47 +08:00
Vincent Wei 5cdd258046 use WaitVBlank 2023-07-14 14:06:28 +08:00
Vincent Wei 8b4ab267b6 and an alternative to use semphaore 2023-07-14 13:11:30 +08:00
Vincent Wei 613a19c236 debug: call pthread_mutex_init for update_lock 2023-07-14 12:54:58 +08:00
Vincent Wei e242cbe32f handle all implementations of kernel_ShowCursorForGDI 2023-07-14 11:19:04 +08:00
Vincent Wei 5f921a2908 cleanup 2023-07-14 10:20:34 +08:00
Vincent Wei 39493ef4dc implement LockHWSurface for shadow and drm engines due to the async. updates to real screen 2023-07-14 10:14:23 +08:00
Vincent Wei fef311f0b2 use async. update for shadow engine 2023-07-13 18:37:56 +08:00
Vincent Wei e98aeab8dc debug and tue 2023-07-13 16:37:12 +08:00
Vincent Wei 2ff96ba383 debug and cleanup 2023-07-13 12:21:28 +08:00
Vincent Wei 03d90aec9f debug 2023-07-12 22:29:14 +08:00
Vincent Wei 57293a2896 debug 2023-07-12 22:05:22 +08:00
Vincent Wei cfd3311f86 use drmWaitVBlank 2023-07-12 21:35:32 +08:00
Vincent Wei 51b09bc2ed tune 2023-07-12 20:09:07 +08:00
Vincent Wei ff54c6ffe5 debug 2023-07-12 16:41:54 +08:00
Vincent Wei 4c836603c1 tune DRM_SyncUpdate 2023-07-12 15:09:08 +08:00
Vincent Wei 311d2262d6 some tries 2023-07-11 22:17:59 +08:00
Vincent Wei 209a0c6ab0 initial support for drmDMA 2023-07-11 16:59:21 +08:00
Vincent Wei 4c2b20c49f fix a minor bug 2023-07-11 10:51:35 +08:00
Vincent Wei b7625c5726 tune 2023-07-11 09:02:21 +08:00
Vincent Wei 872e299ad9 fix a bug when using shadow engine and fbcon with double buffering enabled; fix a bug for bad size for destination line 2023-07-10 22:52:28 +08:00
Vincent Wei c60c19aad5 update copyring year 2023-07-10 11:16:39 +08:00
xueshuming 5d216dcc32 tune: use nr_updaters instead of extra_updaters 2023-07-10 11:06:38 +08:00
Vincent Wei 37c122a1de fix a bug reported in Issue #120; update version to 5.0.13 2023-07-05 12:43:04 +08:00
Vincent Wei 50ae4b9b44 add flag legacy_bidi in CHARSETOPS structure, and tune unicode_bidi_type operation for legacy BIDI algorithm. 2023-07-05 11:59:36 +08:00
Vincent Wei 695c55e464 tune: use extra_updaters instead of multi_updater 2023-06-28 18:14:05 +08:00
Vincent Wei a16903d570 use multiple concurrently updaters in Shadow engine if multi_updater=yes 2023-06-28 11:46:12 +08:00
Vincent Wei 3189931910 cleanup 2023-06-15 11:03:22 +08:00
Vincent Wei c3a8dc0798 fix a bug in Shadow NEWGAL engine: SetVideoMode may return another surface, e.g., when using double bufffering of fbcon engine. 2023-06-15 08:53:21 +08:00
Vincent Wei 848ed3fecc change return type of DefaultItemViewProc and DefaultScrolledProc to LRESULT 2023-05-23 08:59:34 +08:00
Vincent Wei 0d1f1f028a update 2023-05-10 09:00:35 +08:00
Vincent Wei d4add19e6a tune GetTickCount for threads mode 2023-05-08 20:09:23 +08:00
Vincent Wei bfaeae0023 call GetTickCount when setting timer 2023-05-08 19:48:21 +08:00
Vincent Wei 70705c7db0 fix bug reported in Issue #116 2023-05-08 19:34:43 +08:00
Vincent Wei 517d74a2d2 update version in configure.ac 2023-05-08 08:35:10 +08:00
Vincent Wei d68eee3c90 use buffer in stack for short text 2023-04-24 11:52:47 +08:00
Vincent Wei e575e7c69d add new APIs: GetTabbedACharsExtentXXX 2023-04-24 11:38:02 +08:00
Vincent Wei d059fc8de2 fix a typo: Achar2UChar 2023-04-24 11:37:35 +08:00
Vincent Wei 5d9d787dac cleanup 2023-04-23 14:02:15 +08:00
Vincent Wei 9696fbb3ba change version to 5.0.12; cleanup 2023-04-23 12:42:47 +08:00
Vincent Wei 800329086e implement new API: GetACharsExtentPointEx(); enhance GetTextExtentPoint() and GetTabbedTextExtentPoint() to support BIDI charsets 2023-04-23 12:36:55 +08:00
Vincent Wei 11be6af9d3 use Amask from real engine 2023-03-03 10:57:15 +08:00
Vincent Wei e0cc3b5580 update version to 5.0.11 2022-12-13 17:10:13 +08:00
Vincent Wei e33d98a702 set pdc->bkmode correctly before calling _gdi_draw_one_glyph() 2022-11-27 16:31:27 +08:00
Vincent Wei 84f3cf048a fix a bug: dx and dy of StretchBlt are reset to zero if it is less than 0 in error 2022-11-27 16:30:34 +08:00
Vincent Wei ea579771a7 tune the implementation of auto-repeat message 2022-11-27 16:28:45 +08:00
Vincent Wei 4db97ead1f rename timeoutusec to __mg_timeout_usec; rename repeatusec to __mg_repeat_usec 2022-11-27 16:21:54 +08:00
Vincent Wei 2338501d21 use CreateMemDCFromMyBitmap instead of common_rgba8888_dc for DrawIcon() 2022-11-27 16:02:22 +08:00
Vincent Wei 81c061c3c8 cleanup 2022-11-27 15:59:52 +08:00
Vincent Wei 356bf08c4b remove code using the obsolete style: TVS_ICONFORSELECT 2022-11-27 15:58:14 +08:00
Vincent Wei 09a27e508f suppress useless print 2022-11-25 16:04:11 +08:00
Vincent Wei 0b636032ee use bkmode_set instead of saving oldbkmode in context, because it may cause the bkmode cannot be restored correctly 2022-11-25 15:25:56 +08:00
Vincent Wei 5f78f6bb37 fix a bug in Issure #106 2022-11-25 11:03:19 +08:00
Vincent Wei 272bc39c84 call __mg_legacy_bidi_map_reorder when getting the visual Achars 2022-11-25 11:01:36 +08:00
Vincent Wei 1e006c0589 cleanup 2022-11-25 11:00:58 +08:00
Vincent Wei 7158eaee0f restore __mg_legacy_bidi_map_reorder function 2022-11-25 11:00:42 +08:00
Vincent Wei abfc47159e tune and add some output for debug 2022-11-25 10:58:03 +08:00
Vincent Wei deade3d887 tuen code for resolve bugs reported in Issue #105 2022-11-13 12:22:12 +08:00
Vincent Wei cf3e0b3d4d tune 2022-11-13 11:54:20 +08:00
Vincent Wei 614deba4b7 cleanup 2022-11-13 11:53:43 +08:00
Vincent Wei 53d40508a4 set bkmode to BM_TRANSPARENT when having WS_EX_TRANSPARENT exStyle 2022-11-13 11:53:16 +08:00
Vincent Wei 39f96f407f use client DC instead of screen DC; restore the alpha component if amask != 0. 2022-11-08 17:28:23 +08:00
Vincent Wei c8c6f470ce tune 2022-11-08 17:23:02 +08:00
Vincent Wei d78b493aad fix a bug mentioned in Issue 96: bad handling for Backspace key 2022-11-08 17:22:40 +08:00
Vincent Wei 26f415f3db update release notes 2022-11-07 20:34:35 +08:00
Vincent Wei b66ef7a2f5 optimize the refresh of scrolled 2022-11-07 20:23:57 +08:00
Vincent Wei 9b89614569 fix bug reported in Issue #96 2022-11-07 19:59:54 +08:00
Vincent Wei 0d170a6f74 use CreateLogFontEx instead of CreateLogFont to follow the new style convention of font name
when creating system logfonts, but the orientation is ignored for the system logfont.
2022-11-03 20:49:50 +08:00
Vincent Wei f0dd4a74d2 Tune implementation of GetTabbedTextExtentPoint: remore odd code 2022-11-03 16:58:24 +08:00
Vincent Wei 692a6b81e0 tune update logical of some controls calling ScrollWindow 2022-11-03 16:11:49 +08:00
Vincent Wei cf49cf2b64 do not call UpdateInvalidClient in ScrollWindow: this may break update logical of control 2022-11-03 16:11:06 +08:00
Vincent Wei b26accf037 cleanup 2022-11-03 15:54:41 +08:00
Vincent Wei 5913d95ff2 debug info 2022-11-03 15:53:44 +08:00
Vincent Wei e1b94799a2 cleanup 2022-11-03 15:53:21 +08:00
Vincent Wei 385db01097 fix some implicit full-through 2022-10-22 11:49:24 +08:00
Vincent Wei d787dea652 call mg_FreeMsgQueueForThisThread immediately in TerminateGUI() 2022-10-19 19:37:06 +08:00
Vincent Wei 0adddb422b fix a bug in dskOnRemoveCtrlInstance for procs runmode 2022-10-19 19:36:16 +08:00
Vincent Wei c444030334 cleanup 2022-10-19 17:54:43 +08:00
Vincent Wei a9da4ddfba Fix a bug reported in Issue #94. 2022-10-19 17:53:39 +08:00
Vincent Wei 57cc74410f fix a minor bug 2022-10-12 15:17:27 +08:00
Vincent Wei 3cc16ababb update release notes 2022-09-28 15:11:52 +08:00
Vincent Wei d4097b577b tune 2022-09-27 21:54:36 +08:00
Vincent Wei 7ef6c14f3f relay MSG_IDLE to active child in PreDefControlProc 2022-09-27 21:54:30 +08:00
Vincent Wei cbb4e32992 Call UpdateInvalidClient in ScrollWindow; Only delaying MSG_IDLE to the child control if the main window is active 2022-09-27 13:20:18 +08:00
Vincent Wei 6bc85062b9 add an internal extended style: WS_EX_ACTIVATED 2022-09-27 13:17:15 +08:00
Vincent Wei b2dee57f4f tune relaying of MSG_IDLE 2022-09-27 11:44:26 +08:00
Vincent Wei a926754a6b Tuning: the MSG_IDLE message will be relayed to the descendant control if the control captured the mouse currently 2022-09-26 20:03:20 +08:00
Vincent Wei 7e470b0e78 tune code according to Issue #90 2022-09-26 20:01:47 +08:00
Vincent Wei 9f81cac662 reset binary age and interface age; update release notes 2022-09-26 14:30:49 +08:00
Vincent Wei a14bdd894a remove #include "window.h" 2022-09-26 14:18:14 +08:00
Vincent Wei 7004e156b8 use inline functions for SetCursor and SetDefaultCursor instead of macros 2022-09-26 14:17:55 +08:00
Vincent Wei e293cf03ba fix bugs when virtual window enabled for sa and procs runmodes 2022-09-26 14:06:09 +08:00
Vincent Wei 07f226f024 tune 2022-09-26 09:45:36 +08:00
Vincent Wei 4b2503e614 fix a bug when quiting dummy engine under compoisiting schema 2022-09-25 22:13:27 +08:00
Vincent Wei 2df5352356 fix a bug which may cause invalid values in log_clusters 2022-09-25 21:13:20 +08:00
Vincent Wei 67ccb2aafd give default RGBA masks for depth 32 when masks not specified 2022-09-24 14:33:49 +08:00
Vincent Wei 9a124dec50 fix a bug in search_win_tree_bfs; send MSG_MANAGE_MSGTHREAD messages only in message.c 2022-09-24 13:42:02 +08:00
Vincent Wei d013822979 add condition for loongarch 2022-09-23 21:45:00 +08:00
Vincent Wei 7f44e948d0 fix a bug mentioned in Issue #89 2022-09-23 16:04:11 +08:00
Vincent Wei 9a94fb9a7c enhance code for some uninitialized fields 2022-09-23 11:20:50 +08:00
Vincent Wei dfc7e95fcd fix the bug reported in Issue #89 2022-09-21 10:40:22 +08:00
Vincent Wei 362b852ec2 update anchor 2022-09-15 15:33:21 +08:00
Vincent Wei 9141e13640 suppress some warnings reported by GCC 12 2022-09-15 15:01:30 +08:00
Vincent Wei 4a22a38e63 update 2022-09-15 15:01:15 +08:00
Vincent Wei c7ce12449b use RUNMODE_LDADD and RUNMODE_SUBDIRS instead of conditions 2022-09-15 15:01:05 +08:00
Vincent Wei 824557b4f1 ignore configure~ 2022-09-15 11:20:18 +08:00
Vincent Wei 022542ef1b tune 2022-09-15 11:08:43 +08:00
Vincent Wei 3b12e71877 update README 2022-09-15 11:01:01 +08:00
Vincent Wei 9593168196 use recursive mutex for locking zorder info if not using *nix 2022-09-15 10:07:50 +08:00
Vincent Wei b5c5c3f8ae fix a deadlock bug (#87): use wrlock_owner to save the current thread holding the wrlock, skip rdlock if the wrlock owner is the current thread 2022-09-14 12:52:29 +08:00
Vincent Wei 492bd649ed update Release Notes for v5.0.10 2022-09-14 08:57:34 +08:00
Vincent Wei bc1a880479 cleanup and enhance shadow engine to use SyncUpdate method 2022-08-21 13:09:00 +08:00
Vincent Wei 0748f26f42 change version to 5.0.10; release notes for 5.0.10 2022-08-20 17:45:45 +08:00
Vincent Wei 2f72f24a49 debug 2022-08-20 17:29:43 +08:00
Vincent Wei 43e174a604 set dirty_rc empty initially 2022-08-20 17:23:16 +08:00
Vincent Wei 13d36a2785 add double_buffering options in fbcon section in MiniGUI.cfg 2022-08-20 16:26:23 +08:00
Vincent Wei 9ec3e9f7e6 support for double buffering for fbcon 2022-08-20 16:21:15 +08:00
Vincent Wei 148f1b1745 fix a typo 2022-04-24 11:48:37 +08:00
Vincent Wei f76c9187a8 remove _ERR_PRINTF 2022-03-21 17:52:01 +08:00
Vincent Wei 2e8eba7dd0 fix a deadlock bug: https://github.com/VincentWei/minigui/issues/83 2022-03-21 17:48:03 +08:00
Vincent Wei abeafa313d tune 2022-02-02 15:19:44 +08:00
Vincent Wei 310c0f3e7a The coordinates should be in device space for BitBlt and StretchBlt 2022-01-30 19:03:46 +08:00
Vincent Wei c426894ac9 change version to 5.0.9; change copyright year to 2022 2022-01-14 11:46:31 +08:00
Vincent Wei bf6998672f tune the fix 2021-12-17 15:02:21 +08:00
Vincent Wei ea83e92a16 Fix a bug: InitClipRgn on lrgn and ergn in InitSubDC; rename InitSubDC to dc_InitSubDC 2021-12-17 14:39:56 +08:00
Vincent Wei d95e827e93 update release notes for version 5.0.8 2021-10-20 16:36:28 +08:00
161 changed files with 5761 additions and 4646 deletions
+1
View File
@@ -29,3 +29,4 @@ Makefile.in
/src/font/utils/ucd/ /src/font/utils/ucd/
/src/sysres/font_list /src/sysres/font_list
/src/sysres/license/dat_files/ /src/sysres/license/dat_files/
/configure~
+75 -60
View File
File diff suppressed because it is too large Load Diff
+147
View File
@@ -1,5 +1,19 @@
# Release Notes # Release Notes
- [Version 5.2.0](#version-520)
+ [What's new in version 5.2.0](#whats-new-in-version-520)
- [Version 5.0.13](#version-5013)
+ [What's new in version 5.0.13](#whats-new-in-version-5013)
- [Version 5.0.12](#version-5012)
+ [What's new in version 5.0.12](#whats-new-in-version-5012)
- [Version 5.0.11](#version-5011)
+ [What's new in version 5.0.11](#whats-new-in-version-5011)
- [Version 5.0.10](#version-5010)
+ [What's new in version 5.0.10](#whats-new-in-version-5010)
- [Version 5.0.9](#version-508)
+ [What's new in version 5.0.9](#whats-new-in-version-508)
- [Version 5.0.8](#version-508)
+ [What's new in version 5.0.8](#whats-new-in-version-508)
- [Version 5.0.6](#version-506) - [Version 5.0.6](#version-506)
+ [What's new in version 5.0.6](#whats-new-in-version-506) + [What's new in version 5.0.6](#whats-new-in-version-506)
- [Version 5.0.5](#version-505) - [Version 5.0.5](#version-505)
@@ -20,6 +34,139 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility) + [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis) + [Deprecated APIs](#deprecated-apis)
## Version 5.2.0
On Nov. 30, 2023, FMSoft announces the availability of MiniGUI 5.2.0,
which is an mainline release with some major enhancements:
* ENHANCEMENTS:
- Optimize NEWGAL engines: `shadow`, `drm`, and `fbcon` for large resolution.
- New APIs: `GetWindowSharedSurfaceFD()` and `CreateMemDCFromSharedSurfaceFD()` for compositing schema.
* CHANGES:
- The operations for DRM userland driver changed.
## Version 5.0.13
On Aug. 31, 2023, FMSoft announces the availability of MiniGUI 5.0.13,
which is an enhancement release with some minor enhancements
of MiniGUI 5.0.x.
### What's new in version 5.0.13
In this version, we made some enhancements:
* ENHANCEMENTS:
- Disable BIDI for text in UTF-8 charset by default.
* CHANGES:
- Add `BIDI_FLAG_NONE` and `BIDI_FLAG_LEGACY`.
* BUGFIXING:
- Ignore C0CTRL characters when renerding text.
- Support for vowels.
## Version 5.0.12
On May 10, 2023, FMSoft announces the availability of MiniGUI 5.0.12,
which is an enhancement release with some minor enhancements
of MiniGUI 5.0.x.
### What's new in version 5.0.12
In this version, we made some enhancements:
* ENHANCEMENTS:
- Add new API `GetACharsExtentPointEx()`.
- Add new APIs `GetTabbedACharsExtent()`, `GetTabbedACharsExtentPoint()`,
and `GetTabbedACharsExtentPointEx()`.
- Enhance two APIs `GetTextExtentPoint()` and `GetTabbedTextExtentPoint()`
to support BIDI charsets.
- Tune management of tick count.
* BUGFIXING:
- Fix a typo: `Achar2UChar()` to `AChar2UChar()`.
## Version 5.0.11
On Dec. 31, 2022, FMSoft announces the availability of MiniGUI 5.0.11,
which is a bug fixing release with bug fixes and some minor enhancements
of MiniGUI 5.0.x.
### What's new in version 5.0.11
In this version, we made some enhancements
* ENHANCEMENTS:
* BUGFIXING:
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/94
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/96
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/105
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/106
* OPTIMIZATIONS:
- Optimize the refresh of scrolled.
* TUNING:
- Call `mg_FreeMsgQueueForThisThread` immediately in `TerminateGUI()`.
- Use `CreateLogFontEx` instead of `CreateLogFont` to follow the new style convention of font name when creating the system logfonts,
but the orientation is ignored for the system logfont.
## Version 5.0.10
On Sep. 30, 2022, FMSoft announces the availability of MiniGUI 5.0.10,
which is a bug fixing release with bug fixes and some minor enhancements
of MiniGUI 5.0.x.
### What's new in version 5.0.10
In this version, we made some enhancements
* ENHANCEMENTS:
- Enhance `fbcon` engine to support double buffering for Threads and Standalone mode. (Runtime option: `fbcon.double_buffering`).
- Cleanup and enhance `shadow` engine to use `SyncUpdate` method.
- Relaying `MSG_IDLE` messages to the active descendant controls in every 0.5s.
* BUGFIXING:
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/83
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/87
- Fix bugs reported in https://github.com/VincentWei/minigui/issues/89
- Fix some bugs when virtual window enabled under Standalone and Processes runtime modes.
* OPTIMIZATIONS:
* TUNING:
- Fix some warnings reported by GCC 12.
- Use inline functions for SetCursor and SetDefaultCursor instead of macros.
## Version 5.0.9
On Jan. 14, 2022, FMSoft announces the availability of MiniGUI 5.0.9,
which is a bug fixing release with minor enhancements of MiniGUI 5.0.x.
### What's new in version 5.0.9
In this version, we fixed some bugs:
* BUGFIXING:
- Fix a crash bug in `InitSubDC()` of `src/newgdi/gdi.c`.
* ENHANCEMENTS:
* OPTIMIZATIONS:
* TUNING:
- Change copyright year to 2022.
## Version 5.0.8
The MiniGUI development team announces the availability of MiniGUI 5.0.8,
which is a bug fixing release with minor enhancements of MiniGUI 5.0.x.
### What's new in version 5.0.8
In this version, we fixed some bugs and made some optimizations and enhancements:
* BUGFIXING:
* ENHANCEMENTS:
- Support for WebP image format based on `libwebp`.
- Support for two ARM64-based hardware platforms: PX30 and R818.
- New surface pixel format for main window: `ST_PIXEL_XRGB565` under compositing schema.
* OPTIMIZATIONS:
- Shrink heap size for fixed string.
- Optimize the memory use of blitting context.
* TUNING:
- Tune code of fbcon video engine for compositing schema.
- Fix warnings and errors for conditional compilation.
## Version 5.0.6 ## Version 5.0.6
The MiniGUI development team announces the availability of MiniGUI 5.0.6, The MiniGUI development team announces the availability of MiniGUI 5.0.6,
+1 -1
View File
@@ -1,4 +1,4 @@
Version 5.0.8 (2021/10/25) Version 5.0.13 (2023/08/31)
This is a minor enhancement and bugfix release of MiniGUI 5.0.x, the stable version. This is a minor enhancement and bugfix release of MiniGUI 5.0.x, the stable version.
+16 -11
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60) AC_PREREQ(2.60)
AC_INIT(libminigui, 5.0.8) AC_INIT(libminigui, 5.0.14)
AC_CONFIG_SRCDIR(src/main/main.c) AC_CONFIG_SRCDIR(src/main/main.c)
dnl Set various version strings - taken gratefully from the SDL sources dnl Set various version strings - taken gratefully from the SDL sources
@@ -16,9 +16,9 @@ dnl Set various version strings - taken gratefully from the SDL sources
# #
MINIGUI_MAJOR_VERSION=5 MINIGUI_MAJOR_VERSION=5
MINIGUI_MINOR_VERSION=0 MINIGUI_MINOR_VERSION=0
MINIGUI_MICRO_VERSION=8 MINIGUI_MICRO_VERSION=14
MINIGUI_INTERFACE_AGE=2 MINIGUI_INTERFACE_AGE=0
MINIGUI_BINARY_AGE=2 MINIGUI_BINARY_AGE=0
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
AC_SUBST(MINIGUI_MAJOR_VERSION) AC_SUBST(MINIGUI_MAJOR_VERSION)
@@ -95,7 +95,7 @@ message_string="no"
osname="unspecified" osname="unspecified"
runtime_mode="procs" runtime_mode="procs"
compositing_schema="yes" compositing_schema="yes"
virtual_window="no" virtual_window="yes"
use_shmopen="no" use_shmopen="no"
mgslice_use_fallback="no" mgslice_use_fallback="no"
@@ -1704,24 +1704,28 @@ fi
CPPFLAGS="$CPPFLAGS -D__MINIGUI_LIB__" CPPFLAGS="$CPPFLAGS -D__MINIGUI_LIB__"
surface_schema="shared frame buffer" surface_schema="shared"
case "$runtime_mode" in case "$runtime_mode" in
sa) sa)
AC_DEFINE(_MGRM_STANDALONE, 1, AC_DEFINE(_MGRM_STANDALONE, 1,
[Define if build MiniGUI-Standalone]) [Define if build MiniGUI-Standalone])
MINIGUI_RUNMODE="sa" MINIGUI_RUNMODE="standalone"
RUNMODE_LADD="standalone/libstandalone.la"
RUNMODE_SUBDIRS="standalone"
;; ;;
ths) ths)
AC_DEFINE(_MGRM_THREADS, 1, AC_DEFINE(_MGRM_THREADS, 1,
[Define if build MiniGUI-Threads]) [Define if build MiniGUI-Threads])
CPPFLAGS="$CPPFLAGS -D_REENTRANT" CPPFLAGS="$CPPFLAGS -D_REENTRANT"
MINIGUI_RUNMODE="ths" MINIGUI_RUNMODE="threads"
virtual_window="yes" virtual_window="yes"
;; ;;
*) *)
AC_DEFINE(_MGRM_PROCESSES, 1, AC_DEFINE(_MGRM_PROCESSES, 1,
[Define if build MiniGUI-Processes]) [Define if build MiniGUI-Processes])
MINIGUI_RUNMODE="procs" MINIGUI_RUNMODE="processes"
RUNMODE_LADD="server/libserver.la client/libclient.la"
RUNMODE_SUBDIRS="server client"
if test "x$compositing_schema" = "xyes"; then if test "x$compositing_schema" = "xyes"; then
surface_schema="compositing" surface_schema="compositing"
fi fi
@@ -2660,14 +2664,15 @@ if test "x$no_math" = "xno"; then
fi fi
DEP_LIBS="$DEP_LIBS -lpthread" DEP_LIBS="$DEP_LIBS -lpthread"
MINIGUI_RUNMODE="$MINIGUI_RUNMODE-${surface_schema}"
AC_SUBST(VIDEO_SUBDIRS) AC_SUBST(VIDEO_SUBDIRS)
AC_SUBST(VIDEO_DRIVERS) AC_SUBST(VIDEO_DRIVERS)
AC_SUBST(DEP_LIBS) AC_SUBST(DEP_LIBS)
AC_SUBST(MINIGUI_RUNMODE) AC_SUBST(MINIGUI_RUNMODE)
AC_SUBST(RUNMODE_LADD)
AC_SUBST(RUNMODE_SUBDIRS)
AM_CONDITIONAL(MGRM_PROCESSES, test "x$runtime_mode" = "xprocs")
AM_CONDITIONAL(MGRM_STANDALONE, test "x$runtime_mode" = "xsa")
AM_CONDITIONAL(MGIAL_LIBINPUT, test "x$build_libinput_ial_engine" = "xyes") AM_CONDITIONAL(MGIAL_LIBINPUT, test "x$build_libinput_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_SINGLETOUCHKEY, test "x$buid_singletouchkey_ial_engine" = "xyes") AM_CONDITIONAL(MGIAL_SINGLETOUCHKEY, test "x$buid_singletouchkey_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_CONSOLE, test "x$build_console_ial_engine" = "xyes") AM_CONDITIONAL(MGIAL_CONSOLE, test "x$build_console_ial_engine" = "xyes")
+59 -8
View File
@@ -55,6 +55,36 @@ wallpaper_pattern_size=full
# def_compositor_so= # def_compositor_so=
#}} #}}
#{{ifdef _MGGAL_SHADOW
[shadow]
real_engine=pc_xvfb
defaultmode=800x600-16bpp
# `cw`: rotating screen clock-wise.
# `ccw`: rotating screen counter clock-wise.
# `hflip`: flipping screen horizontally.
# `vflip`: flipping screen vertically.
rotate_screen=ccw
# Whether the async. update is enabled.
# Use `true` or `yes` for enabled, anything else for disabled.
# Since 5.0.13.
async_update=yes
# The synchronization interval for the asyn. updater (milli-seconds).
# This setting is only valid when `async_update` is enabled and
# the real engine does not provide WaitWBlank method.
# Since 5.0.13.
update_interval=15
# The minimal pixels to use the hardware accelerator.
# If the number of pixels to copy is less than this value,
# MiniGUI will use the software copy routine to update the real screen,
# even if the real device provides a hardware accelerator.
# Since 5.0.13.
min_pixels_using_hwaccl=4096
#}}
#{{ifdef _MGGAL_DRM #{{ifdef _MGGAL_DRM
[drm] [drm]
defaultmode=1024x768-32bpp defaultmode=1024x768-32bpp
@@ -78,9 +108,21 @@ dpi=96
# Since 5.0.0. # Since 5.0.0.
double_buffering=true double_buffering=true
# The update interval for the asyn. updater (milli-seconds).
# This setting is only valid when drmWaitVBlank doesn't work correctly.
# Since 5.0.13.
update_interval=15
# The minimal pixels to use the hardware accelerator.
# If the number of pixels to copy is less than this value,
# MiniGUI will use the software copy routine to update the real screen,
# even if the device provides a hardware accelerator.
# Since 5.0.13.
min_pixels_using_hwaccl=4096
# The filename of the shared library for the external driver. # The filename of the shared library for the external driver.
# The equivalent environment variable: MG_GAL_DRM_DRIVER # The equivalent environment variable: MG_GAL_DRM_DRIVER
exdriver=libhidrmdrivers-0.2.so.0 exdriver=libdrmdrivers.so
#}} #}}
#{{ifdef _MGIAL_SINGLETOUCHKEY #{{ifdef _MGIAL_SINGLETOUCHKEY
@@ -105,6 +147,22 @@ seat=seat0
[fbcon] [fbcon]
defaultmode=1024x768-16bpp defaultmode=1024x768-16bpp
dpi=96 dpi=96
# Whether double buffering is enabled (only for threads and standalone runmodes).
# Use `true` or `yes` for enabled, anything else for disabled.
# Note that under compositing schema, double buffering is always enabled.
# Since 5.0.10.
double_buffering=true
# Whether the async. update is enabled.
# Use `true` or `yes` for enabled, anything else for disabled.
# Since 5.0.13.
async_update=yes
# The update interval for the asyn. updater (milli-seconds).
# This setting is only valid when drmWaitVBlank doesn't work correctly.
# Since 5.0.13.
update_interval=15
#}} #}}
#{{ifdef _MGGAL_PCXVFB #{{ifdef _MGGAL_PCXVFB
@@ -117,13 +175,6 @@ exec_file=/usr/local/bin/gvfb
[rtos_xvfb] [rtos_xvfb]
defaultmode=800x600-16bpp defaultmode=800x600-16bpp
#{{ifdef _MGGAL_SHADOW
[shadow]
real_engine=pc_xvfb
defaultmode=800x600-16bpp
rotate_screen=normal
#}}
#{{ifdef _MGGAL_MLSHADOW #{{ifdef _MGGAL_MLSHADOW
[mlshadow] [mlshadow]
real_engine=qvfb real_engine=qvfb
+2
View File
@@ -311,6 +311,7 @@ MGUI_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
defined(__amd64) || \ defined(__amd64) || \
(defined(__alpha__) || defined(__alpha)) || \ (defined(__alpha__) || defined(__alpha)) || \
defined(__arm__) || defined(__aarch64__) || \ defined(__arm__) || defined(__aarch64__) || \
defined(__loongarch__) || \
defined(__riscv) || \ defined(__riscv) || \
(defined(__CC_ARM) && !defined(__BIG_ENDIAN)) || \ (defined(__CC_ARM) && !defined(__BIG_ENDIAN)) || \
(defined(__mips__) && defined(__MIPSEL__)) || \ (defined(__mips__) && defined(__MIPSEL__)) || \
@@ -2346,6 +2347,7 @@ int init_minigui_printf (int (*output_char) (int ch),
#define _ERR_PRINTF(fmt, ...) \ #define _ERR_PRINTF(fmt, ...) \
do { \ do { \
TCS_RED (stderr); \ TCS_RED (stderr); \
fprintf (stderr, "%s: ", __FUNCTION__); \
fprintf (stderr, fmt, ##__VA_ARGS__); \ fprintf (stderr, fmt, ##__VA_ARGS__); \
TCS_NONE (stderr); \ TCS_NONE (stderr); \
} while (0) } while (0)
+24 -25
View File
@@ -131,7 +131,31 @@
#define IAL_EVENT_GESTURE_PINCH_UPDATE 0x0084 #define IAL_EVENT_GESTURE_PINCH_UPDATE 0x0084
#define IAL_EVENT_GESTURE_PINCH_END 0x0085 #define IAL_EVENT_GESTURE_PINCH_END 0x0085
#define TABLET_TOOL_CHANGED_X (1 << 0)
#define TABLET_TOOL_CHANGED_Y (1 << 1)
#define TABLET_TOOL_CHANGED_PRESSURE (1 << 2)
#define TABLET_TOOL_CHANGED_DISTANCE (1 << 3)
#define TABLET_TOOL_CHANGED_TILT_X (1 << 4)
#define TABLET_TOOL_CHANGED_TILT_Y (1 << 5)
#define TABLET_TOOL_CHANGED_ROTATION (1 << 6)
#define TABLET_TOOL_CHANGED_SLIDER (1 << 7)
#define TABLET_TOOL_CHANGED_SIZE_MAJOR (1 << 8)
#define TABLET_TOOL_CHANGED_SIZE_MINOR (1 << 9)
#define TABLET_TOOL_CHANGED_WHEEL (1 << 10)
#ifndef TABLET_TOOL_X #ifndef TABLET_TOOL_X
#define TABLET_TOOL_X 0
#define TABLET_TOOL_Y 1
#define TABLET_TOOL_PRESSURE 2
#define TABLET_TOOL_DISTANCE 3
#define TABLET_TOOL_TILT_X 4
#define TABLET_TOOL_TILT_Y 5
#define TABLET_TOOL_ROTATION 6
#define TABLET_TOOL_SLIDER 7
#define TABLET_TOOL_SIZE_MAJOR 8
#define TABLET_TOOL_SIZE_MINOR 9
#define TABLET_TOOL_WHEEL 10
#define TABLET_TOOL_PROXIMITY_STATE_INVALID 0 #define TABLET_TOOL_PROXIMITY_STATE_INVALID 0
#define TABLET_TOOL_PROXIMITY_STATE_OUT 1 #define TABLET_TOOL_PROXIMITY_STATE_OUT 1
#define TABLET_TOOL_PROXIMITY_STATE_IN 2 #define TABLET_TOOL_PROXIMITY_STATE_IN 2
@@ -149,31 +173,6 @@
#define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0 #define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0
#define TABLET_PAD_STRIP_SOURCE_FINGER 1 #define TABLET_PAD_STRIP_SOURCE_FINGER 1
#define TABLET_TOOL_CHANGED_X (1 << 0)
#define TABLET_TOOL_CHANGED_Y (1 << 1)
#define TABLET_TOOL_CHANGED_PRESSURE (1 << 2)
#define TABLET_TOOL_CHANGED_DISTANCE (1 << 3)
#define TABLET_TOOL_CHANGED_TILT_X (1 << 4)
#define TABLET_TOOL_CHANGED_TILT_Y (1 << 5)
#define TABLET_TOOL_CHANGED_ROTATION (1 << 6)
#define TABLET_TOOL_CHANGED_SLIDER (1 << 7)
#define TABLET_TOOL_CHANGED_SIZE_MAJOR (1 << 8)
#define TABLET_TOOL_CHANGED_SIZE_MINOR (1 << 9)
#define TABLET_TOOL_CHANGED_WHEEL (1 << 10)
#define TABLET_TOOL_X 0
#define TABLET_TOOL_Y 1
#define TABLET_TOOL_PRESSURE 2
#define TABLET_TOOL_DISTANCE 3
#define TABLET_TOOL_TILT_X 4
#define TABLET_TOOL_TILT_Y 5
#define TABLET_TOOL_ROTATION 6
#define TABLET_TOOL_SLIDER 7
#define TABLET_TOOL_SIZE_MAJOR 8
#define TABLET_TOOL_SIZE_MINOR 9
#define TABLET_TOOL_WHEEL 10
#endif #endif
#define IAL_EVENT_TABLET_TOOL_AXIS 0x0090 #define IAL_EVENT_TABLET_TOOL_AXIS 0x0090
+57 -77
View File
File diff suppressed because it is too large Load Diff
+446 -34
View File
File diff suppressed because it is too large Load Diff
+9 -5
View File
@@ -1958,7 +1958,7 @@ const CompositorOps* __ex_compositor_get (const char* name,
* *
* \sa RegisterRequestHandler * \sa RegisterRequestHandler
*/ */
#define MAX_SYS_REQID 0x0023 #define MAX_SYS_REQID 0x0024
/** /**
* \def MAX_REQID * \def MAX_REQID
@@ -4097,7 +4097,7 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
#endif /* !_MGHAVE_CURSOR */ #endif /* !_MGHAVE_CURSOR */
/** /**
* \def SetCursor(hcsr) * \fn HCURSOR SetCursor(HCURSOR hcsr)
* \brief Changes the current cursor. * \brief Changes the current cursor.
* *
* This function changes the current cursor to be \a hcsr. * This function changes the current cursor to be \a hcsr.
@@ -4110,10 +4110,12 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
* *
* \sa SetCursorEx, SetDefaultCursor * \sa SetCursorEx, SetDefaultCursor
*/ */
#define SetCursor(hcsr) SetCursorEx (hcsr, FALSE) static inline HCURSOR SetCursor(HCURSOR hcsr) {
return SetCursorEx (hcsr, FALSE);
}
/** /**
* \def SetDefaultCursor(hcsr) * \fn HCURSOR SetDefaultCursor(HCURSOR hcsr)
* \brief Changes the current cursor, and set it as the default cursor. * \brief Changes the current cursor, and set it as the default cursor.
* *
* This function changes the current cursor to be \a hcsr, and set it as * This function changes the current cursor to be \a hcsr, and set it as
@@ -4127,7 +4129,9 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
* *
* \sa SetCursorEx, SetCursor * \sa SetCursorEx, SetCursor
*/ */
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE) static inline HCURSOR SetDefaultCursor(HCURSOR hcsr) {
return SetCursorEx (hcsr, TRUE);
}
/** @} end of cursor_fns */ /** @} end of cursor_fns */
+26
View File
@@ -2905,6 +2905,9 @@ typedef struct _WINMASKINFO {
* *
* This message is sent to the all main windows when the system * This message is sent to the all main windows when the system
* enters idle loop. * enters idle loop.
*
* Since 5.0.10, this messasge will be relayed to the active child control
* if the main window is currently active.
*/ */
#define MSG_IDLE 0x0142 #define MSG_IDLE 0x0142
@@ -7234,6 +7237,29 @@ MG_EXPORT BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags);
#ifdef _MGSCHEMA_COMPOSITING #ifdef _MGSCHEMA_COMPOSITING
/**
* \fn int GUIAPI GetWindowSharedSurfaceFD (HWND hwnd)
* \brief Gets the file descriptor of the surface buffer for a window or
* the main window it locates.
*
* This function gets the file descriptor of the surface buffer for
* the specified window if it is a main window or the main window it locates.
* Note that if the window is a control that has the style `WS_EX_CTRLASMAINWIN`,
* the window will have a separate surface buffer.
*
* \param hwnd The handle to the window.
*
* \return An integer larger than or equal to 0 for a valid file descriptor,
* otherwise a negative value.
*
* \note This function only available when _MGSCHEMA_COMPOSITING is defined.
*
* \sa CreateMemDCFromSharedSurfaceFD
*
* Since 5.0.13
*/
MG_EXPORT int GUIAPI GetWindowSharedSurfaceFD (HWND hWnd);
/** /**
* \fn BOOL GUIAPI SetMainWindowCompositing (HWND hWnd, * \fn BOOL GUIAPI SetMainWindowCompositing (HWND hWnd,
int type, DWORD arg) int type, DWORD arg)
+2 -1
View File
@@ -2,11 +2,12 @@ prefix=@prefix@
exec_prefix=@exec_prefix@ exec_prefix=@exec_prefix@
libdir=@libdir@ libdir=@libdir@
includedir=@includedir@ includedir=@includedir@
runmode=@MINIGUI_RUNMODE@
libsuffix=@MGLIB_SUFFIX@
Name: MiniGUI Name: MiniGUI
Description: A mature cross-platform windowing and GUI system for embedded systems and IoT smart devices. Description: A mature cross-platform windowing and GUI system for embedded systems and IoT smart devices.
Version: @MINIGUI_VERSION@ Version: @MINIGUI_VERSION@
Runmode: @MINIGUI_RUNMODE@
Requires: Requires:
Libs: -L${libdir} -lminigui_@MGLIB_SUFFIX@ @DEP_LIBS@ Libs: -L${libdir} -lminigui_@MGLIB_SUFFIX@ @DEP_LIBS@
Libs.private: Libs.private:
+8 -24
View File
@@ -1,10 +1,10 @@
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 newgal newgdi
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 \
@@ -13,31 +13,15 @@ COMMON_LADD = \
mybmp/libmybmp.la \ mybmp/libmybmp.la \
kernel/libkernel.la \ kernel/libkernel.la \
sysres/libsysres.la \ sysres/libsysres.la \
textedit/libtextedit.la textedit/libtextedit.la \
newgal/libnewgal.la \
newgdi/libnewgdi.la
if MGRM_STANDALONE DIST_SUBDIRS = $(COMMON_SUBDIRS) newgal newgdi server client standalone
LITE_LADD = standalone/libstandalone.la SUBDIRS = $(COMMON_SUBDIRS) @RUNMODE_SUBDIRS@
LITE_SUBDIRS = standalone
else
if MGRM_PROCESSES
LITE_LADD = server/libserver.la client/libclient.la
LITE_SUBDIRS = server client
else
LITE_LADD =
LITE_SUBDIRS =
endif
endif
NEWGAL_LADD = newgal/libnewgal.la newgdi/libnewgdi.la
NEWGAL_SUBDIRS = newgal newgdi
DIST_SUBDIRS = $(COMMON_SUBDIRS) newgal newgdi server client standalone
SUBDIRS = $(COMMON_SUBDIRS) $(NEWGAL_SUBDIRS) $(LITE_SUBDIRS)
MGSOURCES = template.c template.h MGSOURCES = template.c template.h
MGLIBADD = $(COMMON_LADD) \ MGLIBADD = $(COMMON_LADD) @RUNMODE_LADD@
$(LITE_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
+56 -46
View File
File diff suppressed because it is too large Load Diff
+12 -14
View File
@@ -299,7 +299,15 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
} }
} }
/*complete a click if the click if valid /* DK: When the radio or check button state changes do not erase the background,
* and the prospects for direct rendering */
btnGetRects (pctrl, &rcClient, &rcContent, &rcBitmap);
if (BUTTON_IS_PUSHBTN(pctrl) || (pctrl->dwStyle & BS_PUSHLIKE))
InvalidateRect((HWND)pctrl, NULL, TRUE);
else
InvalidateRect((HWND)pctrl, &rcBitmap, FALSE);
/* complete a click if the click if valid
* (mouse lbutton up in button )*/ * (mouse lbutton up in button )*/
if (old_pose == BST_PUSHED && new_pose != BST_DISABLE if (old_pose == BST_PUSHED && new_pose != BST_DISABLE
&& change_valid) && change_valid)
@@ -312,14 +320,6 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
NotifyParent ((HWND)pctrl, pctrl->id, BN_CLICKED); NotifyParent ((HWND)pctrl, pctrl->id, BN_CLICKED);
} }
/* DK: When the radio or check button state changes do not erase the background,
* and the prospects for direct rendering */
btnGetRects (pctrl, &rcClient, &rcContent, &rcBitmap);
if (BUTTON_IS_PUSHBTN(pctrl) || (pctrl->dwStyle & BS_PUSHLIKE))
InvalidateRect((HWND)pctrl, NULL, TRUE);
else
InvalidateRect((HWND)pctrl, &rcBitmap, FALSE);
} }
/*btnGetRects: /*btnGetRects:
@@ -423,8 +423,8 @@ static void draw_bitmap_button (PCONTROL pctrl, HDC hdc, DWORD dwStyle,
GetClientRect ((HWND)pctrl, &prcClient); GetClientRect ((HWND)pctrl, &prcClient);
if (dwStyle & BS_REALSIZEIMAGE) { if (dwStyle & BS_REALSIZEIMAGE) {
x += (w - bmp->bmWidth) >> 1; x += (int)(w - bmp->bmWidth) >> 1;
y += (h - bmp->bmHeight) >> 1; y += (int)(h - bmp->bmHeight) >> 1;
w = h = 0; w = h = 0;
if (bmp->bmWidth > RECTW(prcClient)){ if (bmp->bmWidth > RECTW(prcClient)){
@@ -847,8 +847,6 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break; break;
} }
case BM_SETSTYLE: case BM_SETSTYLE:
pctrl->dwStyle &= 0xFFFF0000; pctrl->dwStyle &= 0xFFFF0000;
pctrl->dwStyle |= (DWORD)(wParam & 0x0000FFFF); pctrl->dwStyle |= (DWORD)(wParam & 0x0000FFFF);
@@ -1054,7 +1052,7 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
} }
default: default:
break; break;
} }
return DefaultControlProc (hWnd, uMsg, wParam, lParam); return DefaultControlProc (hWnd, uMsg, wParam, lParam);
+8 -11
View File
@@ -1678,7 +1678,7 @@ esright_input_char_refresh (HWND hWnd,
scroll_rc.right = cur_caret_x; scroll_rc.right = cur_caret_x;
ScrollWindow(hWnd, -scroll_len, 0, &scroll_rc, NULL); ScrollWindow(hWnd, -scroll_len, 0, &scroll_rc, NULL);
UpdateWindow(hWnd, FALSE); UpdateInvalidClient(hWnd, TRUE);
edtSetCaretPos (hWnd, sled); edtSetCaretPos (hWnd, sled);
sled->changed = TRUE; sled->changed = TRUE;
@@ -2143,9 +2143,6 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
else { else {
chars = 1; chars = 1;
if (charBuffer [0] == 127) // BS
charBuffer [0] = '\b';
if (dwStyle & ES_UPPERCASE) { if (dwStyle & ES_UPPERCASE) {
charBuffer [0] = toupper (charBuffer[0]); charBuffer [0] = toupper (charBuffer[0]);
} }
@@ -2154,12 +2151,8 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
} }
} }
if (chars == 1) { if (chars == 1 && (charBuffer[0] == '\b' || charBuffer[0] == 0x7F)) {
if (charBuffer [0] < 0x20 && charBuffer[0] != '\b') //FIXME // ASCII BS or DEL
return 0;
}
if (charBuffer[0] == '\b') { //backspace
int del; int del;
if (sled->editPos == 0 && sled->selStart == sled->selEnd) if (sled->editPos == 0 && sled->selStart == sled->selEnd)
@@ -2184,7 +2177,11 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
sleInsertText (hWnd, sled, NULL, del); sleInsertText (hWnd, sled, NULL, del);
} }
} }
else{ else if (chars == 1 && charBuffer [0] < 0x20) {
// ignore all other ASCII control characters.
return 0;
}
else {
if (dwStyle & ES_LEFT) { if (dwStyle & ES_LEFT) {
esleft_input_char_refresh(hWnd, sled, (char*)charBuffer, chars); esleft_input_char_refresh(hWnd, sled, (char*)charBuffer, chars);
set_edit_caret_pos(hWnd, sled); set_edit_caret_pos(hWnd, sled);
+1 -1
View File
@@ -404,7 +404,7 @@ void mglist_set_itemops (MgList *mglst, PMGITEMOPS iop)
mglst->iop = *iop; mglst->iop = *iop;
} }
int DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam, LRESULT DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam,
PSCRDATA pscrdata, MgList *mglst) PSCRDATA pscrdata, MgList *mglst)
{ {
switch (message) { switch (message) {
+1 -1
View File
@@ -140,7 +140,7 @@ struct _MgList
/* ------------------------- external api -------------------------- */ /* ------------------------- external api -------------------------- */
MG_EXPORT int DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam, MG_EXPORT LRESULT DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam,
PSCRDATA pscrdata, MgList *mglst); PSCRDATA pscrdata, MgList *mglst);
MG_EXPORT SVITEM_DRAWFUNC mglist_set_itemdraw (MgList *mglst, SVITEM_DRAWFUNC draw_func); MG_EXPORT SVITEM_DRAWFUNC mglist_set_itemdraw (MgList *mglst, SVITEM_DRAWFUNC draw_func);
+5 -1
View File
@@ -172,6 +172,10 @@ BOOL scrolled_set_cont_pos (HWND hWnd, PSCRDATA pscrdata, int cont_x, int cont_y
SetScrollPos (hWnd, SB_VERT, cont_y); SetScrollPos (hWnd, SB_VERT, cont_y);
bChange = TRUE; bChange = TRUE;
} }
if (bChange)
UpdateInvalidClient(hWnd, FALSE);
return bChange; return bChange;
} }
@@ -585,7 +589,7 @@ int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h)
return 0; return 0;
} }
int DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam) LRESULT DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{ {
PSCRDATA pscrdata = NULL; PSCRDATA pscrdata = NULL;
+1 -1
View File
@@ -96,7 +96,7 @@ typedef struct _scrdata
typedef SCRDATA *PSCRDATA; typedef SCRDATA *PSCRDATA;
MG_EXPORT int DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam); MG_EXPORT LRESULT DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
MG_EXPORT int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h); MG_EXPORT int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h);
MG_EXPORT void scrolled_destroy (PSCRDATA pscrdata); MG_EXPORT void scrolled_destroy (PSCRDATA pscrdata);
MG_EXPORT void scrolled_hscroll (HWND hWnd, PSCRDATA pscrdata, WPARAM wParam, LPARAM lParam); MG_EXPORT void scrolled_hscroll (HWND hWnd, PSCRDATA pscrdata, WPARAM wParam, LPARAM lParam);
+9 -4
View File
@@ -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~2022, 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
@@ -493,10 +493,15 @@ LRESULT ScrollViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
break; break;
} }
case MSG_DESTROY: case MSG_DESTROY: {
scrollview_destroy (psvdata); /* suppress a warning about calling free() before using the pointer */
free (psvdata); PSVDATA svdata = (PSVDATA) GetWindowAdditionalData2 (hWnd);
if (svdata) {
scrollview_destroy(svdata);
free (svdata);
}
break; break;
}
case MSG_GETDLGCODE: case MSG_GETDLGCODE:
return DLGC_WANTARROWS; return DLGC_WANTARROWS;
+1 -4
View File
@@ -2096,7 +2096,6 @@ static void teOnChar (HWND hWnd, PTEDATA ptedata, WPARAM wParam)
rcInv.right = ptedata->svdata.scrdata.nContWidth; rcInv.right = ptedata->svdata.scrdata.nContWidth;
rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH; rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH;
REFRESH_NODE_EX(node, &rcInv); REFRESH_NODE_EX(node, &rcInv);
// UpdateWindow(hWnd, FALSE);
newlinenr = NODE_LINENR(node); newlinenr = NODE_LINENR(node);
rcInv.left = 0; rcInv.left = 0;
@@ -2104,12 +2103,10 @@ static void teOnChar (HWND hWnd, PTEDATA ptedata, WPARAM wParam)
rcInv.top += ptedata->nLineHeight; rcInv.top += ptedata->nLineHeight;
rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH; rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH;
REFRESH_NODE_EX(node, &rcInv); REFRESH_NODE_EX(node, &rcInv);
// UpdateWindow(hWnd, FALSE);
} }
/* houhh 20090814, UpdataWindow will invalidate all edit area, but /* houhh 20090814, UpdataWindow will invalidate all edit area, but
* erase area is not same with msg_paint area.*/ * erase area is not same with msg_paint area.*/
UpdateWindow(hWnd, FALSE); UpdateInvalidClient(hWnd, TRUE);
//SendMessage(hWnd, MSG_PAINT, 0, 0);
} }
} }
else { else {
+2 -2
View File
@@ -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~2022, 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
@@ -283,7 +283,7 @@ static void DrawCoolBox (HWND hWnd, HDC hdc, PCOOLBARCTRL pdata)
WINDOWINFO *info; WINDOWINFO *info;
RECT rc; RECT rc;
if (tmpdata->Caption == NULL || tmpdata->Caption [0] == '\0') if (tmpdata->Caption [0] == '\0')
break; break;
GetTextExtent (hdc, tmpdata->Caption, -1, &size); GetTextExtent (hdc, tmpdata->Caption, -1, &size);
+4 -4
View File
@@ -80,17 +80,17 @@ static void update_viewport (gvGridViewData *view, int from, int to, int is_row)
{ {
RECT r; RECT r;
GetClientRect (view->hCtrl, &r); GetClientRect(view->hCtrl, &r);
if (is_row) { if (is_row) {
r.top = from; r.top = from;
ScrollWindow (view->hCtrl, 0, to, &r, NULL); ScrollWindow(view->hCtrl, 0, to, &r, NULL);
} }
else { else {
r.left = from; r.left = from;
ScrollWindow (view->hCtrl, to, 0, &r, NULL); ScrollWindow(view->hCtrl, to, 0, &r, NULL);
} }
UpdateWindow(view->hCtrl, FALSE); UpdateInvalidClient(view->hCtrl, FALSE);
} }
// scroll function {{{ // scroll function {{{
+2
View File
@@ -157,6 +157,8 @@ static int isInItem (MgList *mglst, int mouseX, int mouseY,
index = row * pivlist->nCol + col; index = row * pivlist->nCol + col;
pci = (IconviewItem *)mglist_getitem_byindex (mglst, index); pci = (IconviewItem *)mglist_getitem_byindex (mglst, index);
if (pci == NULL)
return -1;
if (pRet) if (pRet)
*pRet = (MgItem*)pci; *pRet = (MgItem*)pci;
+10 -17
View File
@@ -93,14 +93,15 @@ BOOL RegisterTreeViewControl (void)
const WINDOW_ELEMENT_RENDERER * rdr = const WINDOW_ELEMENT_RENDERER * rdr =
GetDefaultWindowElementRenderer(); GetDefaultWindowElementRenderer();
if (!(icon_fold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name,
if (!(icon_fold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name, SYSICON_FOLD, szValue)))) { SYSICON_FOLD, szValue)))) {
if (!(icon_fold = LoadSystemIcon (SYSICON_FOLD, 0))) { if (!(icon_fold = LoadSystemIcon (SYSICON_FOLD, 0))) {
return FALSE; return FALSE;
} }
} }
if (!(icon_unfold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name, SYSICON_UNFOLD, szValue)))) { if (!(icon_unfold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name,
SYSICON_UNFOLD, szValue)))) {
if (!(icon_unfold = LoadSystemIcon (SYSICON_UNFOLD, 0))) { if (!(icon_unfold = LoadSystemIcon (SYSICON_UNFOLD, 0))) {
DestroyIcon (icon_fold); DestroyIcon (icon_fold);
icon_fold = 0; icon_fold = 0;
@@ -180,6 +181,7 @@ static BOOL tvInitTVData (HWND hwnd, PTVDATA pData, DWORD dwStyle, PTVITEMINFO r
tvRoot->hIconFold = root_ii->hIconFold; tvRoot->hIconFold = root_ii->hIconFold;
else else
tvRoot->hIconFold = ICON_FOLD; tvRoot->hIconFold = ICON_FOLD;
if (root_ii && root_ii->hIconUnfold) if (root_ii && root_ii->hIconUnfold)
tvRoot->hIconUnfold = root_ii->hIconUnfold; tvRoot->hIconUnfold = root_ii->hIconUnfold;
else else
@@ -632,22 +634,13 @@ static void tvDrawItem (HWND hWnd, HDC hdc, PTVDATA pData, int centerX, int cent
centerX += (h>>1) + TV_BOXGAP; centerX += (h>>1) + TV_BOXGAP;
if (pData->dwStyle & TVS_WITHICON) { if (pData->dwStyle & TVS_WITHICON) {
if (!(pData->dwStyle & TVS_ICONFORSELECT) if (p->child != NULL && (p->dwFlags & TVIF_FOLD)) {
&& (!p->child || (p->dwFlags & TVIF_FOLD))) {
if ((p->hIconFold)) { if ((p->hIconFold)) {
DrawIcon (hdc, centerX, centerY - (h>>1), DrawIcon (hdc, centerX, centerY - (h>>1), h, h, p->hIconFold);
h, h, p->hIconFold);
}
} else if ((pData->dwStyle & TVS_ICONFORSELECT) && p->dwFlags & TVIF_SELECTED) {
if ((p->hIconFold)) {
DrawIcon (hdc, centerX, centerY - (h>>1),
h, h, p->hIconFold);
}
} else
if ((p->hIconUnfold)) {
DrawIcon (hdc, centerX, centerY - (h>>1),
h, h, p->hIconUnfold);
} }
} else if ((p->hIconUnfold)) {
DrawIcon (hdc, centerX, centerY - (h>>1), h, h, p->hIconUnfold);
}
centerX += h + TV_ICONGAP; centerX += h + TV_ICONGAP;
} }
+12
View File
@@ -202,6 +202,17 @@ static void destroy (GLYPHTREENODE *root)
/*** device font ops ***/ /*** device font ops ***/
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
return DEVFONTGLYPHTYPE_PRERDRBMP; return DEVFONTGLYPHTYPE_PRERDRBMP;
@@ -380,6 +391,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_bitmap_font_ops = { FONTOPS __mg_bitmap_font_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+19 -16
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -226,7 +226,7 @@ static int iso8859_6_conv_from_uc32 (Uchar32 wc, unsigned char* mchar)
} }
#endif #endif
/* must attetion the para s is arabic chv value.*/ #if 0
static int is_arabic_char_vowel(Uint8 c) static int is_arabic_char_vowel(Uint8 c)
{ {
@@ -240,6 +240,7 @@ static int is_arabic_char_vowel(Uint8 c)
*/ */
return 0; return 0;
} }
#endif
/* ISO8859-6 charset vowel relative define and judge */ /* ISO8859-6 charset vowel relative define and judge */
#define ISARABIC_VOWEL(s) ((s >= FATHATAN) && (s <= SUKUN)) #define ISARABIC_VOWEL(s) ((s >= FATHATAN) && (s <= SUKUN))
@@ -461,15 +462,18 @@ static int iso8859_6_len_first_char (const unsigned char* mstr, int len)
return 2; return 2;
else if (ignore == 2) else if (ignore == 2)
return 3; return 3;
else
return 1;
return 1;
} }
#define ISARABIC_LIG_HALF(s) ((s == 0xa5) || (s == 0xa6)) #define ISARABIC_LIG_HALF(s) ((s == 0xa5) || (s == 0xa6))
static unsigned int iso8859_6_char_type (Achar32 chv) static unsigned int iso8859_6_char_type (Achar32 chv)
{ {
chv = REAL_ACHAR(chv);
#if 1
return sb_char_type(chv);
#else
unsigned int ch_type = ACHAR_BASIC_UNKNOWN; unsigned int ch_type = ACHAR_BASIC_UNKNOWN;
if (is_arabic_char_vowel (chv)) { /* is vowel */ if (is_arabic_char_vowel (chv)) { /* is vowel */
@@ -480,10 +484,10 @@ static unsigned int iso8859_6_char_type (Achar32 chv)
} }
return ch_type; return ch_type;
#endif
} }
static BidiType __mg_iso8859_6_bidi_char_type_map[] = { static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
#if 0
/*0x00~0x0f*/ /*0x00~0x0f*/
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
@@ -531,7 +535,6 @@ static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN,
#endif
/*0x80~0x8f*/ /*0x80~0x8f*/
BIDI_TYPE_ON, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_ON, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
@@ -606,10 +609,9 @@ static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
static BidiType iso8859_6_bidi_char_type (Achar32 chv) static BidiType iso8859_6_bidi_char_type (Achar32 chv)
{ {
chv = REAL_ACHAR(chv); chv = REAL_ACHAR(chv);
if (chv > 0x7F) assert(chv < TABLESIZE(__mg_iso8859_6_bidi_char_type_map));
return (BidiType)__mg_iso8859_6_bidi_char_type_map[chv - 0x80];
else return (BidiType)__mg_iso8859_6_bidi_char_type_map[chv];
return (BidiType)__mg_iso8859_1_bidi_char_type_map[chv];
} }
static int get_table_index(Uint8 c) static int get_table_index(Uint8 c)
@@ -796,7 +798,7 @@ static const unsigned char* iso8859_6_get_next_word (const unsigned char* mstr,
static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar, static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
int cur_len, int shape_type) int cur_len, int shape_type)
{ {
Achar32 chv = -1; Achar32 chv = INV_ACHAR_VALUE;
int ignore; int ignore;
int index; int index;
@@ -811,15 +813,14 @@ static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
} }
} }
if (chv == -1 || chv == 0) { if (chv == INV_ACHAR_VALUE || chv == 0) {
if (ISARABIC_VOWEL(*cur_mchar)){ if (ISARABIC_VOWEL(*cur_mchar)){
chv = fontset_68x_get_vowel_char(*cur_mchar); chv = fontset_68x_get_vowel_char(*cur_mchar);
} }
if (chv == 0 || chv == -1) { if (chv == 0 || chv == INV_ACHAR_VALUE) {
index = get_table_index(*cur_mchar); index = get_table_index(*cur_mchar);
if (index >=0) if (index >=0 ) {
{
switch (shape_type) { switch (shape_type) {
case ACHAR_ISOLATED: case ACHAR_ISOLATED:
chv = shape_info[index].isolated; chv = shape_info[index].isolated;
@@ -841,7 +842,7 @@ static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
} }
if (chv == 0) if (chv == 0)
chv =-1; chv = INV_ACHAR_VALUE;
return chv; return chv;
} }
@@ -862,6 +863,7 @@ static const BIDICHAR_MIRROR_MAP __mg_iso8859_68x_mirror_table [] =
static BOOL iso8859_6_bidi_mirror_char (Achar32 chv, Achar32* mirrored) static BOOL iso8859_6_bidi_mirror_char (Achar32 chv, Achar32* mirrored)
{ {
chv = REAL_ACHAR(chv);
return get_mirror_char (__mg_iso8859_68x_mirror_table, return get_mirror_char (__mg_iso8859_68x_mirror_table,
TABLESIZE (__mg_iso8859_68x_mirror_table), chv, mirrored); TABLESIZE (__mg_iso8859_68x_mirror_table), chv, mirrored);
} }
@@ -871,6 +873,7 @@ static CHARSETOPS CharsetOps_iso8859_6 = {
3, 3,
FONT_CHARSET_ISO8859_6, FONT_CHARSET_ISO8859_6,
0, 0,
1,
iso8859_6_len_first_char, iso8859_6_len_first_char,
iso8859_6_get_char_value, iso8859_6_get_char_value,
iso8859_6_get_shaped_char_value, iso8859_6_get_shaped_char_value,
+33 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -210,6 +210,8 @@ static unsigned int unicode_char_type (Achar32 chv)
mchar_type = ACHAR_BASIC_LF; mchar_type = ACHAR_BASIC_LF;
else if (break_type == UCHAR_BREAK_SPACE) else if (break_type == UCHAR_BREAK_SPACE)
mchar_type = ACHAR_BASIC_SPACE; mchar_type = ACHAR_BASIC_SPACE;
else if (basic_type == UCHAR_CATEGORY_NON_SPACING_MARK)
mchar_type = ACHAR_BASIC_VOWEL;
else if (chv != 0x00AD && ISZEROWIDTHTYPE (basic_type)) else if (chv != 0x00AD && ISZEROWIDTHTYPE (basic_type))
mchar_type = ACHAR_BASIC_ZEROWIDTH; mchar_type = ACHAR_BASIC_ZEROWIDTH;
else if ((chv >= 0x1160 && chv < 0x1200) else if ((chv >= 0x1160 && chv < 0x1200)
@@ -239,10 +241,36 @@ static const BidiType linear_enum_to_bidi_type[] = {
#undef _UNIBIDI_ADD_TYPE #undef _UNIBIDI_ADD_TYPE
}; };
/* Since 5.0.13: this function only returns BidiType which
is recognizable by the legacy BIDI algorithm. */
static BidiType unicode_bidi_char_type(Achar32 ch) static BidiType unicode_bidi_char_type(Achar32 ch)
{ {
ch = REAL_ACHAR(ch); ch = REAL_ACHAR(ch);
return linear_enum_to_bidi_type[UNIBIDI_GET_BIDI_TYPE(ch)]; BidiType bt = linear_enum_to_bidi_type[UNIBIDI_GET_BIDI_TYPE(ch)];
switch (bt) {
case BIDI_TYPE_LTR:
case BIDI_TYPE_RTL:
case BIDI_TYPE_AL:
case BIDI_TYPE_EN:
case BIDI_TYPE_AN:
case BIDI_TYPE_ET:
case BIDI_TYPE_CS:
case BIDI_TYPE_NSM:
case BIDI_TYPE_BN:
case BIDI_TYPE_BS:
case BIDI_TYPE_SS:
case BIDI_TYPE_WS:
case BIDI_TYPE_ON:
case BIDI_TYPE_SOT:
case BIDI_TYPE_EOT:
return bt;
default:
_DBG_PRINTF("Not recognizable for char (0x%04x): %u\n", ch, bt);
break;
}
return BIDI_TYPE_WS;
} }
BidiType GUIAPI UCharGetBidiType(Uchar32 uc) BidiType GUIAPI UCharGetBidiType(Uchar32 uc)
@@ -628,6 +656,7 @@ CHARSETOPS __mg_CharsetOps_utf8 = {
6, 6,
FONT_CHARSET_UTF8, FONT_CHARSET_UTF8,
0, 0,
0,
utf8_len_first_char, utf8_len_first_char,
utf8_get_char_value, utf8_get_char_value,
NULL, NULL,
@@ -854,6 +883,7 @@ CHARSETOPS __mg_CharsetOps_utf16le = {
4, 4,
FONT_CHARSET_UTF16LE, FONT_CHARSET_UTF16LE,
0, 0,
0,
utf16le_len_first_char, utf16le_len_first_char,
utf16le_get_char_value, utf16le_get_char_value,
NULL, NULL,
@@ -1080,6 +1110,7 @@ CHARSETOPS __mg_CharsetOps_utf16be = {
4, 4,
FONT_CHARSET_UTF16BE, FONT_CHARSET_UTF16BE,
0, 0,
0,
utf16be_len_first_char, utf16be_len_first_char,
utf16be_get_char_value, utf16be_get_char_value,
NULL, NULL,
+30 -7
View File
File diff suppressed because it is too large Load Diff
+12
View File
@@ -255,6 +255,17 @@ compute_kernval (TTFINSTANCEINFO* ttf_inst_info)
return kernval; return kernval;
} }
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
if (logfont->style & FS_WEIGHT_BOOK) if (logfont->style & FS_WEIGHT_BOOK)
@@ -792,6 +803,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
} }
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_ttf_ops = { FONTOPS __mg_ttf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+12
View File
@@ -197,6 +197,17 @@ print_bitmap_grey (const BYTE* buffer, int width, int rows, int pitch)
printf("*******************************************\n"); printf("*******************************************\n");
} }
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 1;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
switch (logfont->style & FS_RENDER_MASK) { switch (logfont->style & FS_RENDER_MASK) {
@@ -1265,6 +1276,7 @@ void font_TermFreetypeLibrary (void)
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_ttf_ops = { FONTOPS __mg_ttf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+15 -9
View File
@@ -703,21 +703,20 @@ void __mg_legacy_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
print_hexstr(achars, len, TRUE); print_hexstr(achars, len, TRUE);
} }
#if 0
static void bidi_map_reverse (void* context, int len, int pos) static void bidi_map_reverse (void* context, int len, int pos)
{ {
GLYPHMAPINFO* str = (GLYPHMAPINFO*)context + pos; ACHARMAPINFO* str = (ACHARMAPINFO*)context + pos;
int i; int i;
for (i = 0; i < len / 2; i++) for (i = 0; i < len / 2; i++)
{ {
GLYPHMAPINFO tmp = str[i]; ACHARMAPINFO tmp = str[i];
str[i] = str[len - 1 - i]; str[i] = str[len - 1 - i];
str[len - 1 - i] = tmp; str[len - 1 - i] = tmp;
} }
} }
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops, Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, GLYPHMAPINFO* map, int pel) Achar32* achars, int len, int pel, ACHARMAPINFO* map)
{ {
BYTE max_level = 1; BYTE max_level = 1;
TYPERUN *type_rl_list = NULL; TYPERUN *type_rl_list = NULL;
@@ -725,6 +724,7 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
int i; int i;
int run_pos; int run_pos;
int run_len; int run_len;
REORDER_CONTEXT rc;
print_hexstr(achars, len, FALSE); print_hexstr(achars, len, FALSE);
@@ -735,14 +735,15 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
run_pos = node_p->pos; run_pos = node_p->pos;
run_len = node_p->len; run_len = node_p->len;
for (i=0; i<run_len; i++) for (i=0; i<run_len; i++) {
{
(map+run_pos+i)->is_rtol = (node_p)->level & 1; (map+run_pos+i)->is_rtol = (node_p)->level & 1;
} }
} }
bidi_reorder_cb(map, len, &type_rl_list, max_level, rc.achars = NULL;
bidi_map_reverse); rc.extra = map;
rc.cb = bidi_map_reverse;
bidi_reorder(&rc, len, &type_rl_list, max_level);
/* free typerun list.*/ /* free typerun list.*/
free_typerun_list(type_rl_list); free_typerun_list(type_rl_list);
@@ -752,18 +753,23 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
return achars; return achars;
} }
#if 0
Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops, Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int* index_map, int pel) Achar32* achars, int len, int* index_map, int pel)
{ {
BYTE max_level = 1; BYTE max_level = 1;
TYPERUN *type_rl_list = NULL; TYPERUN *type_rl_list = NULL;
REORDER_CONTEXT rc;
print_hexstr(achars, len, FALSE); print_hexstr(achars, len, FALSE);
/* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */ /* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list, &max_level); bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list, &max_level);
bidi_reorder_cb(index_map, len, &type_rl_list, max_level, rc.achars = achars;
rc.extra = extra;
rc.cb = cb_reverse_extra;
bidi_reorder(index_map, len, &type_rl_list, max_level,
bidi_string_reverse); bidi_string_reverse);
/* free typerun list.*/ /* free typerun list.*/
+12
View File
@@ -66,6 +66,17 @@
#define NUF_WIDTH 8 #define NUF_WIDTH 8
#define NUF_HEIGHT 1 #define NUF_HEIGHT 1
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
return DEVFONTGLYPHTYPE_MONOBMP; return DEVFONTGLYPHTYPE_MONOBMP;
@@ -171,6 +182,7 @@ static void unload_font_data (DEVFONT* devfont, void* data)
} }
FONTOPS __mg_null_font_ops = { FONTOPS __mg_null_font_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+12
View File
@@ -287,6 +287,17 @@ static unsigned char def_smooth_bitmap [] =
static QPF_GLYPH def_glyph = {&def_metrics, def_bitmap}; static QPF_GLYPH def_glyph = {&def_metrics, def_bitmap};
static QPF_GLYPH def_smooth_glyph = {&def_smooth_metrics, def_smooth_bitmap}; static QPF_GLYPH def_smooth_glyph = {&def_smooth_metrics, def_smooth_bitmap};
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH) if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH)
@@ -541,6 +552,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_qpf_ops = { FONTOPS __mg_qpf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+12
View File
@@ -151,6 +151,17 @@ static void unload_font_data (DEVFONT* devfont, void* data)
/*************** Raw bitmap font operations *********************************/ /*************** Raw bitmap font operations *********************************/
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
return DEVFONTGLYPHTYPE_MONOBMP; return DEVFONTGLYPHTYPE_MONOBMP;
@@ -280,6 +291,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_rbf_ops = { FONTOPS __mg_rbf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_ave_width, // max_width same as ave_width get_ave_width, // max_width same as ave_width
+12
View File
@@ -377,6 +377,17 @@ static int get_max_width (LOGFONT* logfont, DEVFONT* devfont)
return logfont->size; return logfont->size;
} }
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
if (logfont->style & FS_WEIGHT_BOOK) if (logfont->style & FS_WEIGHT_BOOK)
@@ -598,6 +609,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/ /**************************** Global data ************************************/
static FONTOPS scripteasy_font_ops = { static FONTOPS scripteasy_font_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+4 -1
View File
@@ -155,7 +155,10 @@ BOOL mg_InitSysFont (void)
goto error_load; goto error_load;
} }
if ((sys_fonts[i] = CreateLogFont (type, family, charset, /* VW 20221003: use CreateLogFontEx instead of CreateLogFont to
follow the new style convention of font name,
but the orientation is ignored for the system logfont. */
if ((sys_fonts[i] = CreateLogFontEx (type, family, charset,
style [0], style [1], style [2], style [0], style [1], style [2],
style [3], style [4], style [5], style [3], style [4], style [5],
height, 0)) == NULL) { height, 0)) == NULL) {
+2 -3
View File
@@ -377,8 +377,8 @@ static _GBType resolve_gbt(struct break_ctxt* ctxt,
uc == 0x8E2 || uc == 0xD4E || uc == 0x110BD || uc == 0x8E2 || uc == 0xD4E || uc == 0x110BD ||
(uc >= 0x111C2 && uc <= 0x111C3)) { (uc >= 0x111C2 && uc <= 0x111C3)) {
gbt = GB_Prepend; gbt = GB_Prepend;
break;
} }
break;
case UCHAR_CATEGORY_CONTROL: case UCHAR_CATEGORY_CONTROL:
case UCHAR_CATEGORY_LINE_SEPARATOR: case UCHAR_CATEGORY_LINE_SEPARATOR:
@@ -393,8 +393,8 @@ static _GBType resolve_gbt(struct break_ctxt* ctxt,
if ((uc >= 0xFFF0 && uc <= 0xFFF8) || if ((uc >= 0xFFF0 && uc <= 0xFFF8) ||
(uc >= 0xE0000 && uc <= 0xE0FFF)) { (uc >= 0xE0000 && uc <= 0xE0FFF)) {
gbt = GB_ControlCRLF; gbt = GB_ControlCRLF;
break;
} }
break;
case UCHAR_CATEGORY_OTHER_LETTER: case UCHAR_CATEGORY_OTHER_LETTER:
if (ctxt->makes_hangul_syllable) if (ctxt->makes_hangul_syllable)
@@ -434,7 +434,6 @@ static _GBType resolve_gbt(struct break_ctxt* ctxt,
gbt = GB_RI_Odd; gbt = GB_RI_Odd;
else else
gbt = GB_RI_Odd; gbt = GB_RI_Odd;
break;
} }
break; break;
+12
View File
@@ -148,6 +148,17 @@ static void unload_font_data (DEVFONT* devfont, void* data)
free (((UPFINFO*) data)); free (((UPFINFO*) data));
} }
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
Uint8* p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir; Uint8* p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir;
@@ -525,6 +536,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
} }
FONTOPS __mg_upf_ops = { FONTOPS __mg_upf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+12
View File
@@ -109,6 +109,17 @@ typedef struct _FONT_PROPT {
int def_glyph; int def_glyph;
} FONT_PROPT; } FONT_PROPT;
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
return DEVFONTGLYPHTYPE_MONOBMP; return DEVFONTGLYPHTYPE_MONOBMP;
@@ -477,6 +488,7 @@ static void unload_font_data (DEVFONT* devfont, void* data)
} }
FONTOPS __mg_vbf_ops = { FONTOPS __mg_vbf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
-1
View File
@@ -59,7 +59,6 @@
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
#include "blockheap.h"
#include "accelkey.h" #include "accelkey.h"
static BLOCKHEAP ACHeap; static BLOCKHEAP ACHeap;
+59 -18
View File
@@ -59,17 +59,22 @@
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
#include "dc.h"
BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight) BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
{ {
PMAINWIN pWin; PMAINWIN pWin;
pWin = (PMAINWIN)hWnd; pWin = (PMAINWIN)hWnd;
if (!pWin->pCaretInfo) { if (!pWin->pCaretInfo) {
HDC hdc;
if (!(pWin->pCaretInfo = malloc (sizeof (CARETINFO)))) if (!(pWin->pCaretInfo = malloc (sizeof (CARETINFO))))
return FALSE; return FALSE;
/* Since 5.0.11: use client DC of the window instead of screen DC */
hdc = GetClientDC(hWnd);
pWin->pCaretInfo->pBitmap = pBitmap; pWin->pCaretInfo->pBitmap = pBitmap;
if (pBitmap) { if (pBitmap) {
nWidth = pBitmap->bmWidth; nWidth = pBitmap->bmWidth;
@@ -78,18 +83,22 @@ BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
pWin->pCaretInfo->nWidth = nWidth; pWin->pCaretInfo->nWidth = nWidth;
pWin->pCaretInfo->nHeight = nHeight; pWin->pCaretInfo->nHeight = nHeight;
pWin->pCaretInfo->caret_bmp.bmType = BMP_TYPE_NORMAL; pWin->pCaretInfo->caret_bmp.bmType = BMP_TYPE_NORMAL;
pWin->pCaretInfo->caret_bmp.bmBitsPerPixel = BITSPERPHYPIXEL; pWin->pCaretInfo->caret_bmp.bmBitsPerPixel =
pWin->pCaretInfo->caret_bmp.bmBytesPerPixel = BYTESPERPHYPIXEL; GetGDCapability(hdc, GDCAP_BITSPP);
pWin->pCaretInfo->caret_bmp.bmBytesPerPixel =
GetGDCapability(hdc, GDCAP_BPP);
pWin->pCaretInfo->caret_bmp.bmWidth = nWidth; pWin->pCaretInfo->caret_bmp.bmWidth = nWidth;
pWin->pCaretInfo->caret_bmp.bmHeight = nHeight; pWin->pCaretInfo->caret_bmp.bmHeight = nHeight;
pWin->pCaretInfo->caret_bmp.bmAlphaMask = NULL; pWin->pCaretInfo->caret_bmp.bmAlphaMask = NULL;
pWin->pCaretInfo->caret_bmp.bmAlphaPitch = 0; pWin->pCaretInfo->caret_bmp.bmAlphaPitch = 0;
pWin->pCaretInfo->nBytesNr = GAL_GetBoxSize (__gal_screen, pWin->pCaretInfo->nBytesNr = GAL_GetBoxSize (dc_HDC2PDC(hdc)->surface,
nWidth, nHeight, &pWin->pCaretInfo->caret_bmp.bmPitch); nWidth, nHeight, &pWin->pCaretInfo->caret_bmp.bmPitch);
pWin->pCaretInfo->pNormal = malloc (pWin->pCaretInfo->nBytesNr); pWin->pCaretInfo->pNormal = malloc (pWin->pCaretInfo->nBytesNr);
pWin->pCaretInfo->pXored = malloc (pWin->pCaretInfo->nBytesNr); pWin->pCaretInfo->pXored = malloc (pWin->pCaretInfo->nBytesNr);
ReleaseDC(hdc);
if (pWin->pCaretInfo->pNormal == NULL || if (pWin->pCaretInfo->pNormal == NULL ||
pWin->pCaretInfo->pXored == NULL) { pWin->pCaretInfo->pXored == NULL) {
free (pWin->pCaretInfo); free (pWin->pCaretInfo);
@@ -219,8 +228,8 @@ void GetCaretBitmaps (PCARETINFO pCaretInfo)
int i; int i;
int sx, sy; int sx, sy;
HDC hdc; HDC hdc;
Uint32 amask;
// convert to screen coordinates
sx = pCaretInfo->x; sx = pCaretInfo->x;
sy = pCaretInfo->y; sy = pCaretInfo->y;
@@ -231,36 +240,68 @@ void GetCaretBitmaps (PCARETINFO pCaretInfo)
pCaretInfo->caret_bmp.bmWidth, pCaretInfo->caret_bmp.bmWidth,
pCaretInfo->caret_bmp.bmHeight, pCaretInfo->caret_bmp.bmHeight,
&pCaretInfo->caret_bmp); &pCaretInfo->caret_bmp);
amask = GetGDCapability(hdc, GDCAP_AMASK);
ReleaseDC (hdc); ReleaseDC (hdc);
// generate XOR bitmap. // generate XOR bitmap.
if (pCaretInfo->pBitmap) { if (amask == 0) {
BYTE* normal; BYTE* normal;
BYTE* bitmap; BYTE* bitmap;
BYTE* xored; BYTE* xored;
normal = pCaretInfo->pNormal; normal = pCaretInfo->pNormal;
bitmap = pCaretInfo->pBitmap->bmBits;
xored = pCaretInfo->pXored; xored = pCaretInfo->pXored;
for (i = 0; i < pCaretInfo->nBytesNr; i++) if (pCaretInfo->pBitmap) {
xored[i] = normal[i] ^ bitmap[i]; bitmap = pCaretInfo->pBitmap->bmBits;
for (i = 0; i < pCaretInfo->nBytesNr; i++)
xored[i] = normal[i] ^ bitmap[i];
}
else {
for (i = 0; i < pCaretInfo->nBytesNr; i++)
xored[i] = normal[i] ^ 0xFF;
}
} }
else { else {
// Since 5.0.11: restore the alpha component if having alpha component.
int x, y;
BYTE* normal; BYTE* normal;
BYTE* xored; BYTE* xored;
BYTE xor_byte; BYTE* bitmap = NULL;
gal_pixel pix_normal, pix_bitmap, pix_xored, bits_alpha;
if (BITSPERPHYPIXEL < 8) for (y = 0; y < pCaretInfo->caret_bmp.bmHeight; y++) {
xor_byte = 0x0F; normal = pCaretInfo->pNormal + pCaretInfo->caret_bmp.bmPitch * y;
else xored = pCaretInfo->pXored + pCaretInfo->caret_bmp.bmPitch * y;
xor_byte = 0xFF; if (pCaretInfo->pBitmap)
bitmap = pCaretInfo->pBitmap->bmBits +
pCaretInfo->caret_bmp.bmPitch * y;
normal = pCaretInfo->pNormal; for (x = 0; x < pCaretInfo->caret_bmp.bmWidth; x++) {
xored = pCaretInfo->pXored;
for (i = 0; i < pCaretInfo->nBytesNr; i++) pix_normal = _mem_get_pixel(normal,
xored[i] = normal[i] ^ xor_byte; pCaretInfo->caret_bmp.bmBytesPerPixel);
if (pCaretInfo->pBitmap) {
pix_bitmap = _mem_get_pixel(bitmap,
pCaretInfo->caret_bmp.bmBytesPerPixel);
}
else {
pix_bitmap = 0xFFFFFFFF;
}
bits_alpha = pix_normal & amask;
pix_xored = pix_normal ^ pix_bitmap;
pix_xored &= ~amask;
pix_xored |= bits_alpha;
_mem_set_pixel(xored,
pCaretInfo->caret_bmp.bmBytesPerPixel, pix_xored);
normal += pCaretInfo->caret_bmp.bmBytesPerPixel;
xored += pCaretInfo->caret_bmp.bmBytesPerPixel;
if (pCaretInfo->pBitmap)
bitmap += pCaretInfo->caret_bmp.bmBytesPerPixel;
}
}
} }
} }
+2 -2
View File
@@ -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~2022, 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
@@ -803,7 +803,7 @@ BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
char buff [20]; char buff [20];
DWORD rgba; DWORD rgba;
if (!rdr || !rdr->name || rdr->name[0] == '\0') if (!rdr || rdr->name[0] == '\0')
return FALSE; return FALSE;
_DBG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n", _DBG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n",
-1
View File
@@ -71,7 +71,6 @@
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
#include "blockheap.h"
#include "menu.h" #include "menu.h"
#define SHORTEN 0 #define SHORTEN 0
+95 -43
View File
File diff suppressed because it is too large Load Diff
+14
View File
@@ -319,6 +319,19 @@ static void flush_rec (void)
#endif #endif
} }
static void close_rec (void)
{
#ifdef WIN32
/* TODO: */
#else
if (record_fd >= 0) {
close(record_fd);
record_fd = -1;
}
#endif
}
static void do_record(AUTO_IAL_INPUT_EVENT *event) static void do_record(AUTO_IAL_INPUT_EVENT *event)
{ {
@@ -744,6 +757,7 @@ void TermPCXVFBInput (void)
remove("/tmp/.pcxvfb_tmp"); remove("/tmp/.pcxvfb_tmp");
} }
#endif #endif
close_rec();
#endif /* WIN32 */ #endif /* WIN32 */
} }
+50 -11
View File
@@ -46,6 +46,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
#include "common.h" #include "common.h"
@@ -65,14 +66,18 @@
#define LEN_TOUCH_DEV 127 #define LEN_TOUCH_DEV 127
#define AUTO_MOUSE_UP_TICKCOUNT 20
static int sg_tp_event_fd = -1, sg_key_event_fd = -1; static int sg_tp_event_fd = -1, sg_key_event_fd = -1;
static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0; static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0;
static DWORD g_last_tickcount = 0;
static bool g_has_auto_event = false;
static int get_touch_data (short *x, short *y, short *button) static int get_touch_data (short *x, short *y, short *button)
{ {
struct input_event data; struct input_event data;
while (read (sg_tp_event_fd, &data, sizeof (data)) == sizeof (data)) { if (read (sg_tp_event_fd, &data, sizeof (data)) == sizeof (data)) {
/* do nothing for EV_SYN due to non-blocking read. /* do nothing for EV_SYN due to non-blocking read.
if (data.type == EV_SYN) { if (data.type == EV_SYN) {
@@ -91,10 +96,12 @@ static int get_touch_data (short *x, short *y, short *button)
if (data.type == EV_KEY) { if (data.type == EV_KEY) {
switch (data.code) { switch (data.code) {
case BTN_TOUCH: case BTN_TOUCH:
if (data.value > 0) if (data.value == 0) {
*button = IAL_MOUSE_LEFTBUTTON;
else
*button = 0; *button = 0;
g_last_tickcount = 0;
return 0;
}
g_last_tickcount = GetTickCount();
break; break;
default: default:
@@ -103,6 +110,7 @@ static int get_touch_data (short *x, short *y, short *button)
} }
} }
else if (data.type == EV_ABS) { else if (data.type == EV_ABS) {
g_last_tickcount = GetTickCount();
switch (data.code) { switch (data.code) {
case ABS_X: case ABS_X:
*x = data.value; *x = data.value;
@@ -110,7 +118,8 @@ static int get_touch_data (short *x, short *y, short *button)
case ABS_Y: case ABS_Y:
*y = data.value; *y = data.value;
break; *button = IAL_MOUSE_LEFTBUTTON;
return 0;
case ABS_MT_POSITION_X: case ABS_MT_POSITION_X:
*x = data.value; *x = data.value;
@@ -118,7 +127,8 @@ static int get_touch_data (short *x, short *y, short *button)
case ABS_MT_POSITION_Y: case ABS_MT_POSITION_Y:
*y = data.value; *y = data.value;
break; *button = IAL_MOUSE_LEFTBUTTON;
return 0;
case ABS_MT_TOUCH_MAJOR: case ABS_MT_TOUCH_MAJOR:
break; break;
@@ -136,13 +146,20 @@ static int get_touch_data (short *x, short *y, short *button)
} }
} }
return 0; if (g_has_auto_event) {
g_has_auto_event = false;
return 0;
}
return -1;
} }
static int mouse_update (void) static int mouse_update (void)
{ {
if (get_touch_data (&MOUSEX, &MOUSEY, &MOUSEBUTTON) == 0) static int idx = 0;
if (get_touch_data (&MOUSEX, &MOUSEY, &MOUSEBUTTON) == 0) {
return 1; return 1;
}
return 0; return 0;
} }
@@ -193,10 +210,32 @@ static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *ex
} }
} }
else if (e < 0) { else if (e < 0) {
retvalue = -1; if (g_last_tickcount > 0) {
DWORD tickcount = GetTickCount();
if (tickcount - g_last_tickcount >= AUTO_MOUSE_UP_TICKCOUNT) {
MOUSEBUTTON = 0;
retvalue |= IAL_MOUSEEVENT;
g_last_tickcount = 0;
g_has_auto_event = true;
}
}
else {
retvalue = -1;
}
} }
else { else {
retvalue = 0; if (g_last_tickcount > 0) {
DWORD tickcount = GetTickCount();
if (tickcount - g_last_tickcount >= AUTO_MOUSE_UP_TICKCOUNT) {
MOUSEBUTTON = 0;
retvalue |= IAL_MOUSEEVENT;
g_last_tickcount = 0;
g_has_auto_event = true;
}
}
else {
retvalue = 0;
}
} }
return retvalue; return retvalue;
@@ -214,7 +253,7 @@ BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype)
return FALSE; return FALSE;
} }
sg_tp_event_fd = open (touch_dev, O_RDONLY | O_NONBLOCK); sg_tp_event_fd = open (touch_dev, O_RDONLY);
if (sg_tp_event_fd < 0) { if (sg_tp_event_fd < 0) {
_WRN_PRINTF ("failed when opening touch event device: %s\n", touch_dev); _WRN_PRINTF ("failed when opening touch event device: %s\n", touch_dev);
return FALSE; return FALSE;
+1 -1
View File
@@ -3,7 +3,7 @@ noinst_HEADERS = \
cursor.h dc.h event.h list.h element.h \ cursor.h dc.h event.h list.h element.h \
ial.h inline.h internals.h zorder.h menu.h misc.h \ ial.h inline.h internals.h zorder.h menu.h misc.h \
msgstr.h sysfont.h timer.h devfont.h fontname.h \ msgstr.h sysfont.h timer.h devfont.h fontname.h \
readbmp.h icon.h blockheap.h rbtree.h \ readbmp.h icon.h rbtree.h \
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \ ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \ gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
glyph.h license.h mgsock.h unicode-ops.h \ glyph.h license.h mgsock.h unicode-ops.h \
+3 -3
View File
@@ -112,11 +112,11 @@ void __mg_legacy_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
Uint32 __mg_legacy_bidi_str_base_dir (const CHARSETOPS* charset_ops, Uint32 __mg_legacy_bidi_str_base_dir (const CHARSETOPS* charset_ops,
Achar32* achars, int len); Achar32* achars, int len);
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel, ACHARMAPINFO* map);
#if 0 #if 0
// Deprecated // Deprecated
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, GLYPHMAPINFO* map, int pel);
Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops, Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int* index_map, int pel); Achar32* achars, int len, int* index_map, int pel);
#endif #endif
-1
View File
@@ -70,7 +70,6 @@ struct _SCALER_INFO_FILLBMP
typedef struct { typedef struct {
struct _SCALER_INFO_FILLBMP scaler_info; struct _SCALER_INFO_FILLBMP scaler_info;
GAL_Rect dst_rect; GAL_Rect dst_rect;
int old_bkmode;
BYTE* decoded_buff; BYTE* decoded_buff;
BYTE* decoded_alpha_buff; BYTE* decoded_alpha_buff;
@@ -47,6 +47,8 @@
** blockheap.h: the head file of heap for block data. ** blockheap.h: the head file of heap for block data.
** **
** Create date: 2001/01/10 ** Create date: 2001/01/10
**
** DEPRECATED, USE window.h INSTEAD.
*/ */
#ifndef GUI_BLOCKHEAP_H #ifndef GUI_BLOCKHEAP_H
@@ -55,7 +57,7 @@
#ifndef _MGUI_GDI_H /* included in include/gdi.h */ #ifndef _MGUI_GDI_H /* included in include/gdi.h */
struct _BLOCKHEAP { struct _BLOCKHEAP {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
/* Size of one block element. */ /* Size of one block element. */
+20 -1
View File
@@ -105,6 +105,10 @@
#define REQID_GETSHAREDSURFACE 0x001C #define REQID_GETSHAREDSURFACE 0x001C
// for compositing schema // for compositing schema
#define SYSSF_WALLPAPER_PATTER "syssf-wallpaper-pattern" #define SYSSF_WALLPAPER_PATTER "syssf-wallpaper-pattern"
#define APPSF_NAME_PREFIX "appsf-name-"
#define APPSF_NAME_PATTER "appsf-name-%s"
#define APPSF_HWND_PREFIX "appsf-hwnd-"
#define APPSF_HWND_PATTER "appsf-hwnd-%d-%p"
// for sharedfb schema // for sharedfb schema
#define SYSSF_REAL_SCREEN "syssf-real-screen" #define SYSSF_REAL_SCREEN "syssf-real-screen"
#define SYSSF_SHADOW_SCREEN "syssf-shadow-screen" #define SYSSF_SHADOW_SCREEN "syssf-shadow-screen"
@@ -126,7 +130,14 @@
// Authenticate client // Authenticate client
#define REQID_AUTHCLIENT 0x0023 #define REQID_AUTHCLIENT 0x0023
#define REQID_SYS_LAST REQID_AUTHCLIENT /* Since 5.2.0 */
// Operate a shared surface to register/revoke the name and set the fd
#define REQID_OPERATENAMEDSSURF 0x0024
#define ID_NAMEDSSURFOP_REGISTER 1
#define ID_NAMEDSSURFOP_SET 2
#define ID_NAMEDSSURFOP_REVOKE 3
#define REQID_SYS_LAST REQID_OPERATENAMEDSSURF
/* /*
* XXX: To fellows who need to add a new REQID, * XXX: To fellows who need to add a new REQID,
@@ -142,6 +153,14 @@ MGUI_COMPILE_TIME_ASSERT(sys_request_id, MAX_SYS_REQID >= REQID_SYS_LAST);
#undef MGUI_COMPILE_TIME_ASSERT #undef MGUI_COMPILE_TIME_ASSERT
/* Since 5.2.0 */
typedef struct OperateNSSurfInfo
{
int id_op;
char name[NAME_MAX + 1];
size_t map_size;
} OPERATENSSURFINFO;
/* Since 5.0.0 */ /* Since 5.0.0 */
typedef struct _SharedSurfInfo { typedef struct _SharedSurfInfo {
uint32_t flags; // the flags of the surface uint32_t flags; // the flags of the surface
+7 -2
View File
@@ -93,7 +93,7 @@ typedef struct tagDC* PDC;
# else /* not defined _MGSCHEMA_COMPOSITING */ # else /* not defined _MGSCHEMA_COMPOSITING */
void __mg_lock_recalc_gcrinfo (PDC pdc); void __mg_lock_recalc_gcrinfo (PDC pdc);
void __mg_unlock_gcrinfo (PDC pdc); void __mg_unlock_gcrinfo (PDC pdc);
#define LOCK_GCRINFO(pdc) __mg_lock_recalc_gcrinfo (pdc) #define LOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_lock_recalc_gcrinfo (pdc)
#define UNLOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_unlock_gcrinfo (pdc) #define UNLOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_unlock_gcrinfo (pdc)
# endif /* not defined _MGSCHEMA_COMPOSITING */ # endif /* not defined _MGSCHEMA_COMPOSITING */
@@ -167,6 +167,8 @@ struct tagDC
/* surface of this DC */ /* surface of this DC */
GAL_Surface* surface; GAL_Surface* surface;
char __first_attr[0]; // just a zero-length field for the first attribute
/* background color */ /* background color */
gal_pixel bkcolor; gal_pixel bkcolor;
@@ -179,7 +181,7 @@ struct tagDC
/* text color */ /* text color */
gal_pixel textcolor; gal_pixel textcolor;
int bkmode; int bkmode_set; /* the background mode set by user (5.0.12, Issue #107) */
int tabstop; int tabstop;
int cExtra; /* Character extra */ int cExtra; /* Character extra */
@@ -213,6 +215,8 @@ struct tagDC
size_t dash_list_len; size_t dash_list_len;
#endif #endif
char __last_attr[0]; // just a zero-length field for the last attribute
PLOGFONT pLogFont; PLOGFONT pLogFont;
POINT CurPenPos; POINT CurPenPos;
@@ -247,6 +251,7 @@ struct tagDC
gal_pixel skip_pixel; gal_pixel skip_pixel;
gal_pixel cur_pixel; gal_pixel cur_pixel;
int step; int step;
int bkmode; /* the effective background mode */
/* ====================================================================== */ /* ====================================================================== */
CLIPRECT* cur_ban; CLIPRECT* cur_ban;
+12 -1
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2023, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -209,6 +209,9 @@ struct _CHARSETOPS
/** Default character. */ /** Default character. */
Achar32 def_char_value; Achar32 def_char_value;
/** Whether using legacy BIDI algorithm (Since 5.0.13). */
unsigned legacy_bidi:1;
/** The method to get the length of the first character. */ /** The method to get the length of the first character. */
int (*len_first_char) (const unsigned char* mstr, int mstrlen); int (*len_first_char) (const unsigned char* mstr, int mstrlen);
@@ -263,9 +266,17 @@ struct _CHARSETOPS
#define DEVFONTGLYPHTYPE_MASK_BMPTYPE 0x0F #define DEVFONTGLYPHTYPE_MASK_BMPTYPE 0x0F
enum devfont_feature {
DEVFONT_FEATURE_MARK_BBOX = 0,
};
/** The font operation structure. */ /** The font operation structure. */
struct _FONTOPS struct _FONTOPS
{ {
/** The method to get the feature value of the font (Since 5.0.13). */
DWORD (*get_feature) (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature);
/** The method to get the glyph bitmap type . */ /** The method to get the glyph bitmap type . */
DWORD (*get_glyph_bmptype) (LOGFONT* logfont, DEVFONT* devfont); DWORD (*get_glyph_bmptype) (LOGFONT* logfont, DEVFONT* devfont);
+3
View File
@@ -127,6 +127,9 @@ typedef LWEVENT* PLWEVENT;
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
extern DWORD __mg_timeout_usec;
extern DWORD __mg_repeat_usec;
// The entrance of low level event handling thread // The entrance of low level event handling thread
BOOL mg_InitLWEvent (void); BOOL mg_InitLWEvent (void);
void mg_TerminateLWEvent (void); void mg_TerminateLWEvent (void);
+13 -6
View File
@@ -84,15 +84,18 @@
#define WS_EX_MODALDISABLED 0x10000000L #define WS_EX_MODALDISABLED 0x10000000L
/* /*
* \def WS_EX_CTRLASMAINWIN * Internal extended style:
* \brief The control can be displayed out of the main window * The control can be displayed out of the main window
* which contains the control. * which contains the control.
*/ */
#define WS_EX_CTRLASMAINWIN 0x20000000L #define WS_EX_CTRLASMAINWIN 0x20000000L
/* Internal extended style. */ /* Internal extended style: dialog box. */
#define WS_EX_DIALOGBOX 0x40000000L #define WS_EX_DIALOGBOX 0x40000000L
/* Internal extended style: activated. */
#define WS_EX_ACTIVATED 0x80000000L
/* Make sure the internal window extended styles above are ok */ /* Make sure the internal window extended styles above are ok */
#define MGUI_COMPILE_TIME_ASSERT(name, x) \ #define MGUI_COMPILE_TIME_ASSERT(name, x) \
typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1] typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1]
@@ -101,6 +104,10 @@ MGUI_COMPILE_TIME_ASSERT(ws_ex_int_1,
WS_EX_INTERNAL_MASK & WS_EX_MODALDISABLED); WS_EX_INTERNAL_MASK & WS_EX_MODALDISABLED);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_2, MGUI_COMPILE_TIME_ASSERT(ws_ex_int_2,
WS_EX_INTERNAL_MASK & WS_EX_CTRLASMAINWIN); WS_EX_INTERNAL_MASK & WS_EX_CTRLASMAINWIN);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_3,
WS_EX_INTERNAL_MASK & WS_EX_DIALOGBOX);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_4,
WS_EX_INTERNAL_MASK & WS_EX_ACTIVATED);
#undef MGUI_COMPILE_TIME_ASSERT #undef MGUI_COMPILE_TIME_ASSERT
@@ -772,8 +779,8 @@ static inline PMSGQUEUE getMsgQueue (HWND hWnd)
} }
MSGQUEUE* mg_AllocMsgQueueForThisThread (void); MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in);
void mg_FreeMsgQueueForThisThread (void); void mg_FreeMsgQueueForThisThread (BOOL sign_off);
/* Since 5.0.0 */ /* Since 5.0.0 */
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd); int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd);
+5
View File
@@ -83,6 +83,11 @@ static inline int comp_key_string (const void *key1, const void *key2)
return strcmp (key1, key2); return strcmp (key1, key2);
} }
static inline void free_val_alloc (void *val)
{
free (val);
}
typedef struct _map_t map_t; typedef struct _map_t map_t;
typedef struct _map_entry_t { typedef struct _map_entry_t {
struct rb_node node; struct rb_node node;
+12 -14
View File
@@ -55,9 +55,9 @@
#ifndef GUI_NEWGAL_H #ifndef GUI_NEWGAL_H
#define GUI_NEWGAL_H #define GUI_NEWGAL_H
#include "minigui.h"
#include "gdi.h" #include "gdi.h"
#include "constants.h" #include "constants.h"
#include "blockheap.h"
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
#include <sys/types.h> #include <sys/types.h>
@@ -117,8 +117,10 @@ void GAL_FreeFormat(GAL_PixelFormat *format);
/* typedef for private surface blitting functions */ /* typedef for private surface blitting functions */
struct GAL_Surface; struct GAL_Surface;
typedef int (*GAL_blit)(struct GAL_Surface *src, GAL_Rect *srcrect,
struct GAL_Surface *dst, GAL_Rect *dstrect); typedef int (*GAL_blit)(GAL_VideoDevice *video,
struct GAL_Surface *src, GAL_Rect *srcrect,
struct GAL_Surface *dst, GAL_Rect *dstrect);
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
typedef struct _DirtyInfo { typedef struct _DirtyInfo {
@@ -670,7 +672,6 @@ void GAL_MoveCursor (GAL_Surface* surface, int x, int y);
#endif /* defined _MGSCHEMA_COMPOSITING */ #endif /* defined _MGSCHEMA_COMPOSITING */
#if 0
/* /*
* GAL_LockSurface() sets up a surface for directly accessing the pixels. * GAL_LockSurface() sets up a surface for directly accessing the pixels.
* Between calls to GAL_LockSurface()/GAL_UnlockSurface(), you can write * Between calls to GAL_LockSurface()/GAL_UnlockSurface(), you can write
@@ -680,9 +681,7 @@ void GAL_MoveCursor (GAL_Surface* surface, int x, int y);
* *
* Not all surfaces require locking. If GAL_MUSTLOCK(surface) evaluates * Not all surfaces require locking. If GAL_MUSTLOCK(surface) evaluates
* to 0, then you can read and write to the surface at any time, and the * to 0, then you can read and write to the surface at any time, and the
* pixel format of the surface will not change. In particular, if the * pixel format of the surface will not change.
* GAL_HWSURFACE flag is not given when calling GAL_SetVideoMode(), you
* will not need to lock the display surface before accessing it.
* *
* No operating system or library calls should be made between lock/unlock * No operating system or library calls should be made between lock/unlock
* pairs, as critical system locks may be held during this time. * pairs, as critical system locks may be held during this time.
@@ -691,7 +690,6 @@ void GAL_MoveCursor (GAL_Surface* surface, int x, int y);
*/ */
int GAL_LockSurface (GAL_Surface *surface); int GAL_LockSurface (GAL_Surface *surface);
void GAL_UnlockSurface (GAL_Surface *surface); void GAL_UnlockSurface (GAL_Surface *surface);
#endif
/* /*
* Set the color key (transparent pixel) in a blittable surface. * Set the color key (transparent pixel) in a blittable surface.
@@ -735,10 +733,10 @@ GAL_bool GAL_IntersectRect (const GAL_Rect *A, const GAL_Rect *B,
Bmin = B->x; Bmin = B->x;
Bmax = Bmin + B->w; Bmax = Bmin + B->w;
if (Bmin > Amin) if (Bmin > Amin)
Amin = Bmin; Amin = Bmin;
intersection->x = Amin; intersection->x = Amin;
if (Bmax < Amax) if (Bmax < Amax)
Amax = Bmax; Amax = Bmax;
intersection->w = Amax - Amin > 0 ? Amax - Amin : 0; intersection->w = Amax - Amin > 0 ? Amax - Amin : 0;
/* Vertical intersection */ /* Vertical intersection */
@@ -747,10 +745,10 @@ GAL_bool GAL_IntersectRect (const GAL_Rect *A, const GAL_Rect *B,
Bmin = B->y; Bmin = B->y;
Bmax = Bmin + B->h; Bmax = Bmin + B->h;
if (Bmin > Amin) if (Bmin > Amin)
Amin = Bmin; Amin = Bmin;
intersection->y = Amin; intersection->y = Amin;
if (Bmax < Amax) if (Bmax < Amax)
Amax = Bmax; Amax = Bmax;
intersection->h = Amax - Amin > 0 ? Amax - Amin : 0; intersection->h = Amax - Amin > 0 ? Amax - Amin : 0;
return (intersection->w && intersection->h); return (intersection->w && intersection->h);
@@ -1067,8 +1065,8 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
uint32_t name, uint32_t drm_format, uint32_t pixels_off, uint32_t name, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch); uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
uint32_t handle, size_t size, uint32_t drm_format, uint32_t pixels_off, size_t size, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch); uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video, GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
+2
View File
@@ -73,6 +73,8 @@
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
/* union semun is defined by including <sys/sem.h> */ /* union semun is defined by including <sys/sem.h> */
#elif defined(__DARWIN__)
/* union semun is defined by including <sys/sem.h> */
#else #else
/* according to X/OPEN we have to define it ourselves */ /* according to X/OPEN we have to define it ourselves */
union semun { union semun {
+5
View File
@@ -132,6 +132,10 @@ void __mg_client_del (int cli);
void __mg_release_global_res (int cli); void __mg_release_global_res (int cli);
/* Since 5.2.0 */
int __mg_nssurf_map_new(void);
void __mg_nssurf_map_delete(void);
void __mg_remove_client (int cli, int clifd); void __mg_remove_client (int cli, int clifd);
int __mg_handle_request (int clifd, int req_id, int cli); int __mg_handle_request (int clifd, int req_id, int cli);
@@ -150,6 +154,7 @@ int __mg_remove_all_znodes_of_client (int cli);
int __mg_handle_normal_mouse_move (const ZORDERINFO* zi, int x, int y); int __mg_handle_normal_mouse_move (const ZORDERINFO* zi, int x, int y);
int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd); int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd);
ZORDERNODE *__mg_find_znode_by_client_hwnd (int cli, HWND hwnd);
int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info); int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info);
int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam); int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
+8 -2
View File
@@ -141,11 +141,17 @@ typedef struct _ZORDERINFO {
/* The size of usage bitmap for mask rect. */ /* The size of usage bitmap for mask rect. */
int size_maskrect_usage_bmp; int size_maskrect_usage_bmp;
/* use read/write lock for Unix-like OS */
#ifndef __NOUNIX__
#define __ZI_USE_RWLOCK 1
#endif
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
# ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
pthread_rwlock_t rwlock; pthread_rwlock_t rwlock;
pthread_t rwlock_owner;
# else # else
pthread_mutex_t rwlock; pthread_mutex_t mutex;
# endif # endif
#elif defined(_MGRM_PROCESSES) #elif defined(_MGRM_PROCESSES)
int zi_semid; int zi_semid;
+1
View File
@@ -1,5 +1,6 @@
# also for makefile.ng and makefile.msvc # also for makefile.ng and makefile.msvc
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
AM_CFLAGS = -Wno-zero-length-bounds
noinst_LTLIBRARIES = libkernel.la noinst_LTLIBRARIES = libkernel.la
+7 -7
View File
@@ -59,13 +59,13 @@
#include "common.h" #include "common.h"
#include "minigui.h" #include "minigui.h"
#include "gdi.h" #include "gdi.h"
#include "window.h"
#include "constants.h" #include "constants.h"
#include "blockheap.h"
#include "misc.h" #include "misc.h"
BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap) BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap)
{ {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_init (&heap->lock, NULL); pthread_mutex_init (&heap->lock, NULL);
#endif #endif
@@ -99,7 +99,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
int free_slot; int free_slot;
unsigned char* block_data = NULL; unsigned char* block_data = NULL;
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&heap->lock); pthread_mutex_lock (&heap->lock);
#endif #endif
@@ -118,7 +118,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
ret: ret:
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&heap->lock); pthread_mutex_unlock (&heap->lock);
#endif #endif
return block_data; return block_data;
@@ -128,7 +128,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
{ {
unsigned char* block_data = data; unsigned char* block_data = data;
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&heap->lock); pthread_mutex_lock (&heap->lock);
#endif #endif
@@ -146,7 +146,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
heap, slot); heap, slot);
} }
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&heap->lock); pthread_mutex_unlock (&heap->lock);
#endif #endif
} }
@@ -193,7 +193,7 @@ void DestroyBlockDataHeap (PBLOCKHEAP heap)
free (heap->usage_bmp); free (heap->usage_bmp);
heap->usage_bmp = NULL; heap->usage_bmp = NULL;
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_destroy (&heap->lock); pthread_mutex_destroy (&heap->lock);
#endif #endif
} }
+1
View File
@@ -228,6 +228,7 @@ static void composite_wallpaper_rect (CompositorCtxt* ctxt,
} }
} }
else { else {
SelectClipRect (HDC_SCREEN_SYS, dirty_rc);
SetBrushColor (HDC_SCREEN_SYS, SetBrushColor (HDC_SCREEN_SYS,
GetWindowElementPixelEx (HWND_DESKTOP, HDC_SCREEN_SYS, GetWindowElementPixelEx (HWND_DESKTOP, HDC_SCREEN_SYS,
WE_BGC_DESKTOP)); WE_BGC_DESKTOP));
+2 -2
View File
@@ -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~2021, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, 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 (compositors [i].name && strcmp (compositors [i].name, name) == 0) { if (strcmp (compositors [i].name, name) == 0) {
return compositors [i].ops; return compositors [i].ops;
} }
} }
+36 -14
View File
@@ -1081,6 +1081,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
const RECT* prc; const RECT* prc;
prc = &cur_pdc->rc_output; prc = &cur_pdc->rc_output;
/* Since 5.0.13 */
if (!fShow) {
GAL_LockSurface(cur_pdc->surface);
}
if (cur_pdc->surface != __gal_screen) { if (cur_pdc->surface != __gal_screen) {
if (fShow) { if (fShow) {
GAL_UpdateRect (cur_pdc->surface, GAL_UpdateRect (cur_pdc->surface,
@@ -1090,7 +1096,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
} }
else { else {
if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) { if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) {
return; goto done;
} }
if (!fShow) { if (!fShow) {
@@ -1109,6 +1115,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
UNLOCK_CURSOR_SEM (); UNLOCK_CURSOR_SEM ();
} }
} }
done:
/* Since 5.0.13 */
if (fShow) {
GAL_UnlockSurface(cur_pdc->surface);
}
} }
#else /* defined _MGSCHEMA_SHAREDFB */ #else /* defined _MGSCHEMA_SHAREDFB */
@@ -1124,6 +1136,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
} }
prc = &cur_pdc->rc_output; prc = &cur_pdc->rc_output;
/* Since 5.0.13 */
if (!fShow) {
GAL_LockSurface(cur_pdc->surface);
}
if (cur_pdc->surface == __gal_screen) { if (cur_pdc->surface == __gal_screen) {
// Under compositing schema, we never call SyncUpdate in // Under compositing schema, we never call SyncUpdate in
// kernel_ShowCursorForGDI for __gal_screen. // kernel_ShowCursorForGDI for __gal_screen.
@@ -1150,6 +1168,11 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
// For surface other than screen, we call SyncUpdate. // For surface other than screen, we call SyncUpdate.
GAL_SyncUpdate (cur_pdc->surface); GAL_SyncUpdate (cur_pdc->surface);
} }
/* Since 5.0.13 */
if (fShow) {
GAL_UnlockSurface(cur_pdc->surface);
}
} }
#endif /* not defined _MGSCHEMA_SHAREDFB */ #endif /* not defined _MGSCHEMA_SHAREDFB */
@@ -1228,26 +1251,25 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
PDC cur_pdc = (PDC)pdc; PDC cur_pdc = (PDC)pdc;
const RECT* prc = NULL; const RECT* prc = NULL;
prc = &cur_pdc->rc_output;
/* houhh20080827, if --disable-cursor, mginit can not update auto(qvfb). */
#if 0
if (cur_pdc->surface == __gal_screen
&& mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer))
return;
if (fShow)
GAL_UpdateRect (cur_pdc->surface,
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
#else
if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) { if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) {
return; return;
} }
prc = &cur_pdc->rc_output;
/* Since 5.0.13 */
if (!fShow) {
GAL_LockSurface(cur_pdc->surface);
}
if (fShow) if (fShow)
GAL_UpdateRect (cur_pdc->surface, GAL_UpdateRect (cur_pdc->surface,
prc->left, prc->top, RECTWP(prc), RECTHP(prc)); prc->left, prc->top, RECTWP(prc), RECTHP(prc));
#endif
/* Since 5.0.13 */
if (fShow) {
GAL_UnlockSurface(cur_pdc->surface);
}
} }
#endif /* _MGHAVE_CURSOR */ #endif /* _MGHAVE_CURSOR */
+20 -2
View File
@@ -448,6 +448,11 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
prc = &cur_pdc->rc_output; prc = &cur_pdc->rc_output;
/* Since 5.0.13 */
if (!fShow) {
GAL_LockSurface(cur_pdc->surface);
}
if (cur_pdc->surface != __gal_screen) { if (cur_pdc->surface != __gal_screen) {
if (fShow) { if (fShow) {
GAL_UpdateRect (cur_pdc->surface, GAL_UpdateRect (cur_pdc->surface,
@@ -472,7 +477,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
prc->left, prc->top, RECTWP(prc), RECTHP(prc)); prc->left, prc->top, RECTWP(prc), RECTHP(prc));
//GAL_SyncUpdate (cur_pdc->surface); //GAL_SyncUpdate (cur_pdc->surface);
} }
return; goto done;
} }
if (fShow && nShowCount >= 0 && pCurCsr) { if (fShow && nShowCount >= 0 && pCurCsr) {
@@ -488,6 +493,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
//GAL_SyncUpdate (cur_pdc->surface); //GAL_SyncUpdate (cur_pdc->surface);
} }
} }
done:
/* Since 5.0.13 */
if (fShow) {
GAL_UnlockSurface(cur_pdc->surface);
}
} }
int GUIAPI ShowCursor (BOOL fShow) int GUIAPI ShowCursor (BOOL fShow)
@@ -516,9 +527,16 @@ void kernel_ShowCursorForGDI(BOOL fShow, void* pdc)
prc = &cur_pdc->rc_output; prc = &cur_pdc->rc_output;
if (fShow) /* Since 5.0.13 */
if (!fShow) {
GAL_LockSurface(cur_pdc->surface);
}
else {
GAL_UpdateRect (cur_pdc->surface, GAL_UpdateRect (cur_pdc->surface,
prc->left, prc->top, RECTWP(prc), RECTHP(prc)); prc->left, prc->top, RECTWP(prc), RECTHP(prc));
/* Since 5.0.13 */
GAL_UnlockSurface(cur_pdc->surface);
}
} }
#endif /* _MGHAVE_CURSOR */ #endif /* _MGHAVE_CURSOR */
+22 -4
View File
@@ -472,11 +472,15 @@ void kernel_ShowCursorForGDI (BOOL fShow, void *pdc)
prc = &cur_pdc->rc_output; prc = &cur_pdc->rc_output;
/* Since 5.0.13 */
if (!fShow) {
GAL_LockSurface(cur_pdc->surface);
}
if (cur_pdc->surface != __gal_screen) { if (cur_pdc->surface != __gal_screen) {
if (fShow) { if (fShow) {
GAL_UpdateRect (cur_pdc->surface, GAL_UpdateRect(cur_pdc->surface,
prc->left, prc->top, RECTWP(prc), RECTHP(prc)); prc->left, prc->top, RECTWP(prc), RECTHP(prc));
// GAL_SyncUpdate (cur_pdc->surface);
} }
} }
else { else {
@@ -500,7 +504,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void *pdc)
pthread_mutex_unlock(&__mg_mouselock); pthread_mutex_unlock(&__mg_mouselock);
// GAL_SyncUpdate (cur_pdc->surface); // GAL_SyncUpdate (cur_pdc->surface);
} }
return; goto done;
} }
if (fShow && nShowCount >= 0 && pCurCsr) { if (fShow && nShowCount >= 0 && pCurCsr) {
@@ -518,6 +522,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void *pdc)
// GAL_SyncUpdate (cur_pdc->surface); // GAL_SyncUpdate (cur_pdc->surface);
} }
} }
done:
/* Since 5.0.13 */
if (fShow) {
GAL_UnlockSurface(cur_pdc->surface);
}
} }
int GUIAPI ShowCursor(BOOL fShow) int GUIAPI ShowCursor(BOOL fShow)
@@ -558,9 +568,17 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
prc = &cur_pdc->rc_output; prc = &cur_pdc->rc_output;
if (fShow) /* Since 5.0.13 */
if (!fShow) {
GAL_LockSurface(cur_pdc->surface);
}
else {
GAL_UpdateRect (cur_pdc->surface, GAL_UpdateRect (cur_pdc->surface,
prc->left, prc->top, RECTWP(prc), RECTHP(prc)); prc->left, prc->top, RECTWP(prc), RECTHP(prc));
/* Since 5.0.13 */
GAL_UnlockSurface(cur_pdc->surface);
}
} }
#endif /* _MGHAVE_CURSOR */ #endif /* _MGHAVE_CURSOR */
+14 -9
View File
@@ -232,7 +232,7 @@ static int dskAddNewMainWindow (PMAINWIN pWin)
if (pWin->secondaryDC == HDC_INVALID) { if (pWin->secondaryDC == HDC_INVALID) {
/* remove the flag of WS_EX_AUTOSECONDARYDC */ /* remove the flag of WS_EX_AUTOSECONDARYDC */
pWin->dwExStyle = pWin->dwExStyle | WS_EX_AUTOSECONDARYDC; pWin->dwExStyle &= ~WS_EX_AUTOSECONDARYDC;
pWin->secondaryDC = 0; pWin->secondaryDC = 0;
} }
@@ -1403,7 +1403,7 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
else { else {
from = 0; from = 0;
} }
lock_zi_for_read (zi); lock_zi_for_read (zi);
from = __kernel_get_next_znode (zi, from); from = __kernel_get_next_znode (zi, from);
@@ -1429,6 +1429,8 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
/* Since 5.0.0 */ /* Since 5.0.0 */
case MSG_SETAUTOREPEAT: case MSG_SETAUTOREPEAT:
sg_msgAutoRepeat = *(const MSG*)lParam; sg_msgAutoRepeat = *(const MSG*)lParam;
/* start auto-repeat after 300ms */
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_timeout_usec/10000);
break; break;
/* Since 5.0.0 */ /* Since 5.0.0 */
@@ -1743,11 +1745,6 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
FreeZOrderNode (0, pCtrl->idx_znode, NULL); FreeZOrderNode (0, pCtrl->idx_znode, NULL);
} }
if (fFound) {
pCtrl->pcci->nUseCount --;
return 0;
}
if ((HWND)pCtrl == __mg_captured_wnd) { if ((HWND)pCtrl == __mg_captured_wnd) {
/* force release the capture */ /* force release the capture */
__mg_captured_wnd = 0; __mg_captured_wnd = 0;
@@ -1762,6 +1759,11 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
sg_msgAutoRepeat.hwnd = 0; sg_msgAutoRepeat.hwnd = 0;
} }
if (fFound) {
pCtrl->pcci->nUseCount--;
return 0;
}
return -1; return -1;
} }
@@ -1821,7 +1823,7 @@ static void dskRefreshAllWindow (const RECT* invrc)
info.is_empty_invrc = TRUE; info.is_empty_invrc = TRUE;
#ifdef _MGHAVE_MENU #ifdef _MGHAVE_MENU
dskForceCloseMenu (); dskForceCloseMenu ();
#endif #endif
SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0,
@@ -1873,9 +1875,12 @@ static void dskOnTimeout (void)
static DWORD uCounter = 0; static DWORD uCounter = 0;
static DWORD blink_counter = 0; static DWORD blink_counter = 0;
if (sg_msgAutoRepeat.hwnd != 0) { if (sg_msgAutoRepeat.hwnd != 0 &&
__mg_tick_counter >= sg_msgAutoRepeat.time) {
PostMessage (sg_msgAutoRepeat.hwnd, sg_msgAutoRepeat.message, PostMessage (sg_msgAutoRepeat.hwnd, sg_msgAutoRepeat.message,
sg_msgAutoRepeat.wParam, sg_msgAutoRepeat.lParam); sg_msgAutoRepeat.wParam, sg_msgAutoRepeat.lParam);
/* next auto-repeat msg after 50ms */
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_repeat_usec/10000);
} }
if (__mg_tick_counter < (blink_counter + 10)) if (__mg_tick_counter < (blink_counter + 10))
+41 -15
View File
@@ -55,6 +55,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <assert.h>
#include "common.h" #include "common.h"
@@ -78,6 +79,7 @@
#include "server.h" #include "server.h"
#include "drawsemop.h" #include "drawsemop.h"
#include "devfont.h" #include "devfont.h"
#include "event.h"
/******************************* global data *********************************/ /******************************* global data *********************************/
PMSGQUEUE __mg_dsk_msg_queue; PMSGQUEUE __mg_dsk_msg_queue;
@@ -231,14 +233,6 @@ static void init_desktop_win (void)
BOOL mg_InitDesktop (void) BOOL mg_InitDesktop (void)
{ {
#if 0 /* move to init-lite.c */
/* Since 5.0.0: allocate message queue for desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
_WRN_PRINTF ("failed to allocate message queue\n");
return FALSE;
}
#endif /* moved code */
#ifndef _MGSCHEMA_COMPOSITING #ifndef _MGSCHEMA_COMPOSITING
/* Init heap of clipping rects. */ /* Init heap of clipping rects. */
InitFreeClipRectList (&sg_FreeClipRectList, SIZE_CLIPRECTHEAP); InitFreeClipRectList (&sg_FreeClipRectList, SIZE_CLIPRECTHEAP);
@@ -259,7 +253,7 @@ BOOL mg_InitDesktop (void)
void mg_TerminateDesktop (void) void mg_TerminateDesktop (void)
{ {
/* Since 5.0.0: message queue for desktop thread was dynamically allocated */ /* Since 5.0.0: message queue for desktop thread was dynamically allocated */
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
#ifndef _MGSCHEMA_COMPOSITING #ifndef _MGSCHEMA_COMPOSITING
@@ -1527,6 +1521,33 @@ static BOOL _cb_update_rc_nocli (void* context,
} }
#endif /* not defined _MGSCHEMA_COMPOSITING */ #endif /* not defined _MGSCHEMA_COMPOSITING */
/* Since 5.2.0 */
ZORDERNODE *__mg_find_znode_by_client_hwnd (int cli, HWND hwnd)
{
ZORDERINFO* zi = get_zorder_info(cli);
ZORDERNODE* nodes;
if (zi == NULL)
return NULL;
int level, slot = -1;
nodes = GET_ZORDERNODE(zi);
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
slot = zi->first_in_levels[level];
for (; slot > 0; slot = nodes[slot].next) {
if (nodes[slot].cli == cli && nodes[slot].hwnd == hwnd) {
goto found;
}
}
}
return NULL;
found:
assert(slot >= 0);
return nodes + slot;
}
int __mg_remove_all_znodes_of_client (int cli) int __mg_remove_all_znodes_of_client (int cli)
{ {
BOOL has_special = FALSE; BOOL has_special = FALSE;
@@ -2756,6 +2777,8 @@ static LRESULT dskWindowMessageHandler (UINT message,
/* Since 5.0.0 */ /* Since 5.0.0 */
case MSG_SETAUTOREPEAT: case MSG_SETAUTOREPEAT:
sg_msgAutoRepeat = *(const MSG*)lParam; sg_msgAutoRepeat = *(const MSG*)lParam;
/* start auto-repeat after 300ms */
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_timeout_usec/10000);
break; break;
} }
@@ -3553,11 +3576,6 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
cliFreeZOrderNode ((PMAINWIN)pCtrl); cliFreeZOrderNode ((PMAINWIN)pCtrl);
} }
if (fFound) {
pCtrl->pcci->nUseCount --;
return 0;
}
if ((HWND)pCtrl == __mg_captured_wnd) { if ((HWND)pCtrl == __mg_captured_wnd) {
/* force release the capture */ /* force release the capture */
__mg_captured_wnd = 0; __mg_captured_wnd = 0;
@@ -3572,6 +3590,11 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
sg_msgAutoRepeat.hwnd = 0; sg_msgAutoRepeat.hwnd = 0;
} }
if (fFound) {
pCtrl->pcci->nUseCount--;
return 0;
}
return -1; return -1;
} }
@@ -4212,9 +4235,12 @@ static void dskOnTimeout (void)
static UINT uCounter = 0; static UINT uCounter = 0;
static UINT blink_counter = 0; static UINT blink_counter = 0;
if (sg_msgAutoRepeat.hwnd != 0) { if (sg_msgAutoRepeat.hwnd != 0 &&
__mg_tick_counter >= sg_msgAutoRepeat.time) {
PostMessage (sg_msgAutoRepeat.hwnd, sg_msgAutoRepeat.message, PostMessage (sg_msgAutoRepeat.hwnd, sg_msgAutoRepeat.message,
sg_msgAutoRepeat.wParam, sg_msgAutoRepeat.lParam); sg_msgAutoRepeat.wParam, sg_msgAutoRepeat.lParam);
/* next auto-repeat msg after 50ms */
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_repeat_usec/10000);
} }
if (__mg_tick_counter < (blink_counter + 10)) if (__mg_tick_counter < (blink_counter + 10))
+2 -9
View File
@@ -74,6 +74,7 @@
#include "dc.h" #include "dc.h"
#include "misc.h" #include "misc.h"
#include "devfont.h" #include "devfont.h"
#include "event.h"
#ifndef WIN32 #ifndef WIN32
#include <sys/termios.h> #include <sys/termios.h>
@@ -102,14 +103,6 @@ BOOL mg_InitDesktop (void)
int ret; int ret;
RECT rcScr = GetScreenRect(); RECT rcScr = GetScreenRect();
#if 0 /* move to init-lite.c */
/* Since 5.0.0: allocate message queue for desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
_WRN_PRINTF ("failed to allocate message queue\n");
return FALSE;
}
#endif /* moved code */
/* /*
* Init ZOrderInfo here. * Init ZOrderInfo here.
*/ */
@@ -153,7 +146,7 @@ BOOL mg_InitDesktop (void)
void mg_TerminateDesktop (void) void mg_TerminateDesktop (void)
{ {
if (__mg_dsk_msg_queue) { if (__mg_dsk_msg_queue) {
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
} }
+15 -4
View File
@@ -72,6 +72,7 @@
#include "dc.h" #include "dc.h"
#include "misc.h" #include "misc.h"
#include "devfont.h" #include "devfont.h"
#include "event.h"
/******************************* global data *********************************/ /******************************* global data *********************************/
/* pointer to desktop message queue */ /* pointer to desktop message queue */
@@ -140,19 +141,29 @@ BOOL mg_InitDesktop (void)
#include "debug.h" #include "debug.h"
static IDLEHANDLER std_idle_handler;
static BOOL idle_handler_for_desktop_thread (MSGQUEUE *msg_queue, BOOL wait)
{
__mg_update_tick_count (NULL);
return std_idle_handler (msg_queue, wait);
}
void* __kernel_desktop_main (void* data) void* __kernel_desktop_main (void* data)
{ {
MSG Msg; MSG Msg;
/* init message queue of desktop thread */ /* init message queue of desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) { if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread (TRUE)) ) {
_ERR_PRINTF ("failed to allocate message queue\n"); _ERR_PRINTF ("failed to allocate message queue\n");
sem_post ((sem_t*)data); sem_post ((sem_t*)data);
return NULL; return NULL;
} }
/* for threads mode, the idle handler for desktop thread is NULL */ /* For bug reported in Issue #116, under threads mode, the idle handler
__mg_dsk_msg_queue->OnIdle = NULL; for the desktop thread should call __mg_update_tick_count () */
std_idle_handler = __mg_dsk_msg_queue->OnIdle;
__mg_dsk_msg_queue->OnIdle = idle_handler_for_desktop_thread;
/* init desktop window */ /* init desktop window */
init_desktop_win (); init_desktop_win ();
@@ -191,7 +202,7 @@ void* __kernel_desktop_main (void* data)
#endif #endif
} }
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
return NULL; return NULL;
} }
+39 -29
View File
@@ -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~2022, 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
@@ -597,55 +597,63 @@ static void reset_window (PMAINWIN pWin, RECT* rcWin)
#endif #endif
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
#ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
/*for unix system, using read/write lock*/ static inline void lock_zi_for_change (ZORDERINFO* zi)
static inline void lock_zi_for_change (const ZORDERINFO* zi)
{ {
pthread_rwlock_wrlock(&((ZORDERINFO*)zi)->rwlock); pthread_rwlock_wrlock(&zi->rwlock);
zi->rwlock_owner = pthread_self();
} }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) static inline void unlock_zi_for_change (ZORDERINFO* zi)
{ {
pthread_rwlock_unlock(&((ZORDERINFO*)zi)->rwlock); pthread_rwlock_unlock(&zi->rwlock);
zi->rwlock_owner = 0;
} }
static inline void lock_zi_for_read (const ZORDERINFO* zi) static inline void lock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_rwlock_rdlock(&((ZORDERINFO*)zi)->rwlock); if (zi->rwlock_owner == pthread_self()) {
return;
}
pthread_rwlock_rdlock(&zi->rwlock);
} }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) static inline void unlock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_rwlock_unlock(&((ZORDERINFO*)zi)->rwlock); if (zi->rwlock_owner == pthread_self()) {
return;
}
pthread_rwlock_unlock(&zi->rwlock);
} }
#else /* __NOUNIX__ */ # else /* __ZI_USE_RWLOCK */
/*for non-unix system, using mutex*/ static inline void lock_zi_for_change (ZORDERINFO* zi)
static inline void lock_zi_for_change (const ZORDERINFO* zi)
{ {
pthread_mutex_lock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_lock(&zi->mutex);
} }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) static inline void unlock_zi_for_change (ZORDERINFO* zi)
{ {
pthread_mutex_unlock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_unlock(&zi->mutex);
} }
static inline void lock_zi_for_read (const ZORDERINFO* zi) static inline void lock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_mutex_lock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_lock(&zi->mutex);
} }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) static inline void unlock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_mutex_unlock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_unlock(&zi->mutex);
} }
#endif /* __NOUNIX__ */ # endif /* notdef __ZI_USE_RWLOCK */
#elif defined(_MGRM_STANDALONE) #elif defined(_MGRM_STANDALONE)
static inline void lock_zi_for_change (const ZORDERINFO* zi) { } static inline void lock_zi_for_change (ZORDERINFO* zi) { }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) { } static inline void unlock_zi_for_change (ZORDERINFO* zi) { }
static inline void lock_zi_for_read (const ZORDERINFO* zi) { } static inline void lock_zi_for_read (ZORDERINFO* zi) { }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) { } static inline void unlock_zi_for_read (ZORDERINFO* zi) { }
#else /* for procs */ #else /* for procs */
/* NULL. see desktop-procs.c */ /* NULL. see desktop-procs.c */
#endif /* _MGRM_THREADS */ #endif /* _MGRM_THREADS */
@@ -3641,6 +3649,9 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL); do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
if (nodes [0].flags & ZOF_IF_REFERENCE) { if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP, SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld); MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
@@ -3680,9 +3691,6 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
update_client_window_rgn (nodes [idx_znode].cli, update_client_window_rgn (nodes [idx_znode].cli,
nodes [idx_znode].hwnd); nodes [idx_znode].hwnd);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
} }
else { else {
lock_zi_for_change (zi); lock_zi_for_change (zi);
@@ -4499,7 +4507,9 @@ int __mg_join_all_message_threads (void)
list_for_each (l, &msg_queue_list) { list_for_each (l, &msg_queue_list) {
MSGQUEUE *msg_queue = (MSGQUEUE*)l; MSGQUEUE *msg_queue = (MSGQUEUE*)l;
#ifndef NDEBUG
dump_message_queue (msg_queue, __func__); dump_message_queue (msg_queue, __func__);
#endif
pthread_cancel (msg_queue->th); pthread_cancel (msg_queue->th);
} }
+14 -13
View File
@@ -89,8 +89,9 @@
struct timeval __mg_event_timeout; struct timeval __mg_event_timeout;
static DWORD timeoutusec; DWORD __mg_timeout_usec;
static DWORD repeatusec; DWORD __mg_repeat_usec;
static DWORD dblclicktime; static DWORD dblclicktime;
#ifndef _MGRM_THREADS #ifndef _MGRM_THREADS
@@ -121,8 +122,8 @@ static void GetTimeout (void)
char szValue [11]; char szValue [11];
int mytimeoutusec, myrepeatusec; int mytimeoutusec, myrepeatusec;
timeoutusec = DEF_USEC_TIMEOUT; __mg_timeout_usec = DEF_USEC_TIMEOUT;
repeatusec = DEF_REPEAT_TIME; __mg_repeat_usec = DEF_REPEAT_TIME;
if (GetMgEtcValue (EVENTPARA, EVENTPARA_REPEATUSEC, szValue, 10) < 0) if (GetMgEtcValue (EVENTPARA, EVENTPARA_REPEATUSEC, szValue, 10) < 0)
return; return;
@@ -133,8 +134,8 @@ static void GetTimeout (void)
mytimeoutusec = atoi(szValue); mytimeoutusec = atoi(szValue);
if (myrepeatusec >= 0 && mytimeoutusec > 0) { if (myrepeatusec >= 0 && mytimeoutusec > 0) {
timeoutusec = mytimeoutusec; __mg_timeout_usec = mytimeoutusec;
repeatusec = myrepeatusec; __mg_repeat_usec = myrepeatusec;
} }
} }
@@ -208,7 +209,7 @@ static void ResetKeyEvent(void)
IAL_SetLeds (slock | (numlock << 1) | (capslock << 2)); IAL_SetLeds (slock | (numlock << 1) | (capslock << 2));
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = timeoutusec; __mg_event_timeout.tv_usec = __mg_timeout_usec;
#ifndef _MGRM_THREADS #ifndef _MGRM_THREADS
#ifdef _MGRM_PROCESSES #ifdef _MGRM_PROCESSES
@@ -216,8 +217,8 @@ static void ResetKeyEvent(void)
SHAREDRES_SHIFTSTATUS = status; SHAREDRES_SHIFTSTATUS = status;
#endif #endif
timeout_threshold = timeoutusec / 10000; timeout_threshold = __mg_timeout_usec / 10000;
repeat_threshold = repeatusec / 10000; repeat_threshold = __mg_repeat_usec / 10000;
timeout_count = timeout_threshold; timeout_count = timeout_threshold;
#endif #endif
} }
@@ -631,7 +632,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
// set repeat time // set repeat time
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = repeatusec; __mg_event_timeout.tv_usec = __mg_repeat_usec;
// repeat last event // repeat last event
if (old_lwe.type == LWETYPE_KEY if (old_lwe.type == LWETYPE_KEY
@@ -652,7 +653,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
old_lwe.data.me.event == ME_MIDDLEDOWN))) { old_lwe.data.me.event == ME_MIDDLEDOWN))) {
// reset delay time // reset delay time
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = timeoutusec; __mg_event_timeout.tv_usec = __mg_timeout_usec;
} }
lwe->type = LWETYPE_TIMEOUT; lwe->type = LWETYPE_TIMEOUT;
@@ -880,7 +881,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
memcpy (oldkeystate, keystate, nr_keys); memcpy (oldkeystate, keystate, nr_keys);
memcpy (&old_lwe, lwe, sizeof (LWEVENT)); memcpy (&old_lwe, lwe, sizeof (LWEVENT));
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = timeoutusec; __mg_event_timeout.tv_usec = __mg_timeout_usec;
return 1; return 1;
} }
@@ -899,7 +900,7 @@ mouseret:
me->status = status; me->status = status;
memcpy (&old_lwe, lwe, sizeof (LWEVENT)); memcpy (&old_lwe, lwe, sizeof (LWEVENT));
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = timeoutusec; __mg_event_timeout.tv_usec = __mg_timeout_usec;
return 1; return 1;
} }
#endif #endif
+8 -8
View File
@@ -66,7 +66,7 @@ static struct FIXSTR {
BYTE bitmap[LEN_BITMAP]; BYTE bitmap[LEN_BITMAP];
int offset[NR_HEAP]; int offset[NR_HEAP];
char* heap[NR_HEAP + 1]; char* heap[NR_HEAP + 1];
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
} FixStrHeap; } FixStrHeap;
@@ -98,7 +98,7 @@ BOOL mg_InitFixStr (void)
offset += 1<<i; offset += 1<<i;
} }
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_init (&FixStrHeap.lock, NULL); pthread_mutex_init (&FixStrHeap.lock, NULL);
#endif #endif
return TRUE; return TRUE;
@@ -106,7 +106,7 @@ BOOL mg_InitFixStr (void)
void mg_TerminateFixStr (void) void mg_TerminateFixStr (void)
{ {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_destroy (&FixStrHeap.lock); pthread_mutex_destroy (&FixStrHeap.lock);
#endif #endif
free (FixStrHeap.heap[0]); free (FixStrHeap.heap[0]);
@@ -154,7 +154,7 @@ char* GUIAPI FixStrAlloc (int len)
// .. // ..
// if i == 0; then bufflen = 512 // if i == 0; then bufflen = 512
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&FixStrHeap.lock); pthread_mutex_lock (&FixStrHeap.lock);
#endif #endif
@@ -166,7 +166,7 @@ char* GUIAPI FixStrAlloc (int len)
for(j = 0; j < 8; j++) { for(j = 0; j < 8; j++) {
if (*bitmap & (0x80 >> j)) { if (*bitmap & (0x80 >> j)) {
*bitmap &= (~(0x80 >> j)); *bitmap &= (~(0x80 >> j));
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
#if 0 #if 0
@@ -181,7 +181,7 @@ char* GUIAPI FixStrAlloc (int len)
bitmap++; bitmap++;
} }
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
return (char*)malloc (len + 1); return (char*)malloc (len + 1);
@@ -216,7 +216,7 @@ void GUIAPI FreeFixStr (char* str)
// if i == 0; then bufflen = 512 // if i == 0; then bufflen = 512
bufflen = 1 << (NR_HEAP + 1 - i); bufflen = 1 << (NR_HEAP + 1 - i);
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&FixStrHeap.lock); pthread_mutex_lock (&FixStrHeap.lock);
#endif #endif
heap = FixStrHeap.heap[i]; heap = FixStrHeap.heap[i];
@@ -236,7 +236,7 @@ void GUIAPI FreeFixStr (char* str)
bitmap = bitmap + (stroff>>3); bitmap = bitmap + (stroff>>3);
*bitmap |= (0x80 >> (stroff%8)); *bitmap |= (0x80 >> (stroff%8));
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
} }
+1 -1
View File
@@ -386,7 +386,7 @@ int InitGUI (int argc, const char* agr[])
/* Since 5.0.0 /* Since 5.0.0
allocate message queue for desktop thread before starting client. */ allocate message queue for desktop thread before starting client. */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) { if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread (TRUE)) ) {
err_message (step, "Failed to allocate message queue!"); err_message (step, "Failed to allocate message queue!");
return step; return step;
} }
+3 -16
View File
@@ -391,14 +391,6 @@ static BOOL InstallSEGVHandler (void)
#include <locale.h> #include <locale.h>
#endif #endif
static IDLEHANDLER std_idle_handler;
static BOOL idle_handler_for_main_thread (MSGQUEUE *msg_queue, BOOL wait)
{
__mg_update_tick_count (NULL);
return std_idle_handler (msg_queue, wait);
}
int GUIAPI InitGUI (int args, const char *agr[]) int GUIAPI InitGUI (int args, const char *agr[])
{ {
char engine [LEN_ENGINE_NAME + 1]; char engine [LEN_ENGINE_NAME + 1];
@@ -578,16 +570,11 @@ int GUIAPI InitGUI (int args, const char *agr[])
/* init message queue of main GUI thread */ /* init message queue of main GUI thread */
step++; step++;
if (!(msg_queue = mg_AllocMsgQueueForThisThread ())) { if (!(msg_queue = mg_AllocMsgQueueForThisThread (TRUE))) {
_ERR_PRINTF ("KERNEL>InitGUI: failed to allocate message queue!\n"); _ERR_PRINTF ("KERNEL>InitGUI: failed to allocate message queue!\n");
goto failure; goto failure;
} }
/* for threads mode, the idle handler for the main threads should
call __mg_update_tick_count () */
std_idle_handler = msg_queue->OnIdle;
msg_queue->OnIdle = idle_handler_for_main_thread;
/* init timer for tick counter */ /* init timer for tick counter */
step++; step++;
if (!mg_InitTimer (FALSE)) { if (!mg_InitTimer (FALSE)) {
@@ -617,6 +604,8 @@ void GUIAPI TerminateGUI (int not_used)
{ {
mg_TerminateTimer (FALSE); mg_TerminateTimer (FALSE);
mg_FreeMsgQueueForThisThread (TRUE);
/* Since 5.0.0 */ /* Since 5.0.0 */
SendNotifyMessage (HWND_DESKTOP, MSG_ENDSESSION, 0, 0); SendNotifyMessage (HWND_DESKTOP, MSG_ENDSESSION, 0, 0);
pthread_join (__mg_dsk_msg_queue->th, NULL); pthread_join (__mg_dsk_msg_queue->th, NULL);
@@ -655,8 +644,6 @@ void GUIAPI TerminateGUI (int not_used)
miFreeArcCache (); miFreeArcCache ();
#endif #endif
mg_FreeMsgQueueForThisThread ();
deleteThreadInfoKey (); deleteThreadInfoKey ();
mg_TerminateSliceAllocator(); mg_TerminateSliceAllocator();
+27 -17
View File
@@ -60,7 +60,6 @@
#include "gdi.h" #include "gdi.h"
#include "window.h" #include "window.h"
#include "blockheap.h"
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
@@ -159,7 +158,7 @@ void mg_DestroyFreeQMSGList (void)
pthread_key_t __mg_threadinfo_key; pthread_key_t __mg_threadinfo_key;
#endif #endif
MSGQUEUE* mg_AllocMsgQueueForThisThread (void) MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in)
{ {
MSGQUEUE* pMsgQueue; MSGQUEUE* pMsgQueue;
@@ -177,13 +176,14 @@ MSGQUEUE* mg_AllocMsgQueueForThisThread (void)
pthread_setspecific (__mg_threadinfo_key, pMsgQueue); pthread_setspecific (__mg_threadinfo_key, pMsgQueue);
#endif #endif
// register this new message queue if (sign_in) {
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD, SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue); MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue);
}
return pMsgQueue; return pMsgQueue;
} }
void mg_FreeMsgQueueForThisThread (void) void mg_FreeMsgQueueForThisThread (BOOL sign_off)
{ {
MSGQUEUE* pMsgQueue; MSGQUEUE* pMsgQueue;
@@ -194,6 +194,11 @@ void mg_FreeMsgQueueForThisThread (void)
_WRN_PRINTF ("there are still some windows not destroyed\n"); _WRN_PRINTF ("there are still some windows not destroyed\n");
} }
if (sign_off) {
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNOUT, (LPARAM)pMsgQueue);
}
mg_DestroyMsgQueue (pMsgQueue); mg_DestroyMsgQueue (pMsgQueue);
free (pMsgQueue); free (pMsgQueue);
@@ -823,8 +828,9 @@ checkagain:
goto got_ret; goto got_ret;
} }
} }
else else {
pMsgQueue->dwState &= ~QS_POSTMSG; pMsgQueue->dwState &= ~QS_POSTMSG;
}
} }
/* /*
@@ -949,6 +955,12 @@ checkagain:
goto checkagain; goto checkagain;
} }
else {
/* no message, wait again. */
if (pMsgQueue->OnIdle && !pMsgQueue->OnIdle (pMsgQueue, FALSE)) {
handle_idle_message (pMsgQueue);
}
}
#else /* defined _MGHAVE_VIRTUAL_WINDOW */ #else /* defined _MGHAVE_VIRTUAL_WINDOW */
/* no message, idle */ /* no message, idle */
if (bWait) { if (bWait) {
@@ -958,6 +970,11 @@ checkagain:
} }
goto checkagain; goto checkagain;
} }
else {
if (!pMsgQueue->OnIdle (pMsgQueue, FALE)) {
handle_idle_message (pMsgQueue);
}
}
#endif /* not defined _MGHAVE_VIRTUAL_WINDOW */ #endif /* not defined _MGHAVE_VIRTUAL_WINDOW */
/* no message */ /* no message */
@@ -1410,6 +1427,9 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
to the controls of the main window will be thrown away as well. */ to the controls of the main window will be thrown away as well. */
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd) int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
{ {
/* For a main window, we use pMainWin to check whether we
should throw away a message for controls of the main window.
Note that checkAndGetMainWindowIfControl returns NULL for non control. */
PMAINWIN pMainWin = (PMAINWIN)hWnd; PMAINWIN pMainWin = (PMAINWIN)hWnd;
PMSG pMsg; PMSG pMsg;
PQMSG pQMsg; PQMSG pQMsg;
@@ -1421,16 +1441,6 @@ int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
LOCK_MSGQ (pMsgQueue); LOCK_MSGQ (pMsgQueue);
/* for virtual window and main window, use pMainWin to check whether we
should throw away a message for controls of a main window.
checkAndGetMainWindowIfControl returns NULL for non control. */
if (pMainWin != HWND_NULL && pMainWin != HWND_INVALID &&
(pMainWin->WinType == TYPE_MAINWIN ||
pMainWin->WinType == TYPE_VIRTWIN))
pMainWin = (PMAINWIN)hWnd;
else
pMainWin = NULL;
if (pMsgQueue->pFirstNotifyMsg) { if (pMsgQueue->pFirstNotifyMsg) {
PQMSG pPrev = NULL, pNext; PQMSG pPrev = NULL, pNext;
pQMsg = pMsgQueue->pFirstNotifyMsg; pQMsg = pMsgQueue->pFirstNotifyMsg;
+31 -173
View File
File diff suppressed because it is too large Load Diff
+20 -8
View File
@@ -243,11 +243,23 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_mask
#endif /* deprecated code */ #endif /* deprecated code */
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
#ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
pthread_rwlock_init(&__mg_zorder_info->rwlock, NULL); pthread_rwlock_init(&__mg_zorder_info->rwlock, NULL);
#else __mg_zorder_info->rwlock_owner = 0;
pthread_mutex_init(&__mg_zorder_info->rwlock, NULL); # else
#endif do {
int ret;
pthread_mutexattr_t my_attr;
ret = pthread_mutexattr_init(&my_attr);
assert(ret == 0);
ret = pthread_mutexattr_settype(&my_attr, PTHREAD_MUTEX_RECURSIVE);
assert(ret == 0);
pthread_mutex_init(&__mg_zorder_info->mutex, &my_attr);
ret = pthread_mutexattr_destroy(&my_attr);
assert(ret == 0);
(void)ret;
} while (0);
# endif
#endif #endif
return 0; return 0;
#endif #endif
@@ -261,11 +273,11 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
#else #else
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
#ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
pthread_rwlock_destroy(&zi->rwlock); pthread_rwlock_destroy(&zi->rwlock);
#else # else
pthread_mutex_destroy(&zi->rwlock); pthread_mutex_destroy(&zi->mutex);
#endif # endif
#endif #endif
free (zi); free (zi);
__mg_zorder_info = NULL; __mg_zorder_info = NULL;
+5 -1
View File
@@ -187,7 +187,8 @@ int __mg_bmp_compute_pitch(int bpp, Uint32 width, Uint32 *pitch, BOOL does_round
return bytespp; return bytespp;
} }
void* GUIAPI InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp, RGB* pal) void* GUIAPI
InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp, RGB* pal)
{ {
int type; int type;
LOAD_MYBITMAP_INFO* load_info; LOAD_MYBITMAP_INFO* load_info;
@@ -209,8 +210,11 @@ void* GUIAPI InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp,
my_bmp->frames = 1; my_bmp->frames = 1;
my_bmp->depth = GetGDCapability (HDC_SCREEN, GDCAP_BPP) << 3; my_bmp->depth = GetGDCapability (HDC_SCREEN, GDCAP_BPP) << 3;
// initialize the palette with the screen palette.
if (my_bmp->depth <= 8) if (my_bmp->depth <= 8)
GetPalette (HDC_SCREEN, 0, 256, (GAL_Color*)pal); GetPalette (HDC_SCREEN, 0, 256, (GAL_Color*)pal);
else
memset (pal, 0, sizeof(RGB) * 256); // reset the palette.
/* This is just for gray screen. If your screen is gray, /* This is just for gray screen. If your screen is gray,
* please define this macro _GRAY_SCREEN. * please define this macro _GRAY_SCREEN.
+5 -3
View File
@@ -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~2021, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, 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
@@ -106,7 +106,8 @@ void* __mg_init_webp(MG_RWops *fp, MYBITMAP *mybmp, RGB *pal)
else else
goto error; goto error;
sc = WebPGetFeatures(info->data, info->sz_data, &info->config.input); sc = WebPGetFeatures((const uint8_t *)info->data, info->sz_data,
&info->config.input);
if (sc == VP8_STATUS_OK) { if (sc == VP8_STATUS_OK) {
break; break;
} }
@@ -210,7 +211,8 @@ int __mg_load_webp(MG_RWops *fp, void *init_info, MYBITMAP *mybmp,
while (1) { while (1) {
int n; int n;
VP8StatusCode status = WebPIAppend(idec, info->data, info->sz_data); VP8StatusCode status = WebPIAppend(idec,
(const uint8_t *)info->data, info->sz_data);
if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) { if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) {
_ERR_PRINTF ("__mg_load_webp: WebPIAppend failed: %d\n", status); _ERR_PRINTF ("__mg_load_webp: WebPIAppend failed: %d\n", status);
rc = ERR_BMP_LOAD; rc = ERR_BMP_LOAD;
+79 -75
View File
@@ -462,99 +462,100 @@ static void RLEClipBlit(int w, Uint8 *srcbuf, GAL_Surface *dst,
} }
/* blit a colorkeyed RLE surface */ /* blit a colorkeyed RLE surface */
int GAL_RLEBlit(GAL_Surface *src, GAL_Rect *srcrect, int GAL_RLEBlit(GAL_VideoDevice *video, GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect) GAL_Surface *dst, GAL_Rect *dstrect)
{ {
Uint8 *dstbuf; (void)video;
Uint8 *srcbuf;
int x, y;
int w = src->w;
unsigned alpha;
/* Set up the source and destination pointers */ Uint8 *dstbuf;
x = dstrect->x; Uint8 *srcbuf;
y = dstrect->y; int x, y;
dstbuf = (Uint8 *)dst->pixels int w = src->w;
+ y * dst->pitch + x * src->format->BytesPerPixel; unsigned alpha;
srcbuf = (Uint8 *)src->map->sw_data->aux_data;
{ /* Set up the source and destination pointers */
/* skip lines at the top if neccessary */ x = dstrect->x;
int vskip = srcrect->y; y = dstrect->y;
int ofs = 0; dstbuf = (Uint8 *)dst->pixels
if(vskip) { + y * dst->pitch + x * src->format->BytesPerPixel;
srcbuf = (Uint8 *)src->map->sw_data->aux_data;
{
/* skip lines at the top if neccessary */
int vskip = srcrect->y;
int ofs = 0;
if(vskip) {
#define RLESKIP(bpp, Type) \ #define RLESKIP(bpp, Type) \
for(;;) { \ for(;;) { \
int run; \ int run; \
ofs += *(Type *)srcbuf; \ ofs += *(Type *)srcbuf; \
run = ((Type *)srcbuf)[1]; \ run = ((Type *)srcbuf)[1]; \
srcbuf += sizeof(Type) * 2; \ srcbuf += sizeof(Type) * 2; \
if(run) { \ if(run) { \
srcbuf += run * bpp; \ srcbuf += run * bpp; \
ofs += run; \ ofs += run; \
} else if(!ofs) \ } else if(!ofs) \
goto done; \ goto done; \
if(ofs == w) { \ if(ofs == w) { \
ofs = 0; \ ofs = 0; \
if(!--vskip) \ if(!--vskip) \
break; \ break; \
} \ } \
} }
switch(src->format->BytesPerPixel) { switch(src->format->BytesPerPixel) {
case 1: RLESKIP(1, Uint8); break; case 1: RLESKIP(1, Uint8); break;
case 2: RLESKIP(2, Uint8); break; case 2: RLESKIP(2, Uint8); break;
case 3: RLESKIP(3, Uint8); break; case 3: RLESKIP(3, Uint8); break;
case 4: RLESKIP(4, Uint16); break; case 4: RLESKIP(4, Uint16); break;
} }
#undef RLESKIP #undef RLESKIP
}
} }
}
alpha = (src->flags & GAL_SRCALPHA) == GAL_SRCALPHA alpha = (src->flags & GAL_SRCALPHA) == GAL_SRCALPHA
? src->format->alpha : 255; ? src->format->alpha : 255;
/* if left or right edge clipping needed, call clip blit */ /* if left or right edge clipping needed, call clip blit */
if ( srcrect->x || srcrect->w != src->w ) { if ( srcrect->x || srcrect->w != src->w ) {
RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha); RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha);
} else { } else {
GAL_PixelFormat *fmt = src->format; GAL_PixelFormat *fmt = src->format;
#define RLEBLIT(bpp, Type, do_blit) \ #define RLEBLIT(bpp, Type, do_blit) \
do { \ do { \
int linecount = srcrect->h; \ int linecount = srcrect->h; \
int ofs = 0; \ int ofs = 0; \
for(;;) { \ for(;;) { \
unsigned run; \ unsigned run; \
ofs += *(Type *)srcbuf; \ ofs += *(Type *)srcbuf; \
run = ((Type *)srcbuf)[1]; \ run = ((Type *)srcbuf)[1]; \
srcbuf += 2 * sizeof(Type); \ srcbuf += 2 * sizeof(Type); \
if(run) { \ if(run) { \
do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \ do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \
srcbuf += run * bpp; \ srcbuf += run * bpp; \
ofs += run; \ ofs += run; \
} else if(!ofs) \ } else if(!ofs) \
break; \ break; \
if(ofs == w) { \ if(ofs == w) { \
ofs = 0; \ ofs = 0; \
dstbuf += dst->pitch; \ dstbuf += dst->pitch; \
if(!--linecount) \ if(!--linecount) \
break; \ break; \
} \
} \ } \
} while(0) } \
} while(0)
CHOOSE_BLIT(RLEBLIT, alpha, fmt); CHOOSE_BLIT(RLEBLIT, alpha, fmt);
#undef RLEBLIT #undef RLEBLIT
} }
done: done:
return(0); return(0);
} }
#undef OPAQUE_BLIT #undef OPAQUE_BLIT
@@ -720,9 +721,12 @@ static void RLEAlphaClipBlit(int w, Uint8 *srcbuf, GAL_Surface *dst,
} }
/* blit a pixel-alpha RLE surface */ /* blit a pixel-alpha RLE surface */
int GAL_RLEAlphaBlit(GAL_Surface *src, GAL_Rect *srcrect, int GAL_RLEAlphaBlit(GAL_VideoDevice *video,
GAL_Surface *dst, GAL_Rect *dstrect) GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect)
{ {
(void)video;
int x, y; int x, y;
int w = src->w; int w = src->w;
Uint8 *srcbuf, *dstbuf; Uint8 *srcbuf, *dstbuf;
@@ -1502,7 +1506,7 @@ void GAL_UnRLESurface(GAL_Surface *surface, int recode)
full.h = surface->h; full.h = surface->h;
alpha_flag = surface->flags & GAL_SRCALPHA; alpha_flag = surface->flags & GAL_SRCALPHA;
surface->flags &= ~GAL_SRCALPHA; /* opaque blit */ surface->flags &= ~GAL_SRCALPHA; /* opaque blit */
GAL_RLEBlit(surface, &full, surface, &full); GAL_RLEBlit(NULL, surface, &full, surface, &full);
surface->flags |= alpha_flag; surface->flags |= alpha_flag;
} else } else
UnRLEAlpha(surface); UnRLEAlpha(surface);
+6 -4
View File
@@ -47,9 +47,11 @@
/* Useful functions and variables from RLEaccel.c */ /* Useful functions and variables from RLEaccel.c */
extern int GAL_RLESurface(GAL_Surface *surface); extern int GAL_RLESurface(GAL_Surface *surface);
extern int GAL_RLEBlit(GAL_Surface *src, GAL_Rect *srcrect, extern int GAL_RLEBlit(GAL_VideoDevice *video,
GAL_Surface *dst, GAL_Rect *dstrect); GAL_Surface *src, GAL_Rect *srcrect,
extern int GAL_RLEAlphaBlit(GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
GAL_Surface *dst, GAL_Rect *dstrect); extern int GAL_RLEAlphaBlit(GAL_VideoDevice *video,
GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect);
extern void GAL_UnRLESurface(GAL_Surface *surface, int recode); extern void GAL_UnRLESurface(GAL_Surface *surface, int recode);
-2
View File
@@ -157,8 +157,6 @@ static GAL_VideoDevice *BF533_CreateDevice(int devindex)
device->AllocHWSurface = BF533_AllocHWSurface; device->AllocHWSurface = BF533_AllocHWSurface;
device->CheckHWBlit = NULL; device->CheckHWBlit = NULL;
device->FillHWRect = NULL; device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = BF533_FreeHWSurface; device->FreeHWSurface = BF533_FreeHWSurface;
device->UpdateRects = BF533_UpdateRects; device->UpdateRects = BF533_UpdateRects;
+21 -15
View File
@@ -57,9 +57,12 @@
#include "memops.h" #include "memops.h"
/* The general purpose software blit routine */ /* The general purpose software blit routine */
static int GAL_SoftBlit(GAL_Surface *src, GAL_Rect *srcrect, static int GAL_SoftBlit(GAL_VideoDevice *video,
GAL_Surface *dst, GAL_Rect *dstrect) GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect)
{ {
(void)video;
int okay; int okay;
/* Everything is okay at the beginning... */ /* Everything is okay at the beginning... */
@@ -141,6 +144,7 @@ static void GAL_BlitCopyOverlap(GAL_BlitInfo *info)
w = info->d_width*info->dst->BytesPerPixel; w = info->d_width*info->dst->BytesPerPixel;
h = info->d_height; h = info->d_height;
src = info->s_pixels; src = info->s_pixels;
dst = info->d_pixels; dst = info->d_pixels;
srcskip = w+info->s_skip; srcskip = w+info->s_skip;
@@ -165,12 +169,14 @@ static void GAL_BlitCopyOverlap(GAL_BlitInfo *info)
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
#include <pixman.h> #include <pixman.h>
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect, static int GAL_PixmanBlit(GAL_VideoDevice *video,
struct GAL_Surface *src, GAL_Rect *srcrect,
struct GAL_Surface *dst, GAL_Rect *dstrect); struct GAL_Surface *dst, GAL_Rect *dstrect);
#endif #endif
/* Figure out which of many blit routines to set up on a surface */ /* Figure out which of many blit routines to set up on a surface */
int GAL_CalculateBlit(GAL_Surface *surface) int GAL_CalculateBlit(GAL_Surface *surface, const GAL_Rect *srcrc,
const GAL_Rect *dstrc, DWORD op)
{ {
int blit_index; int blit_index;
GAL_VideoDevice *src_video, *dst_video, *cur_video = NULL; GAL_VideoDevice *src_video, *dst_video, *cur_video = NULL;
@@ -241,7 +247,8 @@ int GAL_CalculateBlit(GAL_Surface *surface)
if (hw_blit_ok && cur_video) { if (hw_blit_ok && cur_video) {
GAL_VideoDevice *video = cur_video; GAL_VideoDevice *video = cur_video;
GAL_VideoDevice *this = cur_video; GAL_VideoDevice *this = cur_video;
video->CheckHWBlit (this, surface, surface->map->dst); video->CheckHWBlit (this, surface, srcrc,
surface->map->dst, dstrc, op);
} }
} }
@@ -342,7 +349,7 @@ int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
else else
src->msk_img = NULL; src->msk_img = NULL;
ops &= COLOR_BLEND_FLAGS_MASK; ops &= COLOR_BLEND_PIXMAN_MASK;
if (ops == COLOR_BLEND_LEGACY) { if (ops == COLOR_BLEND_LEGACY) {
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) { if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
src->pix_op = PIXMAN_OP_OVER; src->pix_op = PIXMAN_OP_OVER;
@@ -375,37 +382,36 @@ int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst)
src->msk_img = NULL; src->msk_img = NULL;
} }
pixman_image_set_clip_region32 (dst->pix_img, NULL);
return 0; return 0;
} }
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect, static int GAL_PixmanBlit (GAL_VideoDevice *video,
struct GAL_Surface *src, GAL_Rect *srcrect,
struct GAL_Surface *dst, GAL_Rect *dstrect) struct GAL_Surface *dst, GAL_Rect *dstrect)
{ {
(void)video;
pixman_image_t *src_img = src->pix_img, *dst_img = dst->pix_img; pixman_image_t *src_img = src->pix_img, *dst_img = dst->pix_img;
pixman_image_t *msk_img; pixman_image_t *msk_img;
pixman_op_t op; pixman_op_t op;
msk_img = src->msk_img; msk_img = src->msk_img;
op = (pixman_op_t)src->pix_op; 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 #if 0
pixman_region32_t clip_region; pixman_region32_t clip_region;
pixman_region32_init_rect (&clip_region, pixman_region32_init_rect (&clip_region,
dst->clip_rect.x, dst->clip_rect.y, dst->clip_rect.w, dst->clip_rect.h); 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); pixman_image_set_clip_region32 (dst_img, &clip_region);
#endif
#if 0
// pixman_blt does not work // pixman_blt does not work
if (pixman_image_get_format (src_img) == pixman_image_get_format (dst_img) && if (pixman_image_get_format (src_img) == pixman_image_get_format (dst_img) &&
op == PIXMAN_OP_SRC && msk_img == NULL) { op == PIXMAN_OP_SRC && msk_img == NULL) {
pixman_blt ((uint32_t *)((char*)src->pixels + src->pixels_off), pixman_blt ((uint32_t *)((char*)src->pixels + src->pixels_off),
(uint32_t *)((char*)dst->pixels + dst->pixels_off), (uint32_t *)((char*)dst->pixels + dst->pixels_off),
src->pitch, dst->pitch, src->pitch, dst->pitch,
GAL_BytesPerPixel (src), GAL_BytesPerPixel (src),
GAL_BytesPerPixel (dst), GAL_BytesPerPixel (dst),
srcrect->x, srcrect->y, srcrect->x, srcrect->y,
+6 -1
View File
@@ -80,7 +80,11 @@ typedef struct GAL_BlitMap {
Uint8 *table; Uint8 *table;
GAL_blit hw_blit; GAL_blit hw_blit;
GAL_blit sw_blit; GAL_blit sw_blit;
GAL_VideoDevice *video;
/* data for hardware blittor */
struct private_hwaccel *hw_data; struct private_hwaccel *hw_data;
/* data for software blittor */
struct private_swaccel *sw_data; struct private_swaccel *sw_data;
int identity; int identity;
@@ -94,7 +98,8 @@ typedef struct GAL_BlitMap {
#include "blit_A.h" #include "blit_A.h"
/* Functions found in GAL_blit.c */ /* Functions found in GAL_blit.c */
extern int GAL_CalculateBlit(GAL_Surface *surface); extern int GAL_CalculateBlit(GAL_Surface *surface, const GAL_Rect *srcrc,
const GAL_Rect *dstrc, DWORD op);
/* Functions found in GAL_blit_{0,1,N,A}.c */ /* Functions found in GAL_blit_{0,1,N,A}.c */
extern GAL_loblit GAL_CalculateBlit0(GAL_Surface *surface, int complex); extern GAL_loblit GAL_CalculateBlit0(GAL_Surface *surface, int complex);
-2
View File
@@ -236,8 +236,6 @@ static GAL_VideoDevice *COMMLCD_CreateDevice (int devindex)
device->FreeHWSurface = COMMLCD_FreeHWSurface; device->FreeHWSurface = COMMLCD_FreeHWSurface;
device->CheckHWBlit = NULL; device->CheckHWBlit = NULL;
device->FillHWRect = NULL; device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->UpdateRects = NULL; device->UpdateRects = NULL;
device->SyncUpdate = NULL; device->SyncUpdate = NULL;
+3 -4
View File
@@ -107,7 +107,7 @@ static int DFB_AllocHWSurface (_THIS, GAL_Surface *surface);
static void DFB_FreeHWSurface (_THIS, GAL_Surface *surface); static void DFB_FreeHWSurface (_THIS, GAL_Surface *surface);
static int DFB_HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect); static int DFB_HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
static int DFB_CheckHWBlit (_THIS, GAL_Surface * src, GAL_Surface * dst); static int DFB_CheckHWBlit (_THIS, GAL_Surface * src, GAL_Surface * dst);
static int DFB_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color); static int DFB_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
/* common dfb function address */ /* common dfb function address */
GAL_FunctionTable mgGALFuncTable = { GAL_FunctionTable mgGALFuncTable = {
@@ -173,8 +173,6 @@ static GAL_VideoDevice *DFB_CreateDevice (int devindex)
device->AllocHWSurface = DFB_AllocHWSurface; device->AllocHWSurface = DFB_AllocHWSurface;
device->CheckHWBlit = DFB_CheckHWBlit; device->CheckHWBlit = DFB_CheckHWBlit;
device->FillHWRect = DFB_FillHWRect; device->FillHWRect = DFB_FillHWRect;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = DFB_FreeHWSurface; device->FreeHWSurface = DFB_FreeHWSurface;
device->free = DFB_DeleteDevice; device->free = DFB_DeleteDevice;
@@ -518,7 +516,8 @@ static void DFB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSUR
} }
} }
static int DFB_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color) static int
DFB_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{ {
if ((dst->hwdata == NULL && dst != GAL_VideoSurface)) { if ((dst->hwdata == NULL && dst != GAL_VideoSurface)) {
fprintf(stderr, "NEWGAL>DFB: src_hwdata or dst_hwdata NULL\n"); fprintf(stderr, "NEWGAL>DFB: src_hwdata or dst_hwdata NULL\n");
+1 -1
View File
@@ -111,7 +111,7 @@ typedef struct _GAL_FunctionTable {
int (*AllocHWSurface)(_THIS, GAL_Surface *surface); int (*AllocHWSurface)(_THIS, GAL_Surface *surface);
int (*CheckHWBlit)(_THIS, GAL_Surface *src, GAL_Surface *dst); int (*CheckHWBlit)(_THIS, GAL_Surface *src, GAL_Surface *dst);
int (*HWAccelBlit)(GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect); int (*HWAccelBlit)(GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
int (*FillHWRect)(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color); int (*FillHWRect)(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
int (*SetHWColorKey)(_THIS, GAL_Surface *surface, Uint32 key); int (*SetHWColorKey)(_THIS, GAL_Surface *surface, Uint32 key);
int (*SetHWAlpha)(_THIS, GAL_Surface *surface, Uint8 value); int (*SetHWAlpha)(_THIS, GAL_Surface *surface, Uint8 value);
void (*FreeHWSurface)(_THIS, GAL_Surface *surface); void (*FreeHWSurface)(_THIS, GAL_Surface *surface);
+911 -363
View File
File diff suppressed because it is too large Load Diff
+23 -7
View File
@@ -53,10 +53,12 @@
#ifndef _MGSCHEMA_COMPOSITING #ifndef _MGSCHEMA_COMPOSITING
#include <fcntl.h> /* For O_* constants */ #include <fcntl.h> /* For O_* constants */
#include <sys/stat.h> /* For mode constants */ #include <sys/stat.h> /* For mode constants */
#endif
#include <pthread.h>
#include <semaphore.h> #include <semaphore.h>
#define SEM_UPDATE_LOCK "mginit-drm-update" #define SEM_UPDATE_LOCK "minigui-drm-update"
#endif
/* Hidden "this" pointer for the video functions */ /* Hidden "this" pointer for the video functions */
#define _THIS GAL_VideoDevice *this #define _THIS GAL_VideoDevice *this
@@ -85,9 +87,10 @@ typedef struct GAL_PrivateVideoData {
/* the global names of real screen and shadow screen */ /* the global names of real screen and shadow screen */
uint32_t real_name, shadow_name; uint32_t real_name, shadow_name;
sem_t *update_lock;
#endif /* not defined _MGSCHEMA_COMPOSITING */ #endif /* not defined _MGSCHEMA_COMPOSITING */
sem_t *update_lock;
#if !IS_SHAREDFB_SCHEMA_PROCS #if !IS_SHAREDFB_SCHEMA_PROCS
RECT dirty_rc; RECT dirty_rc;
#endif #endif
@@ -100,8 +103,11 @@ typedef struct GAL_PrivateVideoData {
uint32_t cap_cursor_width; uint32_t cap_cursor_width;
uint32_t cap_cursor_height; uint32_t cap_cursor_height;
uint32_t cap_dumb:1; uint32_t cap_dumb:1;
uint32_t cap_vblank_high_crtc:1;
uint32_t dbl_buff:1; uint32_t dbl_buff:1;
uint32_t dirty_fb_ok:1;
uint32_t scanout_buff_id; uint32_t scanout_buff_id;
int crtc_idx;
void* exdrv_handle; void* exdrv_handle;
DrmDriverOps* driver_ops; DrmDriverOps* driver_ops;
@@ -113,10 +119,20 @@ typedef struct GAL_PrivateVideoData {
DrmModeInfo* saved_info; DrmModeInfo* saved_info;
drmModeCrtc* saved_crtc; drmModeCrtc* saved_crtc;
#if 0 /* deprecated code */ int min_pixels_using_hwaccl;
uint32_t console_buff_id;
uint8_t* scanout_fb; /* async updater */
#endif /* deprecated code */ int updater_ready;
int update_interval;
RECT update_rect;
pthread_t update_thd;
sem_t sync_sem;
#ifdef _DEBUG
struct timespec ts_start;
unsigned frames;
#endif
} DrmVideoData; } DrmVideoData;
#endif /* _NEWGAL_DRIVIDEO_H */ #endif /* _NEWGAL_DRIVIDEO_H */
+41
View File
@@ -0,0 +1,41 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Framework for buffer objects that can be shared across devices/subsystems.
*
* Copyright(C) 2015 Intel Ltd
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _DMA_BUF_UAPI_H_
#define _DMA_BUF_UAPI_H_
#include <linux/types.h>
/* begin/end dma-buf functions used for userspace mmap. */
struct dma_buf_sync {
__u64 flags;
};
#define DMA_BUF_SYNC_READ (1 << 0)
#define DMA_BUF_SYNC_WRITE (2 << 0)
#define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
#define DMA_BUF_SYNC_START (0 << 2)
#define DMA_BUF_SYNC_END (1 << 2)
#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
(DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
#define DMA_BUF_BASE 'b'
#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
#endif
+3 -3
View File
@@ -139,8 +139,6 @@ static GAL_VideoDevice *DUMMY_CreateDevice(int devindex)
device->AllocHWSurface = DUMMY_AllocHWSurface; device->AllocHWSurface = DUMMY_AllocHWSurface;
device->CheckHWBlit = NULL; device->CheckHWBlit = NULL;
device->FillHWRect = NULL; device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = DUMMY_FreeHWSurface; device->FreeHWSurface = DUMMY_FreeHWSurface;
device->free = DUMMY_DeleteDevice; device->free = DUMMY_DeleteDevice;
@@ -323,11 +321,13 @@ static void DUMMY_VideoQuit(_THIS)
if (mgIsServer) { if (mgIsServer) {
shm_unlink (DUMMYVID_SHAREDMEM_NAME); shm_unlink (DUMMYVID_SHAREDMEM_NAME);
} }
#else #elif !defined(_MGRM_PROCESSES)
if (this->screen->pixels != NULL) { if (this->screen->pixels != NULL) {
free (this->screen->pixels); free (this->screen->pixels);
this->screen->pixels = NULL; this->screen->pixels = NULL;
} }
#else
// do nothing (COMPOSITING_SCHEMA)
#endif /* not (defined(_MGRM_PROCESSES) && defined (_MGSCHEMA_SHAREDFB)) */ #endif /* not (defined(_MGRM_PROCESSES) && defined (_MGSCHEMA_SHAREDFB)) */
} }
-2
View File
@@ -183,8 +183,6 @@ static GAL_VideoDevice *EM85XXOSD_CreateDevice(int devindex)
device->AllocHWSurface = EM85XXOSD_AllocHWSurface; device->AllocHWSurface = EM85XXOSD_AllocHWSurface;
device->CheckHWBlit = NULL; device->CheckHWBlit = NULL;
device->FillHWRect = NULL; device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = EM85XXOSD_FreeHWSurface; device->FreeHWSurface = EM85XXOSD_FreeHWSurface;
device->UpdateRects = EM85XXOSD_UpdateRects; device->UpdateRects = EM85XXOSD_UpdateRects;
-2
View File
@@ -454,8 +454,6 @@ static GAL_VideoDevice *EM85XXYUV_CreateDevice(int devindex)
device->AllocHWSurface = EM85XXYUV_AllocHWSurface; device->AllocHWSurface = EM85XXYUV_AllocHWSurface;
device->CheckHWBlit = NULL; device->CheckHWBlit = NULL;
device->FillHWRect = NULL; device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = EM85XXYUV_FreeHWSurface; device->FreeHWSurface = EM85XXYUV_FreeHWSurface;
device->UpdateRects = EM85XXYUV_UpdateRects; device->UpdateRects = EM85XXYUV_UpdateRects;
+3 -4
View File
@@ -69,7 +69,7 @@ static int GFX_VideoInit(_THIS, GAL_PixelFormat * vformat);
static GAL_Rect ** GFX_ListModes(_THIS, GAL_PixelFormat * format, Uint32 flags); static GAL_Rect ** GFX_ListModes(_THIS, GAL_PixelFormat * format, Uint32 flags);
static GAL_Surface * GFX_SetVideoMode(_THIS, GAL_Surface * current, int width, int height, int bpp, Uint32 flags); static GAL_Surface * GFX_SetVideoMode(_THIS, GAL_Surface * current, int width, int height, int bpp, Uint32 flags);
static void GFX_VideoQuit(_THIS); static void GFX_VideoQuit(_THIS);
static int GFX_FillHWRect(_THIS, GAL_Surface * dst, GAL_Rect * rect, Uint32 color); static int GFX_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
static int GFX_AllocHWSurface(_THIS, GAL_Surface * surface); static int GFX_AllocHWSurface(_THIS, GAL_Surface * surface);
static void GFX_FreeHWSurface(_THIS, GAL_Surface * surface); static void GFX_FreeHWSurface(_THIS, GAL_Surface * surface);
static int GFX_HWAccelBlit(GAL_Surface * src, GAL_Rect * srcrect, GAL_Surface * dst, GAL_Rect * dstrect); static int GFX_HWAccelBlit(GAL_Surface * src, GAL_Rect * srcrect, GAL_Surface * dst, GAL_Rect * dstrect);
@@ -112,8 +112,6 @@ static GAL_VideoDevice * GFX_CreateDevice(int devindex)
this->AllocHWSurface = GFX_AllocHWSurface; this->AllocHWSurface = GFX_AllocHWSurface;
this->CheckHWBlit = GFX_CheckHWBlit; this->CheckHWBlit = GFX_CheckHWBlit;
this->FillHWRect = GFX_FillHWRect; this->FillHWRect = GFX_FillHWRect;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->UpdateRects = NULL; this->UpdateRects = NULL;
this->FreeHWSurface = GFX_FreeHWSurface; this->FreeHWSurface = GFX_FreeHWSurface;
@@ -298,7 +296,8 @@ static void GFX_VideoQuit (_THIS)
return; return;
} }
static int GFX_FillHWRect(_THIS, GAL_Surface * surface, GAL_Rect * rect, Uint32 color) static int
GFX_FillHWRect(_THIS, GAL_Surface *surface, const GAL_Rect *rect, Uint32 color)
{ {
struct GFXEngine_FillRectangle_type fill_param; struct GFXEngine_FillRectangle_type fill_param;
struct GFXEngine_Surface_type surface_param; struct GFXEngine_Surface_type surface_param;
+19 -11
View File
@@ -68,13 +68,7 @@ static void WaitIdle(_THIS)
tdfx_waitidle(); tdfx_waitidle();
} }
/* Set video mem colorkey and accelerated blit function */ static int FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
static int SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key)
{
return(0);
}
static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
{ {
int bpp; int bpp;
char *dst_base; char *dst_base;
@@ -106,10 +100,9 @@ static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
return(0); return(0);
} }
static int HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect, static int HWAccelBlit(_THIS, GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect) GAL_Surface *dst, GAL_Rect *dstrect)
{ {
GAL_VideoDevice *this = __mg_current_video;
int bpp; int bpp;
Uint32 src_format; Uint32 src_format;
/* Uint32 dst_format; */ /* Uint32 dst_format; */
@@ -175,8 +168,11 @@ static int HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect,
return(0); return(0);
} }
static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst) static int CheckHWBlit(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
{ {
(void)srcrc;
(void)dstrc;
int accelerated; int accelerated;
/* Set initial acceleration on */ /* Set initial acceleration on */
@@ -194,11 +190,24 @@ static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
} }
} }
/* color blend, logical operation, and scaling filter are not supported */
if ((op & COLOR_BLEND_MASK) ||
((op & COLOR_LOGICOP_MASK) != COLOR_LOGICOP_COPY) ||
(op & SCALING_FILTER_MASK)) {
src->flags &= ~GAL_HWACCEL;
}
/* Check to see if final surface blit is accelerated */ /* Check to see if final surface blit is accelerated */
accelerated = !!(src->flags & GAL_HWACCEL); accelerated = !!(src->flags & GAL_HWACCEL);
if ( accelerated ) { if ( accelerated ) {
src->map->video = this;
src->map->hw_blit = HWAccelBlit; src->map->hw_blit = HWAccelBlit;
} }
else {
src->map->video = NULL;
src->map->hw_blit = NULL;
}
return(accelerated); return(accelerated);
} }
@@ -220,5 +229,4 @@ void FB_3DfxAccel(_THIS, __u32 card)
/* The 3Dfx has accelerated normal and colorkey blits */ /* The 3Dfx has accelerated normal and colorkey blits */
this->info.blit_hw = 1; this->info.blit_hw = 1;
this->info.blit_hw_CC = 1; this->info.blit_hw_CC = 1;
this->SetHWColorKey = SetHWColorKey;
} }

Some files were not shown because too many files have changed in this diff Show More