Compare commits

...
172 Commits
Author SHA1 Message Date
Vincent Wei e5a6cb3056 fix a compilation error about bool type 2026-02-07 11:48:05 +08:00
Vincent Wei ea3f345252 Merge remote-tracking branch 'origin/drm-page-flip' 2026-02-07 11:31:00 +08:00
xueshuming 42b28fcc59 1. Fix legacy BIDI bracket reordering/mirroring for MBC Achar32.
2. Fix wrong BIDI type mapping for ISO8859-6 0xEF.
2026-02-03 22:40:14 +08:00
xueshuming 2bde8e299a Fix: Arabic letter 'ي' incorrectly using medial form at word start. 2026-02-03 22:30:41 +08:00
xueshuming 93671fc379 Use drmModePageFlip for drmVideo to fix screen tearing on low-end devices 2026-01-30 09:09:05 +08:00
VincentWei 08d4ab78e5 do not check pciaccess library if the cpu is not i386 2025-05-29 11:25:25 +08:00
Vincent Wei 0cda03a2eb Merge branch 'subpixel' into 'rel-5-0'
add func blend_pixel to fix font rendering issues on transparent backgrounds(SUBPIXEL)

See merge request VincentWei/minigui!18
2025-05-29 02:59:47 +00:00
xueshuming 4cf4d204e7 add func blend_pixel to fix font rendering issues on transparent backgrounds(SUBPIXEL) 2025-05-28 20:55:38 +08:00
VincentWei 6aa294e75b ignore ltmain.sh 2025-05-28 14:45:58 +08:00
VincentWei 7718be5200 ignore m4/*.m4 2025-05-28 14:44:43 +08:00
VincentWei 78e6d6581e update Makefile.am 2025-05-28 14:43:56 +08:00
VincentWei 62b3dc11d0 update libtool files 2025-05-28 14:43:25 +08:00
Vincent Wei 67cddafa19 change version to 5.0.16 2025-05-27 16:04:53 +08:00
Vincent Wei 4ae46a4b94 update 2025-05-27 15:53:44 +08:00
xueshuming 2791dc99ef Init Order: call 'mg_InitTimer' before call 'SystemThreads' 2025-05-27 15:45:03 +08:00
Vincent Wei b7525f3001 fix a bug: MSG_TIMEOUT for desktop thread was not fired correctly 2025-05-27 14:45:53 +08:00
Vincent Wei 4c55f2eac3 use sem_timedwait in the idle handler for desktop threads 2025-05-27 11:08:55 +08:00
Vincent Wei 3ad600d1bf Merge branch 'rel-5-0' 2025-05-09 14:02:57 +08:00
Vincent Wei 3c233a4164 update version to 5.0.15 2025-05-09 13:59:17 +08:00
Vincent Wei 3643606a7f restore the system interval timer for the server under runmode procs 2025-04-30 14:12:19 +08:00
Vincent Wei 3ef2340749 restore old logic to update timer_expected 2025-04-30 12:10:47 +08:00
Vincent Wei a583dc1cbb optimize and cleanup the timer module to fix the bad update of tick counter 2025-04-30 12:00:38 +08:00
xueshuming 0abaeef4c7 impl : __mg_save_png 2024-02-20 19:28:14 +08:00
Vincent Wei c2779cbf09 implement a new API: TestIfSharedSurfaceChanged() 2023-09-26 10:52:09 +08:00
Vincent Wei e118805eef fix a bug of GetUpdateRect: intersect bouding rectangle of invalid region with client rect 2023-09-16 15:43:07 +08:00
Vincent Wei 7513d461bf remove code about semaphhore for shared surface 2023-09-08 18:14:20 +08:00
Vincent Wei b131f00a79 fix compiling errors for MiniGUI-Standalone runmode 2023-09-04 10:45:05 +08:00
Vincent Wei 649fbf571e change copyright year 2023-09-01 16:07:56 +08:00
Vincent Wei e38fd05cb4 debug: use fcntl() instead of flock() 2023-09-01 16:03:50 +08:00
Vincent Wei ce53f2c703 use MSG_WINCOMPOSITED to reset the dirty information of a shared surface of a window 2023-09-01 12:25:04 +08:00
Vincent Wei fbebc94718 use GAL_RefSurface() in CreateMemDCFromSurface() 2023-09-01 10:01:11 +08:00
Vincent Wei b4ce6f9f10 helpers for locking/unlocking a file 2023-09-01 08:36:08 +08:00
Vincent Wei c04dde31e5 use flock() instead of semaphore for shared surfaces 2023-09-01 08:35:32 +08:00
Vincent Wei 5a2b425012 debug 2023-08-31 17:00:50 +08:00
Vincent Wei fa18025350 debug APIs for shared surfaces 2023-08-31 16:02:06 +08:00
Vincent Wei 890ab1db44 debug 2023-08-30 15:40:13 +08:00
Vincent Wei 3d963b3d25 Extend JoinLayer() to JoinLayerEx() to return the client identifier; Add a new API GetClientId() 2023-08-30 12:23:26 +08:00
Vincent Wei 29ac6a4277 initial implementation of new APIs of shared surface: AttachToSharedSurface(), GetSharedSurfaceInfo(), LockSharedSurfaceIfDirty(), UnlockSharedSurface(), and DetachFromSharedSurface() 2023-08-29 16:21:49 +08:00
Vincent Wei 96ecf5e9b7 Tune layout of struct _SharedSurfaceHeader; Change interface of GetWindowSharedSurfaceFD() 2023-08-29 12:50:58 +08:00
Vincent Wei 50aafa3faa initial implementation of CreateSharedSurface(), DestroySharedSurface(), GetSharedSurfaceFDByClientWindow(), and GetSharedSurfaceFDByName() 2023-08-29 12:12:51 +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
161 changed files with 6864 additions and 13349 deletions
+2
View File
@@ -10,6 +10,7 @@ Makefile
Makefile.in Makefile.in
.deps/ .deps/
.libs/ .libs/
m4/*.m4
/acinclude.m4 /acinclude.m4
/aclocal.m4 /aclocal.m4
/autom4te.cache /autom4te.cache
@@ -21,6 +22,7 @@ Makefile.in
/depcomp /depcomp
/install-sh /install-sh
/libtool /libtool
/ltmain.sh
/*.pc /*.pc
/*config.h /*config.h
/*config.h.in /*config.h.in
+2
View File
@@ -1,3 +1,5 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src 3rd-party include rtos etc m4 cmake build SUBDIRS = src 3rd-party include rtos etc m4 cmake build
EXTRA_DIST = minigui.pc.in \ EXTRA_DIST = minigui.pc.in \
+22 -17
View File
@@ -72,7 +72,7 @@ It greatly reduces the size and resource consumption of the entire solution, imp
[HybridOS] is another large open source project initiated by FMSoft. [HybridOS] is another large open source project initiated by FMSoft.
It is an open source operating system designed for embedded/AIoT devices and cloud computing environment. It is an open source operating system designed for embedded/AIoT devices and cloud computing environment.
HybridOS provides the complete software stack and the app framework based on HVML for embedded systems. HybridOS provides the complete software stack and the app framework based on [HVML] for embedded systems.
You can easily develop your products which has rich functions and excellent expressiveness by using HybridOS. You can easily develop your products which has rich functions and excellent expressiveness by using HybridOS.
In practice, MiniGUI and the software which are used to integrated with GPU constitute the graphics stack of HybridOS. In practice, MiniGUI and the software which are used to integrated with GPU constitute the graphics stack of HybridOS.
@@ -85,13 +85,13 @@ The following chart shows the graphics stack of HybridOS:
----------------------------------------------- -----------------------------------------------
| MiniGUI/HVML Apps | | MiniGUI/HVML Apps |
|-----------------------------------------------| |-----------------------------------------------|
| | (Graphics Stack) | | | (Graphics Stack) |
| | ---------------------| | | --------------------|
| | | hiMesa | | | | Mesa-HBD |
| | hiCairo | ------------------| | | Cairo-HBD | ------------------|
| | MiniGUI | | EGL for MiniGUI | | | MiniGUI | | EGL for MiniGUI |
| C++ libs | hiDRMDrivers | | GL, GLES, VG | | C++ libs | HBDDRMDrivers | | GL, GLES, VG |
| C libs | libDRM | | GPU drivers | | C libs | libDRM | | GPU drivers |
|-----------------------------------------------| |-----------------------------------------------|
| Linux Kernel | | Linux Kernel |
| -----------------------------------| | -----------------------------------|
@@ -102,10 +102,10 @@ The following chart shows the graphics stack of HybridOS:
As shown in the chart above, the HybridOS graphics stack consists of the following software: As shown in the chart above, the HybridOS graphics stack consists of the following software:
- `libDRM` provides some user land APIs for Linux Direct Rendering Infrastructure. - `libDRM` provides some user land APIs for Linux Direct Rendering Infrastructure.
- `hiDRMDrivers` contains the drivers (user land drivers, not kernel drivers) for - `HBDDRMDrivers` contains the drivers (user land drivers, not kernel drivers) for
MiniGUI DRM engine. The drivers implement the basic hardware accelerated MiniGUI DRM engine. The drivers implement the basic hardware accelerated
2D graphics operations of various GPUs for MiniGUI. 2D graphics operations of various GPUs for MiniGUI.
- `hiMesa` is the Mesa derivative for HybridOS, while Mesa is the open source - `Mesa-HBD` is the Mesa derivative for HybridOS, while Mesa is the open source
implementation of OpenGL and other graphics APIs, including OpenGL ES implementation of OpenGL and other graphics APIs, including OpenGL ES
(versions 1, 2, 3), OpenCL, OpenMAX, and Vulkan. It contains the following (versions 1, 2, 3), OpenCL, OpenMAX, and Vulkan. It contains the following
components: components:
@@ -113,13 +113,17 @@ As shown in the chart above, the HybridOS graphics stack consists of the followi
graphics APIs. graphics APIs.
+ The EGL implementation for MiniGUI platform. + The EGL implementation for MiniGUI platform.
+ The graphics drivers for various GPUs and a software driver called `swrast`. + The graphics drivers for various GPUs and a software driver called `swrast`.
- `hiCairo` is the Cairo derivative for HybridOS. Cairo is a 2D vector graphics - `Cairo-HBD` is the Cairo derivative for HybridOS. Cairo is a 2D vector graphics
library for Gtk. We provide support for MiniGUI backend in `hiCairo`. library for Gtk. We provide support for MiniGUI backend in `hiCairo`.
For more information about HybridOS, please refer to: For more information about HybridOS, please refer to:
<https://hybridos.fmsoft.cn/> <https://hybridos.fmsoft.cn/>
For more information about HVML, please refer to:
<https://hvml.fmsoft.cn/> or <https://www.hvml.org>
### Source Code Repositories ### Source Code Repositories
FMSoft had created the public repositories for MiniGUI Core, MiniGUI FMSoft had created the public repositories for MiniGUI Core, MiniGUI
@@ -456,7 +460,7 @@ for examples:
## HISTORY ## HISTORY
21 years have pasted since MiniGUI was initially created at 27 years have pasted since MiniGUI was initially created at
the end of 1998, and now it becomes much reliable and stable. the end of 1998, and now it becomes much reliable and stable.
During the past years, many remarkable changes have taken place in During the past years, many remarkable changes have taken place in
the MiniGUI project. the MiniGUI project.
@@ -561,13 +565,15 @@ A brief history description of the development progress is listed as follow:
1. May., 2021: FMSoft released MiniGUI version 5.0.6. 1. May., 2021: FMSoft released MiniGUI version 5.0.6.
1. Jan., 2022: FMSoft released MiniGUI version 5.0.9. 1. Jan., 2022: FMSoft released MiniGUI version 5.0.9.
1. Sep., 2022: FMSoft released MiniGUI version 5.0.10. 1. Sep., 2022: FMSoft released MiniGUI version 5.0.10.
1. Aug., 2023: FMSoft released MiniGUI version 5.0.13.
1. May., 2025: FMSoft released MiniGUI version 5.0.16.
## AUTHORS AND COPYING ## AUTHORS AND COPYING
The original author of MiniGUI is Vincent Wei, and now MiniGUI is maintained by FMSoft. The original author of MiniGUI is Vincent Wei, and now MiniGUI is maintained by FMSoft.
For more information, please refer to <http://www.fmsoft.cn>. For more information, please refer to <http://www.fmsoft.cn>.
Copyright (C) 2002 ~ 2022, Beijing FMSoft Technologies Co., Ltd. Copyright (C) 2002 ~ 2025, Beijing FMSoft Technologies Co., Ltd.
Copyright (C) 1998 ~ 2002, Vincent Wei Copyright (C) 1998 ~ 2002, Vincent Wei
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -645,13 +651,12 @@ A: Yes, FMSoft can provide you with guaranteed commercial technical
[FMSoft Technologies]: https://www.fmsoft.cn [FMSoft Technologies]: https://www.fmsoft.cn
[FMSoft]: https://www.fmsoft.cn [FMSoft]: https://www.fmsoft.cn
[HybridOS Official Site]: https://hybridos.fmsoft.cn [HybridOS Official Site]: https://hybridos.fmsoft.cn
[MiniGUI Official Site]: https://hvml.fmsoft.cn [MiniGUI Official Site]: https://minigui.fmsoft.cn
[HVML Official Site]: https://hvml.fmsoft.cn [HVML Official Site]: https://hvml.fmsoft.cn
[Vincent Wei]: https://github.com/VincentWei [Vincent Wei]: https://github.com/VincentWei
[MiniGUI]: https://github.com/VincentWei/MiniGUI [MiniGUI]: https://github.com/VincentWei
[HybridOS]: https://github.com/FMSoftCN/HybridOS [HybridOS]: https://github.com/HybridOS2
[HVML]: https://github.com/HVML [HVML]: https://github.com/HVML
[PurC]: https://github.com/HVML/PurC [PurC]: https://github.com/HVML/PurC
[xGUI Pro]: https://github.com/HVML/xGUI-Pro [xGUI Pro]: https://github.com/HVML/xGUI-Pro
+96
View File
@@ -1,5 +1,15 @@
# Release Notes # Release Notes
- [Version 5.0.16](#version-5016)
+ [What's new in version 5.0.16](#whats-new-in-version-5016)
- [Version 5.0.15](#version-5015)
+ [What's new in version 5.0.15](#whats-new-in-version-5015)
- [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) - [Version 5.0.10](#version-5010)
+ [What's new in version 5.0.10](#whats-new-in-version-5010) + [What's new in version 5.0.10](#whats-new-in-version-5010)
- [Version 5.0.9](#version-508) - [Version 5.0.9](#version-508)
@@ -26,6 +36,92 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility) + [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis) + [Deprecated APIs](#deprecated-apis)
## Version 5.0.16
On May 27, 2025, FMSoft announces the availability of MiniGUI 5.0.16,
which is a bugfix release with some minor enhancements of MiniGUI 5.0.x.
* BUGFIXING:
- The desktop thread can not handle the request from other threads as soon as possible.
- The `MSG_TIMEOUT` message can not be fired correctly under MiniGUI-Threads mode.
- Bad subpixel rendering when background color is RGBA0000.
* TUNING:
- Tune `configure.ac` and `Makefile.am` to use the system libtool scripts.
- Do not check `pciaccess` if the target architecture is not `i386`.
## Version 5.0.15
On May 09, 2025, FMSoft announces the availability of MiniGUI 5.0.15,
which is an enhancement release with some minor enhancements
of MiniGUI 5.0.x.
* 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 ## Version 5.0.10
On Sep. 30, 2022, FMSoft announces the availability of MiniGUI 5.0.10, On Sep. 30, 2022, FMSoft announces the availability of MiniGUI 5.0.10,
+1 -1
View File
@@ -1,4 +1,4 @@
Version 5.0.9 (2022/01/14) Version 5.0.16 (2025/05/27)
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.
+2 -1
View File
@@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
cat m4/*.m4 > acinclude.m4 libtoolize
cat m4/*.m4 > aclocal.m4
aclocal aclocal
autoheader autoheader
automake --add-missing --foreign --copy automake --add-missing --foreign --copy
+37 -34
View File
@@ -1,7 +1,8 @@
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.71])
AC_INIT(libminigui, 5.0.10) AC_INIT([libminigui],[5.0.16])
AC_CONFIG_SRCDIR(src/main/main.c) AC_CONFIG_SRCDIR(src/main/main.c)
AC_CONFIG_MACRO_DIRS([m4])
dnl Set various version strings - taken gratefully from the SDL sources dnl Set various version strings - taken gratefully from the SDL sources
# #
@@ -16,9 +17,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=10 MINIGUI_MICRO_VERSION=16
MINIGUI_INTERFACE_AGE=0 MINIGUI_INTERFACE_AGE=1
MINIGUI_BINARY_AGE=0 MINIGUI_BINARY_AGE=1
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)
@@ -40,35 +41,31 @@ AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION) AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE) AC_SUBST(LT_AGE)
AC_CANONICAL_SYSTEM AC_CANONICAL_TARGET
dnl ======================================================================== dnl ========================================================================
dnl Init automake dnl Init automake
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
AC_CONFIG_HEADER(mgconfig.h) AC_CONFIG_HEADERS([mgconfig.h])
dnl ======================================================================== dnl ========================================================================
dnl Check for tools dnl Check for tools
AC_PROG_LIBTOOL
AC_PROG_CC AC_PROG_CC
AC_PROG_LD
AC_PROG_RANLIB
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
LT_INIT
dnl ======================================================================== dnl ========================================================================
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_CHECK_HEADERS(limits.h math.h locale.h unistd.h termio.h sys/types.h sys/time.h sys/select.h sys/memfd.h) AC_CHECK_HEADERS(limits.h math.h stdatomic.h locale.h unistd.h termio.h sys/types.h sys/time.h sys/select.h sys/memfd.h)
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
AC_C_INLINE AC_C_INLINE
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM AC_STRUCT_TM
dnl Checks for library functions. dnl Checks for library functions.
@@ -95,7 +92,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"
@@ -884,14 +881,14 @@ CheckFBCON()
if test "x$enable_video_fbcon" = "xyes"; then if test "x$enable_video_fbcon" = "xyes"; then
AC_MSG_CHECKING(for FrameBuffer console support) AC_MSG_CHECKING(for FrameBuffer console support)
video_fbcon=no video_fbcon=no
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/kd.h> #include <linux/kd.h>
#include <linux/keyboard.h> #include <linux/keyboard.h>
],[ ]], [[
],[ ]])],[
video_fbcon=yes video_fbcon=yes
]) ],[])
AC_MSG_RESULT($video_fbcon) AC_MSG_RESULT($video_fbcon)
if test "x$video_fbcon" = "xyes"; then if test "x$video_fbcon" = "xyes"; then
AC_DEFINE(_MGGAL_FBCON, 1, AC_DEFINE(_MGGAL_FBCON, 1,
@@ -899,9 +896,13 @@ CheckFBCON()
VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon" VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la" VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
have_pciaccess="yes" if test "x$target_cpu" = "xi386"; then
AC_CHECK_LIB(pciaccess, pci_system_init, have_pciaccess="yes"
DEP_LIBS="$DEP_LIBS -lpciaccess", have_pciaccess="no") AC_CHECK_LIB(pciaccess, pci_system_init,
DEP_LIBS="$DEP_LIBS -lpciaccess", have_pciaccess="no")
else
have_pciaccess="no"
fi
if test "x$have_pciaccess" = "xyes"; then if test "x$have_pciaccess" = "xyes"; then
AC_DEFINE(_MGHAVE_PCIACCESS, 1, AC_DEFINE(_MGHAVE_PCIACCESS, 1,
@@ -1170,12 +1171,12 @@ CheckDirectFBVideo()
if test "x$enable_video_dfb" = "xyes"; then if test "x$enable_video_dfb" = "xyes"; then
AC_MSG_CHECKING(for DirectFB support) AC_MSG_CHECKING(for DirectFB support)
video_dfb=no video_dfb=no
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <directfb.h> #include <directfb.h>
],[ ]], [[
],[ ]])],[
video_dfb=yes video_dfb=yes
]) ],[])
AC_MSG_RESULT($video_dfb) AC_MSG_RESULT($video_dfb)
if test "x$video_dfb" = "xyes"; then if test "x$video_dfb" = "xyes"; then
AC_DEFINE(_MGGAL_DFB, 1, AC_DEFINE(_MGGAL_DFB, 1,
@@ -1704,12 +1705,12 @@ fi
CPPFLAGS="$CPPFLAGS -D__MINIGUI_LIB__" CPPFLAGS="$CPPFLAGS -D__MINIGUI_LIB__"
surface_schema="shared frame buffer" surface_schema="shared"
case "$runtime_mode" in case "$runtime_mode" in
sa) sa)
AC_DEFINE(_MGRM_STANDALONE, 1, AC_DEFINE(_MGRM_STANDALONE, 1,
[Define if build MiniGUI-Standalone]) [Define if build MiniGUI-Standalone])
MINIGUI_RUNMODE="sa" MINIGUI_RUNMODE="standalone"
RUNMODE_LADD="standalone/libstandalone.la" RUNMODE_LADD="standalone/libstandalone.la"
RUNMODE_SUBDIRS="standalone" RUNMODE_SUBDIRS="standalone"
;; ;;
@@ -1717,13 +1718,13 @@ case "$runtime_mode" in
AC_DEFINE(_MGRM_THREADS, 1, AC_DEFINE(_MGRM_THREADS, 1,
[Define if build MiniGUI-Threads]) [Define if build MiniGUI-Threads])
CPPFLAGS="$CPPFLAGS -D_REENTRANT" CPPFLAGS="$CPPFLAGS -D_REENTRANT"
MINIGUI_RUNMODE="ths" MINIGUI_RUNMODE="threads"
virtual_window="yes" virtual_window="yes"
;; ;;
*) *)
AC_DEFINE(_MGRM_PROCESSES, 1, AC_DEFINE(_MGRM_PROCESSES, 1,
[Define if build MiniGUI-Processes]) [Define if build MiniGUI-Processes])
MINIGUI_RUNMODE="procs" MINIGUI_RUNMODE="processes"
RUNMODE_LADD="server/libserver.la client/libclient.la" RUNMODE_LADD="server/libserver.la client/libclient.la"
RUNMODE_SUBDIRS="server client" RUNMODE_SUBDIRS="server client"
if test "x$compositing_schema" = "xyes"; then if test "x$compositing_schema" = "xyes"; then
@@ -2641,7 +2642,7 @@ if test "x$devel_mode" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_DEBUG" CPPFLAGS="$CPPFLAGS -D_DEBUG"
fi fi
if test "$ac_cv_prog_gcc" = "yes"; then if test "$ac_cv_c_compiler_gnu" = "yes"; then
CFLAGS="$CFLAGS -Wall -Werror" CFLAGS="$CFLAGS -Wall -Werror"
fi fi
@@ -2651,7 +2652,7 @@ else
CPPFLAGS="$CPPFLAGS -DNDEBUG" CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi fi
if test "$ac_cv_prog_gcc" = "yes"; then if test "$ac_cv_c_compiler_gnu" = "yes"; then
CFLAGS="$CFLAGS -fmax-errors=10 -Wstrict-prototypes -pipe" CFLAGS="$CFLAGS -fmax-errors=10 -Wstrict-prototypes -pipe"
fi fi
@@ -2664,6 +2665,7 @@ if test "x$no_math" = "xno"; then
fi fi
DEP_LIBS="$DEP_LIBS -lpthread" DEP_LIBS="$DEP_LIBS -lpthread"
MINIGUI_RUNMODE="$MINIGUI_RUNMODE-${surface_schema}"
AC_SUBST(VIDEO_SUBDIRS) AC_SUBST(VIDEO_SUBDIRS)
AC_SUBST(VIDEO_DRIVERS) AC_SUBST(VIDEO_DRIVERS)
@@ -2687,8 +2689,7 @@ AM_CONDITIONAL(MGLIB_MVFB, test "x$with_libsuffix" = "xmvfb")
AM_CONDITIONAL(MG_ENABLE_SPLASH, test "x$build_splash" = "xyes") AM_CONDITIONAL(MG_ENABLE_SPLASH, test "x$build_splash" = "xyes")
AM_CONDITIONAL(MG_ENABLE_SCREENSAVER, test "x$build_screensaver" = "xyes") AM_CONDITIONAL(MG_ENABLE_SCREENSAVER, test "x$build_screensaver" = "xyes")
AC_OUTPUT( AC_CONFIG_FILES([minigui.pc
minigui.pc
Makefile Makefile
cmake/Makefile cmake/Makefile
src/Makefile src/Makefile
@@ -2755,7 +2756,8 @@ etc/Makefile
3rd-party/scripteasy/Makefile 3rd-party/scripteasy/Makefile
m4/Makefile m4/Makefile
build/Makefile build/Makefile
) ])
AC_OUTPUT
CCVERSION=`$CC --version | head -n 1` CCVERSION=`$CC --version | head -n 1`
@@ -2764,6 +2766,7 @@ AC_MSG_NOTICE([
# Main building configuration: # Main building configuration:
## Global Features: ## Global Features:
* Architecture: ${target_cpu}
* Operating system: ${osname} * Operating system: ${osname}
* Runtime mode: ${runtime_mode} * Runtime mode: ${runtime_mode}
* Virtual Window: ${virtual_window} * Virtual Window: ${virtual_window}
+53 -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
@@ -111,6 +153,16 @@ dpi=96
# Note that under compositing schema, double buffering is always enabled. # Note that under compositing schema, double buffering is always enabled.
# Since 5.0.10. # Since 5.0.10.
double_buffering=true double_buffering=true
# Whether the async. update is enabled.
# Use `true` or `yes` for enabled, anything else for disabled.
# Since 5.0.13.
async_update=yes
# The update interval for the asyn. updater (milli-seconds).
# This setting is only valid when drmWaitVBlank doesn't work correctly.
# Since 5.0.13.
update_interval=15
#}} #}}
#{{ifdef _MGGAL_PCXVFB #{{ifdef _MGGAL_PCXVFB
@@ -123,13 +175,6 @@ exec_file=/usr/local/bin/gvfb
[rtos_xvfb] [rtos_xvfb]
defaultmode=800x600-16bpp defaultmode=800x600-16bpp
#{{ifdef _MGGAL_SHADOW
[shadow]
real_engine=pc_xvfb
defaultmode=800x600-16bpp
rotate_screen=ccw
#}}
#{{ifdef _MGGAL_MLSHADOW #{{ifdef _MGGAL_MLSHADOW
[mlshadow] [mlshadow]
real_engine=qvfb real_engine=qvfb
+3
View File
@@ -268,6 +268,8 @@ MGUI_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
#define MG_UNLIKELY(expr) (expr) #define MG_UNLIKELY(expr) (expr)
#endif #endif
#define HAVE(FEATURE) (defined HAVE_##FEATURE && HAVE_##FEATURE)
/** /**
* \defgroup endian_info Endianness information * \defgroup endian_info Endianness information
* @{ * @{
@@ -2347,6 +2349,7 @@ int init_minigui_printf (int (*output_char) (int ch),
#define _ERR_PRINTF(fmt, ...) \ #define _ERR_PRINTF(fmt, ...) \
do { \ do { \
TCS_RED (stderr); \ TCS_RED (stderr); \
fprintf (stderr, "%s: ", __FUNCTION__); \
fprintf (stderr, fmt, ##__VA_ARGS__); \ fprintf (stderr, fmt, ##__VA_ARGS__); \
TCS_NONE (stderr); \ TCS_NONE (stderr); \
} while (0) } while (0)
+57 -77
View File
@@ -84,6 +84,14 @@ extern "C" {
* @{ * @{
*/ */
/** The current version of DRM driver. */
#define DRM_DRIVER_VERSION 2
#define DRM_SURBUF_TYPE_OFFSCREEN 0x0000
#define DRM_SURBUF_TYPE_SHADOW 0x0001
#define DRM_SURBUF_TYPE_SCANOUT 0x0002
#define DRM_SURBUF_TYPE_MASK 0x000F
/** /**
* The struct type represents the DRI sub driver. * The struct type represents the DRI sub driver.
* The concrete struct should be defined by the driver. * The concrete struct should be defined by the driver.
@@ -129,6 +137,8 @@ typedef struct _DrmSurfaceBuffer {
uint32_t dumb:1; uint32_t dumb:1;
/** Is it a scanout buffer. Since 5.0.0. */ /** Is it a scanout buffer. Since 5.0.0. */
uint32_t scanout:1; uint32_t scanout:1;
/** The buffer is also a dma-buf. Since 5.0.13. */
uint32_t dma_buf:1;
/** The width of the buffer. */ /** The width of the buffer. */
uint32_t width; uint32_t width;
@@ -154,11 +164,23 @@ typedef struct _DrmSurfaceBuffer {
* The address of the pixel data: * The address of the pixel data:
* uint8_t* pixels = this->buff + this->offset; * uint8_t* pixels = this->buff + this->offset;
*/ */
uint8_t* buff; uint8_t* vaddr;
} DrmSurfaceBuffer; } DrmSurfaceBuffer;
typedef struct _DrmBlitOperations {
BlitCopyOperation cpy;
BlitKeyOperation key;
BlitAlphaOperation alf;
ColorBlendMethod bld;
ColorLogicalOp rop;
ScalingFilter scl;
uint32_t key_min, key_max;
uint8_t alpha;
} DrmBlitOperations;
/** /**
* The structure type defines the operations for a DRM driver. * The structure type defines the operations for a userland DRM driver.
*/ */
typedef struct _DrmDriverOps { typedef struct _DrmDriverOps {
/** /**
@@ -176,12 +198,13 @@ typedef struct _DrmDriverOps {
void (*destroy_driver) (DrmDriver *driver); void (*destroy_driver) (DrmDriver *driver);
/** /**
* This operation flushes the batch buffer of the driver or * This operation flushes the batch buffer of the driver and/or
* the hardware cache. * the specified buffer.
* *
* \note This operation can be NULL. * \note This operation can be NULL.
*/ */
void (* flush_driver) (DrmDriver *driver); void (* flush) (DrmDriver *driver, DrmSurfaceBuffer* buff,
const GAL_Rect *dirty_rect);
/** /**
* This operation creates a surface buffer with the specified pixel format, * This operation creates a surface buffer with the specified pixel format,
@@ -194,7 +217,7 @@ typedef struct _DrmDriverOps {
*/ */
DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver, DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver,
uint32_t drm_format, uint32_t hdr_size, uint32_t drm_format, uint32_t hdr_size,
uint32_t width, uint32_t height); uint32_t width, uint32_t height, unsigned flags);
/** /**
* This operation creates a buffer from a given and possibly foreign handle * This operation creates a buffer from a given and possibly foreign handle
@@ -207,7 +230,9 @@ typedef struct _DrmDriverOps {
* DrmSurfaceBuffer object. * DrmSurfaceBuffer object.
*/ */
DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver, DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver,
uint32_t handle, size_t size); uint32_t handle, size_t size,
uint32_t drm_format, uint32_t hdr_size,
uint32_t width, uint32_t height, uint32_t pitch);
/** /**
* This operation creates a buffer for the given system global name * This operation creates a buffer for the given system global name
@@ -219,7 +244,9 @@ typedef struct _DrmDriverOps {
* DrmSurfaceBuffer object. * DrmSurfaceBuffer object.
*/ */
DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver, DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver,
uint32_t name); uint32_t name,
uint32_t drm_format, uint32_t hdr_size,
uint32_t width, uint32_t height, uint32_t pitch);
/** /**
* This operation creates a buffer for the given PRIME file descriptor * This operation creates a buffer for the given PRIME file descriptor
@@ -231,21 +258,19 @@ typedef struct _DrmDriverOps {
* DrmSurfaceBuffer object. * DrmSurfaceBuffer object.
*/ */
DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver, DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver,
int prime_fd, size_t size); int prime_fd, size_t size,
uint32_t drm_format, uint32_t hdr_size,
uint32_t width, uint32_t height, uint32_t pitch);
/** /**
* This operation maps the buffer into the current process's virtual memory * This operation maps the buffer into the current process's virtual memory
* space, and returns the virtual address. If failed, it returns NULL. * space, and returns the virtual address. If failed, it returns NULL.
* *
* When \a for_scanout is not zero, the buffer will be used for scan out
* frame buffer.
*
* \note The driver must implement this operation. The driver must * \note The driver must implement this operation. The driver must
* set a valid value for buff field of the DrmSurfaceBuffer object * set a valid value for buff field of the DrmSurfaceBuffer object
* on success. * on success.
*/ */
uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer, uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
int for_scanout);
/** /**
* This operation un-maps a buffer. * This operation un-maps a buffer.
@@ -264,96 +289,51 @@ typedef struct _DrmDriverOps {
void (* destroy_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer); void (* destroy_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
/** /**
* This operation clears the specific rectangle area of a buffer * This operation fills the specific rectangle area of a buffer
* with the specific pixel value. If succeed, it returns 0. * with the specific pixel value. If succeed, it returns 0.
* *
* \note If this operation is set as NULL, the driver does not support * \note If this operation is set as NULL, the driver does not support
* hardware accelerated clear operation. * hardware accelerated filling operation.
*/ */
int (* clear_buffer) (DrmDriver *driver, int (* fill_rect) (DrmDriver *driver,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value); DrmSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value);
/** /**
* This operation checks whether a hardware accelerated blit * This operation checks whether a specified hardware accelerated blit
* can be done between the source buffer and the destination buffer. * can be done between the source buffer and the destination buffer.
* If succeed, it returns 0. * If succeed, it returns zero, otherwise for failure.
* If succeed, it is safe to call do_blit operation.
* *
* \note If this operation is set as NULL, it will be supposed that * \note If this operation is set as NULL, it will be supposed that
* the driver does not support any hardware accelerated blitting operation. * the driver does not support any hardware accelerated blitting operation.
*/ */
int (* check_blit) (DrmDriver *driver, int (* check_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
/**
* This operation copies bits from a source buffer to a destination buffer.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated copy blitting.
*
* \note Currently, the logical operation is ignored.
*/
int (* copy_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc, DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
ColorLogicalOp logic_op); const DrmBlitOperations *ops);
/** /**
* This operation blits pixels from a source buffer with the source alpha * This operation does the real blit. It should not be NULL if check_blit
* value specified to a destination buffer. * is not NULL.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated blitting with alpha.
*/ */
int (* alpha_blit) (DrmDriver *driver, int (* do_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc, DrmSurfaceBuffer *src_buf, const GAL_Rect *src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, DrmSurfaceBuffer *dst_buf, const GAL_Rect *dst_rc,
uint8_t alpha); const DrmBlitOperations *blit_ops);
/** /**
* This operation blits pixels from a source buffer to a destination buffer, * This operation copies the pixels from the source buffer to
* but skipping the pixel value specified by \a color_key. * the destination buffer, with or without scaling, rotation, and flip.
* *
* \note If this operation is set as NULL, the driver does not support * \note If this operation is set as NULL, the driver does not support
* hardware accelerated blitting with color key. * hardware accelerated copy operation between buffers.
*/ */
int (* key_blit) (DrmDriver *driver, int (* copy_buff) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc, DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
uint32_t color_key); BlitCopyOperation op);
/**
* This operation blits pixels from a source buffer with the source alpha
* value specified to a destination buffer, but skipping the pixel value
* specified.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated blitting with alpha and color key.
*/
int (* alpha_key_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
uint8_t alpha, uint32_t color_key);
/**
* This operation blits pixels from a source buffer with the source alpha
* value of pixels to the destination buffer, and with the specified color
* compositing/blending method (\a ColorBlendMethod).
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated blitting with alpha on basis per pixel.
*
* \note Currently, the color compositing/blending method is ignored.
*/
int (* alpha_pixel_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
ColorBlendMethod blend_method);
} DrmDriverOps; } DrmDriverOps;
/** The current version of DRM driver. */
#define DRM_DRIVER_VERSION 1
/** /**
* Implement this stub to return the DRI driver operations * Implement this stub to return the DRI driver operations
* *
+486 -33
View File
File diff suppressed because it is too large Load Diff
+85 -4
View File
@@ -456,6 +456,45 @@ MG_EXPORT void GUIAPI MiniGUIPanic (int exitcode);
* @{ * @{
*/ */
/**
* \fn GHANDLE GUIAPI JoinLayerEx (const char* layer_name,
const char* client_name,
int max_nr_highers, int max_nr_normals, int *cli_id)
* \brief Joins to a layer and returns the client identifier if success.
*
* This function should be called by clients before calling any other MiniGUI
* functions. You can call \a GetLayerInfo to get the layer information.
* If the layer to be joined does not exist, the server, i.e. \a mginit, will
* try to create a new one. If you passed a NULL pointer or a null string for
* \a layer_name, the client will join to the default layer.
*
* If the client want to create a new layer, you should specify the maximal
* number of z-nodes in the higher level (max_nr_highers) and the maximal
* number of z-nodes in the normal level (max_nr_normals) of the new layer.
* Passing zero to \a max_nr_highers and max_nr_normals will use the default
* values, and the default values are specified by ServerStartup.
*
* Note that the server will create a default layer named "mginit".
*
* \param layer_name The name of the layer. You can use NAME_TOPMOST_LAYER to
* specify the current topmost layer.
* \param client_name The name of the client.
* \param max_nr_highers The maximal number of z-nodes in the higher level of
* the new layer.
* \param max_nr_normals The maximal number of z-nodes in the normal level of
* the new layer.
* \param cli_id The pointer to a buffer of int to return the client identifier.
*
* \return The handle to the layer on success, INV_LAYER_HANDLE on error.
*
* \note Only call this function in clients of MiniGUI-Processes.
*
* \sa GetLayerInfo, ServerStartup, ServerCreateLayer
*/
MG_EXPORT GHANDLE GUIAPI JoinLayerEx (const char* layer_name,
const char* client_name,
int max_nr_highers, int max_nr_normals, int *cli_id);
/** /**
* \fn GHANDLE GUIAPI JoinLayer (const char* layer_name, * \fn GHANDLE GUIAPI JoinLayer (const char* layer_name,
const char* client_name, const char* client_name,
@@ -490,9 +529,30 @@ MG_EXPORT void GUIAPI MiniGUIPanic (int exitcode);
* *
* \sa GetLayerInfo, ServerStartup, ServerCreateLayer * \sa GetLayerInfo, ServerStartup, ServerCreateLayer
*/ */
MG_EXPORT GHANDLE GUIAPI JoinLayer (const char* layer_name, static inline GHANDLE GUIAPI JoinLayer (const char* layer_name,
const char* client_name, const char* client_name,
int max_nr_highers, int max_nr_normals); int max_nr_highers, int max_nr_normals)
{
return JoinLayerEx (layer_name, client_name,
max_nr_highers, max_nr_normals, NULL);
}
/**
* \fn int GUIAPI GetClientId (void)
* \brief Gets the client identifier.
*
* You can get the information of a layer through this function.
* The information will be returned through the pointer arguments
* if the specific pointer is not NULL.
*
* \return Returns the client identifier of the current process.
* Note that the server always returns 0.
*
* \sa JoinLayerEx
*
* Since 5.2.0
*/
MG_EXPORT int GUIAPI GetClientId (void);
/** /**
* \fn GHANDLE GUIAPI GetLayerInfo (const char* layer_name, * \fn GHANDLE GUIAPI GetLayerInfo (const char* layer_name,
@@ -2125,7 +2185,7 @@ MG_EXPORT int GUIAPI ServerSendReplyEx (int clifd,
* \fn int GUIAPI ServerSendReply (int clifd, const void* reply, int len) * \fn int GUIAPI ServerSendReply (int clifd, const void* reply, int len)
* \brief Sends the reply to the client. * \brief Sends the reply to the client.
* *
* This function sends a replay pointed to by \a reply which is * This function sends a reply pointed to by \a reply which is
* \a len bytes long to the client. * \a len bytes long to the client.
* *
* \note Only used by the server to send the reply to the client. * \note Only used by the server to send the reply to the client.
@@ -2673,6 +2733,26 @@ MG_EXPORT void GUIAPI DesktopUpdateAllWindow (void);
#define DUMMY_LAYER_HANDLE (GHANDLE)(-1) #define DUMMY_LAYER_HANDLE (GHANDLE)(-1)
/**
* \fn GHANDLE GUIAPI JoinLayerEx (const char* layer_name,
const char* client_name,
int max_nr_highers, int max_nr_normals, int *cli_fd)
* \brief The dummy replacement of the same function for MiniGUI-Processes.
*
* This function is a replacment of the same function for MiniGUI-Processes
* runtime mode. We provide this function for MiniGUI-Threads and
* MiniGUI-Standalone runtime modes, in order to avoid using the
* conditional compilation instructions in your source code.
*
* \return Always returns DUMMY_LAYER_HANDLE to indicate success.
*/
static inline GHANDLE GUIAPI JoinLayerEx (const char* layer_name,
const char* client_name,
int max_nr_highers, int max_nr_normals, int *cli_fd)
{
return DUMMY_LAYER_HANDLE;
}
/** /**
* \fn GHANDLE GUIAPI JoinLayer (const char* layer_name, * \fn GHANDLE GUIAPI JoinLayer (const char* layer_name,
const char* client_name, const char* client_name,
@@ -2687,7 +2767,8 @@ MG_EXPORT void GUIAPI DesktopUpdateAllWindow (void);
* \return Always returns DUMMY_LAYER_HANDLE to indicate success. * \return Always returns DUMMY_LAYER_HANDLE to indicate success.
*/ */
static inline GHANDLE GUIAPI JoinLayer (const char* layer_name, static inline GHANDLE GUIAPI JoinLayer (const char* layer_name,
const char* client_name, int max_nr_highers, int max_nr_normals) const char* client_name,
int max_nr_highers, int max_nr_normals)
{ {
return DUMMY_LAYER_HANDLE; return DUMMY_LAYER_HANDLE;
} }
+32 -3
View File
@@ -2990,18 +2990,22 @@ typedef struct _WINMASKINFO {
if the client moved to a new layer */ if the client moved to a new layer */
#define MSG_LAYERCHANGED 0x0149 #define MSG_LAYERCHANGED 0x0149
/* Since 5.2.0; the server send this message to the client
if a window has been composited to the screen. */
#define MSG_WINCOMPOSITED 0x014A
#endif /* defined _MGRM_PROCESSES */ #endif /* defined _MGRM_PROCESSES */
/* Since 5.0.0: for managing message thread */ /* Since 5.0.0: for managing message thread */
#define MSG_MANAGE_MSGTHREAD 0x014A #define MSG_MANAGE_MSGTHREAD 0x014B
#define MSGTHREAD_SIGNIN 0x00 #define MSGTHREAD_SIGNIN 0x00
#define MSGTHREAD_SIGNOUT 0x01 #define MSGTHREAD_SIGNOUT 0x01
/* Since 5.0.0: for calculating the default position */ /* Since 5.0.0: for calculating the default position */
#define MSG_CALC_POSITION 0x014B #define MSG_CALC_POSITION 0x014C
/* Since 5.0.6: for waking up the client */ /* Since 5.0.6: for waking up the client */
#define MSG_WAKEUP_CLIENT 0x014C #define MSG_WAKEUP_CLIENT 0x014D
/** /**
* \def MSG_DOESNEEDIME * \def MSG_DOESNEEDIME
@@ -7237,6 +7241,31 @@ MG_EXPORT BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags);
#ifdef _MGSCHEMA_COMPOSITING #ifdef _MGSCHEMA_COMPOSITING
/**
* \fn int GUIAPI GetWindowSharedSurfaceFD (HWND hwnd, size_t *map_size,
* DWORD *flags)
* \brief Gets the file descriptor of the surface buffer for a window or
* the main window it locates.
*
* This function gets the file descriptor of the surface buffer for
* the specified window if it is a main window or the main window it locates.
* Note that if the window is a control that has the style `WS_EX_CTRLASMAINWIN`,
* the window will have a separate surface buffer.
*
* \param hwnd The handle to the window.
*
* \return An integer larger than or equal to 0 for a valid file descriptor,
* otherwise a negative value.
*
* \note This function only available when _MGSCHEMA_COMPOSITING is defined.
*
* \sa CreateMemDCFromSharedSurfaceFD
*
* Since 5.0.13
*/
MG_EXPORT int GUIAPI GetWindowSharedSurfaceFD (HWND hWnd, size_t *map_size,
DWORD *flags);
/** /**
* \fn BOOL GUIAPI SetMainWindowCompositing (HWND hWnd, * \fn BOOL GUIAPI SetMainWindowCompositing (HWND hWnd,
int type, DWORD arg) int type, DWORD arg)
-5064
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
# This file does not do anything, except making sure these files are included # This file does not do anything, except making sure these files are included
# when you run 'make dist'. # when you run 'make dist'.
EXTRA_DIST = libtool.m4 EXTRA_DIST =
-3724
View File
File diff suppressed because it is too large Load Diff
+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:
+32 -3
View File
@@ -184,6 +184,23 @@ static void process_socket_message (MSG *msg)
LOSWORD(msg->wParam), HISWORD(msg->wParam), LOSWORD(msg->wParam), HISWORD(msg->wParam),
LOSWORD(msg->lParam), HISWORD(msg->lParam)); LOSWORD(msg->lParam), HISWORD(msg->lParam));
} }
#ifdef _MGSCHEMA_COMPOSITING
else if (msg->message == MSG_WINCOMPOSITED) {
/* Since 5.2.0 */
int slot = (int)msg->wParam;
HWND hwnd = (HWND)msg->lParam;
unsigned dirty_age = (unsigned)msg->time;
if (__mg_client_check_znode_hwnd(slot, hwnd, __mg_client_id)) {
GAL_Surface *ssurf = ((PMAINWIN)hwnd)->surf;
assert(ssurf->shared_header);
__mg_lock_file_for_write(ssurf->fd);
if (ssurf->dirty_info->dirty_age == dirty_age) {
ssurf->dirty_info->nr_dirty_rcs = 0;
}
__mg_unlock_file_for_write(ssurf->fd);
}
}
#endif
else { else {
if (msg->hwnd == HWND_NULL) { if (msg->hwnd == HWND_NULL) {
msg->hwnd = HWND_DESKTOP; msg->hwnd = HWND_DESKTOP;
@@ -518,8 +535,8 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
return (n > 0); return (n > 0);
} }
GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name, GHANDLE GUIAPI JoinLayerEx (const char* layer_name, const char* client_name,
int max_nr_topmosts, int max_nr_normals) int max_nr_topmosts, int max_nr_normals, int *cli_id)
{ {
GHANDLE layer_handle = INV_LAYER_HANDLE; GHANDLE layer_handle = INV_LAYER_HANDLE;
REQUEST req; REQUEST req;
@@ -529,8 +546,12 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
if (mgIsServer) if (mgIsServer)
return layer_handle; return layer_handle;
if (__mg_client_id != 0) /* Already joined, return the handle */ if (__mg_client_id != 0) {
/* Already joined, return the handle */
if (cli_id)
*cli_id = __mg_client_id;
return GetLayerInfo (NAME_SELF_LAYER, NULL, NULL, NULL); return GetLayerInfo (NAME_SELF_LAYER, NULL, NULL, NULL);
}
if (layer_name) { if (layer_name) {
strncpy (info.layer_name, layer_name, LEN_LAYER_NAME); strncpy (info.layer_name, layer_name, LEN_LAYER_NAME);
@@ -593,10 +614,18 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
__mg_start_client_desktop (); __mg_start_client_desktop ();
if (cli_id)
*cli_id = __mg_client_id;
ret: ret:
return layer_handle; return layer_handle;
} }
int GUIAPI GetClientId (void)
{
return __mg_client_id;
}
GHANDLE GUIAPI GetLayerInfo (const char* layer_name, GHANDLE GUIAPI GetLayerInfo (const char* layer_name,
int* nr_clients, BOOL* is_topmost, int* cli_active) int* nr_clients, BOOL* is_topmost, int* cli_active)
{ {
+56 -46
View File
@@ -210,6 +210,7 @@ static void setup_dc (HWND hWnd, BIDISLEDITDATA *sled, HDC hdc, BOOL bSel)
DWORD dwStyle = GetWindowStyle (hWnd); DWORD dwStyle = GetWindowStyle (hWnd);
if (!bSel) { if (!bSel) {
SetBkMode (hdc, BM_TRANSPARENT);
if (dwStyle & WS_DISABLED) if (dwStyle & WS_DISABLED)
SetTextColor (hdc, SetTextColor (hdc,
@@ -583,7 +584,7 @@ static void slePaint (HWND hWnd, HDC hdc, PBIDISLEDITDATA sled)
/* draw selected chars */ /* draw selected chars */
setup_dc (hWnd, sled, hdc, TRUE); setup_dc (hWnd, sled, hdc, TRUE);
outw += DrawACharString (hdc, startx + outw, starty, outw += DrawACharString (hdc, startx + outw, starty,
achar_string, sled->selEnd - sled->selStart, NULL, NULL); achar_string, sled->selEnd - sled->selStart, NULL, NULL);
achar_string += sled->selEnd - sled->selStart; achar_string += sled->selEnd - sled->selStart;
@@ -1069,6 +1070,7 @@ static int ascii_bidi_type[] = {
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_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_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
/*0x60~0x6f*/ /*0x60~0x6f*/
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON, 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,
@@ -1085,21 +1087,23 @@ static int ascii_bidi_type[] = {
static int inline get_char_bidi_type (LOGFONT* logfont, Achar32 chv) static int inline get_char_bidi_type (LOGFONT* logfont, Achar32 chv)
{ {
DEVFONT* devfont; DEVFONT* devfont;
int bidi_type = BIDI_TYPE_LTR;
if (IS_MBCHV(chv)) { if (IS_MBCHV(chv)) {
devfont = logfont->devfonts[1]; devfont = logfont->devfonts[1];
if (devfont->charset_ops->bidi_char_type) { if (devfont->charset_ops->bidi_char_type) {
return devfont->charset_ops->bidi_char_type (chv); bidi_type = devfont->charset_ops->bidi_char_type (chv);
}
else {
return BIDI_TYPE_LTR;
} }
} }
else { else {
return ascii_bidi_type[chv]; assert(chv < 0x80);
bidi_type = ascii_bidi_type[chv];
} }
_DBG_PRINTF("chv: %X: bidi_type: %x\n", chv, bidi_type);
return bidi_type;
} }
static int get_text_rl_type (PLOGFONT logfont, char* newtext, int l_char_type, static int get_text_rl_type (PLOGFONT logfont, char* newtext, int l_char_type,
int r_char_type, int line_type) int r_char_type, int line_type)
@@ -1108,53 +1112,60 @@ static int get_text_rl_type (PLOGFONT logfont, char* newtext, int l_char_type,
Achar32 chv; Achar32 chv;
chv = GetACharValue (logfont, newtext, strlen(newtext), NULL, 0); chv = GetACharValue (logfont, newtext, strlen(newtext), NULL, 0);
if (chv == INV_ACHAR_VALUE) int type = CHAR_TYPE_UNKKOWN;
return -1;
if (chv == INV_ACHAR_VALUE) {
goto done;
}
bidi_type = get_char_bidi_type (logfont, chv); bidi_type = get_char_bidi_type (logfont, chv);
if (BIDI_IS_STRONG(bidi_type)) if (BIDI_IS_STRONG(bidi_type)) {
{ if (BIDI_IS_RTL(bidi_type)) {
if (BIDI_IS_RTL(bidi_type)) type = CHAR_TYPE_RTL;
{ goto done;
return CHAR_TYPE_RTL;
} }
else else {
{ type = CHAR_TYPE_LTR;
return CHAR_TYPE_LTR; goto done;
} }
} }
if (BIDI_IS_NUMBER(bidi_type)) if (BIDI_IS_NUMBER(bidi_type)) {
{ type = CHAR_TYPE_LTR;
return CHAR_TYPE_LTR; goto done;
} }
if (l_char_type == r_char_type) if (l_char_type == r_char_type) {
{ type = l_char_type;
return l_char_type; goto done;
} }
/* no left char */ /* no left char */
else if (l_char_type == -1) else if (l_char_type == CHAR_TYPE_UNKKOWN) {
{
if (BIDI_IS_WEAK (bidi_type)) if (BIDI_IS_WEAK (bidi_type))
return r_char_type; type = r_char_type;
else else
return line_type; type = line_type;
goto done;
} }
/* no right char */ /* no right char */
else if (r_char_type == -1) else if (r_char_type == CHAR_TYPE_UNKKOWN) {
{
if (BIDI_IS_WEAK (bidi_type)) if (BIDI_IS_WEAK (bidi_type))
return l_char_type; type = l_char_type;
else else
return line_type; type = line_type;
goto done;
} }
else else {
{ type = line_type;
return line_type;
} }
_DBG_PRINTF("l_char_type: %d, r_char_type: %d, line_type: %d, "
"type for %X: %d\n",
l_char_type, r_char_type, line_type, chv, type);
done:
return type;
} }
static int get_line_rl_type (ACHARMAPINFO* map, int len) static int get_line_rl_type (ACHARMAPINFO* map, int len)
@@ -2133,7 +2144,7 @@ esright_input_char_refresh (HWND hWnd,
scroll_rc.right = cur_caret_x; 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;
@@ -2504,8 +2515,6 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
unsigned char charBuffer [4]; unsigned char charBuffer [4];
int chars; int chars;
_DBG_PRINTF("get char-----------------char----%p\n", (PVOID)wParam);
if (dwStyle & ES_READONLY) if (dwStyle & ES_READONLY)
return 0; return 0;
@@ -2526,9 +2535,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]);
} }
@@ -2537,12 +2543,12 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
} }
} }
if (chars == 1) { if (chars > 1) {
if (charBuffer [0] < 0x20 && charBuffer[0] != '\b') //FIXME _WRN_PRINTF("BIDISLEDIT only support ISO8859-6 charset\n");
return 0; return 0;
} }
else if (charBuffer [0] == '\b' || charBuffer [0] == 0x7F) {
if (wParam == '\b') { // backspace // BS or DEL
int del = 1; int del = 1;
if (sled->editPos == 0 && sled->selStart == sled->selEnd) if (sled->editPos == 0 && sled->selStart == sled->selEnd)
@@ -2564,9 +2570,12 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
sleBackspaceText (hWnd, sled, del, FALSE, FALSE); sleBackspaceText (hWnd, sled, del, FALSE, FALSE);
} }
} }
else{ else if (charBuffer [0] < 0x20) {
// ignore all other control characters.
return 0;
}
else {
if (dwStyle & ES_LEFT) { if (dwStyle & ES_LEFT) {
//if ((dwStyle&0xffff) == 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);
@@ -2586,6 +2595,7 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
sleInsertText (hWnd, sled, (char* )charBuffer, chars, FALSE); sleInsertText (hWnd, sled, (char* )charBuffer, chars, FALSE);
} }
} }
return 0; return 0;
} }
+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);
+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 {
+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 {{{
+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,
+21 -18
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
@@ -166,7 +166,7 @@ static unsigned short iso8859_68x_unicode_map [] =
0xFEB3, 0xFEB7, 0xFEBB, 0xFEBF, /*0xF1~0xF4*/ 0xFEB3, 0xFEB7, 0xFEBB, 0xFEBF, /*0xF1~0xF4*/
0xFECB, 0xFECF, 0xFED3, 0xFED7, /*0xF5~0xF8*/ 0xFECB, 0xFECF, 0xFED3, 0xFED7, /*0xF5~0xF8*/
0xFEDB, 0xFEDF, 0xFEE3, 0xFEE7, /*0xF9~0xFC*/ 0xFEDB, 0xFEDF, 0xFEE3, 0xFEE7, /*0xF9~0xFC*/
0xFEEB, 0xFEF4, 0xFFFF, /*0xFD~0xFF*/ 0xFEEB, 0xFEF3, 0xFFFF, /*0xFD~0xFF*/
0xFEC4, 0xFEC6, 0xFE82, 0xFE84, /*0x100~0x103*/ 0xFEC4, 0xFEC6, 0xFE82, 0xFE84, /*0x100~0x103*/
0xFE86, 0xFE88, 0xFE8C, 0xFE8E, /*0x104~0x107*/ 0xFE86, 0xFE88, 0xFE8C, 0xFE8E, /*0x104~0x107*/
@@ -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,
@@ -573,7 +576,7 @@ static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_ON, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
/*0xf0~0xff*/ /*0xf0~0xff*/
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, 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
@@ -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
@@ -49,6 +49,8 @@
** Create date: 2000/06/13 ** Create date: 2000/06/13
*/ */
#undef NDEBUG
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -233,6 +235,7 @@ static CHARSETOPS CharsetOps_ascii = {
1, 1,
FONT_CHARSET_US_ASCII, FONT_CHARSET_US_ASCII,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -296,6 +299,7 @@ static CHARSETOPS CharsetOps_iso8859_1 = {
1, 1,
FONT_CHARSET_ISO8859_1, FONT_CHARSET_ISO8859_1,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -407,6 +411,7 @@ static CHARSETOPS CharsetOps_iso8859_2 = {
1, 1,
FONT_CHARSET_ISO8859_2, FONT_CHARSET_ISO8859_2,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -519,6 +524,7 @@ static CHARSETOPS CharsetOps_iso8859_3 = {
1, 1,
FONT_CHARSET_ISO8859_3, FONT_CHARSET_ISO8859_3,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -632,6 +638,7 @@ static CHARSETOPS CharsetOps_iso8859_4 = {
1, 1,
FONT_CHARSET_ISO8859_4, FONT_CHARSET_ISO8859_4,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -726,6 +733,7 @@ static CHARSETOPS CharsetOps_iso8859_5 = {
1, 1,
FONT_CHARSET_ISO8859_5, FONT_CHARSET_ISO8859_5,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -884,6 +892,7 @@ static CHARSETOPS CharsetOps_iso8859_7 = {
1, 1,
FONT_CHARSET_ISO8859_7, FONT_CHARSET_ISO8859_7,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -969,7 +978,6 @@ static const unsigned char* iso8859_8_get_next_word (const unsigned char* mstr,
} }
static BidiType __mg_iso8859_8_bidi_char_type_map[] = { static BidiType __mg_iso8859_8_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,
@@ -1017,7 +1025,6 @@ static BidiType __mg_iso8859_8_bidi_char_type_map[] = {
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_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_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
@@ -1072,10 +1079,9 @@ static BidiType __mg_iso8859_8_bidi_char_type_map[] = {
static BidiType iso8859_8_bidi_char_type (Achar32 chv) static BidiType iso8859_8_bidi_char_type (Achar32 chv)
{ {
chv = REAL_ACHAR(chv); chv = REAL_ACHAR(chv);
if (chv > 0x7F) assert(chv < TABLESIZE(__mg_iso8859_8_bidi_char_type_map));
return (BidiType)__mg_iso8859_8_bidi_char_type_map[chv - 0x80];
else return (BidiType)__mg_iso8859_8_bidi_char_type_map[chv];
return (BidiType)__mg_iso8859_1_bidi_char_type_map[chv];
} }
static const BIDICHAR_MIRROR_MAP __mg_iso8859_8_mirror_table [] = static const BIDICHAR_MIRROR_MAP __mg_iso8859_8_mirror_table [] =
@@ -1160,6 +1166,7 @@ static CHARSETOPS CharsetOps_iso8859_8 = {
2, // This is a trick for bidi reorder only implemented for MBC. 2, // This is a trick for bidi reorder only implemented for MBC.
FONT_CHARSET_ISO8859_8, FONT_CHARSET_ISO8859_8,
0, 0,
1,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -1261,6 +1268,7 @@ static CHARSETOPS CharsetOps_iso8859_9 = {
1, 1,
FONT_CHARSET_ISO8859_9, FONT_CHARSET_ISO8859_9,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -1374,6 +1382,7 @@ static CHARSETOPS CharsetOps_iso8859_10 = {
1, 1,
FONT_CHARSET_ISO8859_10, FONT_CHARSET_ISO8859_10,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -1486,6 +1495,7 @@ static CHARSETOPS CharsetOps_iso8859_11 = {
1, 1,
FONT_CHARSET_ISO8859_11, FONT_CHARSET_ISO8859_11,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -1598,6 +1608,7 @@ static CHARSETOPS CharsetOps_iso8859_13 = {
1, 1,
FONT_CHARSET_ISO8859_13, FONT_CHARSET_ISO8859_13,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -1710,6 +1721,7 @@ static CHARSETOPS CharsetOps_iso8859_14 = {
1, 1,
FONT_CHARSET_ISO8859_14, FONT_CHARSET_ISO8859_14,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -1821,6 +1833,7 @@ static CHARSETOPS CharsetOps_iso8859_15 = {
1, 1,
FONT_CHARSET_ISO8859_15, FONT_CHARSET_ISO8859_15,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -1971,6 +1984,7 @@ static CHARSETOPS CharsetOps_iso8859_16 = {
1, 1,
FONT_CHARSET_ISO8859_16, FONT_CHARSET_ISO8859_16,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -2168,6 +2182,7 @@ static CHARSETOPS CharsetOps_gb2312_0 = {
2, 2,
FONT_CHARSET_GB2312_0, FONT_CHARSET_GB2312_0,
0, 0,
0,
gb2312_0_len_first_char, gb2312_0_len_first_char,
gb2312_0_get_char_value, gb2312_0_get_char_value,
NULL, NULL,
@@ -2325,6 +2340,7 @@ static CHARSETOPS CharsetOps_gbk = {
2, 2,
FONT_CHARSET_GBK, FONT_CHARSET_GBK,
0, 0,
0,
gbk_len_first_char, gbk_len_first_char,
gbk_get_char_value, gbk_get_char_value,
NULL, NULL,
@@ -2593,6 +2609,7 @@ static CHARSETOPS CharsetOps_gb18030_0 = {
4, 4,
FONT_CHARSET_GB18030_0, FONT_CHARSET_GB18030_0,
0, 0,
0,
gb18030_0_len_first_char, gb18030_0_len_first_char,
gb18030_0_get_char_value, gb18030_0_get_char_value,
NULL, NULL,
@@ -2750,6 +2767,7 @@ static CHARSETOPS CharsetOps_big5 = {
2, 2,
FONT_CHARSET_BIG5, FONT_CHARSET_BIG5,
0, 0,
0,
big5_len_first_char, big5_len_first_char,
big5_get_char_value, big5_get_char_value,
NULL, NULL,
@@ -2896,6 +2914,7 @@ static CHARSETOPS CharsetOps_ksc5601_0 = {
2, 2,
FONT_CHARSET_EUCKR, FONT_CHARSET_EUCKR,
0, 0,
0,
ksc5601_0_len_first_char, ksc5601_0_len_first_char,
ksc5601_0_get_char_value, ksc5601_0_get_char_value,
NULL, NULL,
@@ -3020,6 +3039,7 @@ static CHARSETOPS CharsetOps_jisx0201_0 = {
1, 1,
FONT_CHARSET_JISX0201_0, FONT_CHARSET_JISX0201_0,
0, 0,
0,
jisx0201_0_len_first_char, jisx0201_0_len_first_char,
jisx0201_0_get_char_value, jisx0201_0_get_char_value,
NULL, NULL,
@@ -3163,6 +3183,7 @@ static CHARSETOPS CharsetOps_jisx0208_0 = {
2, 2,
FONT_CHARSET_JISX0208_0, FONT_CHARSET_JISX0208_0,
0, 0,
0,
jisx0208_0_len_first_char, jisx0208_0_len_first_char,
jisx0208_0_get_char_value, jisx0208_0_get_char_value,
NULL, NULL,
@@ -3248,6 +3269,7 @@ static CHARSETOPS CharsetOps_jisx0201_1 = {
1, 1,
FONT_CHARSET_JISX0201_1, FONT_CHARSET_JISX0201_1,
0, 0,
0,
sb_len_first_char, sb_len_first_char,
sb_get_char_value, sb_get_char_value,
NULL, NULL,
@@ -3419,6 +3441,7 @@ static CHARSETOPS CharsetOps_jisx0208_1 = {
2, 2,
FONT_CHARSET_JISX0208_1, FONT_CHARSET_JISX0208_1,
0, 0,
0,
jisx0208_1_len_first_char, jisx0208_1_len_first_char,
jisx0208_1_get_char_value, jisx0208_1_get_char_value,
NULL, NULL,
+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,
+125 -18
View File
@@ -286,7 +286,7 @@ static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Achar32* achars
last = list; last = list;
for (i = 0; i < len; i++){ for (i = 0; i < len; i++){
if ((type = charset_ops->bidi_char_type (achars[i])) != last->type){ if ((type = charset_ops->bidi_char_type (REAL_ACHAR(achars[i]))) != last->type){
link = calloc(1, sizeof(TYPERUN)); link = calloc(1, sizeof(TYPERUN));
link->type = type; link->type = type;
link->pos = i; link->pos = i;
@@ -456,7 +456,7 @@ static void bidi_resolveWeak(TYPERUN **ptype_rl_list, Uint32 base_dir)
prev_type_org = TYPE(pp); prev_type_org = TYPE(pp);
} }
compact_neutrals (type_rl_list); compact_list (type_rl_list);
#ifdef BIDI_DEBUG #ifdef BIDI_DEBUG
print_run_types(type_rl_list); print_run_types(type_rl_list);
@@ -469,19 +469,115 @@ static void bidi_resolveWeak(TYPERUN **ptype_rl_list, Uint32 base_dir)
#define BIDI_EMBEDDING_DIR(list) BIDI_LEVEL_TO_DIR(LEVEL(list)) #define BIDI_EMBEDDING_DIR(list) BIDI_LEVEL_TO_DIR(LEVEL(list))
/* 4.Resolving Neutral Types */ /* 4.Resolving Neutral Types */
static void bidi_resolveNeutrals(TYPERUN **ptype_rl_list, Uint32 base_bir) static void bidi_resolveNeutrals(const CHARSETOPS* charset_ops, Achar32* achars, int len,
TYPERUN **ptype_rl_list, Uint32 base_bir)
{ {
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL; TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
Uint32* bracket_types = NULL;
int i;
if (charset_ops->bidi_mirror_char && achars && len > 0) {
typedef struct {
int pos;
Achar32 mirror;
} BRSTACK;
BRSTACK* stack = NULL;
int top = 0;
bracket_types = calloc(len, sizeof(Uint32));
stack = calloc(len, sizeof(BRSTACK));
if (bracket_types && stack) {
for (i = 0; i < len; i++) {
Achar32 ch = REAL_ACHAR(achars[i]);
Achar32 mirrored;
if (!charset_ops->bidi_mirror_char(ch, &mirrored))
continue;
if (ch < mirrored) {
stack[top].pos = i;
stack[top].mirror = mirrored;
top++;
}
else {
if (top > 0 && stack[top - 1].mirror == ch) {
int open_pos = stack[top - 1].pos;
int close_pos = i;
Uint32 found_dir = BIDI_TYPE_ON;
int k;
for (k = open_pos + 1; k < close_pos; k++) {
Uint32 t = charset_ops->bidi_char_type(REAL_ACHAR(achars[k]));
if (t == BIDI_TYPE_AL)
t = BIDI_TYPE_RTL;
if (BIDI_IS_LETTER(t)) {
found_dir = BIDI_IS_RTL(t) ? BIDI_TYPE_RTL : BIDI_TYPE_LTR;
break;
}
}
if (found_dir != BIDI_TYPE_ON) {
bracket_types[open_pos] = found_dir;
bracket_types[close_pos] = found_dir;
}
top--;
}
}
}
}
if (stack)
free(stack);
}
if (bracket_types) {
for (pp = type_rl_list->next; pp->next; pp = pp->next) {
if (BIDI_IS_NEUTRAL(TYPE(pp))) {
int start = POS(pp);
int end = start + LEN(pp);
Uint32 forced = BIDI_TYPE_ON;
if (end > len)
end = len;
for (i = start; i < end; i++) {
if (bracket_types[i] == BIDI_TYPE_RTL) {
forced = BIDI_TYPE_RTL;
break;
}
if (bracket_types[i] == BIDI_TYPE_LTR) {
forced = BIDI_TYPE_LTR;
}
}
if (forced != BIDI_TYPE_ON) {
TYPE(pp) = forced;
}
}
}
compact_list (type_rl_list);
}
DBGLOG ("\n4.Resolving neutral types\n"); DBGLOG ("\n4.Resolving neutral types\n");
for (pp = type_rl_list->next; pp->next; pp = pp->next) for (pp = type_rl_list->next; pp->next; pp = pp->next)
{ {
Uint32 prev_type, this_type, next_type; Uint32 prev_type, this_type, next_type;
TYPERUN* prev = NULL;
TYPERUN* next = NULL;
prev = pp->prev;
while (prev && BIDI_IS_NEUTRAL(TYPE(prev)) && !BIDI_IS_SENTINEL(TYPE(prev)))
prev = prev->prev;
prev_type = (!prev || BIDI_IS_SENTINEL(TYPE(prev))) ? base_bir : TYPE(prev);
prev_type = TYPE(pp->prev);
this_type = TYPE(pp); this_type = TYPE(pp);
next_type = (pp->next) ? TYPE(pp->next) : this_type; next = pp->next;
while (next && BIDI_IS_NEUTRAL(TYPE(next)) && !BIDI_IS_SENTINEL(TYPE(next)))
next = next->next;
next_type = (!next || BIDI_IS_SENTINEL(TYPE(next))) ? base_bir : TYPE(next);
/* "European and arabic numbers are treated as though they were R, NUMBER_TO_RTL does this. */ /* "European and arabic numbers are treated as though they were R, NUMBER_TO_RTL does this. */
this_type = BIDI_NUMBER_TO_RTL(this_type); this_type = BIDI_NUMBER_TO_RTL(this_type);
prev_type = BIDI_NUMBER_TO_RTL(prev_type); prev_type = BIDI_NUMBER_TO_RTL(prev_type);
@@ -498,6 +594,9 @@ static void bidi_resolveNeutrals(TYPERUN **ptype_rl_list, Uint32 base_bir)
print_resolved_levels (type_rl_list); print_resolved_levels (type_rl_list);
print_resolved_types (type_rl_list); print_resolved_types (type_rl_list);
#endif #endif
if (bracket_types)
free(bracket_types);
} }
/* 5.Resolving implicit levels. */ /* 5.Resolving implicit levels. */
@@ -549,10 +648,13 @@ bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Achar32* achars, int len,
int i; int i;
for (i = POS (pp); i < POS (pp) + LEN (pp); i++) for (i = POS (pp); i < POS (pp) + LEN (pp); i++)
{ {
Achar32 ch = achars[i];
Achar32 real_ch = REAL_ACHAR(ch);
Achar32 mirrored_ch; Achar32 mirrored_ch;
if (charset_ops->bidi_mirror_char && if (charset_ops->bidi_mirror_char &&
charset_ops->bidi_mirror_char (achars[i], &mirrored_ch)) charset_ops->bidi_mirror_char (real_ch, &mirrored_ch)) {
achars[i] = mirrored_ch; achars[i] = IS_MBCHV(ch) ? SET_MBCHV(mirrored_ch) : mirrored_ch;
}
} }
} }
} }
@@ -593,7 +695,7 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops,
bidi_resolveWeak(&type_rl_list, base_dir); bidi_resolveWeak(&type_rl_list, base_dir);
/* 4.Resolving Neutral Types */ /* 4.Resolving Neutral Types */
bidi_resolveNeutrals(&type_rl_list, base_dir); bidi_resolveNeutrals(charset_ops, achars, len, &type_rl_list, base_dir);
/* 5.Resolving implicit levels. */ /* 5.Resolving implicit levels. */
*pmax_level = bidi_resolveImplicit(&type_rl_list, base_level); *pmax_level = bidi_resolveImplicit(&type_rl_list, base_level);
@@ -703,21 +805,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 +826,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 +837,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 +855,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.*/
@@ -820,4 +928,3 @@ Uint32 __mg_legacy_bidi_str_base_dir (const CHARSETOPS* charset_ops,
return base_dir; return base_dir;
} }
+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;
+3 -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~2026, 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
@@ -57,6 +57,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdbool.h>
#include "common.h" #include "common.h"
#include "minigui.h" #include "minigui.h"
@@ -215,8 +216,6 @@ static unsigned char emojiSegmentationCategory (Uchar32 codepoint)
} }
typedef BOOL bool;
enum { false = FALSE, true = TRUE };
typedef unsigned char *emoji_text_iter_t; typedef unsigned char *emoji_text_iter_t;
#include "emoji_presentation_scanner.inc" #include "emoji_presentation_scanner.inc"
@@ -251,7 +250,7 @@ EmojiIterator * __mg_emoji_iterator_init (EmojiIterator *iter,
BOOL __mg_emoji_iterator_next (EmojiIterator *iter) BOOL __mg_emoji_iterator_next (EmojiIterator *iter)
{ {
unsigned int old_cursor, cursor; unsigned int old_cursor, cursor;
BOOL is_emoji; bool is_emoji;
if (iter->end >= iter->text_end) if (iter->end >= iter->text_end)
return FALSE; return FALSE;
+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,
+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;
}
}
} }
} }
+1 -1
View File
@@ -2185,7 +2185,7 @@ static int create_memdc_for_menu (TRACKMENUINFO* ptmi)
return -1; return -1;
} }
ptmi->dc = CreateMemDCFromSurface (surf); ptmi->dc = __mg_create_memdc_for_surface (surf);
if (ptmi->dc == HDC_INVALID) { if (ptmi->dc == HDC_INVALID) {
GAL_FreeSurface (surf); GAL_FreeSurface (surf);
return -1; return -1;
+42 -20
View File
@@ -93,9 +93,8 @@ void GUIAPI SetAutoRepeatMessage (HWND hWnd, UINT uMsg,
{ {
MSG msg; MSG msg;
if (hWnd) { if (hWnd && !MG_IS_NORMAL_WINDOW(hWnd)) {
if (!MG_IS_NORMAL_WINDOW(hWnd)) return;
return;
} }
msg.hwnd = hWnd; msg.hwnd = hWnd;
@@ -138,7 +137,7 @@ static void RecalcClientArea (HWND hWnd)
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;
} }
@@ -365,11 +364,6 @@ HWND GUIAPI ChildWindowFromPointEx (HWND hParent, POINT pt, UINT uFlags)
return pRet; return pRet;
} }
/* NOTE:
** this function is CONTROL mouse messages handler,
** can automaticly capture mouse depend on HITTEST code.
*/
static PCONTROL __mgs_captured_ctrl = NULL; static PCONTROL __mgs_captured_ctrl = NULL;
void __mg_reset_mainwin_capture_info (PCONTROL ctrl) void __mg_reset_mainwin_capture_info (PCONTROL ctrl)
@@ -388,6 +382,11 @@ void __mg_reset_mainwin_capture_info (PCONTROL ctrl)
} }
} }
/* NOTE:
** this function is CONTROL mouse messages handler,
** can automaticly capture mouse depend on HITTEST code.
*/
static LRESULT DefaultDTMouseMsgHandler (PMAINWIN pWin, UINT message, static LRESULT DefaultDTMouseMsgHandler (PMAINWIN pWin, UINT message,
WPARAM flags, int x, int y) WPARAM flags, int x, int y)
{ {
@@ -3245,7 +3244,7 @@ int GUIAPI ScrollWindowEx (HWND hWnd, int dx, int dy,
rcScroll = rcClient; rcScroll = rcClient;
/* /*
* BUGFIX: if we scrolled all area, the all area must * BUGFIX: if we scrolled all area, the whole area must
* be set as invalidate (dongjunjie 2010/7/28) * be set as invalidate (dongjunjie 2010/7/28)
*/ */
if ((dx != 0 && abs(dx) >= RECTW(rcScroll)) || if ((dx != 0 && abs(dx) >= RECTW(rcScroll)) ||
@@ -3281,7 +3280,6 @@ int GUIAPI ScrollWindowEx (HWND hWnd, int dx, int dy,
} }
SendMessage (HWND_DESKTOP, MSG_SCROLLMAINWIN, (WPARAM)hWnd, (LPARAM)(&swi)); SendMessage (HWND_DESKTOP, MSG_SCROLLMAINWIN, (WPARAM)hWnd, (LPARAM)(&swi));
UpdateInvalidClient(hWnd, FALSE);
/* show caret */ /* show caret */
if (fCaret) ShowCaretEx (hWnd, FALSE); if (fCaret) ShowCaretEx (hWnd, FALSE);
@@ -4478,10 +4476,10 @@ HWND GUIAPI CreateMainWindowEx2 (PMAINWINCREATE pCreateInfo, LINT id,
#endif #endif
#ifdef _MGSCHEMA_COMPOSITING #ifdef _MGSCHEMA_COMPOSITING
// Close file descriptor to free kernel memory? /* Since 5.2.0: keep fd available. */
if (pWin->surf->shared_header) { if (0 && pWin->surf->shared_header) {
close (pWin->surf->shared_header->fd); close (pWin->surf->fd);
pWin->surf->shared_header->fd = -1; pWin->surf->fd = -1;
} }
#endif #endif
@@ -5587,11 +5585,13 @@ BOOL GUIAPI ValidateRegion (HWND hWnd, const CLIPRGN* pRgn)
BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect) BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect)
{ {
PMAINWIN pWin; PMAINWIN pWin;
RECT rcClient;
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE); MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE);
pWin = MG_GET_WINDOW_PTR (hWnd); pWin = MG_GET_WINDOW_PTR (hWnd);
*update_rect = pWin->InvRgn.rgn.rcBound; GetClientRect(hWnd, &rcClient);
IntersectRect(update_rect, &pWin->InvRgn.rgn.rcBound, &rcClient);
return TRUE; return TRUE;
} }
@@ -6038,10 +6038,10 @@ HWND GUIAPI CreateWindowEx2 (const char* spClassName,
} }
#ifdef _MGSCHEMA_COMPOSITING #ifdef _MGSCHEMA_COMPOSITING
// Close file descriptor to free kernel memory? /* Since 5.2.0: keep fd available. */
if (dwExStyle & WS_EX_CTRLASMAINWIN && pNewCtrl->surf->shared_header) { if (0 && dwExStyle & WS_EX_CTRLASMAINWIN && pNewCtrl->surf->shared_header) {
close (pNewCtrl->surf->shared_header->fd); close (pNewCtrl->surf->fd);
pNewCtrl->surf->shared_header->fd = -1; pNewCtrl->surf->fd = -1;
} }
#endif #endif
@@ -6068,6 +6068,28 @@ error:
return HWND_INVALID; return HWND_INVALID;
} }
#ifdef _MGSCHEMA_COMPOSITING
int GUIAPI GetWindowSharedSurfaceFD (HWND hWnd, size_t *map_size, DWORD *flags)
{
MG_CHECK_RET (MG_IS_NORMAL_WINDOW (hWnd), -1);
PMAINWIN pWin = (PMAINWIN)hWnd;
if (pWin->surf->shared_header) {
if (map_size)
*map_size = pWin->surf->shared_header->map_size;
if (flags) {
*flags = MEMDC_FLAG_SWSURFACE;
if (pWin->surf->shared_header->byhw)
*flags |= MEMDC_FLAG_HWSURFACE;
}
return pWin->surf->fd;
}
return -1;
}
#endif /* _MGSCHEMA_COMPOSITING */
BOOL GUIAPI DestroyWindow (HWND hWnd) BOOL GUIAPI DestroyWindow (HWND hWnd)
{ {
PCONTROL pCtrl; PCONTROL pCtrl;
+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;
+27 -2
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"
@@ -113,10 +117,22 @@
#define REQID_LOADCURSOR_PNG 0x001D #define REQID_LOADCURSOR_PNG 0x001D
// Load cursor from in-memory PNG // Load cursor from in-memory PNG
#define REQID_LOADCURSOR_PNG_MEM 0x001E #define REQID_LOADCURSOR_PNG_MEM 0x001E
#if 0 // Deprecated since 5.2.0
// allocate semaphore for shared surface // allocate semaphore for shared surface
#define REQID_ALLOC_SURF_SEM 0x001F #define REQID_ALLOC_SURF_SEM 0x001F
// free semaphore of shared surface // free semaphore of shared surface
#define REQID_FREE_SURF_SEM 0x0020 #define REQID_FREE_SURF_SEM 0x0020
#endif
/* Since 5.2.0 */
// Operate a shared surface to register/revoke the name and set the fd
#define REQID_OPERATENAMEDSSURF 0x001F
#define ID_NAMEDSSURFOP_REGISTER 1
#define ID_NAMEDSSURFOP_SET 2
#define ID_NAMEDSSURFOP_REVOKE 3
#define REQID_RESERVED 0x0020
// Move the current client to another layer // Move the current client to another layer
#define REQID_MOVETOLAYER 0x0021 #define REQID_MOVETOLAYER 0x0021
@@ -142,15 +158,23 @@ MGUI_COMPILE_TIME_ASSERT(sys_request_id, MAX_SYS_REQID >= REQID_SYS_LAST);
#undef MGUI_COMPILE_TIME_ASSERT #undef MGUI_COMPILE_TIME_ASSERT
/* Since 5.2.0 */
typedef struct OperateNSSurfInfo
{
int id_op;
char name[NAME_MAX + 1];
size_t map_size;
} OPERATENSSURFINFO;
/* Since 5.0.0 */ /* Since 5.0.0 */
typedef struct _SharedSurfInfo { typedef struct _SharedSurfInfo {
size_t size; // whole size of the surface
off_t offset; // offset of pixel data
uint32_t flags; // the flags of the surface uint32_t flags; // the flags of the surface
uint32_t width, height; uint32_t width, height;
uint32_t pitch; uint32_t pitch;
uint32_t name; // when use flink name uint32_t name; // when use flink name
uint32_t drm_format; // DRM pixel format uint32_t drm_format; // DRM pixel format
size_t size; // whole size of the surface
off_t offset; // offset of pixel data
} SHAREDSURFINFO; } SHAREDSURFINFO;
typedef struct JoinLayerInfo { typedef struct JoinLayerInfo {
@@ -359,6 +383,7 @@ void __mg_start_client_desktop (void);
void __mg_update_window (HWND hwnd, int left, int top, int right, int bottom); void __mg_update_window (HWND hwnd, int left, int top, int right, int bottom);
BOOL __mg_client_check_znode_hwnd (int slot, HWND hwnd, int cli);
BOOL __mg_client_check_hwnd (HWND hwnd, int cli); BOOL __mg_client_check_hwnd (HWND hwnd, int cli);
BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid); BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid);
+12 -5
View File
@@ -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;
@@ -516,14 +521,16 @@ static inline void _dc_step_y (PDC pdc, int step)
# define BLOCK_DRAW_SEM(pdc) \ # define BLOCK_DRAW_SEM(pdc) \
do { \ do { \
if (pdc->surface->shared_header) \ if (pdc->surface->shared_header) { \
LOCK_SURFACE_SEM (pdc->surface->shared_header->sem_num); \ __mg_lock_file_for_write(pdc->surface->fd); \
} \
} while (0) } while (0)
# define UNBLOCK_DRAW_SEM(pdc) \ # define UNBLOCK_DRAW_SEM(pdc) \
do { \ do { \
if (pdc->surface->shared_header) \ if (pdc->surface->shared_header) { \
UNLOCK_SURFACE_SEM (pdc->surface->shared_header->sem_num); \ __mg_unlock_file_for_write(pdc->surface->fd); \
} \
} while (0) } while (0)
# define IS_SCREEN_SURFACE(pdc) \ # define IS_SCREEN_SURFACE(pdc) \

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