mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-27 22:48:47 +08:00
Compare commits
156
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4b18828b2 | ||
|
|
36167be7e6 | ||
|
|
4b633c801d | ||
|
|
33fd8a8668 | ||
|
|
94f44890a5 | ||
|
|
cc7441c4dd | ||
|
|
6fdc0281ba | ||
|
|
136a51d9b8 | ||
|
|
5e871c486b | ||
|
|
fdd69bf470 | ||
|
|
10e55b0d4f | ||
|
|
682c81d636 | ||
|
|
9eb4e54b75 | ||
|
|
e43bc07a63 | ||
|
|
508130afdc | ||
|
|
d60c057dc4 | ||
|
|
8f5a741af6 | ||
|
|
bee1bc87c4 | ||
|
|
3a9274e9a0 | ||
|
|
44ee735cd6 | ||
|
|
2c010cdbeb | ||
|
|
a04ae43bdb | ||
|
|
5c333445c5 | ||
|
|
dd93e67a3d | ||
|
|
d886268eee | ||
|
|
090824cb91 | ||
|
|
00eb4e363f | ||
|
|
f73f0786ee | ||
|
|
dacc81cf2a | ||
|
|
97c6249af5 | ||
|
|
7ce1fe47ff | ||
|
|
8e66bb366e | ||
|
|
ce7fd6e776 | ||
|
|
957f9cbb47 | ||
|
|
2a7e3003bd | ||
|
|
19cd208a6e | ||
|
|
6a44111a35 | ||
|
|
fd5d55942b | ||
|
|
d4e7f048f0 | ||
|
|
d90c4d5842 | ||
|
|
0f562cd39f | ||
|
|
fb01003c45 | ||
|
|
9bcea02975 | ||
|
|
c51ae8d1c1 | ||
|
|
b8a5ad2d73 | ||
|
|
39b8c88d1b | ||
|
|
1e73f6713a | ||
|
|
97babaa4e2 | ||
|
|
c6c486f306 | ||
|
|
338f10b896 | ||
|
|
2353a873a8 | ||
|
|
52c539e870 | ||
|
|
64d63a84c5 | ||
|
|
3d80d73450 | ||
|
|
2e04898fbe | ||
|
|
f390e1a091 | ||
|
|
848c1d7ce1 | ||
|
|
0c0becc780 | ||
|
|
0e918da2a4 | ||
|
|
7f36c339b7 | ||
|
|
871486daab | ||
|
|
0cffc8798f | ||
|
|
4d4a3901eb | ||
|
|
50e95cb461 | ||
|
|
d223edf0ba | ||
|
|
8e88082f07 | ||
|
|
5b1762b637 | ||
|
|
6c83ea4ceb | ||
|
|
5aa5e75813 | ||
|
|
1ba35dcbf6 | ||
|
|
8828824b23 | ||
|
|
e3f2cc22ec | ||
|
|
93aae6782e | ||
|
|
b746d2927e | ||
|
|
79e3be705c | ||
|
|
a052b7bf55 | ||
|
|
74a84362ca | ||
|
|
d673008f5a | ||
|
|
09c9438de8 | ||
|
|
0734180d70 | ||
|
|
8ca8deb02d | ||
|
|
9aa719aeb3 | ||
|
|
447eebbafc | ||
|
|
19f8689a20 | ||
|
|
60902f83d5 | ||
|
|
a725acfd5e | ||
|
|
0191772111 | ||
|
|
a11cef5f2e | ||
|
|
cf4c75bcbc | ||
|
|
f85801dcbe | ||
|
|
4e67f8c56b | ||
|
|
1cfd2fe324 | ||
|
|
5ef2e0fa42 | ||
|
|
57b71e985c | ||
|
|
d9d76ec59b | ||
|
|
7935883267 | ||
|
|
0385def7b2 | ||
|
|
565f4b34e5 | ||
|
|
70ba8a0420 | ||
|
|
4bdbe4a002 | ||
|
|
2c98ef96da | ||
|
|
6663c98787 | ||
|
|
bbf2376f7a | ||
|
|
21ac9f2def | ||
|
|
a10d28dd11 | ||
|
|
856126c72e | ||
|
|
547fc0059c | ||
|
|
195363dc82 | ||
|
|
54288e5687 | ||
|
|
9d46406a95 | ||
|
|
d365feca5d | ||
|
|
f34ac9d0fe | ||
|
|
3a02b056ca | ||
|
|
1a1e8cf652 | ||
|
|
94feb0ae44 | ||
|
|
1e1a5edd13 | ||
|
|
ae9b14201b | ||
|
|
742150d4f1 | ||
|
|
03eac03c8c | ||
|
|
8cd6b037ec | ||
|
|
b35e38bdff | ||
|
|
58275c88e9 | ||
|
|
31b43521d0 | ||
|
|
e68ee00b85 | ||
|
|
6e54d4a7d7 | ||
|
|
69b1d63569 | ||
|
|
817f4063a1 | ||
|
|
c9ec23dc70 | ||
|
|
972085fa56 | ||
|
|
c2e24b61e3 | ||
|
|
bd1fb67930 | ||
|
|
0fcedfca08 | ||
|
|
c39ce7c0b8 | ||
|
|
97014ccdc8 | ||
|
|
48e7f6e928 | ||
|
|
473f9f98ff | ||
|
|
95d09a7673 | ||
|
|
53253ed101 | ||
|
|
4bd7c0eef4 | ||
|
|
9af71438dd | ||
|
|
747894247b | ||
|
|
1ed5b44926 | ||
|
|
16287af2a6 | ||
|
|
82033a44dd | ||
|
|
1c9537fc63 | ||
|
|
612c395c06 | ||
|
|
8dc0ee2ade | ||
|
|
caefd7355a | ||
|
|
9ea0e15dba | ||
|
|
83c8984c74 | ||
|
|
c975fe5b8d | ||
|
|
b4569adbd5 | ||
|
|
4761333a1a | ||
|
|
715a44beeb | ||
|
|
e6bb4fa05f | ||
|
|
c436af69bb |
+16
@@ -0,0 +1,16 @@
|
|||||||
|
The current main maintainers and/or developers:
|
||||||
|
|
||||||
|
* WEI Yongming
|
||||||
|
|
||||||
|
As employed engineers of [Beijing FMSoft Technologies Co., Ltd.],
|
||||||
|
the following people have participated in the development of MiniGUI Core:
|
||||||
|
|
||||||
|
* HOU Huihua
|
||||||
|
* WAN Zheng
|
||||||
|
* DONG Kai
|
||||||
|
* DONG Junjie
|
||||||
|
* YAN Xiaowei
|
||||||
|
|
||||||
|
For community contributors, please see RELASENOTES.md documentation.
|
||||||
|
|
||||||
|
[Beijing FMSoft Technologies Co., Ltd.]: http://www.fmsoft.cn
|
||||||
@@ -3216,7 +3216,7 @@ alExtra.(xwyan)
|
|||||||
* src/gui/lf_flat.c
|
* src/gui/lf_flat.c
|
||||||
* src/gui/lf_skin.c
|
* src/gui/lf_skin.c
|
||||||
|
|
||||||
08/24: ENHANCEMENT #1: Add a new method for FONTOPS: get_glyph_type to return
|
08/24: ENHANCEMENT #1: Add a new method for FONTOPS: get_char_type to return
|
||||||
the glyph type the devfont can give us.
|
the glyph type the devfont can give us.
|
||||||
* src/include/devfont.h
|
* src/include/devfont.h
|
||||||
* src/font/*.c
|
* src/font/*.c
|
||||||
@@ -4761,7 +4761,7 @@ create_skin_main_window_ex:
|
|||||||
* ext/skin/skin.c
|
* ext/skin/skin.c
|
||||||
|
|
||||||
05/16. ENHANCEMENT #8: Support for UTF-16LE and UTF-16BE charsets/encodings.
|
05/16. ENHANCEMENT #8: Support for UTF-16LE and UTF-16BE charsets/encodings.
|
||||||
* Change the definition of UChar32 to 'int'.
|
* Change the definition of Uchar32 to 'int'.
|
||||||
* include/gdi.h
|
* include/gdi.h
|
||||||
|
|
||||||
05/16. ENHANCEMENT #11: Support for FreeType2.
|
05/16. ENHANCEMENT #11: Support for FreeType2.
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Standalone)"
|
|||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
# control system is used.
|
# control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = v3.2.0
|
PROJECT_NUMBER = v3.4.0
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewer a
|
# for a project that appears at the top of each page and should give viewer a
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
|||||||
|
|
||||||
1. Introduction
|
1. Introduction
|
||||||
1. A brief building instruction
|
1. A brief building instruction
|
||||||
|
1. New features in version 3.4.x
|
||||||
1. New features in version 3.2.x
|
1. New features in version 3.2.x
|
||||||
1. The runtime modes of MiniGUI
|
1. The runtime modes of MiniGUI
|
||||||
1. History
|
1. History
|
||||||
@@ -18,42 +19,42 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
|||||||
|
|
||||||
|
|
||||||
## INTRODUCTION
|
## INTRODUCTION
|
||||||
|
|
||||||
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
|
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
|
||||||
User Interface) support system for embedded systems and smart IoT devices.
|
User Interface) support system for embedded systems and smart IoT devices.
|
||||||
This is the version 3.2.x of MiniGUI maintained by WEI Yongming
|
This is the version 3.2.x of MiniGUI maintained by WEI Yongming
|
||||||
(Vincent Wei, https://github.com/VincentWei).
|
(Vincent Wei, https://github.com/VincentWei).
|
||||||
|
|
||||||
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial
|
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial
|
||||||
use.
|
use.
|
||||||
|
|
||||||
MiniGUI aims to provide a fast, stable, full-featured, and cross-platform
|
MiniGUI aims to provide a fast, stable, full-featured, and cross-platform
|
||||||
windowing and GUI support system, which is especially fit for
|
windowing and GUI support system, which is especially fit for
|
||||||
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
|
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
|
||||||
traditional RTOSes, such as VxWorks, ThreadX, Nucleus, pSOS, uC/OS-II,
|
traditional RTOSes, such as VxWorks, ThreadX, Nucleus, pSOS, uC/OS-II,
|
||||||
and OSE.
|
and OSE.
|
||||||
|
|
||||||
This is the MiniGUI core source tree, which provides windowing
|
This is the MiniGUI core source tree, which provides windowing
|
||||||
and graphics interfaces as well as a lot of standard controls (tookit).
|
and graphics interfaces as well as a lot of standard controls (tookit).
|
||||||
|
|
||||||
Besides MiniGUI core, FMSoft also provides some components
|
Besides MiniGUI core, FMSoft also provides some components
|
||||||
for the developers to develop app much easier:
|
for the developers to develop app much easier:
|
||||||
|
|
||||||
* mGUtils: A MiniGUI component which contains miscellaneous utilities
|
* mGUtils: A MiniGUI component which contains miscellaneous utilities
|
||||||
like ColorSelectionDialogBox, FileOpenDialogBox, and so on.
|
like ColorSelectionDialogBox, FileOpenDialogBox, and so on.
|
||||||
|
|
||||||
* mGPlus: A MiniGUI component which provides support for advanced graphics
|
* mGPlus: A MiniGUI component which provides support for advanced graphics
|
||||||
functions like path, gradient, anti-aliase stretch, and color combination.
|
functions like path, gradient, anti-aliase stretch, and color combination.
|
||||||
|
|
||||||
* mGEff: mGEff provides an animation framework for MiniGUI app.
|
* mGEff: mGEff provides an animation framework for MiniGUI app.
|
||||||
It also provides some popular UI/UE special effects.
|
It also provides some popular UI/UE special effects.
|
||||||
|
|
||||||
* mGNCS: This component provides a new control set for MiniGUI app.
|
* mGNCS: This component provides a new control set for MiniGUI app.
|
||||||
By using mGNCS, you can use miniStudio to develop MiniGUI app in
|
By using mGNCS, you can use miniStudio to develop MiniGUI app in
|
||||||
WYSIWYG way.
|
WYSIWYG way.
|
||||||
|
|
||||||
* mGNCS4Touch: This component provides some new controls, which are
|
* mGNCS4Touch: This component provides some new controls, which are
|
||||||
compliant to the new control API spec of mGNCS, for devices with
|
compliant to the new control API spec of mGNCS, for devices with
|
||||||
a touch screen.
|
a touch screen.
|
||||||
|
|
||||||
There are also some legacy MiniGUI components. We will not maintain these
|
There are also some legacy MiniGUI components. We will not maintain these
|
||||||
@@ -61,7 +62,7 @@ components for MiniGUI core v3.2:
|
|||||||
|
|
||||||
* mGi: An input method component for MiniGUI. This component provides
|
* mGi: An input method component for MiniGUI. This component provides
|
||||||
some typical input methods (such as softkey, hand-writing, and predict
|
some typical input methods (such as softkey, hand-writing, and predict
|
||||||
text input for mobile phone) for MiniGUI apps.
|
text input for mobile phone) for MiniGUI apps.
|
||||||
|
|
||||||
* mGp: A printing component for MiniGUI. By using mGp, you can print
|
* mGp: A printing component for MiniGUI. By using mGp, you can print
|
||||||
out the graphics created by MiniGUI app to general-purpose printers.
|
out the graphics created by MiniGUI app to general-purpose printers.
|
||||||
@@ -70,11 +71,11 @@ components for MiniGUI core v3.2:
|
|||||||
provides a simple 3D API for app. You can use mG3d to create simple
|
provides a simple 3D API for app. You can use mG3d to create simple
|
||||||
3D UI.
|
3D UI.
|
||||||
|
|
||||||
MiniGUI is a free software project. In December 1998, the initiator of
|
MiniGUI is a free software project. In December 1998, the initiator of
|
||||||
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
|
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
|
||||||
License (GPL). In September 2002, the core developers of
|
License (GPL). In September 2002, the core developers of
|
||||||
MiniGUI founded FMSoft and started the commercial marketing with
|
MiniGUI founded FMSoft and started the commercial marketing with
|
||||||
the free software. By now, FMSoft still continues to release MiniGUI
|
the free software. By now, FMSoft still continues to release MiniGUI
|
||||||
as a free software project.
|
as a free software project.
|
||||||
|
|
||||||
You can download the source code tarball of MiniGUI and the dependent libraries
|
You can download the source code tarball of MiniGUI and the dependent libraries
|
||||||
@@ -82,27 +83,27 @@ from the download zone of the site:
|
|||||||
|
|
||||||
http://www.minigui.com
|
http://www.minigui.com
|
||||||
|
|
||||||
FMSoft also releases some open source apps for MiniGUI on the site above,
|
FMSoft also releases some open source apps for MiniGUI on the site above,
|
||||||
for examples:
|
for examples:
|
||||||
|
|
||||||
* mDolphin, licensed under Apache 2.0, is a full-featured
|
* mDolphin, licensed under Apache 2.0, is a full-featured
|
||||||
WEB/WAP browser, which is developed based on the open source browser
|
WEB/WAP browser, which is developed based on the open source browser
|
||||||
core WebKit and uses MiniGUI as its underlying graphics support system.
|
core WebKit and uses MiniGUI as its underlying graphics support system.
|
||||||
|
|
||||||
* mGallery, licensed under Apache 2.0, intends to
|
* mGallery, licensed under Apache 2.0, intends to
|
||||||
provide a total solution for PMP (Portable Multimedia Player),
|
provide a total solution for PMP (Portable Multimedia Player),
|
||||||
which uses MiniGUI as the graphics platform.
|
which uses MiniGUI as the graphics platform.
|
||||||
|
|
||||||
* mSpider, licensed under GPL 3.0, intends to provide a
|
* mSpider, licensed under GPL 3.0, intends to provide a
|
||||||
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
|
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
|
||||||
|
|
||||||
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
|
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
|
||||||
which addresses the needs of map browse, query, analysis, etc
|
which addresses the needs of map browse, query, analysis, etc
|
||||||
|
|
||||||
FMSoft had created the public repositories for MiniGUI core, MiniGUI
|
FMSoft had created the public repositories for MiniGUI core, MiniGUI
|
||||||
components, and other open source apps on GitHub. You can visit them on:
|
components, and other open source apps on GitHub. You can visit them on:
|
||||||
|
|
||||||
https://github.com/VincentWei
|
https://github.com/VincentWei
|
||||||
|
|
||||||
FMSoft also releases miniStudio, which is a WYSIWYG IDE for MiniGUI, as a shareware.
|
FMSoft also releases miniStudio, which is a WYSIWYG IDE for MiniGUI, as a shareware.
|
||||||
You can also download it from the official site of MiniGUI.
|
You can also download it from the official site of MiniGUI.
|
||||||
@@ -146,6 +147,15 @@ For more information, please run
|
|||||||
$ ./configure --help
|
$ ./configure --help
|
||||||
|
|
||||||
|
|
||||||
|
## NEW FEATURES IN VERSION 3.4.x
|
||||||
|
|
||||||
|
We introduce some new features in MiniGUI Version 3.4.x:
|
||||||
|
|
||||||
|
* The font and UNICODE related APIs are tuned or enhanced,
|
||||||
|
in order to support HybridOS Foundation C++ Library.
|
||||||
|
|
||||||
|
For more information, please refer to RELEASENOTES.md file.
|
||||||
|
|
||||||
## NEW FEATURES IN VERSION 3.2.x
|
## NEW FEATURES IN VERSION 3.2.x
|
||||||
|
|
||||||
We introduce some new features in MiniGUI Version 3.2.x:
|
We introduce some new features in MiniGUI Version 3.2.x:
|
||||||
@@ -154,7 +164,7 @@ We introduce some new features in MiniGUI Version 3.2.x:
|
|||||||
to support 64-bit platform. For more information, please refer to
|
to support 64-bit platform. For more information, please refer to
|
||||||
RELEASE-NOTES.md file.
|
RELEASE-NOTES.md file.
|
||||||
|
|
||||||
Because of the changes of some APIs, we recommended strongly that you
|
Because of the changes of some APIs, we recommended strongly that you
|
||||||
use this version for new projects.
|
use this version for new projects.
|
||||||
|
|
||||||
## THE RUNTIME MODES OF MINIGUI
|
## THE RUNTIME MODES OF MINIGUI
|
||||||
@@ -164,64 +174,64 @@ You can configure and compile MiniGUI as one of three runtime modes:
|
|||||||
* 'MiniGUI-Threads': A program running on MiniGUI-Threads can create
|
* 'MiniGUI-Threads': A program running on MiniGUI-Threads can create
|
||||||
multiple cascaded windows in different threads, and all the windows
|
multiple cascaded windows in different threads, and all the windows
|
||||||
belong to a single process. MiniGUI-Threads is fit for some real-time
|
belong to a single process. MiniGUI-Threads is fit for some real-time
|
||||||
systems on Linux/uClinux, eCos, uC/OS-II, VxWorks, pSOS, ThreadX,
|
systems on Linux/uClinux, eCos, uC/OS-II, VxWorks, pSOS, ThreadX,
|
||||||
and OSE.
|
and OSE.
|
||||||
|
|
||||||
* 'MiniGUI-Processes': A program running on MiniGUI-Processes is
|
* 'MiniGUI-Processes': A program running on MiniGUI-Processes is
|
||||||
an independent process, which can also create multiple windows.
|
an independent process, which can also create multiple windows.
|
||||||
MiniGUI-Processes is fit for some complex embedded systems, such as
|
MiniGUI-Processes is fit for some complex embedded systems, such as
|
||||||
PDAs, Thin-Clients or STBs. This mode is only useful for full-featured
|
PDAs, Thin-Clients or STBs. This mode is only useful for full-featured
|
||||||
UNIX-like operating systems, like Linux.
|
UNIX-like operating systems, like Linux.
|
||||||
|
|
||||||
* 'MiniGUI-Standalone': A single process version of MiniGUI. This mode
|
* 'MiniGUI-Standalone': A single process version of MiniGUI. This mode
|
||||||
is useful for some small systems, like uClinux or RTOSes.
|
is useful for some small systems, like uClinux or RTOSes.
|
||||||
|
|
||||||
The original MiniGUI (version 1.0) run in MiniGUI-Threads mode.
|
The original MiniGUI (version 1.0) run in MiniGUI-Threads mode.
|
||||||
It is based on POSIX-compliant thread library. And this thread-based
|
It is based on POSIX-compliant thread library. And this thread-based
|
||||||
architecture of MiniGUI is very fit for most traditional embedded
|
architecture of MiniGUI is very fit for most traditional embedded
|
||||||
operating systems, such as eCos, uC/OS-II, and VxWorks. However,
|
operating systems, such as eCos, uC/OS-II, and VxWorks. However,
|
||||||
if you use embedded Linux, the architecture like X Window will have
|
if you use embedded Linux, the architecture like X Window will have
|
||||||
better stability and scalability, because of the independent memory
|
better stability and scalability, because of the independent memory
|
||||||
address space of every process.
|
address space of every process.
|
||||||
|
|
||||||
Since version 2.0, we provides a new runtime mode called MiniGUI-Processes.
|
Since version 2.0, we provides a new runtime mode called MiniGUI-Processes.
|
||||||
You can use MiniGUI-Processes to run more than one MiniGUI-based
|
You can use MiniGUI-Processes to run more than one MiniGUI-based
|
||||||
program in the form of UNIX process at the same time. MiniGUI-Processes
|
program in the form of UNIX process at the same time. MiniGUI-Processes
|
||||||
is a full-featured multi-process version of original MiniGUI -- You
|
is a full-featured multi-process version of original MiniGUI -- You
|
||||||
can run a program based on MiniGUI-Processes from a program called
|
can run a program based on MiniGUI-Processes from a program called
|
||||||
'mginit'. Just like X Window, the former process is called a client,
|
'mginit'. Just like X Window, the former process is called a client,
|
||||||
and the latter the server.
|
and the latter the server.
|
||||||
|
|
||||||
Clients connect to the server via UNIX domain socket, and the server
|
Clients connect to the server via UNIX domain socket, and the server
|
||||||
receives and responses requests from clients. The server provides shared
|
receives and responses requests from clients. The server provides shared
|
||||||
resources for clients, manage window objects, and sends mouse
|
resources for clients, manage window objects, and sends mouse
|
||||||
(or touch screen) and keyboard events to the active top-most client.
|
(or touch screen) and keyboard events to the active top-most client.
|
||||||
If a client exits or dies for some reasons, it will not damage other
|
If a client exits or dies for some reasons, it will not damage other
|
||||||
clients and the server.
|
clients and the server.
|
||||||
|
|
||||||
|
|
||||||
## HISTORY
|
## HISTORY
|
||||||
|
|
||||||
About ten years have pasted since MiniGUI was initially created at
|
21 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.
|
||||||
|
|
||||||
At the original, the version 0.2.xx was based on SVGALib and PThread
|
At the original, the version 0.2.xx was based on SVGALib and PThread
|
||||||
(LinuxThreads). Then the version 0.3.xx had many enhanced features
|
(LinuxThreads). Then the version 0.3.xx had many enhanced features
|
||||||
including Graphics Abstract Layer (GAL), Input Abstract Layer (IAL),
|
including Graphics Abstract Layer (GAL), Input Abstract Layer (IAL),
|
||||||
and the support for multiple charsets and multiple fonts.
|
and the support for multiple charsets and multiple fonts.
|
||||||
|
|
||||||
In version 1.0.00, we designed MiniGUI-Lite, which was more fit for
|
In version 1.0.00, we designed MiniGUI-Lite, which was more fit for
|
||||||
some complex embedded systems, such as PDAs, Thin-Clients, or STBs.
|
some complex embedded systems, such as PDAs, Thin-Clients, or STBs.
|
||||||
MiniGUI-Lite made the embedded systems more stable and efficient.
|
MiniGUI-Lite made the embedded systems more stable and efficient.
|
||||||
The version 1.0.00 provided the native fbcon engine based on Linux
|
The version 1.0.00 provided the native fbcon engine based on Linux
|
||||||
frame buffer device directly as well.
|
frame buffer device directly as well.
|
||||||
|
|
||||||
In the development of version 1.1.00, we re-wrote the GAL and GDI
|
In the development of version 1.1.00, we re-wrote the GAL and GDI
|
||||||
interfaces, and provided some advanced video features, such as raster
|
interfaces, and provided some advanced video features, such as raster
|
||||||
operation, transparent blitting, alpha blending, and video hardware
|
operation, transparent blitting, alpha blending, and video hardware
|
||||||
acceleration. We also provided some important GDI functions, such as
|
acceleration. We also provided some important GDI functions, such as
|
||||||
Ellipse, Arc, Polygon, and FloodFill.
|
Ellipse, Arc, Polygon, and FloodFill.
|
||||||
|
|
||||||
In the development of version 1.6.0, we added advanced 2D graphics
|
In the development of version 1.6.0, we added advanced 2D graphics
|
||||||
@@ -238,7 +248,7 @@ A brief history description of the development progress lay below:
|
|||||||
|
|
||||||
0) 1994 ~ 1996: MiniGUI DOS version.
|
0) 1994 ~ 1996: MiniGUI DOS version.
|
||||||
1) Dec, 1998: Began to write.
|
1) Dec, 1998: Began to write.
|
||||||
2) Apr, 1999: The skeleton of MiniGUI, windowing sub-system
|
2) Apr, 1999: The skeleton of MiniGUI, windowing sub-system
|
||||||
and basic graphics device interfaces.
|
and basic graphics device interfaces.
|
||||||
3) May, 1999: Timer, menu, and the skeleton of control sub-system.
|
3) May, 1999: Timer, menu, and the skeleton of control sub-system.
|
||||||
4) Jun, 1999: Chinese input method (by Kang Xiaoning).
|
4) Jun, 1999: Chinese input method (by Kang Xiaoning).
|
||||||
@@ -247,29 +257,29 @@ A brief history description of the development progress lay below:
|
|||||||
7) Sep, 1999: Dialog boxes and message boxes.
|
7) Sep, 1999: Dialog boxes and message boxes.
|
||||||
8) Sep, 1999: Snapshot of screen or window.
|
8) Sep, 1999: Snapshot of screen or window.
|
||||||
9) Jan., 2000: VCOnGUI (Virtual Console on MiniGUI) version 0.2.02.
|
9) Jan., 2000: VCOnGUI (Virtual Console on MiniGUI) version 0.2.02.
|
||||||
10) Mar., 2000: Linux distribution installer based-on MiniGUI for
|
10) Mar., 2000: Linux distribution installer based-on MiniGUI for
|
||||||
HappyLinux 1.0.
|
HappyLinux 1.0.
|
||||||
11) Jun., 2000: Began to develop version 1.0.xx.
|
11) Jun., 2000: Began to develop version 1.0.xx.
|
||||||
12) Sep., 2000: MiniGUI version 0.3.06 released.
|
12) Sep., 2000: MiniGUI version 0.3.06 released.
|
||||||
13) Oct., 2000: MiniGUI version 0.9.00 released.
|
13) Oct., 2000: MiniGUI version 0.9.00 released.
|
||||||
14) Nov., 2000: MiniGUI version 0.9.96 released.
|
14) Nov., 2000: MiniGUI version 0.9.96 released.
|
||||||
15) Jan., 2001: MiniGUI version 0.9.98 released. You can build
|
15) Jan., 2001: MiniGUI version 0.9.98 released. You can build
|
||||||
MiniGUI-Lite from this version.
|
MiniGUI-Lite from this version.
|
||||||
16) Jan., 2001: MiniGUI version 1.0.00Beta1 released.
|
16) Jan., 2001: MiniGUI version 1.0.00Beta1 released.
|
||||||
17) Feb., 2001: MiniGUI version 1.0.00Pre1 released.
|
17) Feb., 2001: MiniGUI version 1.0.00Pre1 released.
|
||||||
18) Apr., 2001: MiniGUI version 1.0.00 released (2001/04/16).
|
18) Apr., 2001: MiniGUI version 1.0.00 released (2001/04/16).
|
||||||
18) Sep., 2001: MiniGUI version 1.1.0Pre1 released (2001/09/12).
|
18) Sep., 2001: MiniGUI version 1.1.0Pre1 released (2001/09/12).
|
||||||
19) Sep., 2001: MiniGUI version 1.0.9 released (2001/09/17),
|
19) Sep., 2001: MiniGUI version 1.0.9 released (2001/09/17),
|
||||||
this will be the last version of source branch 1.0.x.
|
this will be the last version of source branch 1.0.x.
|
||||||
20) Oct., 2001: MiniGUI version 1.1.0Pre4 released (2001/10/22).
|
20) Oct., 2001: MiniGUI version 1.1.0Pre4 released (2001/10/22).
|
||||||
This version have new GAL and GDI interfaces.
|
This version have new GAL and GDI interfaces.
|
||||||
21) Mar., 2002: MiniGUI official version 1.1.0 released (2002/03/08).
|
21) Mar., 2002: MiniGUI official version 1.1.0 released (2002/03/08).
|
||||||
MiniGUI API Reference documentation version 0.9 released.
|
MiniGUI API Reference documentation version 0.9 released.
|
||||||
22) Mar., 2002: MiniGUI API Reference documentation version 1.0 released.
|
22) Mar., 2002: MiniGUI API Reference documentation version 1.0 released.
|
||||||
23) Apr., 2002: MiniGUI the new stable version 1.2.0 released (2002/04/11).
|
23) Apr., 2002: MiniGUI the new stable version 1.2.0 released (2002/04/11).
|
||||||
24) Sep., 2002: The main developers of MiniGUI founded a
|
24) Sep., 2002: The main developers of MiniGUI founded a
|
||||||
new software corporation: Beijing FMSoft Technology Co., Ltd..
|
new software corporation: Beijing FMSoft Technology Co., Ltd..
|
||||||
And the development and maintenance of MiniGUI changes from
|
And the development and maintenance of MiniGUI changes from
|
||||||
loosely-knit team to business organization.
|
loosely-knit team to business organization.
|
||||||
25) Mar., 2003: MiniGUI official version 1.2.5 released (2003/03/23).
|
25) Mar., 2003: MiniGUI official version 1.2.5 released (2003/03/23).
|
||||||
25) May., 2003: MiniGUI official version 1.2.6 released (2003/05/18).
|
25) May., 2003: MiniGUI official version 1.2.6 released (2003/05/18).
|
||||||
@@ -295,18 +305,19 @@ A brief history description of the development progress lay below:
|
|||||||
45) Aug., 2017: FMSoft released the latest source code of mDolphin under Apache 2.0.
|
45) Aug., 2017: FMSoft released the latest source code of mDolphin under Apache 2.0.
|
||||||
46) Dec., 2017: FMSoft updated MiniGUI and miniStudio for latest Linux distributions.
|
46) Dec., 2017: FMSoft updated MiniGUI and miniStudio for latest Linux distributions.
|
||||||
47) Feb., 2018: FMSoft released MiniGUI version 3.2.
|
47) Feb., 2018: FMSoft released MiniGUI version 3.2.
|
||||||
|
47) Jun., 2019: FMSoft released MiniGUI version 3.4.
|
||||||
|
|
||||||
|
|
||||||
## ABOUT THE AUTHORS
|
## ABOUT THE AUTHORS
|
||||||
|
|
||||||
The original author of MiniGUI is WEI Yongming, and now MiniGUI is
|
The original author of MiniGUI is WEI Yongming, and now MiniGUI is
|
||||||
maintained by FMSoft. For more information, please browse
|
maintained by FMSoft. For more information, please browse
|
||||||
our home page: http://www.fmsoft.cn.
|
our home page: http://www.fmsoft.cn.
|
||||||
|
|
||||||
|
|
||||||
## IF YOU HAVE A PROBLEM
|
## IF YOU HAVE A PROBLEM
|
||||||
|
|
||||||
If you have any technical problem, advice or comment, please send
|
If you have any technical problem, advice or comment, please send
|
||||||
messages to consult@minigui.com.
|
messages to consult@minigui.com.
|
||||||
|
|
||||||
|
|
||||||
@@ -314,15 +325,15 @@ messages to consult@minigui.com.
|
|||||||
|
|
||||||
Q: Is GPL'd MiniGUI free for commercial use?
|
Q: Is GPL'd MiniGUI free for commercial use?
|
||||||
|
|
||||||
A: Simply no. FMSoft releases MiniGUI under GPLv3 license.
|
A: Simply no. FMSoft releases MiniGUI under GPLv3 license.
|
||||||
It is free for those who are 100% GPL and those who never copy, modify
|
It is free for those who are 100% GPL and those who never copy, modify
|
||||||
and distribute MiniGUI. But if you want to use these GPL'd versions
|
and distribute MiniGUI. But if you want to use these GPL'd versions
|
||||||
for commerce, you should get the commercial license from FMSoft first.
|
for commerce, you should get the commercial license from FMSoft first.
|
||||||
|
|
||||||
Q: Which operating system does MiniGUI support?
|
Q: Which operating system does MiniGUI support?
|
||||||
|
|
||||||
A: MiniGUI can run on Linux/uClinux, uC/OS-II, eCos, ThreadX, pSOS,
|
A: MiniGUI can run on Linux/uClinux, uC/OS-II, eCos, ThreadX, pSOS,
|
||||||
VxWorks, ThreadX, OSE, and even Win32. Any other real-time OSes can
|
VxWorks, ThreadX, OSE, and even Win32. Any other real-time OSes can
|
||||||
be supported theoretically.
|
be supported theoretically.
|
||||||
|
|
||||||
Q: Which architecture does MiniGUI support?
|
Q: Which architecture does MiniGUI support?
|
||||||
@@ -332,19 +343,19 @@ A: x86 32/64-bit, ARM 32/64-bit (e.g., ARMv7 and ARM Cortex-A7),
|
|||||||
|
|
||||||
Q: Does MiniGUI offer the support for grey LCD with 4bpp (bits per pixel)?
|
Q: Does MiniGUI offer the support for grey LCD with 4bpp (bits per pixel)?
|
||||||
|
|
||||||
A: Yes, it offers. It even offers the support for 1bpp and 2bpp LCD.
|
A: Yes, it offers. It even offers the support for 1bpp and 2bpp LCD.
|
||||||
|
|
||||||
|
|
||||||
## NOT FREE FOR COMMERCIAL USE
|
## NOT FREE FOR COMMERCIAL USE
|
||||||
|
|
||||||
MiniGUI and its components are licensed under the GPL license.
|
MiniGUI and its components are licensed under the GPL license.
|
||||||
So any links about MiniGUI must follow GPL. If you cannot accept GPL,
|
So any links about MiniGUI must follow GPL. If you cannot accept GPL,
|
||||||
you need to be licensed from FMSoft. If you wonder that if you need
|
you need to be licensed from FMSoft. If you wonder that if you need
|
||||||
the commercial license of MiniGUI, please refer to the LICENSE-POLICY file.
|
the commercial license of MiniGUI, please refer to the LICENSE-POLICY file.
|
||||||
|
|
||||||
We provide you the commercial license of MiniGUI according to the number
|
We provide you the commercial license of MiniGUI according to the number
|
||||||
of the run-time binary copies of MiniGUI. If you are interested in
|
of the run-time binary copies of MiniGUI. If you are interested in
|
||||||
the commercial license of MiniGUI, please write to sales@minigui.com.
|
the commercial license of MiniGUI, please write to sales@minigui.com.
|
||||||
|
|
||||||
|
|
||||||
## COPYING
|
## COPYING
|
||||||
|
|||||||
+151
-85
@@ -10,6 +10,8 @@ Please report any bugs and incompatibilities in
|
|||||||
|
|
||||||
### What's new in this version
|
### What's new in this version
|
||||||
|
|
||||||
|
In this version, we mainly enhanced and tuned the APIs of font rendering.
|
||||||
|
|
||||||
#### Tunning the logical font APIs
|
#### Tunning the logical font APIs
|
||||||
|
|
||||||
The styles of LOGFONT changed.
|
The styles of LOGFONT changed.
|
||||||
@@ -17,37 +19,42 @@ The styles of LOGFONT changed.
|
|||||||
* Add new rendering style:
|
* Add new rendering style:
|
||||||
1. `FS_RENDER_ANY`: Not specified
|
1. `FS_RENDER_ANY`: Not specified
|
||||||
1. `FS_RENDER_MONO`:
|
1. `FS_RENDER_MONO`:
|
||||||
1. `FS_RENDER_OUTLINE`:
|
|
||||||
1. `FS_RENDER_GREY`:
|
1. `FS_RENDER_GREY`:
|
||||||
1. `FS_RENDER_SUBPIXEL`:
|
1. `FS_RENDER_SUBPIXEL`:
|
||||||
* Remove some bad style definitions:
|
* Some old styles are deprecated:
|
||||||
1. `FS_WEIGHT_BOOK`, use `FS_RENDER_GREY` instead.
|
1. `FS_WEIGHT_BOOK`; use `FS_RENDER_GREY` instead.
|
||||||
1. `FS_WEIGHT_LIGHT`, use `FS_RENDER_OUTLINE` instead.
|
1. `FS_WEIGHT_SUBPIXEL`; use `FS_RENDER_SUBPIXEL` instead.
|
||||||
* Introduced the new weight styles:
|
* Introduced or redefined the weight styles to follow OpenType specification:
|
||||||
1. `FONT_WEIGHT_ANY`: Not specified
|
1. `FONT_WEIGHT_ANY`: Not specified
|
||||||
1. `FONT_WEIGHT_THIN`:
|
1. `FONT_WEIGHT_THIN`: Thin.
|
||||||
1. `FONT_WEIGHT_EXTRA_LIGHT`:
|
1. `FONT_WEIGHT_EXTRA_LIGHT`: Extra light (Ultra Light).
|
||||||
1. `FONT_WEIGHT_LIGHT`:
|
1. `FONT_WEIGHT_LIGHT`: Light.
|
||||||
1. `FONT_WEIGHT_REGULAR`:
|
1. `FONT_WEIGHT_REGULAR`: Regular (Normal).
|
||||||
1. `FONT_WEIGHT_MEDIUM`:
|
1. `FONT_WEIGHT_MEDIUM`: Medium.
|
||||||
1. `FONT_WEIGHT_DEMIBOLD`:
|
1. `FONT_WEIGHT_DEMIBOLD`: Demi Bold (Semi Bold)
|
||||||
1. `FONT_WEIGHT_BOLD`:
|
1. `FONT_WEIGHT_BOLD`: Bold.
|
||||||
1. `FONT_WEIGHT_EXTRA_BOLD`:
|
1. `FONT_WEIGHT_EXTRA_BOLD`: Extra Bold (Ultra Bold).
|
||||||
1. `FONT_WEIGHT_BLACK`:
|
1. `FONT_WEIGHT_BLACK`: Black (Heavy).
|
||||||
* Introduce the new decoration styles and replace
|
* Introduce the new decoration styles and replace
|
||||||
`FONT_UNDERLINE_LINE` and `FONT_STRUCKOUT_LINE` with them:
|
`FONT_UNDERLINE_LINE` and `FONT_STRUCKOUT_LINE` with them:
|
||||||
1. `FONT_DECORATE_ANY`:
|
1. `FONT_DECORATE_ANY`: Not specified.
|
||||||
1. `FONT_DECORATE_NONE`:
|
1. `FONT_DECORATE_NONE`: None.
|
||||||
1. `FONT_DECORATE_UNDERLINE`:
|
1. `FONT_DECORATE_UNDERLINE`: glyphs are underscored.
|
||||||
1. `FONT_DECORATE_STRUCKOUT`:
|
1. `FONT_DECORATE_STRUCKOUT`: glyphs are overstruck.
|
||||||
1. `FONT_DECORATE_BOTH`:
|
1. `FONT_DECORATE_US`: Both `FONT_DECORATE_UNDERLINE` and `FONT_DECORATE_STRUCKOUT`.
|
||||||
|
1. `FONT_DECORATE_OUTLINE`: Outline (hollow) glyphs.
|
||||||
|
1. `FONT_DECORATE_REVERSE`: Reverved for future. Glyphs have their foreground and background reversed.
|
||||||
|
* The following style are deprecated:
|
||||||
|
1. `FONT_OTHER_LCDPORTRAIT`
|
||||||
|
1. `FONT_OTHER_LCDPORTRAITKERN`
|
||||||
|
|
||||||
For the back-compatibility, you can still use `CreateLogFont` to
|
For a new app, you should use the new function `CreateLogFontEx` to
|
||||||
create a new LOGFONT. However, the `FS_WEIGHT_BOOK` and `FS_WEIGHT_LIGHT`
|
create a LOGFONT, and specify the weight and rendering method of the glyph.
|
||||||
will be ignored, and the rendering type will be set as `FS_RENDER_ANY`.
|
|
||||||
|
|
||||||
For new app, you should use the new function `CreateLogFontEx` to
|
For the back-compatibility, you can still use `CreateLogFont` to create a new
|
||||||
create a LOGFONT.
|
LOGFONT. However, `FS_WEIGHT_BOOK` will be treated `FS_WEIGHT_REGULAR` and
|
||||||
|
`FS_RENDER_GREY`, while `FS_WEIGHT_SUBPIXEL` will be treated
|
||||||
|
`FS_WEIGHT_REGULAR` and `FS_RENDER_SUBPIXEL`.
|
||||||
|
|
||||||
You can still use `CreateLogFontByName` to create a new LOGFONT.
|
You can still use `CreateLogFontByName` to create a new LOGFONT.
|
||||||
But the style string in the font name changed from
|
But the style string in the font name changed from
|
||||||
@@ -58,21 +65,75 @@ to
|
|||||||
|
|
||||||
<weight><slant><flipping><other><decoration><rendering>
|
<weight><slant><flipping><other><decoration><rendering>
|
||||||
|
|
||||||
Obviously, `<underline>` and `<struckout>` are merged to `<decoration>`
|
Note that `<underline>` and `<struckout>` are merged to `<decoration>`
|
||||||
in order to keep the style string is still 6-character long.
|
in order to keep the style string is still 6-character long.
|
||||||
|
|
||||||
Now, if you want to use the rendering style SUPIXEL for a TTF font,
|
Consequently, if you want to use the rendering method SUPIXEL for a TTF font,
|
||||||
please define the font name in the following way:
|
please define the logical font name in the following way:
|
||||||
|
|
||||||
ttf-Courier-rrncns-*-16-UTF-8
|
ttf-Courier-rrncns-*-16-UTF-8
|
||||||
|
|
||||||
#### Changes of font rendering manners
|
Moreover, the family name of a DEVFONT supports aliases since 3.4.0:
|
||||||
|
|
||||||
|
<fonttype>-<family[,aliase]*>-<styles>-<width>-<height>-<charset[,charset]*>
|
||||||
|
|
||||||
|
for example:
|
||||||
|
|
||||||
|
ttf-Arial,Sans Serif-rrncnn-8-16-ISO8859-1,UTF-8
|
||||||
|
ttf-courier,monospace,serif-rrncnn-8-16-ISO8859-1,UTF-8
|
||||||
|
|
||||||
|
Note that the length of one DEVFONT name can not exceed 255 bytes.
|
||||||
|
|
||||||
|
#### Changed APIs
|
||||||
|
|
||||||
|
* The fields `height` and `descent` have been removed from GLYPHINFO struct.
|
||||||
|
One should get the font metrics information by calling `GetFontMetrics` function
|
||||||
|
if you want to get the height and descent data of one font.
|
||||||
|
|
||||||
|
* More fields added for GLYPHBITMAP struct in order to return the completed
|
||||||
|
rasterized glyph bitmap information.
|
||||||
|
|
||||||
|
* `GetGlyphInfo` now can return the basic glyph type and break type of a
|
||||||
|
UNICODE character. If the glyph is an ASCII character, the old `MCHAR_TYPE`
|
||||||
|
can also be returned.
|
||||||
|
|
||||||
|
* Rename `mg_FT_LcdFilter` to `FT2LCDFilter` in order to follow MiniGUI naming
|
||||||
|
rules.
|
||||||
|
|
||||||
|
* Rename `UChar32` to `Uchar32` and `UChar16` to `Uchar16` in order to
|
||||||
|
avoid the conflict with typedef of UChar32 in 'unicode/umachine.h'.
|
||||||
|
|
||||||
|
* Redefine `Uchar32` and `Glyph32` as `Uint32` instead of `int`.
|
||||||
|
|
||||||
|
#### New APIs
|
||||||
|
|
||||||
|
* `GetGlyphsByRules` function calculates and allocates the glyph string from
|
||||||
|
a multi-byte string under the specified white space rule and transformation
|
||||||
|
rule.
|
||||||
|
|
||||||
|
* `GetGlyphsExtentPointEx` function gets the visual extent information
|
||||||
|
of a glyph string which can fit in a line with the specified maximal extent.
|
||||||
|
|
||||||
|
* `DrawGlyphStringEx` function draws a glyph string to the specific
|
||||||
|
positions of a DC.
|
||||||
|
|
||||||
|
* `CreateLogFontIndirectEx` creates a new LOGFONT by using the value of
|
||||||
|
an existed LOGFONT but with a new rotation value.
|
||||||
|
|
||||||
#### Others
|
#### Others
|
||||||
|
|
||||||
* Support for FreeType1 removed.
|
* Support for FreeType1 removed.
|
||||||
|
|
||||||
|
You should always use FreeType2 to support vector fonts, such as TrueType
|
||||||
|
fonts (TTF), TrueType collections (TTC), OpenType fonts (OTF, both TrueType
|
||||||
|
and CFF variants), OpenType collections (OTC), and Type 1 fonts (PFA and PFB).
|
||||||
|
|
||||||
|
### Other Changes
|
||||||
|
|
||||||
|
* A new BITMAP type: `BMP_TYPE_REPLACEKEY`. When `bmType` of a BITMAP object
|
||||||
|
has this bit set, any pixel which is equal to `bmColorKey` will be replaced by
|
||||||
|
`bmColorRep`.
|
||||||
|
|
||||||
## Version 3.2.1
|
## Version 3.2.1
|
||||||
|
|
||||||
The MiniGUI development team announces the availability of MiniGUI 3.2.1.
|
The MiniGUI development team announces the availability of MiniGUI 3.2.1.
|
||||||
@@ -84,21 +145,21 @@ Please report any bugs and incompatibilities in
|
|||||||
### What's new in this version
|
### What's new in this version
|
||||||
|
|
||||||
* ENHANCEMENTS:
|
* ENHANCEMENTS:
|
||||||
1. Add a new key `dpi` for NEWGAL engine to define the DPI of the screen.
|
1. Add a new key `dpi` for NEWGAL engine to define the DPI of the screen.
|
||||||
If it is absent, use 96 as the default DPI.
|
If it is absent, use 96 as the default DPI.
|
||||||
1. Add an item for `GetGDCapability` to return DPI of the DC.
|
1. Add an item for `GetGDCapability` to return DPI of the DC.
|
||||||
1. New API `InitSlaveScreenEx` to specify the DPI of slave screen.
|
1. New API `InitSlaveScreenEx` to specify the DPI of slave screen.
|
||||||
Define `InitSlaveScreen` as an inline function calling `InitSlaveScreenEx`.
|
Define `InitSlaveScreen` as an inline function calling `InitSlaveScreenEx`.
|
||||||
1. New API: `SyncUpdateDC`. You can use this function to synchronize
|
1. New API: `SyncUpdateDC`. You can use this function to synchronize
|
||||||
the update rectangles of a surface to screen, if the surface
|
the update rectangles of a surface to screen, if the surface
|
||||||
represents the shadow frame buffer of the screen.
|
represents the shadow frame buffer of the screen.
|
||||||
* configure option: `--enable-syncupdate`
|
* configure option: `--enable-syncupdate`
|
||||||
* macro: `_MGUSE_SYNC_UPDATE`
|
* macro: `_MGUSE_SYNC_UPDATE`
|
||||||
1. New API: `UpdateInvalidClient`. You can use this function to update
|
1. New API: `UpdateInvalidClient`. You can use this function to update
|
||||||
the invalid client region of a window instantly.
|
the invalid client region of a window instantly.
|
||||||
1. Use different colors for the output of `_DBG_PRINTF` and `_ERR_PRINTF`.
|
1. Use different colors for the output of `_DBG_PRINTF` and `_ERR_PRINTF`.
|
||||||
1. Add `__mg_save_jpg` function for storing MYBITMAP as JPEG file (10km).
|
1. Add `__mg_save_jpg` function for storing MYBITMAP as JPEG file (@10km).
|
||||||
1. Modified logic for checking JPEG format (10km).
|
1. Modified logic for checking JPEG format (@10km).
|
||||||
1. Support BIDI for UNICODE charsets and cleanup the implementation.
|
1. Support BIDI for UNICODE charsets and cleanup the implementation.
|
||||||
* New API: `GetGlyphBIDIType` to get the glyph type in BIDI.
|
* New API: `GetGlyphBIDIType` to get the glyph type in BIDI.
|
||||||
* New DC attribute: BIDI flag.
|
* New DC attribute: BIDI flag.
|
||||||
@@ -116,6 +177,11 @@ Please report any bugs and incompatibilities in
|
|||||||
* BUGFIXING:
|
* BUGFIXING:
|
||||||
1. handle `PNG_COLOR_TYPE_GRAY_ALPHA` color type of PNG files.
|
1. handle `PNG_COLOR_TYPE_GRAY_ALPHA` color type of PNG files.
|
||||||
1. Fix a bug to free a null pointer (ReleaseDC).
|
1. Fix a bug to free a null pointer (ReleaseDC).
|
||||||
|
1. No need to make the pitch of FT2 monobitmap is single-byte aligned.
|
||||||
|
This bug may generate dirty dots for monobitmap glyph from TTF.
|
||||||
|
1. Skip null pixels for SUBPIXEL glyphs. This bug will always show background
|
||||||
|
pixels of one SUBPIXEL glyph.
|
||||||
|
1. Fix the bug of wrong bounding box handling for SUBPIXEL rendering of glyph.
|
||||||
|
|
||||||
* TUNNING:
|
* TUNNING:
|
||||||
1. Tune GLYPHINFO structure and GetGlyphInfo to return BIDI glyph type.
|
1. Tune GLYPHINFO structure and GetGlyphInfo to return BIDI glyph type.
|
||||||
@@ -126,12 +192,12 @@ The MiniGUI development team announces the availability of MiniGUI 3.2.0.
|
|||||||
All users of MiniGUI are recommended strongly to use this version for new
|
All users of MiniGUI are recommended strongly to use this version for new
|
||||||
MiniGUI apps. Please report any bugs and incompatibilities in
|
MiniGUI apps. Please report any bugs and incompatibilities in
|
||||||
|
|
||||||
https://github.com/VincentWei/minigui.
|
https://github.com/VincentWei/minigui
|
||||||
|
|
||||||
### What's new in this version
|
### What's new in this version
|
||||||
|
|
||||||
* Support for 64-bit platform. Note that the definitions of some types
|
* Support for 64-bit platform. Note that the definitions of some types
|
||||||
and APIs changed.
|
and APIs changed.
|
||||||
* Compliant to the latest GCC, and eliminate all compilation warnings.
|
* Compliant to the latest GCC, and eliminate all compilation warnings.
|
||||||
|
|
||||||
### Type changes
|
### Type changes
|
||||||
@@ -139,37 +205,37 @@ MiniGUI apps. Please report any bugs and incompatibilities in
|
|||||||
#### Changes of handle types
|
#### Changes of handle types
|
||||||
|
|
||||||
All handle types, including `GHANDLE`, `HWND`, `HDC`, etc.,
|
All handle types, including `GHANDLE`, `HWND`, `HDC`, etc.,
|
||||||
are now defined as aliases of `PVOID` (`typedef void* PVOID`).
|
are now defined as aliases of `PVOID` (`typedef void* PVOID`).
|
||||||
You may need to check your code to reflect this change.
|
You may need to check your code to reflect this change.
|
||||||
|
|
||||||
#### Changes of integer types.
|
#### Changes of integer types.
|
||||||
|
|
||||||
The type of `DWORD` now has pointer precision. That is,
|
The type of `DWORD` now has pointer precision. That is,
|
||||||
the size of `DWORD` will be 4 bytes on 32-bit platform, and 8 bytes on
|
the size of `DWORD` will be 4 bytes on 32-bit platform, and 8 bytes on
|
||||||
64-bit platform.
|
64-bit platform.
|
||||||
|
|
||||||
Similarly, `WPARAM` and `LPARAM` now have pointer precision.
|
Similarly, `WPARAM` and `LPARAM` now have pointer precision.
|
||||||
|
|
||||||
`WORD` and `SWORD` has a half of pointer precision. The size of these
|
`WORD` and `SWORD` has a half of pointer precision. The size of these
|
||||||
two types is 2 bytes on 32-bit platform, and 4 bytes on 64-bit platform.
|
two types is 2 bytes on 32-bit platform, and 4 bytes on 64-bit platform.
|
||||||
|
|
||||||
`RGBCOLOR` now is defined as an alias of `DWORD32` (see below).
|
`RGBCOLOR` now is defined as an alias of `DWORD32` (see below).
|
||||||
|
|
||||||
Note that the type of `BYTE` always has the size of 8-bit on both
|
Note that the type of `BYTE` always has the size of 8-bit on both
|
||||||
32-bit and 64-bit platforms.
|
32-bit and 64-bit platforms.
|
||||||
|
|
||||||
#### New integer types:
|
#### New integer types:
|
||||||
|
|
||||||
We introduce `DWORD32` and `SDWORD32` types,
|
We introduce `DWORD32` and `SDWORD32` types,
|
||||||
which have the size of 4 bytes on both 32-bit and 64-bit platforms.
|
which have the size of 4 bytes on both 32-bit and 64-bit platforms.
|
||||||
You should use these types when reading/writing 32-bit integers from
|
You should use these types when reading/writing 32-bit integers from
|
||||||
a binary files for the portability. Of course, you can also use
|
a binary files for the portability. Of course, you can also use
|
||||||
`Uint32` or `Sint32` types.
|
`Uint32` or `Sint32` types.
|
||||||
|
|
||||||
Similarly, we introduce `WORD16` and `SWORD16` types,
|
Similarly, we introduce `WORD16` and `SWORD16` types,
|
||||||
which have the size of 2 bytes on both 32-bit and 64-bit platforms.
|
which have the size of 2 bytes on both 32-bit and 64-bit platforms.
|
||||||
You should use these types when reading/writing 16-bit integers from
|
You should use these types when reading/writing 16-bit integers from
|
||||||
a binary file for the portability. Of course, you can also use
|
a binary file for the portability. Of course, you can also use
|
||||||
`Uint16` or `SUint16` types.
|
`Uint16` or `SUint16` types.
|
||||||
|
|
||||||
`LRESULT` is defined for window callback procedure, and it has
|
`LRESULT` is defined for window callback procedure, and it has
|
||||||
@@ -182,7 +248,7 @@ pointer precision.
|
|||||||
#### Integer macros
|
#### Integer macros
|
||||||
|
|
||||||
`MAKEWPARAM`: this new macro makes a WPARAM value by using four bytes.
|
`MAKEWPARAM`: this new macro makes a WPARAM value by using four bytes.
|
||||||
On the contrary, `FIRSTBYTE`, `SECONDBYTE`, `THIRDBYTE`, and `FOURTH`
|
On the contrary, `FIRSTBYTE`, `SECONDBYTE`, `THIRDBYTE`, and `FOURTH`
|
||||||
macros get the four bytes from a `WPARAM` or a `Uint32` value.
|
macros get the four bytes from a `WPARAM` or a `Uint32` value.
|
||||||
|
|
||||||
`MAKEWORD16`: this new macro makes a 16-bit word by using two bytes.
|
`MAKEWORD16`: this new macro makes a 16-bit word by using two bytes.
|
||||||
@@ -192,12 +258,12 @@ word on 64-bit platform.
|
|||||||
Note that `MAKELONG` macro always makes a `DWORD` integer, which has pointer
|
Note that `MAKELONG` macro always makes a `DWORD` integer, which has pointer
|
||||||
precision. Meanwhile, `MAKELONG32` macro makes a `Uint32` integer.
|
precision. Meanwhile, `MAKELONG32` macro makes a `Uint32` integer.
|
||||||
|
|
||||||
Note that `MakeRGB` and `MakeRGBA` macros always make `DWORD32` integers.
|
Note that `MakeRGB` and `MakeRGBA` macros always make `DWORD32` integers.
|
||||||
In contract, `GetRValue`, `GetRValue`, `GetBValue`, `GetAValue` always
|
In contract, `GetRValue`, `GetRValue`, `GetBValue`, `GetAValue` always
|
||||||
get red, green, blue, and alpha components from a `DWORD32` integer
|
get red, green, blue, and alpha components from a `DWORD32` integer
|
||||||
respectively.
|
respectively.
|
||||||
|
|
||||||
Note that you should use `(-1)` instead of `0xFFFFFFFF` for the invalid
|
Note that you should use `(-1)` instead of `0xFFFFFFFF` for the invalid
|
||||||
integer or pointer type value for good portability.
|
integer or pointer type value for good portability.
|
||||||
|
|
||||||
#### Structure and functions
|
#### Structure and functions
|
||||||
@@ -211,16 +277,16 @@ The main changes in structure and functions:
|
|||||||
|
|
||||||
* We now use a `LRESULT` integer for the return value of a window callback
|
* We now use a `LRESULT` integer for the return value of a window callback
|
||||||
procedure. Now it is safe to return a pointer from the callback procedure
|
procedure. Now it is safe to return a pointer from the callback procedure
|
||||||
on 64-bit platform. This is a very important change, and it will break the
|
on 64-bit platform. This is a very important change, and it will break the
|
||||||
source compatibilty of your code. You should check the source code (use
|
source compatibilty of your code. You should check the source code (use
|
||||||
gcc option `-Wall`) carefully.
|
gcc option `-Wall`) carefully.
|
||||||
|
|
||||||
* We now use a `LINT` integer for the identifier of a timer. So you can pass
|
* We now use a `LINT` integer for the identifier of a timer. So you can pass
|
||||||
a pointer as the identifier of the timer on 64-bit platform. mGNCS uses
|
a pointer as the identifier of the timer on 64-bit platform. mGNCS uses
|
||||||
MiniGUI timer in this manner.
|
MiniGUI timer in this manner.
|
||||||
|
|
||||||
* We now use a `LINT` integer for the identifier of a control/widget and a
|
* We now use a `LINT` integer for the identifier of a control/widget and a
|
||||||
menu item. So you can pass a pointer as the identifier of the timer on
|
menu item. So you can pass a pointer as the identifier of the timer on
|
||||||
64-bit platform. mGNCS works in this manner.
|
64-bit platform. mGNCS works in this manner.
|
||||||
|
|
||||||
##### Message
|
##### Message
|
||||||
@@ -229,7 +295,7 @@ The strcuture `MSG` and all message-related functions changed.
|
|||||||
For example, the prototype of `SendMessage` changed from
|
For example, the prototype of `SendMessage` changed from
|
||||||
|
|
||||||
int SendMessage (HWND hWnd, int nMsg, WPARAM wParam, LPARAM lParam)
|
int SendMessage (HWND hWnd, int nMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
to
|
to
|
||||||
|
|
||||||
LRESULT SendMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT SendMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
|
||||||
@@ -237,7 +303,7 @@ to
|
|||||||
_IMPORTANT NOTE_
|
_IMPORTANT NOTE_
|
||||||
|
|
||||||
For best portability, you should use `FIRSTBYTE` to `FOURTHBYTE` macros
|
For best portability, you should use `FIRSTBYTE` to `FOURTHBYTE` macros
|
||||||
to get the bytes of a character when you extract the bytes from `WPARAM`
|
to get the bytes of a character when you extract the bytes from `WPARAM`
|
||||||
parameter of a `MSG_CHAR` message:
|
parameter of a `MSG_CHAR` message:
|
||||||
|
|
||||||
MSG_CHAR
|
MSG_CHAR
|
||||||
@@ -247,10 +313,10 @@ parameter of a `MSG_CHAR` message:
|
|||||||
unsigned char ch_buff [2] = THIRDBYTE(wParam);
|
unsigned char ch_buff [2] = THIRDBYTE(wParam);
|
||||||
unsigned char ch_buff [3] = FOURTHBYTE(wParam);
|
unsigned char ch_buff [3] = FOURTHBYTE(wParam);
|
||||||
|
|
||||||
##### Window callback procedure
|
##### Window callback procedure
|
||||||
|
|
||||||
Furthermore, the structure and functions to register window class,
|
Furthermore, the structure and functions to register window class,
|
||||||
create main window, and create dialog box changed. For example, the prototype
|
create main window, and create dialog box changed. For example, the prototype
|
||||||
of `WNDPROC` changed from
|
of `WNDPROC` changed from
|
||||||
|
|
||||||
typedef int (* WNDPROC)(HWND, int, WPARAM, LPARAM)
|
typedef int (* WNDPROC)(HWND, int, WPARAM, LPARAM)
|
||||||
@@ -289,8 +355,8 @@ to
|
|||||||
_IMPORTANT NOTE_
|
_IMPORTANT NOTE_
|
||||||
|
|
||||||
If you use `MSG_COMMAND` message to handle the notification sent from children
|
If you use `MSG_COMMAND` message to handle the notification sent from children
|
||||||
controls, you should make sure the identifier is small enough on 64-bit
|
controls, you should make sure the identifier is small enough on 64-bit
|
||||||
platform. Because MiniGUI packs the identifier and the notification code
|
platform. Because MiniGUI packs the identifier and the notification code
|
||||||
in the `WPARAM` parameter:
|
in the `WPARAM` parameter:
|
||||||
|
|
||||||
MSG_COMMAND
|
MSG_COMMAND
|
||||||
@@ -301,8 +367,8 @@ in the `WPARAM` parameter:
|
|||||||
The code above will not work on 64-bit if you use a pointer as the identifier
|
The code above will not work on 64-bit if you use a pointer as the identifier
|
||||||
of the control.
|
of the control.
|
||||||
|
|
||||||
Therefore, we recommend strongly that you use a `NOTIFYPOROC` callback to
|
Therefore, we recommend strongly that you use a `NOTIFYPOROC` callback to
|
||||||
handle the notification sent from controls. To do this, please call
|
handle the notification sent from controls. To do this, please call
|
||||||
`SetNotificationCallback` function to set the notification callback function.
|
`SetNotificationCallback` function to set the notification callback function.
|
||||||
|
|
||||||
##### Time and timer
|
##### Time and timer
|
||||||
@@ -328,10 +394,10 @@ to
|
|||||||
In addition, we correct the bad or wrong definitions of some APIs:
|
In addition, we correct the bad or wrong definitions of some APIs:
|
||||||
|
|
||||||
* `DWORD2PIXEL` to `DWORD2Pixel`. The old one has a bad name.
|
* `DWORD2PIXEL` to `DWORD2Pixel`. The old one has a bad name.
|
||||||
* `GetWindowRendererFromName`: The return type changes from
|
* `GetWindowRendererFromName`: The return type changes from
|
||||||
`const WINDOW_ELEMENT_RENDERER*` to `WINDOW_ELEMENT_RENDERER*`.
|
`const WINDOW_ELEMENT_RENDERER*` to `WINDOW_ELEMENT_RENDERER*`.
|
||||||
So you can overload some methods directly of a renderer.
|
So you can overload some methods directly of a renderer.
|
||||||
* `GetDefaultWindowElementRenderer`: The return type changes from
|
* `GetDefaultWindowElementRenderer`: The return type changes from
|
||||||
`const WINDOW_ELEMENT_RENDERER*` to `WINDOW_ELEMENT_RENDERER*`.
|
`const WINDOW_ELEMENT_RENDERER*` to `WINDOW_ELEMENT_RENDERER*`.
|
||||||
So you can overload some methods directly of the default renderer.
|
So you can overload some methods directly of the default renderer.
|
||||||
|
|
||||||
@@ -345,15 +411,15 @@ We add some new options for autoconf script (`configure`):
|
|||||||
|
|
||||||
* `--enable-develmode`: You should use this option to define `_DEBUG` macro,
|
* `--enable-develmode`: You should use this option to define `_DEBUG` macro,
|
||||||
enable `-Wall -Werror` option, and enable all features of MiniGUI,
|
enable `-Wall -Werror` option, and enable all features of MiniGUI,
|
||||||
if you were a MiniGUI developer.
|
if you were a MiniGUI developer.
|
||||||
|
|
||||||
## Version 3.0.13
|
## Version 3.0.13
|
||||||
|
|
||||||
The MiniGUI development team announces the availability of MiniGUI 3.0.13.
|
The MiniGUI development team announces the availability of MiniGUI 3.0.13.
|
||||||
All users of MiniGUI are encouraged to test this version carefully, and
|
All users of MiniGUI are encouraged to test this version carefully, and
|
||||||
report any bugs and incompatibilities in
|
report any bugs and incompatibilities in
|
||||||
|
|
||||||
https://github.com/VincentWei/minigui.
|
https://github.com/VincentWei/minigui.
|
||||||
|
|
||||||
### What's new in this version
|
### What's new in this version
|
||||||
|
|
||||||
@@ -361,7 +427,7 @@ report any bugs and incompatibilities in
|
|||||||
* The autoconf/automake config scripts are cleaned up.
|
* The autoconf/automake config scripts are cleaned up.
|
||||||
* Remove most of compilation warnings (not used variables).
|
* Remove most of compilation warnings (not used variables).
|
||||||
* Remove some inline function definitions, especially GetIMEPos/SetIMEPos.
|
* Remove some inline function definitions, especially GetIMEPos/SetIMEPos.
|
||||||
* Fix some bugs.
|
* Fix some bugs.
|
||||||
|
|
||||||
### API changes
|
### API changes
|
||||||
|
|
||||||
@@ -370,12 +436,12 @@ report any bugs and incompatibilities in
|
|||||||
* [NEW] ToUnicode/ToAscii: Converts the key code between Unicode and ASCII.
|
* [NEW] ToUnicode/ToAscii: Converts the key code between Unicode and ASCII.
|
||||||
* [NEW] GetWindowRegion: The function obtains a copy of the window region of a window.
|
* [NEW] GetWindowRegion: The function obtains a copy of the window region of a window.
|
||||||
* [NEW] InvalidateRegion: Invalidates the client area within the specified region.
|
* [NEW] InvalidateRegion: Invalidates the client area within the specified region.
|
||||||
* [NEW] ValidateRect: Validates the client area within a rectangle by removing the
|
* [NEW] ValidateRect: Validates the client area within a rectangle by removing the
|
||||||
rectangle from the update region of the specified window.
|
rectangle from the update region of the specified window.
|
||||||
* [NEW] ValidateRegion: Validates the client area within a region by removing the
|
* [NEW] ValidateRegion: Validates the client area within a region by removing the
|
||||||
region from the current update region of the specified window.
|
region from the current update region of the specified window.
|
||||||
* [NEW] GetUpdateRegion: Copy the update region of a window to a region.
|
* [NEW] GetUpdateRegion: Copy the update region of a window to a region.
|
||||||
* [NEW] AdjustWindowRectEx: Calculates the required size of the window rectangle
|
* [NEW] AdjustWindowRectEx: Calculates the required size of the window rectangle
|
||||||
based on the desired size of the client rectangle.
|
based on the desired size of the client rectangle.
|
||||||
* [NEW] WindowFromPointEx: Retrieves a handle to the window that contains the specified point.
|
* [NEW] WindowFromPointEx: Retrieves a handle to the window that contains the specified point.
|
||||||
* [NEW] ChildWindowFromPointEx: Retrieves a handle to the child window that contains the
|
* [NEW] ChildWindowFromPointEx: Retrieves a handle to the child window that contains the
|
||||||
@@ -385,15 +451,15 @@ report any bugs and incompatibilities in
|
|||||||
* [ADJUST] WindowFromPoint: normal function -> inline function.
|
* [ADJUST] WindowFromPoint: normal function -> inline function.
|
||||||
* [ADJUST] ChildWindowFromPoint: normal function -> inline function.
|
* [ADJUST] ChildWindowFromPoint: normal function -> inline function.
|
||||||
* [ADJUST] ScrollWindow: normal function -> inline function.
|
* [ADJUST] ScrollWindow: normal function -> inline function.
|
||||||
|
|
||||||
|
|
||||||
## Version 3.0.2
|
## Version 3.0.2
|
||||||
|
|
||||||
The MiniGUI development team announces the availability of MiniGUI 3.0.2.
|
The MiniGUI development team announces the availability of MiniGUI 3.0.2.
|
||||||
All users of MiniGUI are encouraged to test this version carefully, and
|
All users of MiniGUI are encouraged to test this version carefully, and
|
||||||
report any bugs and incompatibilities in
|
report any bugs and incompatibilities in
|
||||||
|
|
||||||
https://github.com/VincentWei/minigui.
|
https://github.com/VincentWei/minigui.
|
||||||
|
|
||||||
### What's new in this version
|
### What's new in this version
|
||||||
|
|
||||||
@@ -402,20 +468,20 @@ report any bugs and incompatibilities in
|
|||||||
* Support for Look and Feel (LF) concept.
|
* Support for Look and Feel (LF) concept.
|
||||||
* Remove SKIN interfaces of MGExt library, move MGExt library and vcongui into mGUtils component.
|
* Remove SKIN interfaces of MGExt library, move MGExt library and vcongui into mGUtils component.
|
||||||
* Newly added bitmap font.
|
* Newly added bitmap font.
|
||||||
* Developing interfaces of desktop for MiniGUI.
|
* Developing interfaces of desktop for MiniGUI.
|
||||||
* Support direct draw to DC for higher efficiency.
|
* Support direct draw to DC for higher efficiency.
|
||||||
* Enhancement of resource management
|
* Enhancement of resource management
|
||||||
* Enhancement of controls: Support of independent scrollbar and transparent control.
|
* Enhancement of controls: Support of independent scrollbar and transparent control.
|
||||||
* Enhancement of font and character set, support bidi text support.
|
* Enhancement of font and character set, support bidi text support.
|
||||||
* Enhancement of zoom of picture
|
* Enhancement of zoom of picture
|
||||||
|
|
||||||
|
|
||||||
### API changes
|
### API changes
|
||||||
|
|
||||||
* [NEW] ScaleBitmapEx: a bilinear interpolation algorithm which is better than the original.
|
* [NEW] ScaleBitmapEx: a bilinear interpolation algorithm which is better than the original.
|
||||||
* [NEW] GetWindowInfo: get New structure WINDOWINFO.
|
* [NEW] GetWindowInfo: get New structure WINDOWINFO.
|
||||||
* [NEW] CreateMainWindowEx: enhance of CreeateMainWindow, compatiable with CreeateMainWindow.
|
* [NEW] CreateMainWindowEx: enhance of CreeateMainWindow, compatiable with CreeateMainWindow.
|
||||||
* [NEW] CreateWindowEx2:enhance of CreateWindowEx2, compatiable with CreateWindowEx2.
|
* [NEW] CreateWindowEx2:enhance of CreateWindowEx2, compatiable with CreateWindowEx2.
|
||||||
* [NEW] DialogBoxIndirectParamEx: new create dialog.
|
* [NEW] DialogBoxIndirectParamEx: new create dialog.
|
||||||
* [NEW] CreateMainWindowIndirectParamEx:new create dialog.
|
* [NEW] CreateMainWindowIndirectParamEx:new create dialog.
|
||||||
* [NEW] GetWindowRendererFromName: get LF renderer by name
|
* [NEW] GetWindowRendererFromName: get LF renderer by name
|
||||||
@@ -429,7 +495,7 @@ report any bugs and incompatibilities in
|
|||||||
* [NEW] CreateBMPDevFont: create an bitmap device font.
|
* [NEW] CreateBMPDevFont: create an bitmap device font.
|
||||||
* [NEW] AddGlyphsToBMPFont: add an bitmap font glyph.
|
* [NEW] AddGlyphsToBMPFont: add an bitmap font glyph.
|
||||||
* [NEW] DestroyBMPFont: destroy bitmap device font.
|
* [NEW] DestroyBMPFont: destroy bitmap device font.
|
||||||
* [NEW] SetCustomDesktopOperationSet: set the custom desktop operation set.
|
* [NEW] SetCustomDesktopOperationSet: set the custom desktop operation set.
|
||||||
* [NEW] DesktopUpdateAllWindow: refresh all windows on the desktop.
|
* [NEW] DesktopUpdateAllWindow: refresh all windows on the desktop.
|
||||||
* [NEW] PopupDesktopMenu: pop up a menu on the desktop
|
* [NEW] PopupDesktopMenu: pop up a menu on the desktop
|
||||||
* [NEW] GetTextAlign: get the current text-alignment flags of a DC.
|
* [NEW] GetTextAlign: get the current text-alignment flags of a DC.
|
||||||
@@ -437,5 +503,5 @@ report any bugs and incompatibilities in
|
|||||||
* [NEW] SetWindowMask: set non-rectangle window mask rect.
|
* [NEW] SetWindowMask: set non-rectangle window mask rect.
|
||||||
* [NEW] SetWindowRegion: set non-rectangle window visible region
|
* [NEW] SetWindowRegion: set non-rectangle window visible region
|
||||||
* [NEW] LockDCEx: support for directly read and write the pixels in a DC.
|
* [NEW] LockDCEx: support for directly read and write the pixels in a DC.
|
||||||
* [NEW] CreateSecondaryDC: Creates a secondary window DC of a window.
|
* [NEW] CreateSecondaryDC: Creates a secondary window DC of a window.
|
||||||
* [NEW] SetSecondaryDC:set a window's secondary DC and the callback for double buffer window.
|
* [NEW] SetSecondaryDC:set a window's secondary DC and the callback for double buffer window.
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
Version 3.2.0 (2018/02/10)
|
Version 3.4.0 (2019/06/30)
|
||||||
|
|
||||||
This release needs the following resource packages:
|
This release needs the following resource packages:
|
||||||
|
|
||||||
* minigui-res-3.0.13.tar.gz
|
* minigui-res-3.4.0.tar.gz
|
||||||
|
|
||||||
The latest samples package is:
|
The latest samples package is:
|
||||||
|
|
||||||
* mg-samples-3.2.0.tar.gz
|
* mg-samples-3.4.0.tar.gz
|
||||||
|
|||||||
+23
-15
@@ -2003,7 +2003,7 @@ case "$use_ttf_lib" in
|
|||||||
[Define if include ttf cache])
|
[Define if include ttf cache])
|
||||||
|
|
||||||
AC_ARG_WITH(ttfcachesize,
|
AC_ARG_WITH(ttfcachesize,
|
||||||
[ --with-ttfcachesize=[64/128/256/512/1024]])
|
[ --with-ttfcachesize=[64/128/256/512/1024/2048]])
|
||||||
|
|
||||||
case "$with_ttfcachesize" in
|
case "$with_ttfcachesize" in
|
||||||
64)
|
64)
|
||||||
@@ -2026,30 +2026,38 @@ case "$use_ttf_lib" in
|
|||||||
AC_DEFINE(_MGTTF_CACHE_SIZE, 1024,
|
AC_DEFINE(_MGTTF_CACHE_SIZE, 1024,
|
||||||
[Define if compile max ttf cahce size for 1024k])
|
[Define if compile max ttf cahce size for 1024k])
|
||||||
;;
|
;;
|
||||||
|
2048)
|
||||||
|
AC_DEFINE(_MGTTF_CACHE_SIZE, 2048,
|
||||||
|
[Define if compile max ttf cahce size for 2048k])
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
AC_DEFINE(_MGTTF_CACHE_SIZE, 256,
|
AC_DEFINE(_MGTTF_CACHE_SIZE, 1024,
|
||||||
[Define if compile max ttf cahce size for 256k])
|
[Define if compile max ttf cahce size for 1024k (default value)])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
AC_ARG_WITH(ttfcachenum,
|
AC_ARG_WITH(ttfcachenum,
|
||||||
[ --with-mttfcachenum=[10/20/40]])
|
[ --with-mttfcachenum=[16/32/64/128]])
|
||||||
case "$with_mttfcachenum" in
|
case "$with_mttfcachenum" in
|
||||||
10)
|
16)
|
||||||
AC_DEFINE(_MGMAX_TTF_CACHE, 10,
|
AC_DEFINE(_MGMAX_TTF_CACHE, 16,
|
||||||
[Define if compile max ttf cahce number for 10])
|
[Define if compile max ttf cahce number for 16])
|
||||||
;;
|
;;
|
||||||
20)
|
32)
|
||||||
AC_DEFINE(_MGMAX_TTF_CACHE, 20,
|
AC_DEFINE(_MGMAX_TTF_CACHE, 32,
|
||||||
[Define if compile max ttf cahce number for 20])
|
[Define if compile max ttf cahce number for 32])
|
||||||
;;
|
;;
|
||||||
40)
|
64)
|
||||||
AC_DEFINE(_MGMAX_TTF_CACHE, 40,
|
AC_DEFINE(_MGMAX_TTF_CACHE, 64,
|
||||||
[Define if compile max ttf cahce number for 40])
|
[Define if compile max ttf cahce number for 64])
|
||||||
|
;;
|
||||||
|
128)
|
||||||
|
AC_DEFINE(_MGMAX_TTF_CACHE, 128,
|
||||||
|
[Define if compile max ttf cahce number for 128])
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_DEFINE(_MGMAX_TTF_CACHE, 10,
|
AC_DEFINE(_MGMAX_TTF_CACHE, 32,
|
||||||
[Define if compile max ttf cahce number for 10 (default value)])
|
[Define if compile max ttf cahce number for 32 (default value)])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -239,9 +239,9 @@ int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len,
|
|||||||
496 static int euckr_is_this_charset (const unsigned char* charset)
|
496 static int euckr_is_this_charset (const unsigned char* charset)
|
||||||
497 {
|
497 {
|
||||||
498 int i;
|
498 int i;
|
||||||
499 char name [LEN_FONT_NAME + 1];
|
499 char name [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
500
|
500
|
||||||
501 for (i = 0; i < LEN_FONT_NAME + 1; i++) {
|
501 for (i = 0; i < LEN_LOGFONT_NAME_FIELD + 1; i++) {
|
||||||
502 if (charset [i] == '\0')
|
502 if (charset [i] == '\0')
|
||||||
503 break;
|
503 break;
|
||||||
504 name [i] = toupper (charset [i]);
|
504 name [i] = toupper (charset [i]);
|
||||||
@@ -388,9 +388,9 @@ int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len,
|
|||||||
|
|
||||||
<table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td> <pre>
|
<table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td> <pre>
|
||||||
228 typedef struct _LOGFONT {
|
228 typedef struct _LOGFONT {
|
||||||
229 char type [LEN_FONT_NAME + 1];
|
229 char type [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
230 char family [LEN_FONT_NAME + 1];
|
230 char family [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
231 char charset [LEN_FONT_NAME + 1];
|
231 char charset [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
232 DWORD style;
|
232 DWORD style;
|
||||||
233 int size;
|
233 int size;
|
||||||
234 int rotation;
|
234 int rotation;
|
||||||
|
|||||||
+81
-67
@@ -2,13 +2,13 @@
|
|||||||
* \file common.h
|
* \file common.h
|
||||||
* \author Wei Yongming <vincent@minigui.org>
|
* \author Wei Yongming <vincent@minigui.org>
|
||||||
* \date 2002/01/06
|
* \date 2002/01/06
|
||||||
*
|
*
|
||||||
* \brief This file includes macro definitions and typedefs that commonly used
|
* \brief This file includes macro definitions and typedefs that commonly used
|
||||||
* by MiniGUI.
|
* by MiniGUI.
|
||||||
*
|
*
|
||||||
\verbatim
|
\verbatim
|
||||||
|
|
||||||
This file is part of MiniGUI, a mature cross-platform windowing
|
This file is part of MiniGUI, a mature cross-platform windowing
|
||||||
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.
|
||||||
|
|
||||||
@@ -46,10 +46,10 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: common.h 13674 2010-12-06 06:45:01Z wanzheng $
|
* $Id: common.h 13674 2010-12-06 06:45:01Z wanzheng $
|
||||||
*
|
*
|
||||||
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
|
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
|
||||||
* pSOS, ThreadX, NuCleus, OSE, and Win32.
|
* pSOS, ThreadX, NuCleus, OSE, and Win32.
|
||||||
*
|
*
|
||||||
* The definitions of some data types and byte order macros
|
* The definitions of some data types and byte order macros
|
||||||
* borrowed from LGPL'ed SDL by Sam Lantinga.
|
* borrowed from LGPL'ed SDL by Sam Lantinga.
|
||||||
*
|
*
|
||||||
* Fix point math routines come from Allegro (a gift software)
|
* Fix point math routines come from Allegro (a gift software)
|
||||||
@@ -109,11 +109,11 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def _VERSION_CODE(major, minor, micro)
|
* \def _VERSION_CODE(major, minor, micro)
|
||||||
* \brief A macro that returns the version code from \a major, \a minor
|
* \brief A macro that returns the version code from \a major, \a minor
|
||||||
* and \a micro version number.
|
* and \a micro version number.
|
||||||
*
|
*
|
||||||
* MiniGUI uses this macro to evaluate the version code of current MiniGUI
|
* MiniGUI uses this macro to evaluate the version code of current MiniGUI
|
||||||
* library installed in your system, and define it to _MINIGUI_VERSION_CODE.
|
* library installed in your system, and define it to _MINIGUI_VERSION_CODE.
|
||||||
*
|
*
|
||||||
* \sa _MINIGUI_VERSION_CODE
|
* \sa _MINIGUI_VERSION_CODE
|
||||||
*/
|
*/
|
||||||
@@ -333,7 +333,7 @@ typedef int BOOL;
|
|||||||
# if defined(__MINIGUI_LIB__)
|
# if defined(__MINIGUI_LIB__)
|
||||||
# define MG_EXPORT __declspec(dllexport)
|
# define MG_EXPORT __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define MG_EXPORT __declspec(dllimport)
|
# define MG_EXPORT __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# define MG_EXPORT
|
# define MG_EXPORT
|
||||||
@@ -463,7 +463,7 @@ typedef signed char SBYTE;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \var WORD_HPTR
|
* \var WORD_HPTR
|
||||||
* \brief An unsigned int (word) type in half pointer precision.
|
* \brief An unsigned int (word) type in half pointer precision.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
typedef unsigned int WORD_HPTR;
|
typedef unsigned int WORD_HPTR;
|
||||||
@@ -475,7 +475,7 @@ typedef unsigned short WORD_HPTR;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \var SWORD_HPTR
|
* \var SWORD_HPTR
|
||||||
* \brief An signed int type in half pointer precision.
|
* \brief An signed int type in half pointer precision.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
typedef signed int SWORD_HPTR;
|
typedef signed int SWORD_HPTR;
|
||||||
@@ -486,13 +486,13 @@ typedef signed short SWORD_HPTR;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \var WORD
|
* \var WORD
|
||||||
* \brief A type definition for an unsigned integer (word).
|
* \brief A type definition for an unsigned integer (word).
|
||||||
*/
|
*/
|
||||||
typedef WORD_HPTR WORD;
|
typedef WORD_HPTR WORD;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \var SWORD
|
* \var SWORD
|
||||||
* \brief A type definition for a signed integer.
|
* \brief A type definition for a signed integer.
|
||||||
*/
|
*/
|
||||||
typedef SWORD_HPTR SWORD;
|
typedef SWORD_HPTR SWORD;
|
||||||
@@ -511,7 +511,7 @@ typedef signed short SWORD16;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \var LONG_PTR
|
* \var LONG_PTR
|
||||||
* \brief A signed long type for pointer precision.
|
* \brief A signed long type for pointer precision.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
typedef __int64 LONG_PTR;
|
typedef __int64 LONG_PTR;
|
||||||
@@ -535,9 +535,9 @@ typedef LONG_PTR LRESULT;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \var DWORD_PTR
|
* \var DWORD_PTR
|
||||||
* \brief An unsigned long type for pointer precision.
|
* \brief An unsigned long type for pointer precision.
|
||||||
*
|
*
|
||||||
* Commonly used for general 32-bit parameters that have been extended
|
* Commonly used for general 32-bit parameters that have been extended
|
||||||
* to 64 bits in 64-bit platform.
|
* to 64 bits in 64-bit platform.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
@@ -562,9 +562,9 @@ typedef unsigned int DWORD32;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \var SDWORD_PTR
|
* \var SDWORD_PTR
|
||||||
* \brief A signed long type for pointer precision.
|
* \brief A signed long type for pointer precision.
|
||||||
*
|
*
|
||||||
* Commonly used for general 32-bit parameters that have been extended
|
* Commonly used for general 32-bit parameters that have been extended
|
||||||
* to 64 bits in 64-bit platform.
|
* to 64 bits in 64-bit platform.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
@@ -694,6 +694,20 @@ typedef UINT_PTR LPARAM;
|
|||||||
*/
|
*/
|
||||||
#define MAKEWORD16(low, high) ((WORD16)(((BYTE)(low)) | (((WORD16)((BYTE)(high))) << 8)))
|
#define MAKEWORD16(low, high) ((WORD16)(((BYTE)(low)) | (((WORD16)((BYTE)(high))) << 8)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \def MAKEWORD32(first, second, third, fourth)
|
||||||
|
* \brief Makes a WORD32 value with four bytes.
|
||||||
|
*
|
||||||
|
* \sa MAKEWORD16, FIRSTBYTE, SECONDBYTE, THIRDBYTE, FOURTHBYTE
|
||||||
|
*/
|
||||||
|
#define MAKEDWORD32(first, second, third, fourth) \
|
||||||
|
((DWORD32)( \
|
||||||
|
((BYTE)(first)) | \
|
||||||
|
(((DWORD32)((BYTE)(second))) << 8) | \
|
||||||
|
(((DWORD32)((BYTE)(third))) << 16) | \
|
||||||
|
(((DWORD32)((BYTE)(fourth))) << 24) \
|
||||||
|
))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def MAKEWPARAM(first, second, third, fourth)
|
* \def MAKEWPARAM(first, second, third, fourth)
|
||||||
* \brief Makes a WPARAM value with four bytes.
|
* \brief Makes a WPARAM value with four bytes.
|
||||||
@@ -829,7 +843,7 @@ typedef DWORD32 RGBCOLOR;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def MakeRGBA(r, g, b, a)
|
* \def MakeRGBA(r, g, b, a)
|
||||||
* \brief Makes a RGBA triple value from red \a r, green \a g,
|
* \brief Makes a RGBA triple value from red \a r, green \a g,
|
||||||
* blue \a b and alpha \a components.
|
* blue \a b and alpha \a components.
|
||||||
*
|
*
|
||||||
* \note The red, green, blue and alpha components are all ranged from 0 to 255,
|
* \note The red, green, blue and alpha components are all ranged from 0 to 255,
|
||||||
@@ -953,7 +967,7 @@ typedef struct _RGB
|
|||||||
*/
|
*/
|
||||||
BYTE b;
|
BYTE b;
|
||||||
/**
|
/**
|
||||||
* Reserved for alignment, maybe used for the alpha component of a RGB triple.
|
* Reserved for alignment, maybe used for the alpha component of a RGB triple.
|
||||||
*/
|
*/
|
||||||
BYTE a;
|
BYTE a;
|
||||||
} RGB;
|
} RGB;
|
||||||
@@ -962,7 +976,7 @@ typedef struct _RGB
|
|||||||
* \var typedef RGB* PRGB
|
* \var typedef RGB* PRGB
|
||||||
* \brief Data type of the pointer to a RGB.
|
* \brief Data type of the pointer to a RGB.
|
||||||
*
|
*
|
||||||
* \sa RGB
|
* \sa RGB
|
||||||
*/
|
*/
|
||||||
typedef RGB* PRGB;
|
typedef RGB* PRGB;
|
||||||
|
|
||||||
@@ -1029,7 +1043,7 @@ typedef signed int gal_sint;
|
|||||||
typedef unsigned int gal_uint;
|
typedef unsigned int gal_uint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \var typedef Uint32 gal_pixel
|
* \var typedef Uint32 gal_pixel
|
||||||
* \brief Data type of pixel value
|
* \brief Data type of pixel value
|
||||||
*/
|
*/
|
||||||
typedef Uint32 gal_pixel;
|
typedef Uint32 gal_pixel;
|
||||||
@@ -1087,7 +1101,7 @@ typedef struct _GAL_Palette
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A rectangle defined by upper-left coordinates and width/height.
|
* A rectangle defined by upper-left coordinates and width/height.
|
||||||
* \sa RECT
|
* \sa RECT
|
||||||
*/
|
*/
|
||||||
typedef struct _GAL_Rect {
|
typedef struct _GAL_Rect {
|
||||||
/**
|
/**
|
||||||
@@ -1113,11 +1127,11 @@ typedef struct _GAL_Rect {
|
|||||||
*
|
*
|
||||||
* The number of MiniGUI keys is defined to 255 by default. This means that
|
* The number of MiniGUI keys is defined to 255 by default. This means that
|
||||||
* MiniGUI can destinguish 255 different keys with each has an unique scan code.
|
* MiniGUI can destinguish 255 different keys with each has an unique scan code.
|
||||||
* The scan codes below 129 are defined for PC keyboard by default.
|
* The scan codes below 129 are defined for PC keyboard by default.
|
||||||
* If your system has a large amount of keys, you can define the scan code of
|
* If your system has a large amount of keys, you can define the scan code of
|
||||||
* keys ranged from 1 to 255 in your IAL engine. And your application will
|
* keys ranged from 1 to 255 in your IAL engine. And your application will
|
||||||
* receive a MSG_KEYDOWN and MSG_KEYUP messages when a key pressed and
|
* receive a MSG_KEYDOWN and MSG_KEYUP messages when a key pressed and
|
||||||
* released, and the wParam of the messages will be defined to be equal to
|
* released, and the wParam of the messages will be defined to be equal to
|
||||||
* the scan code of the key.
|
* the scan code of the key.
|
||||||
*
|
*
|
||||||
* \sa NR_KEYS, SCANCODE_USER
|
* \sa NR_KEYS, SCANCODE_USER
|
||||||
@@ -1126,11 +1140,11 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def NR_KEYS
|
* \def NR_KEYS
|
||||||
* \brief The number of keys defined by Linux operating system.
|
* \brief The number of keys defined by Linux operating system.
|
||||||
*
|
*
|
||||||
* For a PC box, NR_KEYS is defined to 128 by default. You can define
|
* For a PC box, NR_KEYS is defined to 128 by default. You can define
|
||||||
* some input events from an input device other than keyboard, e.g.
|
* some input events from an input device other than keyboard, e.g.
|
||||||
* your remote controller, as key events with different scan codes from
|
* your remote controller, as key events with different scan codes from
|
||||||
* those of PC's. MiniGUI can support 255 keys, and the constant
|
* those of PC's. MiniGUI can support 255 keys, and the constant
|
||||||
* is defined by MGUI_NR_KEYS.
|
* is defined by MGUI_NR_KEYS.
|
||||||
*
|
*
|
||||||
@@ -1305,7 +1319,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_REPEATED
|
* \def KS_REPEATED
|
||||||
* \brief This status indicate that the key down message is an
|
* \brief This status indicate that the key down message is an
|
||||||
* auto-repeated one.
|
* auto-repeated one.
|
||||||
*
|
*
|
||||||
* You can test the status by AND'ed with lParam of the message, like below:
|
* You can test the status by AND'ed with lParam of the message, like below:
|
||||||
@@ -1327,7 +1341,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_CAPTURED
|
* \def KS_CAPTURED
|
||||||
* \brief This status indicate that the mouse is captured by a window when
|
* \brief This status indicate that the mouse is captured by a window when
|
||||||
* the mouse message posted.
|
* the mouse message posted.
|
||||||
*
|
*
|
||||||
* You can test the status by AND'ed with wParam of the message, like below:
|
* You can test the status by AND'ed with wParam of the message, like below:
|
||||||
@@ -1357,7 +1371,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_CAPSLOCK
|
* \def KS_CAPSLOCK
|
||||||
* \brief This status indicate that the CapsLock key was locked when
|
* \brief This status indicate that the CapsLock key was locked when
|
||||||
* the key or mouse message posted to the window.
|
* the key or mouse message posted to the window.
|
||||||
*
|
*
|
||||||
* You can test the status by AND'ed with lParam of the message, like below
|
* You can test the status by AND'ed with lParam of the message, like below
|
||||||
@@ -1379,7 +1393,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_NUMLOCK
|
* \def KS_NUMLOCK
|
||||||
* \brief This status indicate that the NumLock key was locked when
|
* \brief This status indicate that the NumLock key was locked when
|
||||||
* the key or mouse message posted to the window.
|
* the key or mouse message posted to the window.
|
||||||
*
|
*
|
||||||
* \sa key_msgs
|
* \sa key_msgs
|
||||||
@@ -1415,7 +1429,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_CTRL
|
* \def KS_CTRL
|
||||||
* \brief This status indicate that either the left-Ctrl key or the right-Ctrl key
|
* \brief This status indicate that either the left-Ctrl key or the right-Ctrl key
|
||||||
* was pressed when the key or mouse message posted to the window.
|
* was pressed when the key or mouse message posted to the window.
|
||||||
*
|
*
|
||||||
* \sa key_msgs
|
* \sa key_msgs
|
||||||
@@ -1442,7 +1456,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_ALT
|
* \def KS_ALT
|
||||||
* \brief This status indicate that either the left-Alt key or the right-Alt key
|
* \brief This status indicate that either the left-Alt key or the right-Alt key
|
||||||
* was pressed when the key or mouse message posted to the window.
|
* was pressed when the key or mouse message posted to the window.
|
||||||
*
|
*
|
||||||
* \sa key_msgs
|
* \sa key_msgs
|
||||||
@@ -1469,7 +1483,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_SHIFT
|
* \def KS_SHIFT
|
||||||
* \brief This status indicate that either the left-Shift key or the right-Shift key
|
* \brief This status indicate that either the left-Shift key or the right-Shift key
|
||||||
* was pressed when the key or mouse message posted to the window.
|
* was pressed when the key or mouse message posted to the window.
|
||||||
*
|
*
|
||||||
* \sa key_msgs
|
* \sa key_msgs
|
||||||
@@ -1484,7 +1498,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_LEFTBUTTON
|
* \def KS_LEFTBUTTON
|
||||||
* \brief This status indicate that left button was pressed when
|
* \brief This status indicate that left button was pressed when
|
||||||
* the key or mouse message posted to the window.
|
* the key or mouse message posted to the window.
|
||||||
*
|
*
|
||||||
* \sa key_msgs
|
* \sa key_msgs
|
||||||
@@ -1493,7 +1507,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_RIGHTBUTTON
|
* \def KS_RIGHTBUTTON
|
||||||
* \brief This status indicate that right button was pressed when
|
* \brief This status indicate that right button was pressed when
|
||||||
* the key or mouse message posted to the window.
|
* the key or mouse message posted to the window.
|
||||||
*
|
*
|
||||||
* \sa key_msgs
|
* \sa key_msgs
|
||||||
@@ -1502,7 +1516,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def KS_MIDDLBUTTON
|
* \def KS_MIDDLBUTTON
|
||||||
* \brief This status indicate that middle button was pressed when
|
* \brief This status indicate that middle button was pressed when
|
||||||
* the key or mouse message posted to the window.
|
* the key or mouse message posted to the window.
|
||||||
*
|
*
|
||||||
* \sa key_msgs
|
* \sa key_msgs
|
||||||
@@ -1535,37 +1549,37 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def ERR_QUEUE_FULL
|
* \def ERR_QUEUE_FULL
|
||||||
* \brief Return value queue is full error.
|
* \brief Return value queue is full error.
|
||||||
*/
|
*/
|
||||||
#define ERR_QUEUE_FULL -2
|
#define ERR_QUEUE_FULL -2
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def ERR_INVALID_HANDLE
|
* \def ERR_INVALID_HANDLE
|
||||||
* \brief Return value invalid handle error.
|
* \brief Return value invalid handle error.
|
||||||
*/
|
*/
|
||||||
#define ERR_INVALID_HANDLE -3
|
#define ERR_INVALID_HANDLE -3
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def ERR_INVALID_HMENU
|
* \def ERR_INVALID_HMENU
|
||||||
* \brief Return value invalid menu handle error.
|
* \brief Return value invalid menu handle error.
|
||||||
*/
|
*/
|
||||||
#define ERR_INVALID_HMENU -4
|
#define ERR_INVALID_HMENU -4
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def ERR_INVALID_POS
|
* \def ERR_INVALID_POS
|
||||||
* \brief Return value invalid postion error.
|
* \brief Return value invalid postion error.
|
||||||
*/
|
*/
|
||||||
#define ERR_INVALID_POS -5
|
#define ERR_INVALID_POS -5
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def ERR_INVALID_ID
|
* \def ERR_INVALID_ID
|
||||||
* \brief Return value invalid id error.
|
* \brief Return value invalid id error.
|
||||||
*/
|
*/
|
||||||
#define ERR_INVALID_ID -6
|
#define ERR_INVALID_ID -6
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def ERR_RES_ALLOCATION
|
* \def ERR_RES_ALLOCATION
|
||||||
* \brief Return value allocation resource error .
|
* \brief Return value allocation resource error .
|
||||||
*/
|
*/
|
||||||
#define ERR_RES_ALLOCATION -7
|
#define ERR_RES_ALLOCATION -7
|
||||||
|
|
||||||
@@ -1589,7 +1603,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def ERR_CTRLCLASS_INUSE
|
* \def ERR_CTRLCLASS_INUSE
|
||||||
* \brief Return value inuse control class error.
|
* \brief Return value inuse control class error.
|
||||||
*/
|
*/
|
||||||
#define ERR_CTRLCLASS_INUSE -11
|
#define ERR_CTRLCLASS_INUSE -11
|
||||||
|
|
||||||
@@ -1649,7 +1663,7 @@ typedef struct _GAL_Rect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \def ERR_INPUT_ENGINE
|
* \def ERR_INPUT_ENGINE
|
||||||
* \brief Return value input engine error.
|
* \brief Return value input engine error.
|
||||||
*/
|
*/
|
||||||
#define ERR_INPUT_ENGINE -21
|
#define ERR_INPUT_ENGINE -21
|
||||||
|
|
||||||
@@ -1769,12 +1783,12 @@ struct tm {
|
|||||||
#define fseek tp_fseek
|
#define fseek tp_fseek
|
||||||
#define feof tp_feof
|
#define feof tp_feof
|
||||||
|
|
||||||
#undef assert
|
#undef assert
|
||||||
#define _HAVE_ASSERT 1
|
#define _HAVE_ASSERT 1
|
||||||
|
|
||||||
#define assert(e) do { \
|
#define assert(e) do { \
|
||||||
e; \
|
e; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#undef stdin
|
#undef stdin
|
||||||
#undef stdout
|
#undef stdout
|
||||||
@@ -1811,13 +1825,13 @@ MG_EXPORT int strncasecmp(const char *s1, const char *s2, unsigned int n);
|
|||||||
|
|
||||||
#ifdef _MGUSE_OWN_MALLOC
|
#ifdef _MGUSE_OWN_MALLOC
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn int init_minigui_malloc (unsigned char* heap, unsigned int heap_size, \
|
* \fn int init_minigui_malloc (unsigned char* heap, unsigned int heap_size, \
|
||||||
int (*lock_heap) (void), int (*unlock_heap) (void))
|
int (*lock_heap) (void), int (*unlock_heap) (void))
|
||||||
* \brief Initialize MiniGUI's own heap system.
|
* \brief Initialize MiniGUI's own heap system.
|
||||||
*
|
*
|
||||||
* MiniGUI implements a heap system which is compatbile with ANIS C. When you
|
* MiniGUI implements a heap system which is compatbile with ANIS C. When you
|
||||||
* RTOS does not provide a re-entriable malloc implementation, you can use MiniGUI's
|
* RTOS does not provide a re-entriable malloc implementation, you can use MiniGUI's
|
||||||
* heap system.
|
* heap system.
|
||||||
*
|
*
|
||||||
* Before using MiniGUI's own heap system, you should provide a memory range to be
|
* Before using MiniGUI's own heap system, you should provide a memory range to be
|
||||||
@@ -1830,7 +1844,7 @@ MG_EXPORT int strncasecmp(const char *s1, const char *s2, unsigned int n);
|
|||||||
*
|
*
|
||||||
* \return Zero on success, non-zero on error.
|
* \return Zero on success, non-zero on error.
|
||||||
*/
|
*/
|
||||||
int init_minigui_malloc (unsigned char* heap, unsigned int heap_size,
|
int init_minigui_malloc (unsigned char* heap, unsigned int heap_size,
|
||||||
int (*lock_heap) (void), int (*unlock_heap) (void));
|
int (*lock_heap) (void), int (*unlock_heap) (void));
|
||||||
|
|
||||||
#define USE_DL_PREFIX
|
#define USE_DL_PREFIX
|
||||||
@@ -1876,7 +1890,7 @@ int init_minigui_malloc (unsigned char* heap, unsigned int heap_size,
|
|||||||
*
|
*
|
||||||
* \return Zero no success, non-zero on error.
|
* \return Zero no success, non-zero on error.
|
||||||
*/
|
*/
|
||||||
int init_minigui_printf (int (*output_char) (int ch),
|
int init_minigui_printf (int (*output_char) (int ch),
|
||||||
int (*input_char) (void));
|
int (*input_char) (void));
|
||||||
|
|
||||||
#if defined (__UCOSII__) || defined (__VXWORKS__) || defined (__NUCLEUS__) || defined (__PSOS__)
|
#if defined (__UCOSII__) || defined (__VXWORKS__) || defined (__NUCLEUS__) || defined (__PSOS__)
|
||||||
@@ -2085,7 +2099,7 @@ int init_minigui_printf (int (*output_char) (int ch),
|
|||||||
*
|
*
|
||||||
* This function initializes MiniGUI's own POSIX Threads system.
|
* This function initializes MiniGUI's own POSIX Threads system.
|
||||||
* If pth_entry is not NULL, this function will create a detached pthread
|
* If pth_entry is not NULL, this function will create a detached pthread
|
||||||
* as the main pthread, and call pth_entry with the arguments passed to
|
* as the main pthread, and call pth_entry with the arguments passed to
|
||||||
* this function.
|
* this function.
|
||||||
*
|
*
|
||||||
* Note for pSOS, this function will ignore the stack_base, cause pSOS kernel
|
* Note for pSOS, this function will ignore the stack_base, cause pSOS kernel
|
||||||
@@ -2100,8 +2114,8 @@ int init_minigui_printf (int (*output_char) (int ch),
|
|||||||
*
|
*
|
||||||
* \return Zero on success, non-zero on error.
|
* \return Zero on success, non-zero on error.
|
||||||
*/
|
*/
|
||||||
int start_minigui_pthread (int (* pth_entry) (int argc, const char* argv []),
|
int start_minigui_pthread (int (* pth_entry) (int argc, const char* argv []),
|
||||||
int argc, const char* argv[],
|
int argc, const char* argv[],
|
||||||
char* stack_base, unsigned int stack_size);
|
char* stack_base, unsigned int stack_size);
|
||||||
|
|
||||||
#ifndef ESRCH
|
#ifndef ESRCH
|
||||||
@@ -2261,17 +2275,17 @@ int _sysvipc_mutex_sem_term (void);
|
|||||||
#define pthread_mutex_t _sysvipc_pthread_mutex_t
|
#define pthread_mutex_t _sysvipc_pthread_mutex_t
|
||||||
#define pthread_mutexattr_t _sysvipc_pthread_mutexattr_t
|
#define pthread_mutexattr_t _sysvipc_pthread_mutexattr_t
|
||||||
|
|
||||||
#define pthread_mutexattr_init _sysvipc_pthread_mutexattr_init
|
#define pthread_mutexattr_init _sysvipc_pthread_mutexattr_init
|
||||||
#define pthread_mutexattr_destroy _sysvipc_pthread_mutexattr_destroy
|
#define pthread_mutexattr_destroy _sysvipc_pthread_mutexattr_destroy
|
||||||
#define pthread_mutexattr_settype _sysvipc_pthread_mutexattr_settype
|
#define pthread_mutexattr_settype _sysvipc_pthread_mutexattr_settype
|
||||||
#define pthread_mutexattr_gettype _sysvipc_pthread_mutexattr_gettype
|
#define pthread_mutexattr_gettype _sysvipc_pthread_mutexattr_gettype
|
||||||
|
|
||||||
#define pthread_init _sysvipc_pthread_init
|
#define pthread_init _sysvipc_pthread_init
|
||||||
#define pthread_mutex_init _sysvipc_pthread_mutex_init
|
#define pthread_mutex_init _sysvipc_pthread_mutex_init
|
||||||
#define pthread_mutex_destroy _sysvipc_pthread_mutex_destroy
|
#define pthread_mutex_destroy _sysvipc_pthread_mutex_destroy
|
||||||
#define pthread_mutex_lock _sysvipc_pthread_mutex_lock
|
#define pthread_mutex_lock _sysvipc_pthread_mutex_lock
|
||||||
#define pthread_mutex_trylock _sysvipc_pthread_mutex_trylock
|
#define pthread_mutex_trylock _sysvipc_pthread_mutex_trylock
|
||||||
#define pthread_mutex_unlock _sysvipc_pthread_mutex_unlock
|
#define pthread_mutex_unlock _sysvipc_pthread_mutex_unlock
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-3
@@ -2,12 +2,12 @@
|
|||||||
* \file control.h
|
* \file control.h
|
||||||
* \author Wei Yongming <vincent@minigui.org>
|
* \author Wei Yongming <vincent@minigui.org>
|
||||||
* \date 2001/12/29
|
* \date 2001/12/29
|
||||||
*
|
*
|
||||||
* \brief This file includes interfaces of standard controls of MiniGUI.
|
* \brief This file includes interfaces of standard controls of MiniGUI.
|
||||||
*
|
*
|
||||||
\verbatim
|
\verbatim
|
||||||
|
|
||||||
This file is part of MiniGUI, a mature cross-platform windowing
|
This file is part of MiniGUI, a mature cross-platform windowing
|
||||||
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.
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: control.h 11349 2009-03-02 05:00:43Z weiym $
|
* $Id: control.h 11349 2009-03-02 05:00:43Z weiym $
|
||||||
*
|
*
|
||||||
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
|
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
|
||||||
* pSOS, ThreadX, NuCleus, OSE, and Win32.
|
* pSOS, ThreadX, NuCleus, OSE, and Win32.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
+3888
-1807
File diff suppressed because it is too large
Load Diff
+339
-339
File diff suppressed because it is too large
Load Diff
+1011
-1011
File diff suppressed because it is too large
Load Diff
+426
-428
File diff suppressed because it is too large
Load Diff
+37
-38
@@ -44,21 +44,20 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct _GLYPHBUF
|
typedef struct _ACHARBUF
|
||||||
{
|
{
|
||||||
GLYPHMAPINFO* glyph_map; /* glyph info array */
|
ACHARMAPINFO* achar_map; /* achar info array */
|
||||||
int* glyphs; /* glyph array */
|
Achar32* achars; /* achar array */
|
||||||
int glyphs_len; /* glyph array len or buffer used size */
|
int achars_len; /* achar array len or buffer used size */
|
||||||
|
|
||||||
int blocksize; /* block size, a block is an allocate unit */
|
int blocksize; /* block size, a block is an allocate unit */
|
||||||
int glyphs_buffsize; /* glyph string buffer size */
|
int achars_buffsize; /* achar string buffer size */
|
||||||
int glyphmap_buffsize; /* glyph map buffer size */
|
int acharmap_buffsize; /* achar map buffer size */
|
||||||
} GLYPHBUF;
|
} ACHARBUF;
|
||||||
|
|
||||||
typedef struct tagBIDISLEDITDATA
|
typedef struct tagBIDISLEDITDATA
|
||||||
{
|
{
|
||||||
StrBuffer str_content; // string text buffer
|
StrBuffer str_content; // string text buffer
|
||||||
GLYPHBUF glyph_content; // glyph string buffer
|
ACHARBUF achar_content; // achar string buffer
|
||||||
|
|
||||||
int editPos; // current edit position
|
int editPos; // current edit position
|
||||||
int selStart; // selection start position
|
int selStart; // selection start position
|
||||||
@@ -92,48 +91,48 @@ typedef struct tagBIDISLEDITDATA
|
|||||||
typedef BIDISLEDITDATA* PBIDISLEDITDATA;
|
typedef BIDISLEDITDATA* PBIDISLEDITDATA;
|
||||||
|
|
||||||
static inline void*
|
static inline void*
|
||||||
glyphbuf_alloc (GLYPHBUF* glyph_buff, int len, int block_size)
|
acharbuf_alloc (ACHARBUF* achar_buff, int len, int block_size)
|
||||||
{
|
{
|
||||||
glyph_buff->glyphs_buffsize = (len + (block_size - len % block_size))
|
achar_buff->achars_buffsize = (len + (block_size - len % block_size))
|
||||||
* sizeof (int);
|
* sizeof (Achar32);
|
||||||
glyph_buff->glyphs = malloc (glyph_buff->glyphs_buffsize);
|
achar_buff->achars = malloc (achar_buff->achars_buffsize);
|
||||||
|
|
||||||
glyph_buff->glyphmap_buffsize = (len + (block_size - len % block_size))
|
achar_buff->acharmap_buffsize = (len + (block_size - len % block_size))
|
||||||
* sizeof (GLYPHMAPINFO);
|
* sizeof (ACHARMAPINFO);
|
||||||
glyph_buff->glyph_map = malloc (glyph_buff->glyphmap_buffsize);
|
achar_buff->achar_map = malloc (achar_buff->acharmap_buffsize);
|
||||||
|
|
||||||
glyph_buff->glyphs_len = len;
|
achar_buff->achars_len = len;
|
||||||
glyph_buff->blocksize = block_size;
|
achar_buff->blocksize = block_size;
|
||||||
|
|
||||||
return glyph_buff->glyphs;
|
return achar_buff->achars;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void glyphbuf_free (GLYPHBUF *glyph_buff)
|
static inline void acharbuf_free (ACHARBUF *achar_buff)
|
||||||
{
|
{
|
||||||
if (glyph_buff) {
|
if (achar_buff) {
|
||||||
free (glyph_buff->glyphs);
|
free (achar_buff->achars);
|
||||||
free (glyph_buff->glyph_map);
|
free (achar_buff->achar_map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void* glyphbuf_realloc (GLYPHBUF *glyph_buff, int len)
|
static inline void* acharbuf_realloc (ACHARBUF *achar_buff, int len)
|
||||||
{
|
{
|
||||||
if (len * sizeof(int) > glyph_buff->glyphs_buffsize ||
|
if (len * sizeof(int) > achar_buff->achars_buffsize ||
|
||||||
len * sizeof(int) < glyph_buff->glyphs_buffsize - glyph_buff->blocksize) {
|
len * sizeof(int) < achar_buff->achars_buffsize - achar_buff->blocksize) {
|
||||||
/* realloc glyph string mem */
|
/* realloc achar string mem */
|
||||||
glyph_buff->glyphs_buffsize = (len + (glyph_buff->blocksize -
|
achar_buff->achars_buffsize = (len + (achar_buff->blocksize -
|
||||||
len % glyph_buff->blocksize))* sizeof(int);
|
len % achar_buff->blocksize))* sizeof(Achar32);
|
||||||
glyph_buff->glyphs = realloc (glyph_buff->glyphs,
|
achar_buff->achars = realloc (achar_buff->achars,
|
||||||
glyph_buff->glyphs_buffsize);
|
achar_buff->achars_buffsize);
|
||||||
|
|
||||||
/* realloc glyph map mem */
|
/* realloc achar map mem */
|
||||||
glyph_buff->glyphmap_buffsize = (len + (glyph_buff->blocksize -
|
achar_buff->acharmap_buffsize = (len + (achar_buff->blocksize -
|
||||||
len % glyph_buff->blocksize))* sizeof(GLYPHMAPINFO);
|
len % achar_buff->blocksize))* sizeof(ACHARMAPINFO);
|
||||||
glyph_buff->glyph_map = realloc (glyph_buff->glyph_map,
|
achar_buff->achar_map = realloc (achar_buff->achar_map,
|
||||||
glyph_buff->glyphmap_buffsize);
|
achar_buff->acharmap_buffsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
return glyph_buff->glyphs;
|
return achar_buff->achars;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL RegisterBIDISLEditControl (void);
|
BOOL RegisterBIDISLEditControl (void);
|
||||||
|
|||||||
@@ -271,30 +271,30 @@ static void set_keyboard_layout(HWND hDlg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (cur_type == GLYPH_TYPE_RTL) {
|
if (cur_type == CHAR_TYPE_RTL) {
|
||||||
if (l_glyph_type == GLYPH_TYPE_RTL)
|
if (l_char_type == CHAR_TYPE_RTL)
|
||||||
return INSERTPOS_BEFORE (sled, l_glyph_index);
|
return INSERTPOS_BEFORE (sled, l_glyph_index);
|
||||||
else if (r_glyph_type == GLYPH_TYPE_RTL)
|
else if (r_char_type == CHAR_TYPE_RTL)
|
||||||
return INSERTPOS_AFTER (sled, r_glyph_index);
|
return INSERTPOS_AFTER (sled, r_glyph_index);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (l_glyph_type == GLYPH_TYPE_LTR)
|
if (l_char_type == CHAR_TYPE_LTR)
|
||||||
return INSERTPOS_AFTER (sled, l_glyph_index);
|
return INSERTPOS_AFTER (sled, l_glyph_index);
|
||||||
else if (l_glyph_type == GLYPH_TYPE_LTR)
|
else if (l_char_type == CHAR_TYPE_LTR)
|
||||||
return INSERTPOS_BEFORE (sled, r_glyph_index);
|
return INSERTPOS_BEFORE (sled, r_glyph_index);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (l_glyph_type == GLYPH_TYPE_LTR)
|
if (l_char_type == CHAR_TYPE_LTR)
|
||||||
return INSERTPOS_AFTER (sled, l_glyph_index);
|
return INSERTPOS_AFTER (sled, l_glyph_index);
|
||||||
else if (r_glyph_type == GLYPH_TYPE_LTR)
|
else if (r_char_type == CHAR_TYPE_LTR)
|
||||||
return INSERTPOS_BEFORE (sled, r_glyph_index);
|
return INSERTPOS_BEFORE (sled, r_glyph_index);
|
||||||
else {
|
else {
|
||||||
if (l_glyph_type == GLYPH_TYPE_RTL)
|
if (l_char_type == CHAR_TYPE_RTL)
|
||||||
return INSERTPOS_BEFORE (sled, l_glyph_index);
|
return INSERTPOS_BEFORE (sled, l_glyph_index);
|
||||||
else if (l_glyph_type == GLYPH_TYPE_RTL)
|
else if (l_char_type == CHAR_TYPE_RTL)
|
||||||
return INSERTPOS_AFTER (sled, r_glyph_index);
|
return INSERTPOS_AFTER (sled, r_glyph_index);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -3,16 +3,19 @@ SUBDIRS = in-core
|
|||||||
noinst_LTLIBRARIES = libfont.la
|
noinst_LTLIBRARIES = libfont.la
|
||||||
|
|
||||||
SRC_FILES = charset.c charset-arabic.c charset-bidi.c \
|
SRC_FILES = charset.c charset-arabic.c charset-bidi.c \
|
||||||
|
unicode-comp.c unicode-script.c language-code.c \
|
||||||
sysfont.c logfont.c devfont.c fontname.c \
|
sysfont.c logfont.c devfont.c fontname.c \
|
||||||
rawbitmap.c varbitmap.c qpf.c upf.c \
|
rawbitmap.c varbitmap.c qpf.c upf.c \
|
||||||
fontcache.c freetype2.c font-engines.c\
|
fontcache.c freetype2.c font-engines.c\
|
||||||
gbunimap.c gbkunimap.c gb18030unimap.c big5unimap.c \
|
gbunimap.c gbkunimap.c gb18030unimap.c big5unimap.c \
|
||||||
ujisunimap.c sjisunimap.c euckrunimap.c \
|
ujisunimap.c sjisunimap.c euckrunimap.c \
|
||||||
textops.c mapunitogb.c mapunitogbk.c mapunitobig5.c mapunitogb18030.c \
|
textops.c mapunitogb.c mapunitogbk.c mapunitobig5.c mapunitogb18030.c \
|
||||||
bitmapfont.c scripteasy.c
|
bitmapfont.c scripteasy.c \
|
||||||
|
unicode-emoji.c
|
||||||
|
|
||||||
HDR_FILES = charset.h rawbitmap.h varbitmap.h freetype2.h qpf.h \
|
HDR_FILES = charset.h rawbitmap.h varbitmap.h freetype2.h qpf.h se_minigui.h \
|
||||||
upf.h bitmapfont.h gunichartables.h se_minigui.h unicode-bidi-tables.h
|
upf.h bitmapfont.h unicode-bidi-tables.h \
|
||||||
|
unicode-tables.h unicode-break.h unicode-decomp.h unicode-comp.h unicode-emoji-table.h
|
||||||
|
|
||||||
EXTRA_DIST = convgbmap.c jisunimap.c $(SRC_FILES) $(HDR_FILES) \
|
EXTRA_DIST = convgbmap.c jisunimap.c $(SRC_FILES) $(HDR_FILES) \
|
||||||
makefile.ng makefile.msvc
|
makefile.ng makefile.msvc
|
||||||
|
|||||||
+10
-7
@@ -190,7 +190,7 @@ static void destroy (GLYPHTREENODE *root)
|
|||||||
|
|
||||||
/*** device font ops ***/
|
/*** device font ops ***/
|
||||||
|
|
||||||
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
return DEVFONTGLYPHTYPE_PRERDRBMP;
|
return DEVFONTGLYPHTYPE_PRERDRBMP;
|
||||||
}
|
}
|
||||||
@@ -210,8 +210,11 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
return ((BMPFONTINFO *)devfont->data)->height;
|
return ((BMPFONTINFO *)devfont->data)->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
|
||||||
{
|
{
|
||||||
|
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
|
||||||
|
SET_DEVFONT_SCALE (logfont, df_slot, 1);
|
||||||
|
|
||||||
return ((BMPFONTINFO *)devfont->data)->height;
|
return ((BMPFONTINFO *)devfont->data)->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,7 +368,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_glyph_type,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
get_font_height,
|
get_font_height,
|
||||||
@@ -469,7 +472,7 @@ DEVFONT *CreateBMPDevFont (const char *bmpfont_name, const BITMAP* glyph_bmp,
|
|||||||
{
|
{
|
||||||
DEVFONT* bitmapfont_dev_font = NULL;
|
DEVFONT* bitmapfont_dev_font = NULL;
|
||||||
CHARSETOPS* charset_ops;
|
CHARSETOPS* charset_ops;
|
||||||
char charset[LEN_FONT_NAME + 1];
|
char charset[LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
BMPFONTINFO *bmpfont_info;
|
BMPFONTINFO *bmpfont_info;
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
@@ -484,7 +487,7 @@ DEVFONT *CreateBMPDevFont (const char *bmpfont_name, const BITMAP* glyph_bmp,
|
|||||||
goto error_create;
|
goto error_create;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = (charset_ops->char_glyph_value) (NULL, 0,
|
offset = (charset_ops->get_char_value) (NULL, 0,
|
||||||
(const unsigned char*) start_mchar, 0);
|
(const unsigned char*) start_mchar, 0);
|
||||||
|
|
||||||
bmpfont_info = build_bmpfont_info (bmpfont_name, glyph_bmp,
|
bmpfont_info = build_bmpfont_info (bmpfont_name, glyph_bmp,
|
||||||
@@ -547,7 +550,7 @@ BOOL AddGlyphsToBMPFont (DEVFONT* dev_font, BITMAP* glyph_bmp,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Insert a node in the avl tree */
|
/* Insert a node in the avl tree */
|
||||||
offset = (*dev_font->charset_ops->char_glyph_value) (NULL, 0,
|
offset = (*dev_font->charset_ops->get_char_value) (NULL, 0,
|
||||||
(const unsigned char*)start_mchar, 0);
|
(const unsigned char*)start_mchar, 0);
|
||||||
|
|
||||||
if (look_up (root, offset) == NULL) {
|
if (look_up (root, offset) == NULL) {
|
||||||
@@ -641,7 +644,7 @@ static int avl_look_up (DEVFONT *dev_font, char *start_mchar, int n)
|
|||||||
GLYPHTREENODE *p;
|
GLYPHTREENODE *p;
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
offset = (*dev_font->charset_ops->char_glyph_value) (NULL, 0,
|
offset = (*dev_font->charset_ops->get_char_value) (NULL, 0,
|
||||||
(const unsigned char*)start_mchar, n);
|
(const unsigned char*)start_mchar, n);
|
||||||
offset += n;
|
offset += n;
|
||||||
|
|
||||||
|
|||||||
+196
-192
File diff suppressed because it is too large
Load Diff
+117
-94
@@ -133,7 +133,7 @@ static void print_run_types(TYPERUN *pp)
|
|||||||
fprintf (stderr, "\n");
|
fprintf (stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_hexstr(Glyph32* str, int len, BOOL reorder_state)
|
static void print_hexstr(Achar32* str, int len, BOOL reorder_state)
|
||||||
{
|
{
|
||||||
int m = 0;
|
int m = 0;
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ static void print_hexstr(Glyph32* str, int len, BOOL reorder_state)
|
|||||||
|
|
||||||
#else /* BIDI_DEBUG */
|
#else /* BIDI_DEBUG */
|
||||||
|
|
||||||
inline static void print_hexstr(Glyph32* str, int len, BOOL reorder_state)
|
inline static void print_hexstr(Achar32* str, int len, BOOL reorder_state)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -218,7 +218,7 @@ static void compact_neutrals (TYPERUN *list)
|
|||||||
(p) = (q); \
|
(p) = (q); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len)
|
static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Achar32* achars, int len)
|
||||||
{
|
{
|
||||||
int type = 0;
|
int type = 0;
|
||||||
TYPERUN *list, *last, *link;
|
TYPERUN *list, *last, *link;
|
||||||
@@ -231,7 +231,7 @@ static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Glyph32* glyphs
|
|||||||
last = list;
|
last = list;
|
||||||
|
|
||||||
for (i = 0; i < len; i++){
|
for (i = 0; i < len; i++){
|
||||||
if ((type = charset_ops->bidi_glyph_type (glyphs[i])) != last->type){
|
if ((type = charset_ops->bidi_char_type (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;
|
||||||
@@ -473,7 +473,7 @@ static int bidi_resolveImplicit(TYPERUN **ptype_rl_list, int base_level)
|
|||||||
|
|
||||||
/* 6.Resolving Mirrored Char. */
|
/* 6.Resolving Mirrored Char. */
|
||||||
static void
|
static void
|
||||||
bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len,
|
bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Achar32* achars, int len,
|
||||||
TYPERUN **ptype_rl_list, int base_level)
|
TYPERUN **ptype_rl_list, int base_level)
|
||||||
{
|
{
|
||||||
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
|
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
|
||||||
@@ -486,53 +486,18 @@ bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Glyph32* glyphs, 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++)
|
||||||
{
|
{
|
||||||
Glyph32 mirrored_ch;
|
Achar32 mirrored_ch;
|
||||||
if (charset_ops->bidi_mirror_glyph && charset_ops->bidi_mirror_glyph (glyphs[i], &mirrored_ch))
|
if (charset_ops->bidi_mirror_char && charset_ops->bidi_mirror_char (achars[i], &mirrored_ch))
|
||||||
glyphs[i] = mirrored_ch;
|
achars[i] = mirrored_ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGLOG (" Mirroring, Done\n");
|
DBGLOG (" Mirroring, Done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bidi_map_reverse (void* context, int len, int pos)
|
static void bidi_resolve_string (const CHARSETOPS* charset_ops,
|
||||||
{
|
Achar32* achars, int len, int pel,
|
||||||
GLYPHMAPINFO* str = (GLYPHMAPINFO*)context + pos;
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < len / 2; i++)
|
|
||||||
{
|
|
||||||
GLYPHMAPINFO tmp = str[i];
|
|
||||||
str[i] = str[len - 1 - i];
|
|
||||||
str[len - 1 - i] = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bidi_index_reverse (void* context, int len, int pos)
|
|
||||||
{
|
|
||||||
char* str = (char*)context + pos;
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < len / 2; i++)
|
|
||||||
{
|
|
||||||
char tmp = str[i];
|
|
||||||
str[i] = str[len - 1 - i];
|
|
||||||
str[len - 1 - i] = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bidi_string_reverse (void* context, int len, int pos)
|
|
||||||
{
|
|
||||||
Glyph32* str = (Glyph32*)context + pos;
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < len / 2; i++)
|
|
||||||
{
|
|
||||||
Glyph32 tmp = str[i];
|
|
||||||
str[i] = str[len - 1 - i];
|
|
||||||
str[len - 1 - i] = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bidi_resolve_string (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len,
|
|
||||||
TYPERUN **ptype_rl_list, BYTE *pmax_level)
|
TYPERUN **ptype_rl_list, BYTE *pmax_level)
|
||||||
{
|
{
|
||||||
BYTE base_level = 0;
|
BYTE base_level = 0;
|
||||||
@@ -540,10 +505,16 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops, Glyph32* glyphs,
|
|||||||
TYPERUN *type_rl_list = NULL;
|
TYPERUN *type_rl_list = NULL;
|
||||||
|
|
||||||
/* split the text to some runs. */
|
/* split the text to some runs. */
|
||||||
type_rl_list = get_runtype_link (charset_ops, glyphs, len);
|
type_rl_list = get_runtype_link (charset_ops, achars, len);
|
||||||
|
|
||||||
/* 1.Find base level */
|
/* 1.Find base level */
|
||||||
bidi_resolveParagraphs(&type_rl_list, &base_dir, &base_level);
|
if (pel != 0 && pel != 1) {
|
||||||
|
bidi_resolveParagraphs(&type_rl_list, &base_dir, &base_level);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
base_level = pel;
|
||||||
|
base_dir = BIDI_LEVEL_TO_DIR (base_level);
|
||||||
|
}
|
||||||
|
|
||||||
/* 2.Resolving Explicit levels.*/
|
/* 2.Resolving Explicit levels.*/
|
||||||
bidi_resolveExplicit(&type_rl_list, base_dir);
|
bidi_resolveExplicit(&type_rl_list, base_dir);
|
||||||
@@ -558,13 +529,31 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops, Glyph32* glyphs,
|
|||||||
*pmax_level = bidi_resolveImplicit(&type_rl_list, base_level);
|
*pmax_level = bidi_resolveImplicit(&type_rl_list, base_level);
|
||||||
|
|
||||||
/* 6.Resolving Mirrored Char. */
|
/* 6.Resolving Mirrored Char. */
|
||||||
bidi_resolveMirrorChar (charset_ops, glyphs, len, &type_rl_list, base_level);
|
bidi_resolveMirrorChar (charset_ops, achars, len, &type_rl_list, base_level);
|
||||||
|
|
||||||
*ptype_rl_list = type_rl_list;
|
*ptype_rl_list = type_rl_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bidi_reorder_cb (void* context, int len,
|
typedef struct _REORDER_CONTEXT {
|
||||||
TYPERUN **ptype_rl_list, BYTE max_level, CB_DO_REORDER cb)
|
Achar32* achars;
|
||||||
|
void* extra;
|
||||||
|
CB_REVERSE_EXTRA cb;
|
||||||
|
} REORDER_CONTEXT;
|
||||||
|
|
||||||
|
static void bidi_reverse_achars (Achar32* achars, int len, int pos)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
Achar32* gs = achars + pos;
|
||||||
|
|
||||||
|
for (i = 0; i < len / 2; i++) {
|
||||||
|
Achar32 tmp = gs[i];
|
||||||
|
gs[i] = gs[len - 1 - i];
|
||||||
|
gs[len - 1 - i] = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void bidi_reorder (REORDER_CONTEXT* context, int len,
|
||||||
|
TYPERUN **ptype_rl_list, BYTE max_level)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
|
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
|
||||||
@@ -583,44 +572,82 @@ static void bidi_reorder_cb (void* context, int len,
|
|||||||
pp1 = pp1->next;
|
pp1 = pp1->next;
|
||||||
}
|
}
|
||||||
pp = pp1->prev;
|
pp = pp1->prev;
|
||||||
cb(context, len, pos);
|
|
||||||
|
if (context->achars) {
|
||||||
|
bidi_reverse_achars(context->achars, len, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context->extra && context->cb) {
|
||||||
|
context->cb(context->extra, len, pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBGLOG("\nReordering, Done\n");
|
DBGLOG("\nReordering, Done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void __mg_charset_bidi_get_embeddlevels (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len,
|
static void bidi_reverse_chars (void* context, int len, int pos)
|
||||||
Uint8* embedding_level_list, Uint8 type)
|
{
|
||||||
|
char* str = (char*)context + pos;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < len / 2; i++)
|
||||||
|
{
|
||||||
|
char tmp = str[i];
|
||||||
|
str[i] = str[len - 1 - i];
|
||||||
|
str[len - 1 - i] = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void __mg_charset_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
|
||||||
|
Achar32* achars, int len, int pel, Uint8* embedding_levels, Uint8 type)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
BYTE max_level = 1;
|
BYTE max_level = 1;
|
||||||
TYPERUN *type_rl_list = NULL, *pp;
|
TYPERUN *type_rl_list = NULL, *pp;
|
||||||
|
|
||||||
print_hexstr(glyphs, 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, glyphs, len, &type_rl_list, &max_level);
|
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list,
|
||||||
|
&max_level);
|
||||||
|
|
||||||
/* type = 0, get the logical embedding level; else visual level.*/
|
/* type = 0, get the logical embedding level; else visual level.*/
|
||||||
for (pp = type_rl_list->next; pp->next; pp = pp->next){
|
for (pp = type_rl_list->next; pp->next; pp = pp->next){
|
||||||
int pos = POS (pp), len = LEN (pp);
|
int pos = POS (pp), len = LEN (pp);
|
||||||
for(i = 0; i < len; i++)
|
for(i = 0; i < len; i++)
|
||||||
embedding_level_list[pos + i] = LEVEL(pp);
|
embedding_levels[pos + i] = LEVEL(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type) {
|
if (type) {
|
||||||
bidi_reorder_cb(embedding_level_list, len, &type_rl_list, max_level,
|
REORDER_CONTEXT rc;
|
||||||
bidi_index_reverse);
|
|
||||||
|
rc.achars = NULL;
|
||||||
|
rc.extra = embedding_levels;
|
||||||
|
rc.cb = bidi_reverse_chars;
|
||||||
|
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);
|
||||||
|
|
||||||
print_hexstr(glyphs, len, TRUE);
|
print_hexstr(achars, len, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Glyph32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops, Glyph32* glyphs,
|
#if 0
|
||||||
int len, GLYPHMAPINFO* map)
|
static void bidi_map_reverse (void* context, int len, int pos)
|
||||||
|
{
|
||||||
|
GLYPHMAPINFO* str = (GLYPHMAPINFO*)context + pos;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < len / 2; i++)
|
||||||
|
{
|
||||||
|
GLYPHMAPINFO tmp = str[i];
|
||||||
|
str[i] = str[len - 1 - i];
|
||||||
|
str[len - 1 - i] = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Achar32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops,
|
||||||
|
Achar32* achars, int len, GLYPHMAPINFO* map, int pel)
|
||||||
{
|
{
|
||||||
BYTE max_level = 1;
|
BYTE max_level = 1;
|
||||||
TYPERUN *type_rl_list = NULL;
|
TYPERUN *type_rl_list = NULL;
|
||||||
@@ -629,14 +656,12 @@ Glyph32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops, Glyph32*
|
|||||||
int run_pos;
|
int run_pos;
|
||||||
int run_len;
|
int run_len;
|
||||||
|
|
||||||
print_hexstr(glyphs, 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, glyphs, len, &type_rl_list, &max_level);
|
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list, &max_level);
|
||||||
|
|
||||||
for (node_p=type_rl_list->next; node_p->next;
|
for (node_p=type_rl_list->next; node_p->next; node_p=node_p->next) {
|
||||||
node_p=node_p->next)
|
|
||||||
{
|
|
||||||
run_pos = node_p->pos;
|
run_pos = node_p->pos;
|
||||||
run_len = node_p->len;
|
run_len = node_p->len;
|
||||||
|
|
||||||
@@ -652,21 +677,21 @@ Glyph32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops, Glyph32*
|
|||||||
/* free typerun list.*/
|
/* free typerun list.*/
|
||||||
free_typerun_list(type_rl_list);
|
free_typerun_list(type_rl_list);
|
||||||
|
|
||||||
print_hexstr(glyphs, len, TRUE);
|
print_hexstr(achars, len, TRUE);
|
||||||
|
|
||||||
return glyphs;
|
return achars;
|
||||||
}
|
}
|
||||||
|
|
||||||
Glyph32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops, Glyph32* glyphs,
|
Achar32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops,
|
||||||
int len, int* index_map)
|
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;
|
||||||
|
|
||||||
print_hexstr(glyphs, 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, glyphs, len, &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,
|
bidi_reorder_cb(index_map, len, &type_rl_list, max_level,
|
||||||
bidi_string_reverse);
|
bidi_string_reverse);
|
||||||
@@ -674,39 +699,48 @@ Glyph32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops, Glyph32
|
|||||||
/* free typerun list.*/
|
/* free typerun list.*/
|
||||||
free_typerun_list(type_rl_list);
|
free_typerun_list(type_rl_list);
|
||||||
|
|
||||||
print_hexstr(glyphs, len, TRUE);
|
print_hexstr(achars, len, TRUE);
|
||||||
|
|
||||||
return glyphs;
|
return achars;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Glyph32* __mg_charset_bidi_glyphs_reorder (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len)
|
Achar32* __mg_charset_bidi_achars_reorder (const CHARSETOPS* charset_ops,
|
||||||
|
Achar32* achars, int len, int pel,
|
||||||
|
void* extra, CB_REVERSE_EXTRA cb_reverse_extra)
|
||||||
{
|
{
|
||||||
BYTE max_level = 1;
|
BYTE max_level = 1;
|
||||||
TYPERUN *type_rl_list = NULL;
|
TYPERUN *type_rl_list = NULL;
|
||||||
|
REORDER_CONTEXT rc;
|
||||||
|
|
||||||
print_hexstr(glyphs, 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, glyphs, len, &type_rl_list, &max_level);
|
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list,
|
||||||
|
&max_level);
|
||||||
|
|
||||||
bidi_reorder_cb (glyphs, len, &type_rl_list, max_level, bidi_string_reverse);
|
rc.achars = achars;
|
||||||
|
rc.extra = extra;
|
||||||
|
rc.cb = cb_reverse_extra;
|
||||||
|
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);
|
||||||
|
|
||||||
print_hexstr (glyphs, len, TRUE);
|
print_hexstr (achars, len, TRUE);
|
||||||
|
|
||||||
return glyphs;
|
return achars;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 __mg_charset_bidi_str_base_dir (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len)
|
Uint32 __mg_charset_bidi_str_base_dir (const CHARSETOPS* charset_ops,
|
||||||
|
Achar32* achars, int len)
|
||||||
{
|
{
|
||||||
BYTE base_level = 0;
|
BYTE base_level = 0;
|
||||||
Uint32 base_dir = BIDI_TYPE_L;
|
Uint32 base_dir = BIDI_TYPE_L;
|
||||||
TYPERUN *type_rl_list = NULL;
|
TYPERUN *type_rl_list = NULL;
|
||||||
|
|
||||||
/* split the text to some runs. */
|
/* split the text to some runs. */
|
||||||
type_rl_list = get_runtype_link (charset_ops, glyphs, len);
|
type_rl_list = get_runtype_link (charset_ops, achars, len);
|
||||||
|
|
||||||
/* 1.Find base level */
|
/* 1.Find base level */
|
||||||
bidi_resolveParagraphs(&type_rl_list, &base_dir, &base_level);
|
bidi_resolveParagraphs(&type_rl_list, &base_dir, &base_level);
|
||||||
@@ -717,14 +751,3 @@ Uint32 __mg_charset_bidi_str_base_dir (const CHARSETOPS* charset_ops, Glyph32* g
|
|||||||
return base_dir;
|
return base_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL GetGlyphBIDIType (LOGFONT* log_font, Glyph32 glyph_value, Uint32 *bidi_type)
|
|
||||||
{
|
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
|
||||||
|
|
||||||
if (mbc_devfont == NULL || mbc_devfont->charset_ops->bidi_glyph_type == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
*bidi_type = mbc_devfont->charset_ops->bidi_glyph_type (glyph_value);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+1001
-435
File diff suppressed because it is too large
Load Diff
+217
-88
File diff suppressed because it is too large
Load Diff
+29
-63
@@ -85,15 +85,12 @@ typedef struct _HashDirectory {
|
|||||||
*hashDir : the hash directory pointer
|
*hashDir : the hash directory pointer
|
||||||
lruQueueDummyHead : head node of lru queue
|
lruQueueDummyHead : head node of lru queue
|
||||||
makeHashKeyFunc : the function which make hash key */
|
makeHashKeyFunc : the function which make hash key */
|
||||||
typedef struct cache {
|
typedef struct _FontCache {
|
||||||
/* Information about font */
|
/* Information about font */
|
||||||
char family[LEN_FONT_NAME + 1];
|
char df_name[LEN_UNIDEVFONT_NAME + 1];
|
||||||
// VincentWei: no need to check charset for TrueType
|
int style;
|
||||||
//char charset[LEN_FONT_NAME + 1];
|
|
||||||
int render_style; // render style
|
|
||||||
int fontsize;
|
int fontsize;
|
||||||
int rotation;
|
int rotation;
|
||||||
|
|
||||||
int refers;
|
int refers;
|
||||||
int blkSize;
|
int blkSize;
|
||||||
int nBlk;
|
int nBlk;
|
||||||
@@ -103,7 +100,7 @@ typedef struct cache {
|
|||||||
HashDirectory *hashDir;
|
HashDirectory *hashDir;
|
||||||
LruQueueDummyHead lruQueueDummyHead;
|
LruQueueDummyHead lruQueueDummyHead;
|
||||||
MakeHashKeyFunc makeHashKeyFunc;
|
MakeHashKeyFunc makeHashKeyFunc;
|
||||||
} cache_t;
|
} FontCache;
|
||||||
|
|
||||||
/* Least-Recently-Used-Order
|
/* Least-Recently-Used-Order
|
||||||
global cache LRU queue */
|
global cache LRU queue */
|
||||||
@@ -111,7 +108,7 @@ typedef struct _CacheQueueNode
|
|||||||
{
|
{
|
||||||
/* hold global cache queue
|
/* hold global cache queue
|
||||||
max cache node maybe 10 */
|
max cache node maybe 10 */
|
||||||
cache_t cache;
|
FontCache cache;
|
||||||
struct _CacheQueueNode *prevCache;
|
struct _CacheQueueNode *prevCache;
|
||||||
struct _CacheQueueNode *nextCache;
|
struct _CacheQueueNode *nextCache;
|
||||||
}CacheQueueNode;
|
}CacheQueueNode;
|
||||||
@@ -149,7 +146,7 @@ AppendCache(CacheQueueNode *new)
|
|||||||
|
|
||||||
/* create a new LRU-Queue. */
|
/* create a new LRU-Queue. */
|
||||||
static int
|
static int
|
||||||
CreateCacheLruQueue(cache_t *cache, int nblk)
|
CreateCacheLruQueue(FontCache *cache, int nblk)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
MemBlk *blk;
|
MemBlk *blk;
|
||||||
@@ -221,7 +218,7 @@ InitCache(CacheQueueNode *new, int ndir, int nblock)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
LruQueueBufferSplit(cache_t *cache, int bufsize)
|
LruQueueBufferSplit(FontCache *cache, int bufsize)
|
||||||
{
|
{
|
||||||
MemBlk *blk;
|
MemBlk *blk;
|
||||||
unsigned char *buff;
|
unsigned char *buff;
|
||||||
@@ -236,7 +233,7 @@ LruQueueBufferSplit(cache_t *cache, int bufsize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DestroyCache(cache_t *cache)
|
DestroyCache(FontCache *cache)
|
||||||
{
|
{
|
||||||
if (cache->hashDir != NULL) {
|
if (cache->hashDir != NULL) {
|
||||||
free(cache->hashDir);
|
free(cache->hashDir);
|
||||||
@@ -325,7 +322,7 @@ GetCache(int nblock, int ndir)
|
|||||||
lru-queue and also Hash queue(anywhere in hash q).
|
lru-queue and also Hash queue(anywhere in hash q).
|
||||||
Relink the lru queue and hash queue */
|
Relink the lru queue and hash queue */
|
||||||
static MemBlk *
|
static MemBlk *
|
||||||
PickOffBlk(cache_t *cache)
|
PickOffBlk(FontCache *cache)
|
||||||
{
|
{
|
||||||
MemBlk *blk;
|
MemBlk *blk;
|
||||||
|
|
||||||
@@ -352,7 +349,7 @@ PickOffBlk(cache_t *cache)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
AppendBlk(cache_t *cache, MemBlk *blk, int key)
|
AppendBlk(FontCache *cache, MemBlk *blk, int key)
|
||||||
{
|
{
|
||||||
/* first, append the blcok at the end of the
|
/* first, append the blcok at the end of the
|
||||||
lru-queue. */
|
lru-queue. */
|
||||||
@@ -381,7 +378,7 @@ AppendBlk(cache_t *cache, MemBlk *blk, int key)
|
|||||||
*size : if found the data, how long is the data(return val)
|
*size : if found the data, how long is the data(return val)
|
||||||
reutrn = pointer to the data */
|
reutrn = pointer to the data */
|
||||||
TTFCACHEINFO *
|
TTFCACHEINFO *
|
||||||
__mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
|
__mg_ttc_search(HCACHE hCache, Uchar32 unicode, int *size)
|
||||||
{
|
{
|
||||||
int key;
|
int key;
|
||||||
CacheQueueNode *ca;
|
CacheQueueNode *ca;
|
||||||
@@ -399,7 +396,8 @@ __mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
|
|||||||
|
|
||||||
for ( ; blk != &(ca->cache.hashDir[key].hashHead);
|
for ( ; blk != &(ca->cache.hashDir[key].hashHead);
|
||||||
blk = blk->hashNext) {
|
blk = blk->hashNext) {
|
||||||
if (*(unsigned short *)(blk->data) == unicode) {
|
TTFCACHEINFO* tci = (TTFCACHEINFO*)blk->data;
|
||||||
|
if (tci->unicode == unicode) {
|
||||||
/* If found the blk, we should pick off it
|
/* If found the blk, we should pick off it
|
||||||
and link it at the end of LRU-q */
|
and link it at the end of LRU-q */
|
||||||
*size = blk->len;
|
*size = blk->len;
|
||||||
@@ -409,17 +407,18 @@ __mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
|
|||||||
blk->lruPrev = ca->cache.lruQueueDummyHead.lruPrev;
|
blk->lruPrev = ca->cache.lruQueueDummyHead.lruPrev;
|
||||||
(ca->cache.lruQueueDummyHead.lruPrev)->lruNext = blk;
|
(ca->cache.lruQueueDummyHead.lruPrev)->lruNext = blk;
|
||||||
ca->cache.lruQueueDummyHead.lruPrev = blk;
|
ca->cache.lruQueueDummyHead.lruPrev = blk;
|
||||||
return blk->data;
|
return tci;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add data into a speicial cache
|
/* add data into the specific cache
|
||||||
hCache : which cache ,
|
hCache : which cache ,
|
||||||
*data : your data pointer
|
*data : your data pointer
|
||||||
size : your data's bytes
|
size : your data's bytes
|
||||||
key : hash key of your data */
|
key : hash key of your data
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
__mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
|
__mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
|
||||||
{
|
{
|
||||||
@@ -434,7 +433,7 @@ __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
|
|||||||
if (ca->cache.blkSize < size) {
|
if (ca->cache.blkSize < size) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
key = ca->cache.makeHashKeyFunc(*(unsigned short *)data);
|
key = ca->cache.makeHashKeyFunc(data->unicode);
|
||||||
|
|
||||||
/* pick off a block from lru queue */
|
/* pick off a block from lru queue */
|
||||||
if ((blk = PickOffBlk(&ca->cache)) == NULL) {
|
if ((blk = PickOffBlk(&ca->cache)) == NULL) {
|
||||||
@@ -461,12 +460,11 @@ __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
|
|||||||
ndir : how many hash entries in the cache
|
ndir : how many hash entries in the cache
|
||||||
makeHashKey : the function which make the hash key */
|
makeHashKey : the function which make the hash key */
|
||||||
HCACHE
|
HCACHE
|
||||||
__mg_ttc_create(char *family, char *charset,
|
__mg_ttc_create(const char *df_name, int style, int size, int rotation,
|
||||||
DWORD style, int size, int rotation,
|
|
||||||
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey)
|
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey)
|
||||||
{
|
{
|
||||||
CacheQueueNode *temp;
|
CacheQueueNode *temp;
|
||||||
if (family == NULL || /* charset == NULL || */makeHashKey == NULL) {
|
if (df_name == NULL || makeHashKey == NULL) {
|
||||||
return (HCACHE)(0);
|
return (HCACHE)(0);
|
||||||
}
|
}
|
||||||
if (nblk <= 0 || blksize <= 0 || size <= 0 || ndir <= 0) {
|
if (nblk <= 0 || blksize <= 0 || size <= 0 || ndir <= 0) {
|
||||||
@@ -480,9 +478,9 @@ __mg_ttc_create(char *family, char *charset,
|
|||||||
return (HCACHE)(0);
|
return (HCACHE)(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(temp->cache.family, family, LEN_FONT_NAME);
|
memset(temp->cache.df_name, 0, LEN_UNIDEVFONT_NAME + 1);
|
||||||
//strncpy(temp->cache.charset, charset, LEN_FONT_NAME);
|
strncpy(temp->cache.df_name, df_name, LEN_UNIDEVFONT_NAME);
|
||||||
temp->cache.render_style = (style & FS_RENDER_MASK);
|
temp->cache.style = style & FS_RENDER_MASK;
|
||||||
temp->cache.fontsize = size;
|
temp->cache.fontsize = size;
|
||||||
temp->cache.rotation = rotation;
|
temp->cache.rotation = rotation;
|
||||||
temp->cache.blkSize = blksize;
|
temp->cache.blkSize = blksize;
|
||||||
@@ -572,11 +570,8 @@ __mg_ttc_sys_deinit(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HCACHE
|
HCACHE
|
||||||
__mg_ttc_is_exist(char *family, char *charset,
|
__mg_ttc_is_exist(const char *df_name, int style, int size, int rotation)
|
||||||
DWORD style, int size, int rotation)
|
|
||||||
{
|
{
|
||||||
CacheQueueNode *p;
|
CacheQueueNode *p;
|
||||||
|
|
||||||
@@ -584,44 +579,17 @@ __mg_ttc_is_exist(char *family, char *charset,
|
|||||||
return (HCACHE)0;
|
return (HCACHE)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // VincentWei: Use FS_RENDER_MASK insead (3.4.0)
|
|
||||||
/* If can not match font name*/
|
|
||||||
p = __mg_globalCache.queueDummyHead.nextCache;
|
p = __mg_globalCache.queueDummyHead.nextCache;
|
||||||
while (p != &__mg_globalCache.queueDummyHead) {
|
while (p != &__mg_globalCache.queueDummyHead) {
|
||||||
if (strncmp(p->cache.family, family, LEN_FONT_NAME) == 0) {
|
if (strncmp(p->cache.df_name, df_name, LEN_UNIDEVFONT_NAME) == 0
|
||||||
if (strncmp(p->cache.charset, charset, LEN_FONT_NAME) == 0) {
|
&& p->cache.style == (style & FS_RENDER_MASK)
|
||||||
if (p->cache.fontsize == size) {
|
|
||||||
int s = style & 0x000000FF;
|
|
||||||
if ((s == FS_WEIGHT_BOOK || s == FS_WEIGHT_DEMIBOLD || s == FS_WEIGHT_SUBPIXEL) &&
|
|
||||||
(p->cache.style == FS_WEIGHT_BOOK || p->cache.style == FS_WEIGHT_DEMIBOLD ||
|
|
||||||
p->cache.style == FS_WEIGHT_SUBPIXEL)) {
|
|
||||||
return (HCACHE) p;
|
|
||||||
}
|
|
||||||
if ((s != FS_WEIGHT_BOOK && s != FS_WEIGHT_DEMIBOLD && s != FS_WEIGHT_SUBPIXEL) &&
|
|
||||||
(p->cache.style != FS_WEIGHT_BOOK && p->cache.style != FS_WEIGHT_DEMIBOLD &&
|
|
||||||
p->cache.style != FS_WEIGHT_SUBPIXEL)) {
|
|
||||||
return (HCACHE) p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p = p->nextCache;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
p = __mg_globalCache.queueDummyHead.nextCache;
|
|
||||||
while (p != &__mg_globalCache.queueDummyHead) {
|
|
||||||
if (strncmp(p->cache.family, family, LEN_FONT_NAME) == 0
|
|
||||||
#if 0 // VincentWei: do not need to check charset.
|
|
||||||
&& strncmp(p->cache.charset, charset, LEN_FONT_NAME) == 0
|
|
||||||
#endif
|
|
||||||
&& p->cache.fontsize == size
|
&& p->cache.fontsize == size
|
||||||
&& p->cache.rotation == rotation
|
&& p->cache.rotation == rotation) {
|
||||||
&& (style & FS_RENDER_MASK) == p->cache.render_style) {
|
|
||||||
return (HCACHE) p;
|
return (HCACHE) p;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = p->nextCache;
|
p = p->nextCache;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return (HCACHE)0;
|
return (HCACHE)0;
|
||||||
}
|
}
|
||||||
@@ -675,15 +643,13 @@ void __mg_ttc_dump_all(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void __mg_ttc_dump(cache_t *cache)
|
void __mg_ttc_dump(FontCache *cache)
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
MemBlk *ptr;
|
MemBlk *ptr;
|
||||||
#if 0
|
#if 0
|
||||||
DP(("&cache = %p\n", cache));
|
DP(("&cache = %p\n", cache));
|
||||||
DP(("cache.family = %s\n", cache->family));
|
DP(("cache.df_name = %s\n", cache->df_name));
|
||||||
DP(("cache.charset = %s\n", cache->charset));
|
|
||||||
DP(("cache.style = %d\n", cache->style));
|
|
||||||
DP(("cache.fontsize = %d\n", cache->fontsize));
|
DP(("cache.fontsize = %d\n", cache->fontsize));
|
||||||
DP(("cache.blkSize = %d\n", cache->blkSize));
|
DP(("cache.blkSize = %d\n", cache->blkSize));
|
||||||
DP(("cache.refers = %d\n", cache->refers));
|
DP(("cache.refers = %d\n", cache->refers));
|
||||||
|
|||||||
+129
-29
@@ -42,6 +42,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#define DEBUG
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "minigui.h"
|
#include "minigui.h"
|
||||||
@@ -70,7 +73,7 @@ int fontConvertFontType (const char* type)
|
|||||||
if (strcasecmp (type, FONT_TYPE_NAME_SCALE_T1F) == 0)
|
if (strcasecmp (type, FONT_TYPE_NAME_SCALE_T1F) == 0)
|
||||||
return FONT_TYPE_SCALE_T1F;
|
return FONT_TYPE_SCALE_T1F;
|
||||||
if (strcasecmp (type, FONT_TYPE_NAME_ALL) == 0)
|
if (strcasecmp (type, FONT_TYPE_NAME_ALL) == 0)
|
||||||
return FONT_TYPE_ALL;
|
return FONT_TYPE_ANY;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -96,7 +99,7 @@ BOOL fontGetTypeNameFromName (const char* name, char* type)
|
|||||||
|
|
||||||
int fontGetFontTypeFromName (const char* name)
|
int fontGetFontTypeFromName (const char* name)
|
||||||
{
|
{
|
||||||
char type [LEN_FONT_NAME + 1];
|
char type [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
|
|
||||||
if (!fontGetTypeNameFromName (name, type))
|
if (!fontGetTypeNameFromName (name, type))
|
||||||
return -1;
|
return -1;
|
||||||
@@ -114,8 +117,8 @@ BOOL fontGetFamilyFromName (const char* name, char* family)
|
|||||||
if (*(++family_part) == '\0')
|
if (*(++family_part) == '\0')
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
while (family_part [i] && i <= LEN_FONT_NAME) {
|
while (family_part [i] && i <= LEN_LOGFONT_FAMILY_FILED) {
|
||||||
if (family_part [i] == '-') {
|
if (family_part [i] == '-'/* || family_part [i] == ',' */) {
|
||||||
family [i] = '\0';
|
family [i] = '\0';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -127,6 +130,99 @@ BOOL fontGetFamilyFromName (const char* name, char* family)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL get_family_part_lower (const char* name, char* family)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
const char* family_part;
|
||||||
|
|
||||||
|
if ((family_part = strchr (name, '-')) == NULL)
|
||||||
|
return FALSE;
|
||||||
|
if (*(++family_part) == '\0')
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
while (family_part [i] && i <= LEN_UNIDEVFONT_NAME) {
|
||||||
|
if (family_part [i] == '-') {
|
||||||
|
family [i] = '\0';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
family [i] = tolower(family_part [i]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
static const char *my_strstr(const char *haystack, const char *needle)
|
||||||
|
{
|
||||||
|
int i = 0, j = 0;
|
||||||
|
int tmp = i;
|
||||||
|
int str_len = strlen(haystack);
|
||||||
|
int substr_len = strlen(needle);
|
||||||
|
|
||||||
|
for (i = 0; i < str_len - substr_len; i++) {
|
||||||
|
tmp = i;
|
||||||
|
|
||||||
|
for (j = 0; j < substr_len; j++) {
|
||||||
|
if (haystack[tmp] == needle[j]) {
|
||||||
|
if (j == substr_len - 1)
|
||||||
|
return haystack + i;
|
||||||
|
tmp++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* devfont family specification:
|
||||||
|
* family[,alias]...
|
||||||
|
*/
|
||||||
|
BOOL fontDoesMatchFamily (const char* name, const char* family)
|
||||||
|
{
|
||||||
|
// make sure there is a redundant space for the head and tail characters.
|
||||||
|
char family_part[LEN_LOGFONT_FAMILY_FILED + 3];
|
||||||
|
char family_request[LEN_LOGFONT_NAME_FIELD + 3];
|
||||||
|
int i;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
// add ',' to the head
|
||||||
|
family_part[0] = ',';
|
||||||
|
if (!get_family_part_lower(name, family_part + 1)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add ',' to the tail
|
||||||
|
len = strlen(family_part);
|
||||||
|
family_part[len] = ',';
|
||||||
|
family_part[len + 1] = '\0';
|
||||||
|
|
||||||
|
// make family (lowercase)
|
||||||
|
family_request[0] = ',';
|
||||||
|
i = 0;
|
||||||
|
while (family[i] && i < LEN_LOGFONT_NAME_FIELD) {
|
||||||
|
family_request[i + 1] = tolower(family[i]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
family_request[i + 1] = '\0';
|
||||||
|
|
||||||
|
// add ',' to the tail
|
||||||
|
len = strlen(family_request);
|
||||||
|
family_request[len] = ',';
|
||||||
|
family_request[len + 1] = '\0';
|
||||||
|
|
||||||
|
// try to match "<family_request>,"
|
||||||
|
if (strstr(family_part, family_request)) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
DWORD fontConvertStyle (const char* style_part)
|
DWORD fontConvertStyle (const char* style_part)
|
||||||
{
|
{
|
||||||
DWORD style = 0;
|
DWORD style = 0;
|
||||||
@@ -142,7 +238,7 @@ DWORD fontConvertStyle (const char* style_part)
|
|||||||
case FONT_WEIGHT_BOLD:
|
case FONT_WEIGHT_BOLD:
|
||||||
style |= FS_WEIGHT_BOLD;
|
style |= FS_WEIGHT_BOLD;
|
||||||
break;
|
break;
|
||||||
/* deprecated since v3.2.1
|
/* deprecated since v3.4.0
|
||||||
case FONT_WEIGHT_BOOK:
|
case FONT_WEIGHT_BOOK:
|
||||||
style |= FS_WEIGHT_BOOK;
|
style |= FS_WEIGHT_BOOK;
|
||||||
break;
|
break;
|
||||||
@@ -156,6 +252,9 @@ DWORD fontConvertStyle (const char* style_part)
|
|||||||
case FONT_WEIGHT_REGULAR:
|
case FONT_WEIGHT_REGULAR:
|
||||||
style |= FS_WEIGHT_REGULAR;
|
style |= FS_WEIGHT_REGULAR;
|
||||||
break;
|
break;
|
||||||
|
case FONT_WEIGHT_NORMAL:
|
||||||
|
style |= FS_WEIGHT_NORMAL;
|
||||||
|
break;
|
||||||
case FONT_WEIGHT_LIGHT:
|
case FONT_WEIGHT_LIGHT:
|
||||||
style |= FS_WEIGHT_LIGHT;
|
style |= FS_WEIGHT_LIGHT;
|
||||||
break;
|
break;
|
||||||
@@ -165,7 +264,7 @@ DWORD fontConvertStyle (const char* style_part)
|
|||||||
case FONT_WEIGHT_THIN:
|
case FONT_WEIGHT_THIN:
|
||||||
style |= FS_WEIGHT_THIN;
|
style |= FS_WEIGHT_THIN;
|
||||||
break;
|
break;
|
||||||
/* deprecated since v3.2.1
|
/* deprecated since v3.4.0
|
||||||
case FONT_WEIGHT_SUBPIXEL:
|
case FONT_WEIGHT_SUBPIXEL:
|
||||||
style |= FS_WEIGHT_SUBPIXEL;
|
style |= FS_WEIGHT_SUBPIXEL;
|
||||||
break;
|
break;
|
||||||
@@ -173,6 +272,7 @@ DWORD fontConvertStyle (const char* style_part)
|
|||||||
style |= FS_WEIGHT_MASK;
|
style |= FS_WEIGHT_MASK;
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
|
case FONT_WEIGHT_ANY:
|
||||||
default:
|
default:
|
||||||
style |= FS_WEIGHT_ANY;
|
style |= FS_WEIGHT_ANY;
|
||||||
break;
|
break;
|
||||||
@@ -189,11 +289,10 @@ DWORD fontConvertStyle (const char* style_part)
|
|||||||
case FONT_SLANT_ROMAN:
|
case FONT_SLANT_ROMAN:
|
||||||
style |= FS_SLANT_ROMAN;
|
style |= FS_SLANT_ROMAN;
|
||||||
break;
|
break;
|
||||||
case FONT_SLANT_ALL:
|
case FONT_SLANT_ANY:
|
||||||
style |= FS_SLANT_MASK;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return 0xFFFFFFFF;
|
style |= FS_SLANT_ANY;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
style &= ~FS_FLIP_MASK;
|
style &= ~FS_FLIP_MASK;
|
||||||
@@ -208,6 +307,7 @@ DWORD fontConvertStyle (const char* style_part)
|
|||||||
style |= FS_FLIP_HORZVERT;
|
style |= FS_FLIP_HORZVERT;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
//style |= FS_FLIP_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,13 +325,8 @@ DWORD fontConvertStyle (const char* style_part)
|
|||||||
case FONT_OTHER_TTFNOCACHEKERN:
|
case FONT_OTHER_TTFNOCACHEKERN:
|
||||||
style |= FS_OTHER_TTFNOCACHEKERN;
|
style |= FS_OTHER_TTFNOCACHEKERN;
|
||||||
break;
|
break;
|
||||||
case FONT_OTHER_LCDPORTRAIT:
|
|
||||||
style |= FS_OTHER_LCDPORTRAIT;
|
|
||||||
break;
|
|
||||||
case FONT_OTHER_LCDPORTRAITKERN:
|
|
||||||
style |= FS_OTHER_LCDPORTRAITKERN;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
|
//style |= FS_OTHER_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,10 +340,18 @@ DWORD fontConvertStyle (const char* style_part)
|
|||||||
case FONT_DECORATE_STRUCKOUT:
|
case FONT_DECORATE_STRUCKOUT:
|
||||||
style |= FS_DECORATE_STRUCKOUT;
|
style |= FS_DECORATE_STRUCKOUT;
|
||||||
break;
|
break;
|
||||||
case FONT_DECORATE_BOTH:
|
case FONT_DECORATE_REVERSE:
|
||||||
style |= FS_DECORATE_BOTH;
|
style |= FS_DECORATE_REVERSE;
|
||||||
|
break;
|
||||||
|
case FONT_DECORATE_OUTLINE:
|
||||||
|
style |= FS_DECORATE_OUTLINE;
|
||||||
|
break;
|
||||||
|
case FONT_DECORATE_US:
|
||||||
|
style |= FS_DECORATE_UNDERLINE;
|
||||||
|
style |= FS_DECORATE_STRUCKOUT;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
//style |= FS_DECORATE_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,9 +360,6 @@ DWORD fontConvertStyle (const char* style_part)
|
|||||||
case FONT_RENDER_MONO:
|
case FONT_RENDER_MONO:
|
||||||
style |= FS_RENDER_MONO;
|
style |= FS_RENDER_MONO;
|
||||||
break;
|
break;
|
||||||
case FONT_RENDER_OUTLINE:
|
|
||||||
style |= FS_RENDER_OUTLINE;
|
|
||||||
break;
|
|
||||||
case FONT_RENDER_GREY:
|
case FONT_RENDER_GREY:
|
||||||
style |= FS_RENDER_GREY;
|
style |= FS_RENDER_GREY;
|
||||||
break;
|
break;
|
||||||
@@ -347,7 +447,7 @@ int fontGetWidthFromName (const char* name)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const char* width_part = name;
|
const char* width_part = name;
|
||||||
char width [LEN_FONT_NAME + 1];
|
char width [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
|
|
||||||
for (i = 0; i < NR_LOOP_FOR_WIDTH; i++) {
|
for (i = 0; i < NR_LOOP_FOR_WIDTH; i++) {
|
||||||
if ((width_part = strchr (width_part, '-')) == NULL)
|
if ((width_part = strchr (width_part, '-')) == NULL)
|
||||||
@@ -378,7 +478,7 @@ int fontGetHeightFromName (const char* name)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const char* height_part = name;
|
const char* height_part = name;
|
||||||
char height [LEN_FONT_NAME + 1];
|
char height [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
|
|
||||||
for (i = 0; i < NR_LOOP_FOR_HEIGHT; i++) {
|
for (i = 0; i < NR_LOOP_FOR_HEIGHT; i++) {
|
||||||
if ((height_part = strchr (height_part, '-')) == NULL)
|
if ((height_part = strchr (height_part, '-')) == NULL)
|
||||||
@@ -425,8 +525,8 @@ BOOL fontGetCharsetFromName (const char* name, char* charset)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy (charset, charset_part, LEN_FONT_NAME);
|
strncpy (charset, charset_part, LEN_LOGFONT_NAME_FIELD);
|
||||||
charset [LEN_FONT_NAME] = '\0';
|
charset [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,8 +548,8 @@ BOOL fontGetCompatibleCharsetFromName (const char* name, char* charset)
|
|||||||
if (*(++charset_part) == '\0')
|
if (*(++charset_part) == '\0')
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
strncpy (charset, charset_part, LEN_FONT_NAME);
|
strncpy (charset, charset_part, LEN_LOGFONT_NAME_FIELD);
|
||||||
charset [LEN_FONT_NAME] = '\0';
|
charset [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -507,8 +607,8 @@ BOOL charsetGetSpecificCharset (const char* charsets, int _index, char* charset)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy (charset, charsets, LEN_FONT_NAME);
|
strncpy (charset, charsets, LEN_LOGFONT_NAME_FIELD);
|
||||||
charset [LEN_FONT_NAME] = '\0';
|
charset [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+127
-118
File diff suppressed because it is too large
Load Diff
+333
-250
File diff suppressed because it is too large
Load Diff
+31
-29
@@ -1,33 +1,33 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||||
* 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~2018, 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
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
* Or,
|
* Or,
|
||||||
*
|
*
|
||||||
* As this program is a library, any link to this program must follow
|
* As this program is a library, any link to this program must follow
|
||||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||||
* GPLv3, you need to be licensed from FMSoft.
|
* GPLv3, you need to be licensed from FMSoft.
|
||||||
*
|
*
|
||||||
* If you have got a commercial license of this program, please use it
|
* If you have got a commercial license of this program, please use it
|
||||||
* under the terms and conditions of the commercial license.
|
* under the terms and conditions of the commercial license.
|
||||||
*
|
*
|
||||||
* For more information about the commercial license, please refer to
|
* For more information about the commercial license, please refer to
|
||||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||||
*/
|
*/
|
||||||
@@ -40,6 +40,14 @@
|
|||||||
#ifndef GUI_FREETYP2_H
|
#ifndef GUI_FREETYP2_H
|
||||||
#define GUI_FREETYP2_H
|
#define GUI_FREETYP2_H
|
||||||
|
|
||||||
|
#undef TTF_DBG
|
||||||
|
|
||||||
|
#ifndef TTF_DBG
|
||||||
|
#define DP(x)
|
||||||
|
#else
|
||||||
|
#define DP(x) do { printf x; } while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
@@ -63,14 +71,13 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MGFONT_TTF_CACHE
|
#ifdef _MGFONT_TTF_CACHE
|
||||||
typedef unsigned long HCACHE;
|
typedef void* HCACHE;
|
||||||
typedef int (* MakeHashKeyFunc)(unsigned short unicode);
|
typedef int (* MakeHashKeyFunc)(Uchar32 unicode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct tagFTFACEINFO {
|
typedef struct tagFTFACEINFO {
|
||||||
#ifdef _MGFONT_TTF_CACHE
|
#ifdef _MGFONT_TTF_CACHE
|
||||||
/*should be MAX_PATH*/
|
char* filepathname;
|
||||||
char filepathname[256];
|
|
||||||
int face_index;
|
int face_index;
|
||||||
int cmap_index;
|
int cmap_index;
|
||||||
#else
|
#else
|
||||||
@@ -115,39 +122,34 @@ typedef struct tagFTINSTANCEINFO {
|
|||||||
#define _TTF_HASH_NDIR 37
|
#define _TTF_HASH_NDIR 37
|
||||||
|
|
||||||
typedef struct tagTTFCACHEINFO {
|
typedef struct tagTTFCACHEINFO {
|
||||||
unsigned short unicode;
|
Uchar32 unicode;
|
||||||
short glyph_code;
|
FT_UInt glyph_code;
|
||||||
FT_Vector advance;
|
FT_Vector advance;
|
||||||
FT_BBox bbox;
|
FT_BBox bbox;
|
||||||
FT_Vector delta;
|
FT_Vector delta;
|
||||||
int flag;
|
int flag;
|
||||||
int pitch;
|
int pitch;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
void *bitmap;
|
void *bitmap;
|
||||||
} TTFCACHEINFO, *PTTFCACHEINFO;
|
} TTFCACHEINFO, *PTTFCACHEINFO;
|
||||||
|
|
||||||
extern HCACHE __mg_ttc_create(char *family, char *charset,
|
extern HCACHE __mg_ttc_create(const char *df_name,
|
||||||
DWORD style, int size, int rotation,
|
int style, int size, int rotation,
|
||||||
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey);
|
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey);
|
||||||
|
extern HCACHE __mg_ttc_is_exist(const char *df_name,
|
||||||
|
int style, int size, int rotation);
|
||||||
|
|
||||||
extern int __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size);
|
extern int __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size);
|
||||||
extern void __mg_ttc_release(HCACHE hCache);
|
extern void __mg_ttc_release(HCACHE hCache);
|
||||||
extern int __mg_ttc_sys_init(int maxCache, int cacheSize);
|
extern int __mg_ttc_sys_init(int maxCache, int cacheSize);
|
||||||
extern void __mg_ttc_sys_deinit(void);
|
extern void __mg_ttc_sys_deinit(void);
|
||||||
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache,
|
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache,
|
||||||
unsigned short unicode, int *size);
|
Uchar32 unicode, int *size);
|
||||||
extern HCACHE __mg_ttc_is_exist(char *family, char *charset,
|
|
||||||
DWORD style, int size, int rotation);
|
|
||||||
extern void __mg_ttc_refer(HCACHE hCache);
|
extern void __mg_ttc_refer(HCACHE hCache);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef TTF_DBG
|
|
||||||
|
|
||||||
#ifndef TTF_DBG
|
|
||||||
#define DP(x)
|
|
||||||
#else
|
|
||||||
#define DP(x) do { printf x; } while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,201 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
|
||||||
* and Graphics User Interface (GUI) support system for embedded systems
|
|
||||||
* and smart IoT devices.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
|
||||||
* Copyright (C) 1998~2002, WEI Yongming
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* Or,
|
|
||||||
*
|
|
||||||
* As this program is a library, any link to this program must follow
|
|
||||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
|
||||||
* GPLv3, you need to be licensed from FMSoft.
|
|
||||||
*
|
|
||||||
* If you have got a commercial license of this program, please use it
|
|
||||||
* under the terms and conditions of the commercial license.
|
|
||||||
*
|
|
||||||
* For more information about the commercial license, please refer to
|
|
||||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __G_UNICODE_H__
|
|
||||||
#define __G_UNICODE_H__
|
|
||||||
|
|
||||||
|
|
||||||
/* These are the possible character classifications.
|
|
||||||
* See http://www.unicode.org/Public/UNIDATA/UCD.html#General_Category_Values
|
|
||||||
*/
|
|
||||||
#if 0 /* VincentWei: Moved to gid.h */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
G_UNICODE_CONTROL,
|
|
||||||
G_UNICODE_FORMAT,
|
|
||||||
G_UNICODE_UNASSIGNED,
|
|
||||||
G_UNICODE_PRIVATE_USE,
|
|
||||||
G_UNICODE_SURROGATE,
|
|
||||||
G_UNICODE_LOWERCASE_LETTER,
|
|
||||||
G_UNICODE_MODIFIER_LETTER,
|
|
||||||
G_UNICODE_OTHER_LETTER,
|
|
||||||
G_UNICODE_TITLECASE_LETTER,
|
|
||||||
G_UNICODE_UPPERCASE_LETTER,
|
|
||||||
G_UNICODE_COMBINING_MARK,
|
|
||||||
G_UNICODE_ENCLOSING_MARK,
|
|
||||||
G_UNICODE_NON_SPACING_MARK,
|
|
||||||
G_UNICODE_DECIMAL_NUMBER,
|
|
||||||
G_UNICODE_LETTER_NUMBER,
|
|
||||||
G_UNICODE_OTHER_NUMBER,
|
|
||||||
G_UNICODE_CONNECT_PUNCTUATION,
|
|
||||||
G_UNICODE_DASH_PUNCTUATION,
|
|
||||||
G_UNICODE_CLOSE_PUNCTUATION,
|
|
||||||
G_UNICODE_FINAL_PUNCTUATION,
|
|
||||||
G_UNICODE_INITIAL_PUNCTUATION,
|
|
||||||
G_UNICODE_OTHER_PUNCTUATION,
|
|
||||||
G_UNICODE_OPEN_PUNCTUATION,
|
|
||||||
G_UNICODE_CURRENCY_SYMBOL,
|
|
||||||
G_UNICODE_MODIFIER_SYMBOL,
|
|
||||||
G_UNICODE_MATH_SYMBOL,
|
|
||||||
G_UNICODE_OTHER_SYMBOL,
|
|
||||||
G_UNICODE_LINE_SEPARATOR,
|
|
||||||
G_UNICODE_PARAGRAPH_SEPARATOR,
|
|
||||||
G_UNICODE_SPACE_SEPARATOR
|
|
||||||
} GUnicodeType;
|
|
||||||
#endif /* VincentWei: Moved to gid.h */
|
|
||||||
|
|
||||||
/* These are the possible line break classifications.
|
|
||||||
* Note that new types may be added in the future.
|
|
||||||
* Implementations may regard unknown values like G_UNICODE_BREAK_UNKNOWN
|
|
||||||
* See http://www.unicode.org/unicode/reports/tr14/
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
G_UNICODE_BREAK_MANDATORY,
|
|
||||||
G_UNICODE_BREAK_CARRIAGE_RETURN,
|
|
||||||
G_UNICODE_BREAK_LINE_FEED,
|
|
||||||
G_UNICODE_BREAK_COMBINING_MARK,
|
|
||||||
G_UNICODE_BREAK_SURROGATE,
|
|
||||||
G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
|
|
||||||
G_UNICODE_BREAK_INSEPARABLE,
|
|
||||||
G_UNICODE_BREAK_NON_BREAKING_GLUE,
|
|
||||||
G_UNICODE_BREAK_CONTINGENT,
|
|
||||||
G_UNICODE_BREAK_SPACE,
|
|
||||||
G_UNICODE_BREAK_AFTER,
|
|
||||||
G_UNICODE_BREAK_BEFORE,
|
|
||||||
G_UNICODE_BREAK_BEFORE_AND_AFTER,
|
|
||||||
G_UNICODE_BREAK_HYPHEN,
|
|
||||||
G_UNICODE_BREAK_NON_STARTER,
|
|
||||||
G_UNICODE_BREAK_OPEN_PUNCTUATION,
|
|
||||||
G_UNICODE_BREAK_CLOSE_PUNCTUATION,
|
|
||||||
G_UNICODE_BREAK_QUOTATION,
|
|
||||||
G_UNICODE_BREAK_EXCLAMATION,
|
|
||||||
G_UNICODE_BREAK_IDEOGRAPHIC,
|
|
||||||
G_UNICODE_BREAK_NUMERIC,
|
|
||||||
G_UNICODE_BREAK_INFIX_SEPARATOR,
|
|
||||||
G_UNICODE_BREAK_SYMBOL,
|
|
||||||
G_UNICODE_BREAK_ALPHABETIC,
|
|
||||||
G_UNICODE_BREAK_PREFIX,
|
|
||||||
G_UNICODE_BREAK_POSTFIX,
|
|
||||||
G_UNICODE_BREAK_COMPLEX_CONTEXT,
|
|
||||||
G_UNICODE_BREAK_AMBIGUOUS,
|
|
||||||
G_UNICODE_BREAK_UNKNOWN,
|
|
||||||
G_UNICODE_BREAK_NEXT_LINE,
|
|
||||||
G_UNICODE_BREAK_WORD_JOINER,
|
|
||||||
G_UNICODE_BREAK_HANGUL_L_JAMO,
|
|
||||||
G_UNICODE_BREAK_HANGUL_V_JAMO,
|
|
||||||
G_UNICODE_BREAK_HANGUL_T_JAMO,
|
|
||||||
G_UNICODE_BREAK_HANGUL_LV_SYLLABLE,
|
|
||||||
G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE
|
|
||||||
} GUnicodeBreakType;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{ /* ISO 15924 code */
|
|
||||||
G_UNICODE_SCRIPT_INVALID_CODE = -1,
|
|
||||||
G_UNICODE_SCRIPT_COMMON = 0, /* Zyyy */
|
|
||||||
G_UNICODE_SCRIPT_INHERITED, /* Qaai */
|
|
||||||
G_UNICODE_SCRIPT_ARABIC, /* Arab */
|
|
||||||
G_UNICODE_SCRIPT_ARMENIAN, /* Armn */
|
|
||||||
G_UNICODE_SCRIPT_BENGALI, /* Beng */
|
|
||||||
G_UNICODE_SCRIPT_BOPOMOFO, /* Bopo */
|
|
||||||
G_UNICODE_SCRIPT_CHEROKEE, /* Cher */
|
|
||||||
G_UNICODE_SCRIPT_COPTIC, /* Qaac */
|
|
||||||
G_UNICODE_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
|
|
||||||
G_UNICODE_SCRIPT_DESERET, /* Dsrt */
|
|
||||||
G_UNICODE_SCRIPT_DEVANAGARI, /* Deva */
|
|
||||||
G_UNICODE_SCRIPT_ETHIOPIC, /* Ethi */
|
|
||||||
G_UNICODE_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
|
|
||||||
G_UNICODE_SCRIPT_GOTHIC, /* Goth */
|
|
||||||
G_UNICODE_SCRIPT_GREEK, /* Grek */
|
|
||||||
G_UNICODE_SCRIPT_GUJARATI, /* Gujr */
|
|
||||||
G_UNICODE_SCRIPT_GURMUKHI, /* Guru */
|
|
||||||
G_UNICODE_SCRIPT_HAN, /* Hani */
|
|
||||||
G_UNICODE_SCRIPT_HANGUL, /* Hang */
|
|
||||||
G_UNICODE_SCRIPT_HEBREW, /* Hebr */
|
|
||||||
G_UNICODE_SCRIPT_HIRAGANA, /* Hira */
|
|
||||||
G_UNICODE_SCRIPT_KANNADA, /* Knda */
|
|
||||||
G_UNICODE_SCRIPT_KATAKANA, /* Kana */
|
|
||||||
G_UNICODE_SCRIPT_KHMER, /* Khmr */
|
|
||||||
G_UNICODE_SCRIPT_LAO, /* Laoo */
|
|
||||||
G_UNICODE_SCRIPT_LATIN, /* Latn (Latf, Latg) */
|
|
||||||
G_UNICODE_SCRIPT_MALAYALAM, /* Mlym */
|
|
||||||
G_UNICODE_SCRIPT_MONGOLIAN, /* Mong */
|
|
||||||
G_UNICODE_SCRIPT_MYANMAR, /* Mymr */
|
|
||||||
G_UNICODE_SCRIPT_OGHAM, /* Ogam */
|
|
||||||
G_UNICODE_SCRIPT_OLD_ITALIC, /* Ital */
|
|
||||||
G_UNICODE_SCRIPT_ORIYA, /* Orya */
|
|
||||||
G_UNICODE_SCRIPT_RUNIC, /* Runr */
|
|
||||||
G_UNICODE_SCRIPT_SINHALA, /* Sinh */
|
|
||||||
G_UNICODE_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
|
|
||||||
G_UNICODE_SCRIPT_TAMIL, /* Taml */
|
|
||||||
G_UNICODE_SCRIPT_TELUGU, /* Telu */
|
|
||||||
G_UNICODE_SCRIPT_THAANA, /* Thaa */
|
|
||||||
G_UNICODE_SCRIPT_THAI, /* Thai */
|
|
||||||
G_UNICODE_SCRIPT_TIBETAN, /* Tibt */
|
|
||||||
G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
|
|
||||||
G_UNICODE_SCRIPT_YI, /* Yiii */
|
|
||||||
G_UNICODE_SCRIPT_TAGALOG, /* Tglg */
|
|
||||||
G_UNICODE_SCRIPT_HANUNOO, /* Hano */
|
|
||||||
G_UNICODE_SCRIPT_BUHID, /* Buhd */
|
|
||||||
G_UNICODE_SCRIPT_TAGBANWA, /* Tagb */
|
|
||||||
|
|
||||||
/* Unicode-4.0 additions */
|
|
||||||
G_UNICODE_SCRIPT_BRAILLE, /* Brai */
|
|
||||||
G_UNICODE_SCRIPT_CYPRIOT, /* Cprt */
|
|
||||||
G_UNICODE_SCRIPT_LIMBU, /* Limb */
|
|
||||||
G_UNICODE_SCRIPT_OSMANYA, /* Osma */
|
|
||||||
G_UNICODE_SCRIPT_SHAVIAN, /* Shaw */
|
|
||||||
G_UNICODE_SCRIPT_LINEAR_B, /* Linb */
|
|
||||||
G_UNICODE_SCRIPT_TAI_LE, /* Tale */
|
|
||||||
G_UNICODE_SCRIPT_UGARITIC, /* Ugar */
|
|
||||||
|
|
||||||
/* Unicode-4.1 additions */
|
|
||||||
G_UNICODE_SCRIPT_NEW_TAI_LUE, /* Talu */
|
|
||||||
G_UNICODE_SCRIPT_BUGINESE, /* Bugi */
|
|
||||||
G_UNICODE_SCRIPT_GLAGOLITIC, /* Glag */
|
|
||||||
G_UNICODE_SCRIPT_TIFINAGH, /* Tfng */
|
|
||||||
G_UNICODE_SCRIPT_SYLOTI_NAGRI, /* Sylo */
|
|
||||||
G_UNICODE_SCRIPT_OLD_PERSIAN, /* Xpeo */
|
|
||||||
G_UNICODE_SCRIPT_KHAROSHTHI, /* Khar */
|
|
||||||
|
|
||||||
/* Unicode-5.0 additions */
|
|
||||||
G_UNICODE_SCRIPT_UNKNOWN, /* Zzzz */
|
|
||||||
G_UNICODE_SCRIPT_BALINESE, /* Bali */
|
|
||||||
G_UNICODE_SCRIPT_CUNEIFORM, /* Xsux */
|
|
||||||
G_UNICODE_SCRIPT_PHOENICIAN, /* Phnx */
|
|
||||||
G_UNICODE_SCRIPT_PHAGS_PA, /* Phag */
|
|
||||||
G_UNICODE_SCRIPT_NKO /* Nkoo */
|
|
||||||
} GUnicodeScript;
|
|
||||||
|
|
||||||
#endif /* __G_UNICODE_H__ */
|
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||||
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
|
* and smart IoT devices.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||||
|
* Copyright (C) 1998~2002, WEI Yongming
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* Or,
|
||||||
|
*
|
||||||
|
* As this program is a library, any link to this program must follow
|
||||||
|
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||||
|
* GPLv3, you need to be licensed from FMSoft.
|
||||||
|
*
|
||||||
|
* If you have got a commercial license of this program, please use it
|
||||||
|
* under the terms and conditions of the commercial license.
|
||||||
|
*
|
||||||
|
* For more information about the commercial license, please refer to
|
||||||
|
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
#include "minigui.h"
|
||||||
|
#include "gdi.h"
|
||||||
|
|
||||||
|
#ifdef _MGCHARSET_UNICODE
|
||||||
|
|
||||||
|
static const Uint16 iso639_1_codes[] =
|
||||||
|
{
|
||||||
|
#define PACK(a,b) ((Uint16)((((Uint8)(a))<<8)|((Uint8)(b))))
|
||||||
|
PACK('a', 'a'), // Afar
|
||||||
|
PACK('a', 'b'), // Abkhazian
|
||||||
|
PACK('a', 'f'), // Afrikaans
|
||||||
|
PACK('a', 'm'), // Amharic
|
||||||
|
PACK('a', 'r'), // Arabic
|
||||||
|
PACK('a', 's'), // Assamese
|
||||||
|
PACK('a', 'y'), // Aymara
|
||||||
|
PACK('a', 'z'), // Azerbaijani
|
||||||
|
PACK('b', 'a'), // Bashkir
|
||||||
|
PACK('b', 'e'), // Byelorussian
|
||||||
|
PACK('b', 'g'), // Bulgarian
|
||||||
|
PACK('b', 'h'), // Bihari
|
||||||
|
PACK('b', 'i'), // Bislama
|
||||||
|
PACK('b', 'n'), // Bengali
|
||||||
|
PACK('b', 'o'), // Tibetan
|
||||||
|
PACK('b', 'r'), // Breton
|
||||||
|
PACK('c', 'a'), // Catalan
|
||||||
|
PACK('c', 'o'), // Corsican
|
||||||
|
PACK('c', 's'), // Czech
|
||||||
|
PACK('c', 'y'), // Welch
|
||||||
|
PACK('d', 'a'), // Danish
|
||||||
|
PACK('d', 'e'), // German
|
||||||
|
PACK('d', 'z'), // Bhutani
|
||||||
|
PACK('e', 'l'), // Greek
|
||||||
|
PACK('e', 'n'), // English
|
||||||
|
PACK('e', 'o'), // Esperanto
|
||||||
|
PACK('e', 's'), // Spanish
|
||||||
|
PACK('e', 't'), // Estonian
|
||||||
|
PACK('e', 'u'), // Basque
|
||||||
|
PACK('f', 'a'), // Persian
|
||||||
|
PACK('f', 'i'), // Finnish
|
||||||
|
PACK('f', 'j'), // Fiji
|
||||||
|
PACK('f', 'o'), // Faeroese
|
||||||
|
PACK('f', 'r'), // French
|
||||||
|
PACK('f', 'y'), // Frisian
|
||||||
|
PACK('g', 'a'), // Irish
|
||||||
|
PACK('g', 'd'), // Scots Gaelic
|
||||||
|
PACK('g', 'l'), // Galician
|
||||||
|
PACK('g', 'n'), // Guarani
|
||||||
|
PACK('g', 'u'), // Gujarati
|
||||||
|
PACK('h', 'a'), // Hausa
|
||||||
|
PACK('h', 'i'), // Hindi
|
||||||
|
PACK('h', 'e'), // Hebrew
|
||||||
|
PACK('h', 'r'), // Croatian
|
||||||
|
PACK('h', 'u'), // Hungarian
|
||||||
|
PACK('h', 'y'), // Armenian
|
||||||
|
PACK('i', 'a'), // Interlingua
|
||||||
|
PACK('i', 'd'), // Indonesian
|
||||||
|
PACK('i', 'e'), // Interlingue
|
||||||
|
PACK('i', 'k'), // Inupiak
|
||||||
|
PACK('i', 'n'), // former Indonesian
|
||||||
|
PACK('i', 's'), // Icelandic
|
||||||
|
PACK('i', 't'), // Italian
|
||||||
|
PACK('i', 'u'), // Inuktitut (Eskimo)
|
||||||
|
PACK('i', 'w'), // former Hebrew
|
||||||
|
PACK('j', 'a'), // Japanese
|
||||||
|
PACK('j', 'i'), // former Yiddish
|
||||||
|
PACK('j', 'w'), // Javanese
|
||||||
|
PACK('k', 'a'), // Georgian
|
||||||
|
PACK('k', 'k'), // Kazakh
|
||||||
|
PACK('k', 'l'), // Greenlandic
|
||||||
|
PACK('k', 'm'), // Cambodian
|
||||||
|
PACK('k', 'n'), // Kannada
|
||||||
|
PACK('k', 'o'), // Korean
|
||||||
|
PACK('k', 's'), // Kashmiri
|
||||||
|
PACK('k', 'u'), // Kurdish
|
||||||
|
PACK('k', 'y'), // Kirghiz
|
||||||
|
PACK('l', 'a'), // Latin
|
||||||
|
PACK('l', 'n'), // Lingala
|
||||||
|
PACK('l', 'o'), // Laothian
|
||||||
|
PACK('l', 't'), // Lithuanian
|
||||||
|
PACK('l', 'v'), // Latvian, Lettish
|
||||||
|
PACK('m', 'g'), // Malagasy
|
||||||
|
PACK('m', 'i'), // Maori
|
||||||
|
PACK('m', 'k'), // Macedonian
|
||||||
|
PACK('m', 'l'), // Malayalam
|
||||||
|
PACK('m', 'n'), // Mongolian
|
||||||
|
PACK('m', 'o'), // Moldavian
|
||||||
|
PACK('m', 'r'), // Marathi
|
||||||
|
PACK('m', 's'), // Malay
|
||||||
|
PACK('m', 't'), // Maltese
|
||||||
|
PACK('m', 'y'), // Burmese
|
||||||
|
PACK('n', 'a'), // Nauru
|
||||||
|
PACK('n', 'e'), // Nepali
|
||||||
|
PACK('n', 'l'), // Dutch
|
||||||
|
PACK('n', 'o'), // Norwegian
|
||||||
|
PACK('o', 'c'), // Occitan
|
||||||
|
PACK('o', 'm'), // (Afan) Oromo
|
||||||
|
PACK('o', 'r'), // Oriya
|
||||||
|
PACK('p', 'a'), // Punjabi
|
||||||
|
PACK('p', 'l'), // Polish
|
||||||
|
PACK('p', 's'), // Pashto, Pushto
|
||||||
|
PACK('p', 't'), // Portuguese
|
||||||
|
PACK('q', 'u'), // Quechua
|
||||||
|
PACK('r', 'm'), // Rhaeto-Romance
|
||||||
|
PACK('r', 'n'), // Kirundi
|
||||||
|
PACK('r', 'o'), // Romanian
|
||||||
|
PACK('r', 'u'), // Russian
|
||||||
|
PACK('r', 'w'), // Kinyarwanda
|
||||||
|
PACK('s', 'a'), // Sanskrit
|
||||||
|
PACK('s', 'd'), // Sindhi
|
||||||
|
PACK('s', 'g'), // Sangro
|
||||||
|
PACK('s', 'h'), // Serbo-Croatian
|
||||||
|
PACK('s', 'i'), // Singhalese
|
||||||
|
PACK('s', 'k'), // Slovak
|
||||||
|
PACK('s', 'l'), // Slovenian
|
||||||
|
PACK('s', 'm'), // Samoan
|
||||||
|
PACK('s', 'n'), // Shona
|
||||||
|
PACK('s', 'o'), // Somali
|
||||||
|
PACK('s', 'q'), // Albanian
|
||||||
|
PACK('s', 'r'), // Serbian
|
||||||
|
PACK('s', 's'), // Siswati
|
||||||
|
PACK('s', 't'), // Sesotho
|
||||||
|
PACK('s', 'u'), // Sudanese
|
||||||
|
PACK('s', 'v'), // Swedish
|
||||||
|
PACK('s', 'w'), // Swahili
|
||||||
|
PACK('t', 'a'), // Tamil
|
||||||
|
PACK('t', 'e'), // Tegulu
|
||||||
|
PACK('t', 'g'), // Tajik
|
||||||
|
PACK('t', 'h'), // Thai
|
||||||
|
PACK('t', 'i'), // Tigrinya
|
||||||
|
PACK('t', 'k'), // Turkmen
|
||||||
|
PACK('t', 'l'), // Tagalog
|
||||||
|
PACK('t', 'n'), // Setswana
|
||||||
|
PACK('t', 'o'), // Tonga
|
||||||
|
PACK('t', 'r'), // Turkish
|
||||||
|
PACK('t', 's'), // Tsonga
|
||||||
|
PACK('t', 't'), // Tatar
|
||||||
|
PACK('t', 'w'), // Twi
|
||||||
|
PACK('u', 'g'), // Uigur
|
||||||
|
PACK('u', 'k'), // Ukrainian
|
||||||
|
PACK('u', 'r'), // Urdu
|
||||||
|
PACK('u', 'z'), // Uzbek
|
||||||
|
PACK('v', 'i'), // Vietnamese
|
||||||
|
PACK('v', 'o'), // Volapuk
|
||||||
|
PACK('w', 'o'), // Wolof
|
||||||
|
PACK('x', 'h'), // Xhosa
|
||||||
|
PACK('y', 'i'), // Yiddish
|
||||||
|
PACK('y', 'o'), // Yoruba
|
||||||
|
PACK('z', 'a'), // Zhuang
|
||||||
|
PACK('z', 'h'), // Chinese
|
||||||
|
PACK('z', 'u'), // Zulu
|
||||||
|
#undef PACK
|
||||||
|
};
|
||||||
|
|
||||||
|
int GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1)
|
||||||
|
{
|
||||||
|
unsigned int lower = 0;
|
||||||
|
unsigned int upper = TABLESIZE (iso639_1_codes) - 1;
|
||||||
|
unsigned int mid = TABLESIZE (iso639_1_codes) / 2;
|
||||||
|
|
||||||
|
if (!iso639_1)
|
||||||
|
return LANGCODE_unknown;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (iso639_1 < iso639_1_codes[mid])
|
||||||
|
upper = mid - 1;
|
||||||
|
else if (iso639_1 > iso639_1_codes[mid])
|
||||||
|
lower = mid + 1;
|
||||||
|
else
|
||||||
|
return (int)mid;
|
||||||
|
|
||||||
|
mid = (lower + upper) / 2;
|
||||||
|
} while (lower <= upper);
|
||||||
|
|
||||||
|
return LANGCODE_unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _MGCHARSET_UNICODE */
|
||||||
|
|
||||||
+342
-313
File diff suppressed because it is too large
Load Diff
+669
-669
File diff suppressed because it is too large
Load Diff
+37
-31
@@ -154,7 +154,7 @@ static void clear_glyph_tree (QPF_GLYPHTREE* tree)
|
|||||||
free (tree->more);
|
free (tree->more);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* load_font_data (const char* font_name, const char* file_name)
|
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
|
||||||
{
|
{
|
||||||
FILE* fp = NULL;
|
FILE* fp = NULL;
|
||||||
uchar* data;
|
uchar* data;
|
||||||
@@ -222,7 +222,7 @@ error:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unload_font_data (void* data)
|
static void unload_font_data (DEVFONT* devfont, void* data)
|
||||||
{
|
{
|
||||||
QPFINFO* qpf_info = (QPFINFO*)data;
|
QPFINFO* qpf_info = (QPFINFO*)data;
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ 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_glyph_type (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)
|
||||||
return DEVFONTGLYPHTYPE_GREYBMP;
|
return DEVFONTGLYPHTYPE_GREYBMP;
|
||||||
@@ -302,7 +302,7 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
* GET_DEVFONT_SCALE (logfont, devfont);
|
* GET_DEVFONT_SCALE (logfont, devfont);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
|
||||||
{
|
{
|
||||||
int height = QPFONT_INFO_P (devfont)->fm->ascent +
|
int height = QPFONT_INFO_P (devfont)->fm->ascent +
|
||||||
QPFONT_INFO_P (devfont)->fm->descent;
|
QPFONT_INFO_P (devfont)->fm->descent;
|
||||||
@@ -311,7 +311,8 @@ static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
|||||||
if (logfont->style & FS_OTHER_AUTOSCALE)
|
if (logfont->style & FS_OTHER_AUTOSCALE)
|
||||||
scale = font_GetBestScaleFactor (height, expect);
|
scale = font_GetBestScaleFactor (height, expect);
|
||||||
|
|
||||||
SET_DEVFONT_SCALE (logfont, devfont, scale);
|
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
|
||||||
|
SET_DEVFONT_SCALE (logfont, df_slot, scale);
|
||||||
|
|
||||||
return height * scale;
|
return height * scale;
|
||||||
}
|
}
|
||||||
@@ -329,23 +330,24 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
unsigned int uc16;
|
unsigned int uc16;
|
||||||
QPF_GLYPH* glyph;
|
QPF_GLYPH* glyph;
|
||||||
|
|
||||||
if(devfont->charset_ops->conv_to_uc32)
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
|
if (devfont->charset_ops->conv_to_uc32)
|
||||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||||
else
|
else
|
||||||
uc16 = glyph_value;
|
uc16 = glyph_value;
|
||||||
|
|
||||||
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
||||||
|
|
||||||
if (glyph == NULL) {
|
if (glyph == NULL) {
|
||||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
|
||||||
unsigned char ascii_ch = uc16;
|
unsigned char ascii_ch = uc16;
|
||||||
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
|
return logfont->devfonts[0]->font_ops->get_glyph_monobitmap (logfont,
|
||||||
logfont->sbc_devfont, ascii_ch, pitch, scale);
|
logfont->devfonts[0], ascii_ch, sz, pitch, scale);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
glyph = &def_glyph;
|
glyph = &def_glyph;
|
||||||
@@ -365,11 +367,12 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
unsigned int uc16;
|
unsigned int uc16;
|
||||||
QPF_GLYPH* glyph;
|
QPF_GLYPH* glyph;
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if (scale)
|
if (scale)
|
||||||
*scale = GET_DEVFONT_SCALE (logfont, devfont);
|
*scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||||
|
|
||||||
@@ -400,6 +403,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
QPF_GLYPH* glyph;
|
QPF_GLYPH* glyph;
|
||||||
unsigned short scale = GET_DEVFONT_SCALE (logfont, devfont);
|
unsigned short scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if(devfont->charset_ops->conv_to_uc32)
|
if(devfont->charset_ops->conv_to_uc32)
|
||||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||||
else
|
else
|
||||||
@@ -408,21 +412,21 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
||||||
|
|
||||||
if (glyph == NULL) {
|
if (glyph == NULL) {
|
||||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
|
||||||
unsigned char ascii_ch = uc16;
|
unsigned char ascii_ch = uc16;
|
||||||
if (logfont->sbc_devfont->font_ops->get_glyph_bbox) {
|
if (logfont->devfonts[0]->font_ops->get_glyph_bbox) {
|
||||||
return logfont->sbc_devfont->font_ops->get_glyph_bbox (logfont,
|
return logfont->devfonts[0]->font_ops->get_glyph_bbox (logfont,
|
||||||
logfont->sbc_devfont, ascii_ch,
|
logfont->devfonts[0], ascii_ch,
|
||||||
px, py, pwidth, pheight);
|
px, py, pwidth, pheight);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int width, height, ascent;
|
int width, height, ascent;
|
||||||
logfont->sbc_devfont->font_ops->get_glyph_advance
|
logfont->devfonts[0]->font_ops->get_glyph_advance
|
||||||
(logfont, logfont->sbc_devfont, glyph_value, &width, 0);
|
(logfont, logfont->devfonts[0], glyph_value, &width, 0);
|
||||||
height = logfont->sbc_devfont->font_ops->get_font_height
|
height = logfont->devfonts[0]->font_ops->get_font_height
|
||||||
(logfont, logfont->sbc_devfont);
|
(logfont, logfont->devfonts[0]);
|
||||||
ascent = logfont->sbc_devfont->font_ops->get_font_ascent
|
ascent = logfont->devfonts[0]->font_ops->get_font_ascent
|
||||||
(logfont, logfont->sbc_devfont);
|
(logfont, logfont->devfonts[0]);
|
||||||
|
|
||||||
if (pwidth) *pwidth = width;
|
if (pwidth) *pwidth = width;
|
||||||
if (pheight) *pheight = height;
|
if (pheight) *pheight = height;
|
||||||
@@ -452,6 +456,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
QPF_GLYPH* glyph;
|
QPF_GLYPH* glyph;
|
||||||
int advance;
|
int advance;
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if(devfont->charset_ops->conv_to_uc32)
|
if(devfont->charset_ops->conv_to_uc32)
|
||||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||||
else
|
else
|
||||||
@@ -460,11 +465,11 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
||||||
|
|
||||||
if (glyph == NULL) {
|
if (glyph == NULL) {
|
||||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
|
||||||
unsigned char ascii_ch = uc16;
|
unsigned char ascii_ch = uc16;
|
||||||
if (logfont->sbc_devfont->font_ops->get_glyph_advance) {
|
if (logfont->devfonts[0]->font_ops->get_glyph_advance) {
|
||||||
return logfont->sbc_devfont->font_ops->
|
return logfont->devfonts[0]->font_ops->
|
||||||
get_glyph_advance (logfont, logfont->sbc_devfont,
|
get_glyph_advance (logfont, logfont->devfonts[0],
|
||||||
ascii_ch, px, py);
|
ascii_ch, px, py);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -498,17 +503,18 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
|||||||
unsigned int uc16;
|
unsigned int uc16;
|
||||||
QPF_GLYPH* glyph;
|
QPF_GLYPH* glyph;
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if(devfont->charset_ops->conv_to_uc32)
|
if(devfont->charset_ops->conv_to_uc32)
|
||||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||||
else
|
else
|
||||||
uc16 = glyph_value;
|
uc16 = glyph_value;
|
||||||
|
|
||||||
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
||||||
|
|
||||||
if (glyph == NULL) {
|
if (glyph == NULL) {
|
||||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) /* ASCII */
|
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) /* ASCII */
|
||||||
return logfont->sbc_devfont->font_ops->is_glyph_existed (logfont,
|
return logfont->devfonts[0]->font_ops->is_glyph_existed (logfont,
|
||||||
logfont->sbc_devfont, glyph_value);
|
logfont->devfonts[0], glyph_value);
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -522,7 +528,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_glyph_type,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
get_font_height,
|
get_font_height,
|
||||||
|
|||||||
+14
-16
@@ -65,11 +65,7 @@
|
|||||||
#define RBFONT_INFO(devfont) ((RBFINFO*)(devfont.data))
|
#define RBFONT_INFO(devfont) ((RBFINFO*)(devfont.data))
|
||||||
|
|
||||||
/********************** Load/Unload of raw bitmap font ***********************/
|
/********************** Load/Unload of raw bitmap font ***********************/
|
||||||
#if 0
|
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
|
||||||
static void* load_font_data (char* font_name, char* file_name,
|
|
||||||
char* real_font_name)
|
|
||||||
#endif
|
|
||||||
static void* load_font_data (const char* font_name, const char* file_name)
|
|
||||||
{
|
{
|
||||||
FILE* fp = NULL;
|
FILE* fp = NULL;
|
||||||
RBFINFO* rbf_info = calloc (1, sizeof(RBFINFO));
|
RBFINFO* rbf_info = calloc (1, sizeof(RBFINFO));
|
||||||
@@ -129,7 +125,7 @@ error_load:
|
|||||||
|
|
||||||
/********************** Init/Term of raw bitmap font ***********************/
|
/********************** Init/Term of raw bitmap font ***********************/
|
||||||
|
|
||||||
static void unload_font_data (void* data)
|
static void unload_font_data (DEVFONT* devfont, void* data)
|
||||||
{
|
{
|
||||||
RBFINFO* rbfinfo = (RBFINFO*)data;
|
RBFINFO* rbfinfo = (RBFINFO*)data;
|
||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
@@ -143,7 +139,7 @@ static void unload_font_data (void* data)
|
|||||||
|
|
||||||
/*************** Raw bitmap font operations *********************************/
|
/*************** Raw bitmap font operations *********************************/
|
||||||
|
|
||||||
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
|
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
return DEVFONTGLYPHTYPE_MONOBMP;
|
return DEVFONTGLYPHTYPE_MONOBMP;
|
||||||
}
|
}
|
||||||
@@ -158,7 +154,7 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
return RBFONT_INFO_P (devfont)->height * GET_DEVFONT_SCALE (logfont, devfont);
|
return RBFONT_INFO_P (devfont)->height * GET_DEVFONT_SCALE (logfont, devfont);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
|
||||||
{
|
{
|
||||||
int height = RBFONT_INFO_P (devfont)->height;
|
int height = RBFONT_INFO_P (devfont)->height;
|
||||||
unsigned short scale = 1;
|
unsigned short scale = 1;
|
||||||
@@ -166,7 +162,8 @@ static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
|||||||
if (logfont->style & FS_OTHER_AUTOSCALE)
|
if (logfont->style & FS_OTHER_AUTOSCALE)
|
||||||
scale = font_GetBestScaleFactor (height, expect);
|
scale = font_GetBestScaleFactor (height, expect);
|
||||||
|
|
||||||
SET_DEVFONT_SCALE (logfont, devfont, scale);
|
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
|
||||||
|
SET_DEVFONT_SCALE (logfont, df_slot, scale);
|
||||||
|
|
||||||
return height * scale;
|
return height * scale;
|
||||||
}
|
}
|
||||||
@@ -192,7 +189,7 @@ static int get_font_ascent (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||||
{
|
{
|
||||||
int height = RBFONT_INFO_P (devfont)->height;
|
int height = RBFONT_INFO_P (devfont)->height;
|
||||||
|
|
||||||
height *= GET_DEVFONT_SCALE (logfont, devfont);
|
height *= GET_DEVFONT_SCALE (logfont, devfont);
|
||||||
|
|
||||||
if (height >= 40)
|
if (height >= 40)
|
||||||
@@ -208,13 +205,13 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
int bitmap_size;
|
int bitmap_size;
|
||||||
Glyph32 glyph_tmp = glyph_value;
|
|
||||||
|
|
||||||
if (glyph_tmp >= RBFONT_INFO_P (devfont)->nr_glyphs)
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
glyph_tmp = devfont->charset_ops->def_glyph_value;
|
if (glyph_value >= RBFONT_INFO_P (devfont)->nr_glyphs)
|
||||||
|
glyph_value = devfont->charset_ops->def_char_value;
|
||||||
|
|
||||||
bitmap_size = ((RBFONT_INFO_P (devfont)->width + 7) >> 3)
|
bitmap_size = ((RBFONT_INFO_P (devfont)->width + 7) >> 3)
|
||||||
* RBFONT_INFO_P (devfont)->height;
|
* RBFONT_INFO_P (devfont)->height;
|
||||||
@@ -224,12 +221,13 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
if (scale)
|
if (scale)
|
||||||
*scale = GET_DEVFONT_SCALE (logfont, devfont);
|
*scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||||
|
|
||||||
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_tmp;
|
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont,
|
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
Glyph32 glyph_value)
|
Glyph32 glyph_value)
|
||||||
{
|
{
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if (glyph_value > RBFONT_INFO_P(devfont)->nr_glyphs)
|
if (glyph_value > RBFONT_INFO_P(devfont)->nr_glyphs)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
else
|
||||||
@@ -268,7 +266,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_glyph_type,
|
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
|
||||||
get_font_height,
|
get_font_height,
|
||||||
|
|||||||
+12
-6
@@ -103,7 +103,7 @@ static void unlock(void)
|
|||||||
static BOOL load_fonts(void)
|
static BOOL load_fonts(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int font_table_size = se_font_desc.font_name_map_size;
|
int font_table_size = se_font_desc.font_name_map_size;
|
||||||
BOOL result = FALSE;
|
BOOL result = FALSE;
|
||||||
|
|
||||||
#if SE_MINIGUI_TRACE
|
#if SE_MINIGUI_TRACE
|
||||||
@@ -113,7 +113,7 @@ static BOOL load_fonts(void)
|
|||||||
se_dev_fonts = calloc (font_table_size, sizeof (DEVFONT));
|
se_dev_fonts = calloc (font_table_size, sizeof (DEVFONT));
|
||||||
|
|
||||||
for (i = 0; i < font_table_size; i++) {
|
for (i = 0; i < font_table_size; i++) {
|
||||||
char charset[LEN_FONT_NAME + 1];
|
char charset[LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
CHARSETOPS *charset_ops;
|
CHARSETOPS *charset_ops;
|
||||||
const char *font_name;
|
const char *font_name;
|
||||||
int font_id;
|
int font_id;
|
||||||
@@ -158,7 +158,7 @@ static BOOL load_fonts(void)
|
|||||||
if ((nr_charsets = charsetGetCharsetsNumber (charsets)) > 1) {
|
if ((nr_charsets = charsetGetCharsetsNumber (charsets)) > 1) {
|
||||||
int j;
|
int j;
|
||||||
for (j = 1; j < nr_charsets; j++) {
|
for (j = 1; j < nr_charsets; j++) {
|
||||||
char charset [LEN_FONT_NAME + 1];
|
char charset [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
CHARSETOPS* charset_ops;
|
CHARSETOPS* charset_ops;
|
||||||
DEVFONT* new_devfont;
|
DEVFONT* new_devfont;
|
||||||
|
|
||||||
@@ -334,6 +334,7 @@ static int get_glyph_width (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
SeLogFont selogfont;
|
SeLogFont selogfont;
|
||||||
int width;
|
int width;
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if (devfont->charset_ops->conv_to_uc32)
|
if (devfont->charset_ops->conv_to_uc32)
|
||||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||||
else
|
else
|
||||||
@@ -364,7 +365,7 @@ static int get_max_width (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
return logfont->size;
|
return logfont->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DWORD get_glyph_type (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)
|
||||||
return DEVFONTGLYPHTYPE_GREYBMP;
|
return DEVFONTGLYPHTYPE_GREYBMP;
|
||||||
@@ -440,6 +441,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
printf("in get_glyph_greybitmap....\n");
|
printf("in get_glyph_greybitmap....\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if (devfont->charset_ops->conv_to_uc32)
|
if (devfont->charset_ops->conv_to_uc32)
|
||||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||||
else
|
else
|
||||||
@@ -466,7 +468,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
seunichar16 wc;
|
seunichar16 wc;
|
||||||
SeLogFont selogfont;
|
SeLogFont selogfont;
|
||||||
@@ -476,6 +478,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
printf("in get_char_bitmap....\n");
|
printf("in get_char_bitmap....\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if (devfont->charset_ops->conv_to_uc32)
|
if (devfont->charset_ops->conv_to_uc32)
|
||||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||||
else
|
else
|
||||||
@@ -505,6 +508,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
if(px == 0 && py == 0 && pwidth == 0 && pheight == 0)
|
if(px == 0 && py == 0 && pwidth == 0 && pheight == 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if (devfont->charset_ops->conv_to_uc32)
|
if (devfont->charset_ops->conv_to_uc32)
|
||||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||||
else
|
else
|
||||||
@@ -534,6 +538,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
SeLogFont selogfont;
|
SeLogFont selogfont;
|
||||||
int x = *px;
|
int x = *px;
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if (devfont->charset_ops->conv_to_uc32)
|
if (devfont->charset_ops->conv_to_uc32)
|
||||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||||
else
|
else
|
||||||
@@ -558,6 +563,7 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
|||||||
int uni_char;
|
int uni_char;
|
||||||
int x, y, width, height;
|
int x, y, width, height;
|
||||||
|
|
||||||
|
glyph_value = REAL_GLYPH(glyph_value);
|
||||||
if(devfont->charset_ops->conv_to_uc32)
|
if(devfont->charset_ops->conv_to_uc32)
|
||||||
uni_char = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
uni_char = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||||
else
|
else
|
||||||
@@ -577,7 +583,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_glyph_type,
|
get_glyph_bmptype,
|
||||||
get_ave_width,
|
get_ave_width,
|
||||||
get_max_width,
|
get_max_width,
|
||||||
get_font_height,
|
get_font_height,
|
||||||
|
|||||||
+13
-13
@@ -102,10 +102,10 @@ BOOL mg_InitSysFont (void)
|
|||||||
|
|
||||||
for (i = 0; i < nr_fonts; i++) {
|
for (i = 0; i < nr_fonts; i++) {
|
||||||
char key [11];
|
char key [11];
|
||||||
char type [LEN_FONT_NAME + 1];
|
char type [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
char family [LEN_FONT_NAME + 1];
|
char family [LEN_LOGFONT_FAMILY_FILED + 1];
|
||||||
char style [LEN_FONT_NAME + 1];
|
char style [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
char charset [LEN_FONT_NAME + 1];
|
char charset [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
char font_name [LEN_DEVFONT_NAME + 1];
|
char font_name [LEN_DEVFONT_NAME + 1];
|
||||||
int height;
|
int height;
|
||||||
int j = 0, need = 0;
|
int j = 0, need = 0;
|
||||||
@@ -205,28 +205,28 @@ void mg_TermSysFont (void)
|
|||||||
const char* GUIAPI GetSysCharset (BOOL wchar)
|
const char* GUIAPI GetSysCharset (BOOL wchar)
|
||||||
{
|
{
|
||||||
if (wchar) {
|
if (wchar) {
|
||||||
if (g_SysLogFont[1]->mbc_devfont)
|
if (g_SysLogFont[1]->devfonts[1])
|
||||||
return MBC_DEVFONT_INFO_P (g_SysLogFont[1])->charset_ops->name;
|
return g_SysLogFont[1]->devfonts[1]->charset_ops->name;
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return SBC_DEVFONT_INFO_P (g_SysLogFont[0])->charset_ops->name;
|
return g_SysLogFont[0]->devfonts[0]->charset_ops->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GUIAPI GetSysCharWidth (void)
|
int GUIAPI GetSysCharWidth (void)
|
||||||
{
|
{
|
||||||
DEVFONT* sbc_devfont = g_SysLogFont[0]->sbc_devfont;
|
DEVFONT* sbc_devfont = g_SysLogFont[0]->devfonts[0];
|
||||||
|
|
||||||
return sbc_devfont->font_ops->get_ave_width (g_SysLogFont[0], sbc_devfont);
|
return sbc_devfont->font_ops->get_ave_width (g_SysLogFont[0], sbc_devfont);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GUIAPI GetSysCCharWidth (void)
|
int GUIAPI GetSysCCharWidth (void)
|
||||||
{
|
{
|
||||||
DEVFONT* mbc_devfont = g_SysLogFont[1]->mbc_devfont;
|
DEVFONT* mbc_devfont = g_SysLogFont[1]->devfonts[1];
|
||||||
|
|
||||||
if (mbc_devfont)
|
if (mbc_devfont)
|
||||||
return mbc_devfont->font_ops->get_ave_width (g_SysLogFont[1], mbc_devfont);
|
return mbc_devfont->font_ops->get_ave_width (g_SysLogFont[1], mbc_devfont);
|
||||||
else
|
else
|
||||||
return GetSysCharWidth () * 2;
|
return GetSysCharWidth () * 2;
|
||||||
}
|
}
|
||||||
@@ -238,14 +238,14 @@ int GUIAPI GetSysCharHeight (void)
|
|||||||
|
|
||||||
int GUIAPI GetSysFontMaxWidth (int font_id)
|
int GUIAPI GetSysFontMaxWidth (int font_id)
|
||||||
{
|
{
|
||||||
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->sbc_devfont;
|
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->devfonts[0];
|
||||||
|
|
||||||
return sbc_devfont->font_ops->get_max_width (g_SysLogFont[font_id], sbc_devfont);
|
return sbc_devfont->font_ops->get_max_width (g_SysLogFont[font_id], sbc_devfont);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GUIAPI GetSysFontAveWidth (int font_id)
|
int GUIAPI GetSysFontAveWidth (int font_id)
|
||||||
{
|
{
|
||||||
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->sbc_devfont;
|
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->devfonts[0];
|
||||||
|
|
||||||
return sbc_devfont->font_ops->get_ave_width (g_SysLogFont[font_id], sbc_devfont);
|
return sbc_devfont->font_ops->get_ave_width (g_SysLogFont[font_id], sbc_devfont);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ BOOL mg_InitSysFont (void)
|
|||||||
|
|
||||||
for (i = 0; i < nr_fonts; i++) {
|
for (i = 0; i < nr_fonts; i++) {
|
||||||
char key [11];
|
char key [11];
|
||||||
char charset [LEN_FONT_NAME + 1];
|
char charset [LEN_LOGFONT_NAME_FIELD + 1];
|
||||||
char file [MAX_PATH + 1];
|
char file [MAX_PATH + 1];
|
||||||
|
|
||||||
sprintf (key, "name%d", i);
|
sprintf (key, "name%d", i);
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ u:arabic_test_unicode
|
|||||||
hex:arabic_test_hex
|
hex:arabic_test_hex
|
||||||
|
|
||||||
MINIGUI_COMMON = /usr/local/include/minigui
|
MINIGUI_COMMON = /usr/local/include/minigui
|
||||||
LIBS = -lminigui_ths -lm -ljpeg -lz -lpng -lpthread -lttf
|
LIBS = -lminigui_ths -lm -ljpeg -lz -lpng -lpthread -lfreetype
|
||||||
#LIBS = -lminigui_ths -lm -ljpeg -lz -lpng -lpthread -lfreetype
|
|
||||||
|
|
||||||
arabic_test:arabic_test.c $(MINIGUI_COMMON)
|
arabic_test:arabic_test.c $(MINIGUI_COMMON)
|
||||||
gcc arabic_test.c -Wall -g -o arabic_test $(LIBS)
|
gcc arabic_test.c -Wall -g -o arabic_test $(LIBS)
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ void read_total_file( void )
|
|||||||
fclose (fp);
|
fclose (fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
static LRESULT HelloWinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
switch (message) {
|
switch (message) {
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ static int test_correctness ()
|
|||||||
if (index < 0) /* not a letter.*/
|
if (index < 0) /* not a letter.*/
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
glyph_value = iso8859_6_char_glyph_value (NULL, 0, c, 1);
|
glyph_value = iso8859_6_get_char_value (NULL, 0, c, 1);
|
||||||
fprintf (stderr, "%x 's glyph value = %x\n", *c, glyph_value);
|
fprintf (stderr, "%x 's glyph value = %x\n", *c, glyph_value);
|
||||||
|
|
||||||
if (!test_glyph_value (index, glyph_value)) {
|
if (!iso8859_6_test_glyph_value (index, glyph_value)) {
|
||||||
fprintf (stderr, "Shape error: %x\n", *c);
|
fprintf (stderr, "Shape error: %x\n", *c);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ helloworld:helloworld.c
|
|||||||
gcc helloworld.c -Wall -g -o helloworld -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
|
gcc helloworld.c -Wall -g -o helloworld -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
|
||||||
|
|
||||||
hebrew_test:hebrew_test.c
|
hebrew_test:hebrew_test.c
|
||||||
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lttf -lpng -lpthread
|
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
|
||||||
|
|
||||||
hebrew_test_release:hebrew_test.c
|
hebrew_test_release:hebrew_test.c
|
||||||
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lttf -lpng -lpthread
|
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
|
||||||
|
|
||||||
hebrew_test_debug:hebrew_test.c
|
hebrew_test_debug:hebrew_test.c
|
||||||
gcc hebrew_test.c -DARABIC_DEBUG -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lttf -lpng -lpthread
|
gcc hebrew_test.c -DARABIC_DEBUG -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
|
||||||
|
|
||||||
hebrew_test_unicode:hebrew_test.c
|
hebrew_test_unicode:hebrew_test.c
|
||||||
gcc hebrew_test.c -DARABIC_UNICODE -DARABIC_DEBUG -g -o hebrew_test_u -lminigui_ths -lm -lfreetype -ljpeg -lz -lpng -lpthread
|
gcc hebrew_test.c -DARABIC_UNICODE -DARABIC_DEBUG -g -o hebrew_test_u -lminigui_ths -lm -lfreetype -ljpeg -lz -lpng -lpthread
|
||||||
|
|||||||
@@ -59,23 +59,23 @@ char filename[256];
|
|||||||
char fontname[50];
|
char fontname[50];
|
||||||
|
|
||||||
BOOL textout = TRUE;
|
BOOL textout = TRUE;
|
||||||
RECT arabic_rc = {0, 0, 640, 480};
|
RECT hebrew_rc = {0, 0, 640, 480};
|
||||||
int line_num = 0;
|
int line_num = 0;
|
||||||
|
|
||||||
static char msg_text [256] = "Show text with TextOut.";
|
static char msg_text [256] = "Show text with TextOut.";
|
||||||
|
|
||||||
static FILE *fp = NULL;
|
static FILE *fp = NULL;
|
||||||
static PLOGFONT logfont_iso8859_8;
|
static PLOGFONT logfont_iso8859_8;
|
||||||
//static char arabic_text[] = {0xc7,0xe4,0xe1,0xd1,0xea,0xe2,0xa0,0xc7,0xe4,0xca,0xe2,0xe6,0xea,0x00};
|
//static char hebrew_text[] = {0xc7,0xe4,0xe1,0xd1,0xea,0xe2,0xa0,0xc7,0xe4,0xca,0xe2,0xe6,0xea,0x00};
|
||||||
|
|
||||||
static int reset_fp_pos()
|
static int reset_fp_pos()
|
||||||
{
|
{
|
||||||
arabic_rc.left = 0;
|
hebrew_rc.left = 0;
|
||||||
arabic_rc.top = 0;
|
hebrew_rc.top = 0;
|
||||||
arabic_rc.right = g_rcScr.right - 24;
|
hebrew_rc.right = g_rcScr.right - 24;
|
||||||
arabic_rc.bottom = g_rcScr.bottom;
|
hebrew_rc.bottom = g_rcScr.bottom;
|
||||||
if(!fp){
|
if(!fp){
|
||||||
DBGLOG2("============================= arabic_test %s===============================\n", filename);
|
DBGLOG2("============================= hebrew_test %s===============================\n", filename);
|
||||||
fp = fopen(filename, "rb");
|
fp = fopen(filename, "rb");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
DBGLOG2("cannot open %s\n", filename);
|
DBGLOG2("cannot open %s\n", filename);
|
||||||
@@ -140,7 +140,7 @@ void read_total_file( void )
|
|||||||
fclose (fp);
|
fclose (fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
static LRESULT HelloWinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
switch (message) {
|
switch (message) {
|
||||||
@@ -196,13 +196,13 @@ static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
if(textout == TRUE) {
|
if(textout == TRUE) {
|
||||||
if(GetTextAlign(hdc) == TA_RIGHT)
|
if(GetTextAlign(hdc) == TA_RIGHT)
|
||||||
TextOut(hdc, arabic_rc.right, i*line_height, pline);
|
TextOut(hdc, hebrew_rc.right, i*line_height, pline);
|
||||||
else
|
else
|
||||||
TextOut(hdc, arabic_rc.left, i*line_height, pline);
|
TextOut(hdc, hebrew_rc.left, i*line_height, pline);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
int height = DrawText(hdc, pline, -1, &arabic_rc, DT_RIGHT);
|
int height = DrawText(hdc, pline, -1, &hebrew_rc, DT_RIGHT);
|
||||||
arabic_rc.top += height;
|
hebrew_rc.top += height;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
|||||||
/*
|
/*
|
||||||
else{
|
else{
|
||||||
read_total_file();
|
read_total_file();
|
||||||
DrawText(hdc, filebuf, -1, &arabic_rc, DT_RIGHT);
|
DrawText(hdc, filebuf, -1, &hebrew_rc, DT_RIGHT);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+39
-39
@@ -50,8 +50,8 @@
|
|||||||
int GUIAPI GetTextMCharInfo (PLOGFONT log_font, const char* mstr, int len,
|
int GUIAPI GetTextMCharInfo (PLOGFONT log_font, const char* mstr, int len,
|
||||||
int* pos_chars)
|
int* pos_chars)
|
||||||
{
|
{
|
||||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int left_bytes = len;
|
int left_bytes = len;
|
||||||
int len_cur_char;
|
int len_cur_char;
|
||||||
@@ -86,8 +86,8 @@ int GUIAPI GetTextMCharInfo (PLOGFONT log_font, const char* mstr, int len,
|
|||||||
int GUIAPI GetTextWordInfo (PLOGFONT log_font, const char* mstr, int len,
|
int GUIAPI GetTextWordInfo (PLOGFONT log_font, const char* mstr, int len,
|
||||||
int* pos_words, WORDINFO* info_words)
|
int* pos_words, WORDINFO* info_words)
|
||||||
{
|
{
|
||||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
WORDINFO word_info;
|
WORDINFO word_info;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int left_bytes = len;
|
int left_bytes = len;
|
||||||
@@ -150,8 +150,8 @@ int GUIAPI GetTextWordInfo (PLOGFONT log_font, const char* mstr, int len,
|
|||||||
|
|
||||||
int GUIAPI GetFirstMCharLen (PLOGFONT log_font, const char* mstr, int len)
|
int GUIAPI GetFirstMCharLen (PLOGFONT log_font, const char* mstr, int len)
|
||||||
{
|
{
|
||||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
int len_cur_char = 0;
|
int len_cur_char = 0;
|
||||||
|
|
||||||
if (mbc_devfont) {
|
if (mbc_devfont) {
|
||||||
@@ -171,8 +171,8 @@ int GUIAPI GetFirstMCharLen (PLOGFONT log_font, const char* mstr, int len)
|
|||||||
|
|
||||||
int GUIAPI GetLastMCharLen (PLOGFONT log_font, const char* mstr, int len)
|
int GUIAPI GetLastMCharLen (PLOGFONT log_font, const char* mstr, int len)
|
||||||
{
|
{
|
||||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
int left_bytes = len;
|
int left_bytes = len;
|
||||||
int len_cur_char;
|
int len_cur_char;
|
||||||
int lastlen = 0;
|
int lastlen = 0;
|
||||||
@@ -204,8 +204,8 @@ int GUIAPI GetLastMCharLen (PLOGFONT log_font, const char* mstr, int len)
|
|||||||
int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len,
|
int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len,
|
||||||
WORDINFO* word_info)
|
WORDINFO* word_info)
|
||||||
{
|
{
|
||||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
|
|
||||||
if (mbc_devfont) {
|
if (mbc_devfont) {
|
||||||
int mbc_pos;
|
int mbc_pos;
|
||||||
@@ -234,12 +234,12 @@ int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len,
|
|||||||
int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
||||||
const unsigned char* mchar, int n)
|
const unsigned char* mchar, int n)
|
||||||
{
|
{
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||||
DEVFONT* devfont;
|
DEVFONT* devfont;
|
||||||
int len_cur_char = 0;
|
int len_cur_char = 0;
|
||||||
Glyph32 glyph_value;
|
Glyph32 glyph_value;
|
||||||
UChar32 uc32;
|
Uchar32 uc32;
|
||||||
|
|
||||||
if (mbc_devfont) {
|
if (mbc_devfont) {
|
||||||
len_cur_char = mbc_devfont->charset_ops->len_first_char (mchar, n);
|
len_cur_char = mbc_devfont->charset_ops->len_first_char (mchar, n);
|
||||||
@@ -256,22 +256,22 @@ int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
|||||||
return 0;
|
return 0;
|
||||||
else {
|
else {
|
||||||
if (dest) {
|
if (dest) {
|
||||||
glyph_value = devfont->charset_ops->char_glyph_value(NULL, 0, mchar, n);
|
glyph_value = devfont->charset_ops->get_char_value(NULL, 0, mchar, n);
|
||||||
if(devfont->charset_ops->conv_to_uc32)
|
if(devfont->charset_ops->conv_to_uc32)
|
||||||
uc32 = devfont->charset_ops->conv_to_uc32 (glyph_value);
|
uc32 = devfont->charset_ops->conv_to_uc32 (glyph_value);
|
||||||
else
|
else
|
||||||
uc32 = glyph_value;
|
uc32 = glyph_value;
|
||||||
|
|
||||||
if (wc32) {
|
if (wc32) {
|
||||||
UChar32* uchar32 = (UChar32*)dest;
|
Uchar32* uchar32 = (Uchar32*)dest;
|
||||||
*uchar32 = uc32;
|
*uchar32 = uc32;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
UChar16* uchar16 = (UChar16*)dest;
|
Uchar16* uchar16 = (Uchar16*)dest;
|
||||||
if (uc32 > 0xFFFF)
|
if (uc32 > 0xFFFF)
|
||||||
*uchar16 = 0xFEFF;
|
*uchar16 = 0xFEFF;
|
||||||
else
|
else
|
||||||
*uchar16 = (UChar16)uc32;
|
*uchar16 = (Uchar16)uc32;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return len_cur_char;
|
return len_cur_char;
|
||||||
@@ -280,10 +280,10 @@ int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, UChar32 wc)
|
int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, Uchar32 wc)
|
||||||
{
|
{
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||||
unsigned char mchar [16];
|
unsigned char mchar [16];
|
||||||
int len_cur_char = 0;
|
int len_cur_char = 0;
|
||||||
|
|
||||||
@@ -311,14 +311,14 @@ int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
|||||||
const unsigned char* mstr, int mstr_len, int n,
|
const unsigned char* mstr, int mstr_len, int n,
|
||||||
int* conved_mstr_len)
|
int* conved_mstr_len)
|
||||||
{
|
{
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||||
DEVFONT* devfont;
|
DEVFONT* devfont;
|
||||||
int left, count = 0;
|
int left, count = 0;
|
||||||
UChar32* uchar32;
|
Uchar32* uchar32;
|
||||||
UChar16* uchar16;
|
Uchar16* uchar16;
|
||||||
Glyph32 glyph_value;
|
Glyph32 glyph_value;
|
||||||
UChar32 uc32;
|
Uchar32 uc32;
|
||||||
|
|
||||||
if (conved_mstr_len)
|
if (conved_mstr_len)
|
||||||
*conved_mstr_len = 0;
|
*conved_mstr_len = 0;
|
||||||
@@ -328,10 +328,10 @@ int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
|||||||
|
|
||||||
if (wc32) {
|
if (wc32) {
|
||||||
uchar16 = NULL;
|
uchar16 = NULL;
|
||||||
uchar32 = (UChar32*)dest;
|
uchar32 = (Uchar32*)dest;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar16 = (UChar16*)dest;
|
uchar16 = (Uchar16*)dest;
|
||||||
uchar32 = NULL;
|
uchar32 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
glyph_value = devfont->charset_ops->char_glyph_value (NULL, 0, mstr, left);
|
glyph_value = devfont->charset_ops->get_char_value (NULL, 0, mstr, left);
|
||||||
if (devfont->charset_ops->conv_to_uc32)
|
if (devfont->charset_ops->conv_to_uc32)
|
||||||
uc32 = devfont->charset_ops->conv_to_uc32 (glyph_value);
|
uc32 = devfont->charset_ops->conv_to_uc32 (glyph_value);
|
||||||
else
|
else
|
||||||
@@ -384,7 +384,7 @@ int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
|||||||
if (uc32 > 0xFFFF)
|
if (uc32 > 0xFFFF)
|
||||||
uchar16 [count] = 0xFEFF;
|
uchar16 [count] = 0xFEFF;
|
||||||
else
|
else
|
||||||
uchar16 [count] = (UChar16)uc32;
|
uchar16 [count] = (Uchar16)uc32;
|
||||||
}
|
}
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
@@ -406,13 +406,13 @@ int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest,
|
|||||||
const void *wcs, int wcs_len, BOOL wc32, int n,
|
const void *wcs, int wcs_len, BOOL wc32, int n,
|
||||||
int* conved_wcs_len)
|
int* conved_wcs_len)
|
||||||
{
|
{
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||||
int wc_count = 0, count = 0;
|
int wc_count = 0, count = 0;
|
||||||
unsigned char mchar [16] = {0};
|
unsigned char mchar [16] = {0};
|
||||||
const UChar32* uchar32;
|
const Uchar32* uchar32;
|
||||||
const UChar16* uchar16;
|
const Uchar16* uchar16;
|
||||||
UChar32 uc32;
|
Uchar32 uc32;
|
||||||
|
|
||||||
if (conved_wcs_len)
|
if (conved_wcs_len)
|
||||||
*conved_wcs_len = 0;
|
*conved_wcs_len = 0;
|
||||||
@@ -422,10 +422,10 @@ int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest,
|
|||||||
|
|
||||||
if (wc32) {
|
if (wc32) {
|
||||||
uchar16 = NULL;
|
uchar16 = NULL;
|
||||||
uchar32 = (UChar32*)wcs;
|
uchar32 = (Uchar32*)wcs;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar16 = (UChar16*)wcs;
|
uchar16 = (Uchar16*)wcs;
|
||||||
uchar32 = NULL;
|
uchar32 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +493,7 @@ int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest,
|
|||||||
|
|
||||||
size_t __mg_strlen (PLOGFONT log_font, const char* mstr)
|
size_t __mg_strlen (PLOGFONT log_font, const char* mstr)
|
||||||
{
|
{
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
|
|
||||||
if (mbc_devfont && strstr (mbc_devfont->charset_ops->name, "UTF-16")) {
|
if (mbc_devfont && strstr (mbc_devfont->charset_ops->name, "UTF-16")) {
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
@@ -514,7 +514,7 @@ char* __mg_strnchr (PLOGFONT log_font, const char* s, size_t n, int c,
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
unsigned char c1, c2;
|
unsigned char c1, c2;
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
|
|
||||||
if (mbc_devfont) {
|
if (mbc_devfont) {
|
||||||
*chlen = 2;
|
*chlen = 2;
|
||||||
@@ -566,7 +566,7 @@ int __mg_substrlen (PLOGFONT log_font, const char* text, int len,
|
|||||||
|
|
||||||
len = substr - text;
|
len = substr - text;
|
||||||
if (*nr_delim == 2) {
|
if (*nr_delim == 2) {
|
||||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||||
unsigned char c1, c2;
|
unsigned char c1, c2;
|
||||||
|
|
||||||
if (strstr (mbc_devfont->charset_ops->name, "UTF-16LE")) {
|
if (strstr (mbc_devfont->charset_ops->name, "UTF-16LE")) {
|
||||||
|
|||||||
+6
-3
@@ -79,7 +79,7 @@ static encstruct default_enc;
|
|||||||
|
|
||||||
#define CHARSPACEUNIT2PIXEL(x) (x/1000)
|
#define CHARSPACEUNIT2PIXEL(x) (x/1000)
|
||||||
|
|
||||||
static void* load_font_data (const char* font_name, const char* file_name)
|
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
int font_id;
|
int font_id;
|
||||||
@@ -109,7 +109,7 @@ error:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unload_font_data (void* data)
|
static void unload_font_data (DEVFONT* devfont, void* data)
|
||||||
{
|
{
|
||||||
free (data);
|
free (data);
|
||||||
}
|
}
|
||||||
@@ -200,8 +200,11 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
return type1_inst_info->font_height;
|
return type1_inst_info->font_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
|
||||||
{
|
{
|
||||||
|
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
|
||||||
|
SET_DEVFONT_SCALE (logfont, df_slot, scale);
|
||||||
|
|
||||||
return expect;
|
return expect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user