Compare commits

...
53 Commits
Author SHA1 Message Date
Vincent Wei 56fd0a1050 release version 3.2.3 2019-10-31 11:28:20 +08:00
Vincent Wei fbba2ebd1a cleanup 2019-10-31 10:46:47 +08:00
Vincent Wei 33b3ad0bd3 clean code for 64-bit 2019-10-31 10:44:40 +08:00
Vincent Wei 9bee00cf9f remove targetname movidius 2019-10-31 10:26:14 +08:00
Vincent Wei aedcffacf7 cleanup 2019-10-31 10:23:12 +08:00
Vincent Wei c91eeddd2c cleanup 2019-10-31 10:15:42 +08:00
Vincent Wei 2ac54f9ee6 cleanup for new release 2019-10-31 10:02:18 +08:00
Vincent Wei 20f160074f Change version to 3.2.3 2019-10-31 09:55:06 +08:00
Vincent Wei 437769c1a4 use #ifdef instead of #if for HAVE_LIMITS_H 2019-10-31 09:53:26 +08:00
Vincent Wei 69eebf37e3 use HAVE_LIMITS_H for the system header <limits.h> 2019-10-31 09:50:09 +08:00
Vincent Wei 4ea6912024 clean up new code for supporting RTEMS 2019-10-31 09:38:25 +08:00
gengyue 6b2039c151 for rtems 2019-10-31 08:55:47 +08:00
gengyue d7eed07222 for rtems 2019-10-31 08:55:17 +08:00
gengyue 6f033d8e93 for rtems 2019-10-31 08:46:47 +08:00
gengyue 193f5e58b1 add socklen_t 2019-10-31 08:39:55 +08:00
Vincent Wei 75dabce7af tune for minigui-docs 2019-10-23 19:09:21 +08:00
Vincent Wei 2149a6aa5e restore build/rules-pc.linux and fix errors in makefile.ng files 2019-10-18 15:43:38 +08:00
Vincent Wei bf8a9fee5c remove standalone option 2019-10-17 16:41:47 +08:00
Vincent Wei 8556f15e36 Exception List Statement 2019-07-15 14:42:46 +08:00
Vincent Wei 57215b9e59 add *.in~ 2019-06-06 10:55:59 +08:00
Vincent Wei 6201664035 remove getpt from function checking list 2019-06-06 10:19:19 +08:00
Vincent Wei 7303f40b2e add static for inline function to avoid duplicated definitions when using old GCC 2019-06-06 10:18:35 +08:00
Vincent Wei 42b10aed6a optimize ThrowAwayMessages 2019-05-16 10:22:37 +08:00
Vincent Wei d9dc070698 change binary age to 2 2019-04-29 18:51:57 +08:00
Vincent Wei ee5a1f86a7 fixbug of FT2 subpixel glyph rendering 2019-04-29 17:34:45 +08:00
gengyue d335e008ad modified for rtems 2019-04-24 20:10:36 +08:00
gengyue 268695a94b modified for rtems 2019-04-24 19:56:20 +08:00
Vincent Wei 1d211ed855 cleanup 2019-04-15 16:28:50 +08:00
Vincent Wei a7eaab6d38 use inline functions for --disable-cursor instead of macros 2019-04-15 16:26:22 +08:00
Vincent Wei 7d671c8318 tune release notes for LoadDevFontFromFile 2019-04-15 15:57:58 +08:00
Vincent Wei 76f4bf3661 add const to INNER_RES 2019-04-15 15:54:39 +08:00
Vincent Wei 4f51baac32 tune 2019-04-15 10:12:25 +08:00
Vincent Wei 4fa002216e tune release notes 2019-04-12 15:49:42 +08:00
Vincent Wei 6dc8696c08 Remove char_type and bidi_type from GLYPHINFO 2019-04-12 15:41:23 +08:00
Vincent Wei 06c497d671 tune 2019-04-12 14:39:02 +08:00
Vincent Wei 79267be62c use sys/sysmacros.h for makedev 2019-04-11 17:36:02 +08:00
Vincent Wei 9475ff227f add LoadDevFontFromIncoreData 2019-04-09 10:57:30 +08:00
Vincent Wei f562661146 use 0xff for alpha of RGB2Pixel 2019-04-09 10:47:38 +08:00
Vincent Wei eca15c447d check li.bpp with the requested bpp 2019-04-08 13:48:16 +08:00
Vincent Wei 736a532b1a use standard pixel format for alpha_pixel_format 2019-04-07 17:16:53 +08:00
Vincent Wei 5a0fc2e74f tune 2019-04-07 16:25:43 +08:00
Vincent Wei 12106c036c tune 2019-04-07 16:13:17 +08:00
Vincent Wei debd8a3fdd introduce exstubs.h header file to define the interfaces for commlcd NEWGAL engine, comm IAL engine, and custom IAL engine 2019-04-07 16:09:39 +08:00
Vincent Wei ac6d4019d5 fix typo 2019-04-06 13:58:49 +08:00
Vincent Wei 61dd46f965 handle SIGINT 2019-04-06 13:55:19 +08:00
Vincent Wei 3f53804f62 fix bugs 2019-03-31 15:38:39 +08:00
Vincent Wei f8e9dea491 tune release notes 2019-03-04 17:07:03 +08:00
Vincent Wei 8943cc75ec italic enabled for subpixeled glyph 2019-03-04 17:01:08 +08:00
Vincent Wei ebf765f4ad only override BITMAP size for monobitmap 2019-03-04 16:58:08 +08:00
Vincent Wei 3b61f25bb5 merge some changes from dev-3-4 for fix some bugs about freetype2 font engine and vbf font engine. 2019-03-04 12:55:09 +08:00
Vincent Wei ea20032dae fix a potential bug: reserve key when creating logfont by calling CreateLogFontIndirect 2019-01-19 14:06:18 +08:00
Vincent Wei 9245091b87 tune 2019-01-15 17:17:48 +08:00
Vincent Wei 747894247b tune release notes 2019-01-15 16:18:45 +08:00
68 changed files with 2579 additions and 2638 deletions
+1
View File
@@ -22,4 +22,5 @@ Makefile.in
/*.pc /*.pc
/*config.h /*config.h
/*config.h.in /*config.h.in
/*config.h.in~
+158 -148
View File
@@ -2,7 +2,6 @@
A mature and proven cross-platform GUI system for embedded and smart IoT devices. A mature and proven cross-platform GUI system for embedded and smart IoT devices.
## TABLE OF CONTENTS ## TABLE OF CONTENTS
1. Introduction 1. Introduction
@@ -18,96 +17,90 @@ 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 RTEMS, 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 (toolkit).
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-aliased stretch, and color combination.
functions like path, gradient, anti-aliase stretch, and color combination. * mGEff: mGEff provides an animation framework for MiniGUI app.
It also provides some popular UI/UE special effects.
* mGEff: mGEff provides an animation framework for MiniGUI app. * mGNCS: This component provides a new control set for MiniGUI app.
It also provides some popular UI/UE special effects. By using mGNCS, you can use miniStudio to develop MiniGUI app in
WYSIWYG way.
* mGNCS: This component provides a new control set for MiniGUI app. * mGNCS4Touch: This component provides some new controls, which are
By using mGNCS, you can use miniStudio to develop MiniGUI app in compliant to the new control API spec of mGNCS, for devices with
WYSIWYG way. a touch screen.
* mGNCS4Touch: This component provides some new controls, which are
compliant to the new control API spec of mGNCS, for devices with
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
components for MiniGUI core v3.2: components for MiniGUI 3.2.x:
* 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 soft keyboard, 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
out the graphics created by MiniGUI app to general-purpose printers.
* mG3d: A simple three-dimension component for MiniGUI. This component
provides a simple 3D API for app. You can use mG3d to create simple
3D UI.
* mGp: A printing component for MiniGUI. By using mGp, you can print MiniGUI is a free software project. In December 1998, the initiator of
out the graphics created by MiniGUI app to general-purpose printers. FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
License (GPL). In September 2002, the core developers of
* mG3d: A simple three-dimension component for MiniGUI. This component MiniGUI founded FMSoft and started the commercial marketing with
provides a simple 3D API for app. You can use mG3d to create simple the free software. By now, FMSoft still continues to release MiniGUI
3D UI.
MiniGUI is a free software project. In December 1998, the initiator of
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
License (GPL). In September 2002, the core developers of
MiniGUI founded FMSoft and started the commercial marketing with
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
from the download zone of the site: 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
provide a total solution for PMP (Portable Multimedia Player),
which uses MiniGUI as the graphics platform.
* mSpider, licensed under GPL 3.0, intends to provide a
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
* mGallery, licensed under Apache 2.0, intends to FMSoft had created the public repositories for MiniGUI core, MiniGUI
provide a total solution for PMP (Portable Multimedia Player),
which uses MiniGUI as the graphics platform.
* mSpider, licensed under GPL 3.0, intends to provide a
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
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. and
You can also download it from the official site of MiniGUI.
http://www.minigui.com/en/download <https://github.com/FMSoftCN>
We now maintain all documents about MiniGUI on the following public repo:
<https://github.com/VincentWei/minigui-docs>
## A BRIEF BUILDING INSTRUCTION ## A BRIEF BUILDING INSTRUCTION
@@ -154,7 +147,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 +157,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 About ten 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 +231,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 +240,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).
@@ -299,14 +292,14 @@ A brief history description of the development progress lay below:
## 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 +307,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,48 +325,65 @@ 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
Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. Copyright (C) 2002 ~ 2019, 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/>.
### Special Statement
The above open source or free software license does
not apply to any entity in the Exception List published by
Beijing FMSoft Technologies Co., Ltd.
If you are or the entity you represent is listed in the Exception List,
the above open source or free software license does not apply to you
or the entity you represent. Regardless of the purpose, you should not
use the software in any way whatsoever, including but not limited to
downloading, viewing, copying, distributing, compiling, and running.
If you have already downloaded it, you MUST destroy all of its copies.
The Exception List is published by FMSoft and may be updated
from time to time. For more information, please see
<https://www.fmsoft.cn/exception-list>.
+86 -66
View File
@@ -1,56 +1,76 @@
# Release Notes # Release Notes
## Version 3.2.3
The MiniGUI development team announces the availability of MiniGUI 3.2.3.
All users of MiniGUI are recommended strongly to use this version.
Please report any bugs and incompatibilities in
<https://github.com/VincentWei/minigui>
* ENHANCEMENTS:
- Support for RTEMS operating system.
* BUGFIXES:
- Fixed errors in makefile.ng files.
* CLEANUP:
- `README.md` for correct markdown tags.
### What's new in this version
## Version 3.2.2 ## Version 3.2.2
The MiniGUI development team announces the availability of MiniGUI 3.2.2. The MiniGUI development team announces the availability of MiniGUI 3.2.2.
All users of MiniGUI are recommended strongly to use this version. All users of MiniGUI are recommended strongly to use this version.
Please report any bugs and incompatibilities in 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
* ENHANCEMENTS: * ENHANCEMENTS:
1. Add a new key `dpi` for NEWGAL engine to define the DPI of the screen. 1. New API: `SyncUpdateDC`. You can use this function to synchronize
If it is absent, use 96 as the default DPI.
1. Add an item for `GetGDCapability` to return DPI of the DC.
1. New API `InitSlaveScreenEx` to specify the DPI of slave screen.
Define `InitSlaveScreen` as an inline function calling `InitSlaveScreenEx`.
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. New API `LoadDevFontFromIncoreData`. You can use this function to load
a device font from incore data.
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.
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.
1. Add an item for `GetGDCapability` to return DPI of the DC.
1. New API `InitSlaveScreenEx` to specify the DPI of slave screen.
Define `InitSlaveScreen` as an inline function calling `InitSlaveScreenEx`.
1. Enhance commlcd engint to support more pixel type and synchronously update. 1. Enhance commlcd engint to support more pixel type and synchronously update.
1. New USVFB IAL engine and NEWGAL engine for web display server. 1. New USVFB IAL engine and NEWGAL engine for web display server.
1. New type: `QDWORD` for a quauter of DWORD. This type is 16-bit long on 1. New type: `QDWORD` for a quauter of DWORD. This type is 16-bit long on
64-bit architecture, and 8-bit long on 32-bit. 64-bit architecture, and 8-bit long on 32-bit.
1. New macros for QDWORD: 1. New macros for QDWORD:
* `MAKEDWORD`: Make a DWROD from four QDWORDs. * `MAKEDWORD`: Make a DWROD from four QDWORDs.
* `FIRST_QDWORD`: get the first (LSB) QDWORD from a DWORD. * `FIRST_QDWORD`: get the first (LSB) QDWORD from a DWORD.
* `SECOND_QDWORD`: get the second (LSB) QDWORD from a DWORD. * `SECOND_QDWORD`: get the second (LSB) QDWORD from a DWORD.
* `THIRD_QDWORD`: get the third (LSB) QDWORD from a DWORD. * `THIRD_QDWORD`: get the third (LSB) QDWORD from a DWORD.
* `FOURTH_QDWORD`: get the fourth (LSB) QDWORD from a DWORD. * `FOURTH_QDWORD`: get the fourth (LSB) QDWORD from a DWORD.
1. New header for CommLCD NEWGAL engine and COMM IAL engine:
`<minigui/exstubs.h>`.
* 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. 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. This bug may generate dirty dots for monobitmap glyph from TTF.
1. Skip null pixels for SUBPIXEL glyphs. This bug will always show background 1. Skip null pixels for SUBPIXEL glyphs. This bug will always show background
pixels of one SUBPIXEL glyph. pixels of one SUBPIXEL glyph.
1. Fix the bug of wrong bounding box handling for SUBPIXEL rendering of glyph. 1. Fix the bug of wrong bounding box handling for SUBPIXEL rendering of glyph.
1. Tune cache implementation of FreeType2 font engine.
* TUNNING: * Enable cache for rotated LOGFONT.
1. Tune GLYPHINFO structure and GetGlyphInfo to return BIDI glyph type.
## Version 3.2.0 ## Version 3.2.0
@@ -58,12 +78,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
@@ -71,37 +91,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
@@ -114,7 +134,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.
@@ -124,12 +144,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
@@ -143,16 +163,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
@@ -161,7 +181,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)
@@ -169,7 +189,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
@@ -179,10 +199,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)
@@ -221,8 +241,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
@@ -233,8 +253,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
@@ -260,10 +280,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.
@@ -277,15 +297,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
@@ -293,7 +313,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
@@ -302,12 +322,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
@@ -317,15 +337,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
@@ -334,20 +354,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] CreateWindowEx2enhance of CreateWindowEx2, compatiable with CreateWindowEx2. * [NEW] CreateWindowEx2enhance 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
@@ -361,7 +381,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.
@@ -369,5 +389,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.
+2 -2
View File
@@ -1,4 +1,4 @@
Version 3.2.0 (2018/02/10) Version 3.2.3 (2019/10/31)
This release needs the following resource packages: This release needs the following resource packages:
@@ -6,4 +6,4 @@ This release needs the following resource packages:
The latest samples package is: The latest samples package is:
* mg-samples-3.2.0.tar.gz * mg-samples-3.2.2.tar.gz
+1
View File
@@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
./configure \ ./configure \
--with-runmode=ths \
--disable-dblclk \ --disable-dblclk \
--disable-cursor \ --disable-cursor \
--disable-mousecalibrate \ --disable-mousecalibrate \
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
RTEMS_DIR=/home/projects/movidius/m8_gui/tools/18.11.4/linux64/sparc-myriad-rtems-6.3.0
#RTEMS_GLOBAL_CFLAGS="-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -finit-priority"
rm -f config.cache config.status
CC=${RTEMS_DIR}/bin/sparc-myriad-rtems-gcc \
CFLAGS="-I${RTEMS_DIR}/sparc-myriad-rtems/include -I${RTEMS_DIR}/pnglib/include -I${RTEMS_DIR}/zlib/include" \
LDFLAGS="-L${RTEMS_DIR}/lib/gcc/sparc-myriad-rtems/6.3.0 -L${RTEMS_DIR}/pnglib/lib -L${RTEMS_DIR}/zlib/lib" \
./configure --prefix=/home/projects/movidius/m8_gui/tools/18.11.4/linux64/sparc-myriad-rtems-6.3.0/minigui \
--build=i686-linux \
--host=sparc-myriad-rtems \
--target=sparc-myriad-rtems \
--with-osname=rtems \
--with-runmode=ths \
--enable-miniguientry \
--enable-incoreres \
--disable-cursor \
--disable-videofbcon \
--disable-qvfbial \
--disable-vbfsupport \
--disable-qpfsupport \
--disable-latin9support \
--enable-gbksupport \
--disable-big5support \
--enable-unicodesupport \
--disable-savebitmap \
--disable-jpgsupport \
--disable-pngsupport \
--disable-aboutdlg \
--enable-adv2dapi \
--enable-videodummy \
--disable-consoleial \
--disable-videopcxvfb \
--with-targetname=external \
--enable-pngsupport \
--disable-develmode \
--disable-detaildebug \
--disable-tracemsg \
--enable-videocommlcd \
--enable-commial \
--disable-splash
+36
View File
@@ -0,0 +1,36 @@
# rules for pc-linux
# set your own targaet_os
TARGET_OS=linux
##################################################
# set your compile tool #
CC=gcc
CXX=g++
CPP=g++
AR=ar
AS=as
RANLIB=ranlib
MAKE=/usr/bin/make
##################################################
ARFLAGS=-rc
COFLAG=-c
OBJ=o
LIBA=a
##################################################
# if you don't want to create dynamic, delete it #
LIBSO=so
SOFLAGS=-fPIC -shared -o
##################################################
##################################################
# set your compile flags and install prefix path #
PREFIX=/usr/local
CFLAGS+=-g -Wall -fPIC `pkg-config --cflags freetype2`
LDFLAGS+=
##################################################
+32 -29
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60) AC_PREREQ(2.60)
AC_INIT(libminigui, 3.2.2) AC_INIT(libminigui, 3.2.3)
AC_CONFIG_SRCDIR(src/main/main.c) AC_CONFIG_SRCDIR(src/main/main.c)
dnl Set various version strings - taken gratefully from the SDL sources dnl Set various version strings - taken gratefully from the SDL sources
@@ -16,9 +16,9 @@ dnl Set various version strings - taken gratefully from the SDL sources
# #
MINIGUI_MAJOR_VERSION=3 MINIGUI_MAJOR_VERSION=3
MINIGUI_MINOR_VERSION=2 MINIGUI_MINOR_VERSION=2
MINIGUI_MICRO_VERSION=2 MINIGUI_MICRO_VERSION=3
MINIGUI_INTERFACE_AGE=0 MINIGUI_INTERFACE_AGE=0
MINIGUI_BINARY_AGE=1 MINIGUI_BINARY_AGE=3
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
AC_SUBST(MINIGUI_MAJOR_VERSION) AC_SUBST(MINIGUI_MAJOR_VERSION)
@@ -62,7 +62,7 @@ dnl ========================================================================
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_CHECK_HEADERS(sys/types.h sys/time.h termio.h unistd.h math.h locale.h) AC_CHECK_HEADERS(limits.h math.h locale.h unistd.h termio.h sys/types.h sys/time.h)
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
@@ -76,7 +76,7 @@ AC_FUNC_ALLOCA
AC_FUNC_MEMCMP AC_FUNC_MEMCMP
AC_FUNC_MMAP AC_FUNC_MMAP
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS(time mktime localtime strdup strcasecmp strncasecmp strerror setlocale getpt) AC_CHECK_FUNCS(time mktime localtime strdup strcasecmp strncasecmp strerror setlocale)
dnl ======================================================================== dnl ========================================================================
dnl User selectable options dnl User selectable options
@@ -89,8 +89,6 @@ message_string="no"
runtime_mode="procs" runtime_mode="procs"
stand_alone="no"
incore_res="no" incore_res="no"
use_miniguientry="no" use_miniguientry="no"
fixed_math="yes" fixed_math="yes"
@@ -304,10 +302,6 @@ AC_ARG_WITH(runmode,
[ --with-runmode=procs/ths/sa the MiniGUI runtime mode <default=procs>], [ --with-runmode=procs/ths/sa the MiniGUI runtime mode <default=procs>],
runtime_mode=$withval) runtime_mode=$withval)
AC_ARG_ENABLE(standalone,
[ --enable-standalone build MiniGUI-Standalone version <default=no>],
stand_alone=$enableval)
AC_ARG_ENABLE(incoreres, AC_ARG_ENABLE(incoreres,
[ --enable-incoreres use incore resource instead file IO to initialize MiniGUI <default=no>], [ --enable-incoreres use incore resource instead file IO to initialize MiniGUI <default=no>],
incore_res=$enableval) incore_res=$enableval)
@@ -389,7 +383,7 @@ AC_ARG_ENABLE(netial,
build_net_ial_engine=$enableval) build_net_ial_engine=$enableval)
AC_ARG_ENABLE(cisco_touchpad_ial, AC_ARG_ENABLE(cisco_touchpad_ial,
[ --enable-cisco_touchpad_ial build the IAL engine for Cisco Touchpad <default=no>], [ --enable-cisco_touchpad_ial build the IAL engine for Cisco Touchpad <default=no>],
build_cisco_touchpad_ial_engine=$enableval) build_cisco_touchpad_ial_engine=$enableval)
AC_ARG_ENABLE(mstar_ial, AC_ARG_ENABLE(mstar_ial,
@@ -732,9 +726,8 @@ AC_ARG_ENABLE(ctrlbidisledit,
[ --enable-ctrlbidisledit include Single-Line BIDI EDIT control <default=no>], [ --enable-ctrlbidisledit include Single-Line BIDI EDIT control <default=no>],
build_ctrl_bidisledit=$enableval) build_ctrl_bidisledit=$enableval)
dnl enable new textedit AC_ARG_ENABLE(ctrlnewtextedit,
AC_ARG_ENABLE(newtextedit, [ --disable-ctrlnewtextedit include the new implementation of TEXTEDIT control <default=yes>],
[ --enable-ctrlnewtextedit include the new implementation of TEXTEDIT control <default=yes>],
build_ctrl_textedit_new=$enableval) build_ctrl_textedit_new=$enableval)
AC_ARG_ENABLE(ctrllistbox, AC_ARG_ENABLE(ctrllistbox,
@@ -892,21 +885,21 @@ CheckXVFB()
[ --enable-videortosxvfb include RTOS Virtual FrameBuffer NEWGAL engine <default=no>. Please disable pcxvfb to enable rtosxvfb], [ --enable-videortosxvfb include RTOS Virtual FrameBuffer NEWGAL engine <default=no>. Please disable pcxvfb to enable rtosxvfb],
enable_video_rtos_xvfb=$enableval) enable_video_rtos_xvfb=$enableval)
if test "x$enable_video_pc_xvfb" = "xyes"; then if test "x$enable_video_pc_xvfb" = "xyes"; then
dnl CheckPCXVFB dnl CheckPCXVFB
AC_DEFINE(_MGGAL_PCXVFB, 1, AC_DEFINE(_MGGAL_PCXVFB, 1,
[Define if include PC Virtual FrameBuffer NEWGAL engine]) [Define if include PC Virtual FrameBuffer NEWGAL engine])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS pcxvfb" VIDEO_SUBDIRS="$VIDEO_SUBDIRS pcxvfb"
VIDEO_DRIVERS="$VIDEO_DRIVERS pcxvfb/libvideo_pcxvfb.la" VIDEO_DRIVERS="$VIDEO_DRIVERS pcxvfb/libvideo_pcxvfb.la"
else else
if test "x$enable_video_rtos_xvfb" = "xyes"; then if test "x$enable_video_rtos_xvfb" = "xyes"; then
dnl CheckRTOSXVFB dnl CheckRTOSXVFB
AC_DEFINE(_MGGAL_RTOSXVFB, 1, AC_DEFINE(_MGGAL_RTOSXVFB, 1,
[Define if include RTOS Virtual FrameBuffer NEWGAL engine]) [Define if include RTOS Virtual FrameBuffer NEWGAL engine])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS rtos_xvfb" VIDEO_SUBDIRS="$VIDEO_SUBDIRS rtos_xvfb"
VIDEO_DRIVERS="$VIDEO_DRIVERS rtos_xvfb/libvideo_rtos_xvfb.la" VIDEO_DRIVERS="$VIDEO_DRIVERS rtos_xvfb/libvideo_rtos_xvfb.la"
fi fi
fi fi
} }
@@ -1404,12 +1397,18 @@ case "$with_libsuffix" in
esac esac
AC_ARG_WITH(osname, AC_ARG_WITH(osname,
[ --with-osname=linux/uclinux/ecos/ucos2/swlinux/vxworks/win32/darwin/threadx/cygwin/nucleus/ose/psos]) [ --with-osname=linux/uclinux/ecos/ucos2/swlinux/vxworks/win32/darwin/threadx/cygwin/nucleus/ose/psos/rtems])
dnl configure.in file is used only for the following OSes: linux/uclinux/swlinux/ecos/darwin/cygwin dnl configure.in file is used only for the following OSes: linux/uclinux/swlinux/ecos/darwin/cygwin
dnl for other OSes, you should use makefile.ng or else. dnl for other OSes, you should use makefile.ng or else.
case "$with_osname" in case "$with_osname" in
rtems)
AC_DEFINE(__RTEMS__, 1,
[Define if compile for rtems])
AC_DEFINE(__NOUNIX__, 1,
[Define if compile for non-UNIX like OS])
;;
uclinux) uclinux)
AC_DEFINE(__uClinux__, 1, AC_DEFINE(__uClinux__, 1,
[Define if compile for uClinux]) [Define if compile for uClinux])
@@ -1513,13 +1512,17 @@ AC_ARG_WITH(targetname,
S3C6410/S3C2440/S3C2410/hi3560a Define the target board name]) S3C6410/S3C2440/S3C2410/hi3560a Define the target board name])
case "$with_targetname" in case "$with_targetname" in
external)
AC_DEFINE(__TARGET_EXTERNAL__, 1,
[Define for targets which use GAL and/or IAL engines and define the interfaces externally])
;;
fmsoft) fmsoft)
AC_DEFINE(__TARGET_FMSOFT__, 1, AC_DEFINE(__TARGET_FMSOFT__, 1,
[Define for FMSoft internal use]) [Define for FMSoft internal use])
;; ;;
mstudio) mstudio)
AC_DEFINE(__TARGET_MSTUDIO__, 1, AC_DEFINE(__TARGET_MSTUDIO__, 1,
[Define for FMSoft miniStudio]) [Define for FMSoft miniStudio])
;; ;;
stb810) stb810)
AC_DEFINE(__TARGET_STB810__, 1, AC_DEFINE(__TARGET_STB810__, 1,
@@ -1547,11 +1550,11 @@ case "$with_targetname" in
;; ;;
bfin) bfin)
AC_DEFINE(__TARGET_BLACKFIN__, 1, AC_DEFINE(__TARGET_BLACKFIN__, 1,
[Define for Blackfin run uClinux]) [Define for Blackfin run uClinux])
;; ;;
c33l05) c33l05)
AC_DEFINE(__TARGET_C33L05__, 1, AC_DEFINE(__TARGET_C33L05__, 1,
[Define for EPSON C33L05 (axLinux)]) [Define for EPSON C33L05 (axLinux)])
;; ;;
S3C6410) S3C6410)
CFLAGS="$CFLAGS -D_WITH_TARGET_S3C6410" CFLAGS="$CFLAGS -D_WITH_TARGET_S3C6410"
@@ -2430,8 +2433,8 @@ fi
if test "x$build_ctrl_textedit_new" = "xyes"; then if test "x$build_ctrl_textedit_new" = "xyes"; then
AC_DEFINE(_MGCTRL_TEXTEDIT, 1, AC_DEFINE(_MGCTRL_TEXTEDIT, 1,
[Define if include TEXTEDIT control]) [Define if include TEXTEDIT control])
AC_DEFINE(_MGCTRL_TEXTEDIT_USE_NEW_IMPL, 1, AC_DEFINE(_MGCTRL_TEXTEDIT_USE_NEW_IMPL, 1,
[Define if use new implementation of TEXTEDIT control]) [Define if use new implementation of TEXTEDIT control])
fi fi
if test "x$build_splash" = "xyes"; then if test "x$build_splash" = "xyes"; then
+2 -2
View File
@@ -11,8 +11,8 @@ COMM_HDRS = \
common.h endianrw.h fixedmath.h \ common.h endianrw.h fixedmath.h \
minigui.h gdi.h window.h control.h \ minigui.h gdi.h window.h control.h \
own_malloc.h own_stdio.h \ own_malloc.h own_stdio.h \
xvfb.h customial.h \ xvfb.h customial.h exstubs.h \
dti.c dti.c
UCOSII_HDRS=ucos2_pthread.h ucos2_semaphore.h UCOSII_HDRS=ucos2_pthread.h ucos2_semaphore.h
THREADX_HDRS=threadx_pthread.h threadx_semaphore.h THREADX_HDRS=threadx_pthread.h threadx_semaphore.h
+1 -1
View File
@@ -1701,7 +1701,7 @@ typedef struct _GAL_Rect {
#endif #endif
/* Commonly used definitions */ /* Commonly used definitions */
#if !defined(__NOUNIX__) || defined (__ECOS__) #ifdef HAVE_LIMITS_H
#include <limits.h> #include <limits.h>
#endif #endif
+1 -1
View File
@@ -871,7 +871,7 @@ typedef LVNM_ITEMRUP *PLVNM_ITEMRUP;
*/ */
#define LVM_GETITEMSTATE 0xF128 #define LVM_GETITEMSTATE 0xF128
/** /*
* \def LVM_GETSELECTEDCOLUMN * \def LVM_GETSELECTEDCOLUMN
* \brief Retrieves the index of the currently selected column of a listview. * \brief Retrieves the index of the currently selected column of a listview.
* *
+14 -14
View File
@@ -51,11 +51,6 @@
#ifndef GUI_IAL_CUSTOM_H #ifndef GUI_IAL_CUSTOM_H
#define GUI_IAL_CUSTOM_H #define GUI_IAL_CUSTOM_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define IAL_MOUSE_LEFTBUTTON 1 #define IAL_MOUSE_LEFTBUTTON 1
#define IAL_MOUSE_RIGHTBUTTON 2 #define IAL_MOUSE_RIGHTBUTTON 2
#define IAL_MOUSE_MIDDLEBUTTON 4 #define IAL_MOUSE_MIDDLEBUTTON 4
@@ -67,12 +62,12 @@ extern "C" {
#define IAL_MOUSEEVENT 1 #define IAL_MOUSEEVENT 1
#define IAL_KEYEVENT 2 #define IAL_KEYEVENT 2
typedef struct tagINPUT typedef struct tagINPUT {
{
char* id; char* id;
// Initialization and termination // Initialization and termination
BOOL (*init_input) (struct tagINPUT *input, const char* mdev, const char* mtype); BOOL (*init_input) (struct tagINPUT *input, const char* mdev,
const char* mtype);
void (*term_input) (void); void (*term_input) (void);
// Mouse operations // Mouse operations
@@ -92,21 +87,26 @@ typedef struct tagINPUT
void (*set_leds) (unsigned int leds); void (*set_leds) (unsigned int leds);
// Event // Event
int (*wait_event) (int which, int maxfd, fd_set *in, fd_set *out, int (*wait_event) (int which, int maxfd, fd_set *in, fd_set *out,
fd_set *except, struct timeval *timeout); fd_set *except, struct timeval *timeout);
char mdev [MAX_PATH + 1]; char mdev [MAX_PATH + 1];
}INPUT; } INPUT;
#ifdef _MGIAL_CUSTOM #ifdef _MGIAL_CUSTOM
extern BOOL InitCustomInput (INPUT* input, const char* mdev, const char* mtype);
extern void TermCustomInput (void); #ifdef __cplusplus
#endif extern "C" {
#endif /* __cplusplus */
BOOL InitCustomInput (INPUT* input, const char* mdev, const char* mtype);
void TermCustomInput (void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* _MGIAL_CUSTOM */
#endif /* GUI_IAL_CUSTOM_H */ #endif /* GUI_IAL_CUSTOM_H */
+114
View File
@@ -0,0 +1,114 @@
/**
* \file exstubs.h
* \author Wei Yongming <vincent@minigui.org>
* \date 2019/04/07
*
* \brief This file is the header for NEWGAL/IAL engines which should be
* implemented by an external module.
*
\verbatim
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) 2007~2018, Beijing FMSoft Technologies Co., Ltd.
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/>.
\endverbatim
*/
/*
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
* pSOS, ThreadX, NuCleus, OSE, and Win32.
*/
#ifndef GUI_EXSTUBS_H
#define GUI_EXSTUBS_H
/* The pixel format defined by depth */
#define COMMLCD_PSEUDO_RGB332 1
#define COMMLCD_TRUE_RGB555 2
#define COMMLCD_TRUE_RGB565 3
#define COMMLCD_TRUE_RGB888 4
#define COMMLCD_TRUE_RGB0888 5
#define COMMLCD_TRUE_ARGB1555 6
#define COMMLCD_TRUE_ARGB8888 7
#define COMMLCD_TRUE_ABRG8888 8
#define COMMLCD_UPDATE_NONE 0
#define COMMLCD_UPDATE_SYNC 1
#define COMMLCD_UPDATE_ASYNC 2
struct commlcd_info {
int height; // vertical resolution of the screen
int width; // horinzontal resolution of the screen
int pitch; // Length of one scan line in bytes
int bpp; // Depth (bits-per-pixel)
int type; // Pixel type
int update_method; // Update method: none, asynchronously, or synchronously.
Uint8* fb; // Frame buffer
};
#define COMM_MOUSEINPUT 0x01
#define COMM_KBINPUT 0x02
#define COMM_MOUSELBUTTON 0x01
#define COMM_MOUSERBUTTON 0x04
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* external stubs for COMMLCD NEWGAL engine */
#ifdef _MGGAL_COMMLCD
int __commlcd_drv_init (void);
int __commlcd_drv_getinfo (struct commlcd_info *li,
int width, int height, int depth);
int __commlcd_drv_release (void);
int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
int __commlcd_drv_update (const RECT* rc_dirty);
#endif /* _MGGAL_COMMLCD */
#ifdef _MGIAL_COMM
int __comminput_init (void);
int __comminput_ts_getdata (short *x, short *y, short *button);
int __comminput_kb_getdata (short *key, short *status);
int __comminput_wait_for_input (struct timeval *timeout);
void __comminput_deinit (void);
#endif /* _MGIAL_COMM */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GUI_EXSTUBS_H */
+23 -18
View File
@@ -2769,7 +2769,7 @@ MG_EXPORT void GUIAPI RGB2Pixels (HDC hdc, const RGB* rgbs,
*/ */
static inline gal_pixel RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b) static inline gal_pixel RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b)
{ {
RGB rgb = {r, g, b, 0}; RGB rgb = {r, g, b, 0xFF};
gal_pixel pixel; gal_pixel pixel;
RGB2Pixels (hdc, &rgb, &pixel, 1); RGB2Pixels (hdc, &rgb, &pixel, 1);
@@ -6258,7 +6258,6 @@ MG_EXPORT BOOL GUIAPI ft2SetLcdFilter (LOGFONT* logfont, mg_FT_LcdFilter filter)
#endif #endif
#if defined(_MGFONT_QPF) || defined(_MGFONT_FT2) || defined(_MGFONT_TTF) || defined(_MGFONT_UPF)
/** /**
* \fn DEVFONT* GUIAPI LoadDevFontFromFile (const char* devfont_name, \ * \fn DEVFONT* GUIAPI LoadDevFontFromFile (const char* devfont_name, \
* const char* file_name) * const char* file_name)
@@ -6275,9 +6274,26 @@ MG_EXPORT BOOL GUIAPI ft2SetLcdFilter (LOGFONT* logfont, mg_FT_LcdFilter filter)
* *
* \sa GetNextDevFont, DestroyDynamicDevFont * \sa GetNextDevFont, DestroyDynamicDevFont
*/ */
MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name, MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name,
const char *file_name); const char *file_name);
/**
* \fn DEVFONT* GUIAPI LoadDevFontFromIncoreData (const char* devfont_name, \
* const void* data)
* \brief Load device font from incore data.
*
* This function can be used to load device font from incore data.
*
* \param devfont_name The device font name.
* \param data The pointer to the incore font data.
*
* \return the pointer to the new device font on success, NULL on error.
*
* \sa GetNextDevFont, DestroyDynamicDevFont
*/
MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromIncoreData (const char *devfont_name,
const void *data);
/** /**
* \fn void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont) * \fn void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont)
* \brief Destroy device font loaded dynamically from font file. * \brief Destroy device font loaded dynamically from font file.
@@ -6288,7 +6304,6 @@ MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name,
* \sa LoadDevFontFromFile * \sa LoadDevFontFromFile
*/ */
MG_EXPORT void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont); MG_EXPORT void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont);
#endif
/** @} end of font_fns */ /** @} end of font_fns */
@@ -8003,7 +8018,7 @@ MG_EXPORT HDC GUIAPI InitSlaveScreenEx (const char* name, const char* mode, int
* *
* \return Valid handle on success, HDC_INVALID on failure. * \return Valid handle on success, HDC_INVALID on failure.
*/ */
inline HDC InitSlaveScreen (const char* name, const char* mode) static inline HDC InitSlaveScreen (const char* name, const char* mode)
{ {
return InitSlaveScreenEx(name, mode, GDCAP_DPI_DEFAULT); return InitSlaveScreenEx(name, mode, GDCAP_DPI_DEFAULT);
} }
@@ -8760,10 +8775,8 @@ MG_EXPORT int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
MG_EXPORT int GUIAPI DrawGlyphString (HDC hdc, int x, int y, Glyph32* glyph_string, MG_EXPORT int GUIAPI DrawGlyphString (HDC hdc, int x, int y, Glyph32* glyph_string,
int len, int* adv_x, int* adv_y); int len, int* adv_x, int* adv_y);
#define GLYPH_INFO_TYPE 0x01 #define GLYPH_INFO_METRICS 0x01
#define GLYPH_INFO_BIDI_TYPE 0x02 #define GLYPH_INFO_BMP 0x02
#define GLYPH_INFO_METRICS 0x04
#define GLYPH_INFO_BMP 0x10
/*the type of glyph bitmap*/ /*the type of glyph bitmap*/
#define GLYPHBMP_TYPE_MONO 0x00 #define GLYPHBMP_TYPE_MONO 0x00
@@ -8780,18 +8793,10 @@ typedef struct _GLYPHINFO
/** /**
* The mask indicates if you want to get glyph type info, metrics, * The mask indicates if you want to get glyph type info, metrics,
* or bitmap infomation you want. Or'ed with the following values: * or bitmap infomation you want. Or'ed with the following values:
* - GLYPH_INFO_TYPE
* - GLYPH_INFO_BIDI_TYPE
* - GLYPH_INFO_METRICS * - GLYPH_INFO_METRICS
* - GLYPH_INFO_BMP * - GLYPH_INFO_BMP
*/ */
unsigned char mask; Uint32 mask;
/** The basic glyph type */
unsigned int glyph_type;
/** The BIDI glyph type */
unsigned int bidi_glyph_type;
/** The height of the glyph */ /** The height of the glyph */
int height; int height;
+78 -55
View File
@@ -2565,10 +2565,6 @@ MG_EXPORT void GUIAPI FreeFixStr (char* str);
* @{ * @{
*/ */
#ifndef _MGHAVE_CURSOR
static inline void do_nothing (void) { return; }
#endif
#ifdef _MGHAVE_CURSOR #ifdef _MGHAVE_CURSOR
/** /**
@@ -2730,12 +2726,34 @@ MG_EXPORT HCURSOR GUIAPI GetSystemCursor (int csrid);
* \return Handle to the current system cursor, zero means no current cursor. * \return Handle to the current system cursor, zero means no current cursor.
*/ */
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor (void); MG_EXPORT HCURSOR GUIAPI GetCurrentCursor (void);
#else #else
#define LoadCursorFromFile(filename) (do_nothing(), 0)
#define CreateCursor(x, y, w, h, ANDbs, XORbs, cr) (do_nothing(), 0) static inline HCURSOR LoadCursorFromFile(const char* filename) {
#define DestroyCursor(hcsr) (do_nothing(), 0) return (HCURSOR)0;
#define GetSystemCursor(csrid) (do_nothing(), 0) }
#define GetCurrentCursor() (do_nothing(), 0)
static inline HCURSOR CreateCursor(int xhotspot, int yhotspot, int w, int h,
const BYTE* pANDBits, const BYTE* pXORBits, int colornum) {
return (HCURSOR)0;
}
static inline HCURSOR GUIAPI CopyCursor (HCURSOR hcsr) {
return (HCURSOR)0;
}
static inline BOOL DestroyCursor (HCURSOR hcsr) {
return TRUE;
}
static inline HCURSOR GetSystemCursor (int csrid) {
return (HCURSOR)0;
}
static inline HCURSOR GUIAPI GetCurrentCursor (void) {
return (HCURSOR)0;
}
#endif /* _MGHAVE_CURSOR */ #endif /* _MGHAVE_CURSOR */
#define MAX_SYSCURSORINDEX 22 #define MAX_SYSCURSORINDEX 22
@@ -2843,6 +2861,7 @@ MG_EXPORT void GUIAPI GetCursorPos (POINT* ppt);
MG_EXPORT void GUIAPI SetCursorPos (int x, int y); MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
#ifdef _MGHAVE_CURSOR #ifdef _MGHAVE_CURSOR
/** /**
* \fn HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def) * \fn HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def)
* \brief Changes the current cursor. * \brief Changes the current cursor.
@@ -2861,40 +2880,7 @@ MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
* *
* \sa SetCursor, SetDefaultCursor, GetDefaultCursor * \sa SetCursor, SetDefaultCursor, GetDefaultCursor
*/ */
MG_EXPORT HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def); MG_EXPORT HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def);
/**
* \def SetCursor(hcsr)
* \brief Changes the current cursor.
*
* This function changes the current cursor to be \a hcsr.
*
* \param hcsr The expected cursor handle.
* \return The old cursor handle.
*
* \note This function defined as a macro calling \a SetCursorEx with
* passing \a set_def as FALSE.
*
* \sa SetCursorEx, SetDefaultCursor
*/
#define SetCursor(hcsr) SetCursorEx (hcsr, FALSE)
/**
* \def SetDefaultCursor(hcsr)
* \brief Changes the current cursor, and set it as the default cursor.
*
* This function changes the current cursor to be \a hcsr, and set it as
* the default cursor.
*
* \param hcsr The expected cursor handle.
* \return The old cursor handle.
*
* \note This function defined as a macro calling \a SetCursorEx with
* passing \a set_def as TRUE.
*
* \sa SetCursorEx, SetCursor
*/
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE)
/** /**
* \fn HCURSOR GUIAPI GetDefaultCursor (void) * \fn HCURSOR GUIAPI GetDefaultCursor (void)
@@ -2908,15 +2894,6 @@ MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
*/ */
MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void); MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void);
#else
#define SetCursorEx(hcsr, set_def) (do_nothing(), 0)
#define SetCursor(hcsr) (do_nothing(), 0)
#define SetDefaultCursor(hcsr) (do_nothing(), 0)
#define GetDefaultCursor() (do_nothing(), 0)
#endif /* _MGHAVE_CURSOR */
#ifdef _MGHAVE_CURSOR
/** /**
* \fn int GUIAPI ShowCursor (BOOL fShow) * \fn int GUIAPI ShowCursor (BOOL fShow)
* \brief Shows or hides cursor. * \brief Shows or hides cursor.
@@ -2932,9 +2909,55 @@ MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void);
* \return Cursor showing count value. * \return Cursor showing count value.
*/ */
MG_EXPORT int GUIAPI ShowCursor (BOOL fShow); MG_EXPORT int GUIAPI ShowCursor (BOOL fShow);
#else
#define ShowCursor(fShow) (do_nothing(), 0) #else /* _MGHAVE_CURSOR */
#endif /* _MGHAVE_CURSOR */
static inline HCURSOR SetCursorEx(HCURSOR hcsr, BOOL set_def) {
return (HCURSOR)0;
}
static inline HCURSOR GetDefaultCursor(void) {
return (HCURSOR)0;
}
static inline int GUIAPI ShowCursor (BOOL fShow) {
return 0;
}
#endif /* !_MGHAVE_CURSOR */
/**
* \def SetCursor(hcsr)
* \brief Changes the current cursor.
*
* This function changes the current cursor to be \a hcsr.
*
* \param hcsr The expected cursor handle.
* \return The old cursor handle.
*
* \note This function defined as a macro calling \a SetCursorEx with
* passing \a set_def as FALSE.
*
* \sa SetCursorEx, SetDefaultCursor
*/
#define SetCursor(hcsr) SetCursorEx (hcsr, FALSE)
/**
* \def SetDefaultCursor(hcsr)
* \brief Changes the current cursor, and set it as the default cursor.
*
* This function changes the current cursor to be \a hcsr, and set it as
* the default cursor.
*
* \param hcsr The expected cursor handle.
* \return The old cursor handle.
*
* \note This function defined as a macro calling \a SetCursorEx with
* passing \a set_def as TRUE.
*
* \sa SetCursorEx, SetCursor
*/
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE)
/** @} end of cursor_fns */ /** @} end of cursor_fns */
+5 -6
View File
@@ -4584,17 +4584,16 @@ typedef unsigned long RES_KEY;
/* define the incore res type */ /* define the incore res type */
typedef struct _INNER_RES { typedef struct _INNER_RES {
RES_KEY key; RES_KEY key;
Uint8* data; const Uint8* data;
int data_len; int data_len;
/* special param recognized by the TYPE_OPS /* The special param recognized by the TYPE_OPS normally it is NULL.
* normal is null. * If data is the data is a mem of raw png, jpeg, bmp
* is the data is a mem of raw png, jpeg, bmp
* and so on, it should be the extention name * and so on, it should be the extention name
* of the filename. eg. * of the filename. eg.
* INNER_RES res[]= { ... { ..., ... ,.., "png" } .. }; * INNER_RES res[]= { ... { ..., ... ,.., "png" } .. };
* */ * */
void* additional; const void* additional;
} INNER_RES; } INNER_RES;
/* the type of resource */ /* the type of resource */
+2 -13
View File
@@ -14,7 +14,6 @@ include $(abs_top_srcdir)/$(TARGET_RULES)
# Flags that can be set on the nmake command line: # Flags that can be set on the nmake command line:
# DEBUG=1 for compiling a debugging version # DEBUG=1 for compiling a debugging version
# PREFIX=Some/Directory Base directory for installation # PREFIX=Some/Directory Base directory for installation
# CONFIGH=YourConfigHeader for defining the mgconfig.h file to use
ifndef DEBUG ifndef DEBUG
DEBUG=0 DEBUG=0
@@ -37,8 +36,6 @@ docdir = $(datadir)/doc/minigui
# The directory where the include files will be installed # The directory where the include files will be installed
libminiguiincludedir = $(includedir)/minigui libminiguiincludedir = $(includedir)/minigui
libmgextincludedir = $(includedir)/minigui
# Programs used by "make": # Programs used by "make":
CP = cp CP = cp
@@ -93,14 +90,6 @@ TIFF_LIBS = $(TIFF_NOLZW_LIBS)
ZLIB_CFLAGS = -I $(ZLIB) ZLIB_CFLAGS = -I $(ZLIB)
ZLIB_LIBS = $(ZLIB)/zlib.lib ZLIB_LIBS = $(ZLIB)/zlib.lib
ifdef COMPILE_MGEXTLIB
MGEXT_CFLAGS = -D__MGEXT_LIB__
else
MGEXT_CFLAGS =
endif
MG_PRE_DEFINES = -D__MINIGUI_LIB__ $(MGEXT_CFLAGS)
################################################################################# #################################################################################
ifdef LOCAL_INC ifdef LOCAL_INC
@@ -119,10 +108,10 @@ endif
DEPLIBINC = -I$(DEPLIBDIR)/include DEPLIBINC = -I$(DEPLIBDIR)/include
CFLAGS += $(OPTIMIZE) $(DEBUGINFO) $(DEPLIBINC) $(INCLUDES) $(DEFINES) $(DEPCFLAGS) $(MG_PRE_DEFINES) -c CFLAGS += $(OPTIMIZE) $(DEBUGINFO) $(DEPLIBINC) $(DEFINES) $(DEPCFLAGS) -c
DEFS += -D__MINIGUI_LIB__ -D_REENTRANT DEFS += -D__MINIGUI_LIB__ -D_REENTRANT
CFLAGS += -I$(abs_top_srcdir) $(INCLUDES) $(DEFS) $(INCS) CFLAGS += -I$(abs_top_srcdir) -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/include $(INCLUDES) $(DEFS) $(INCS)
%.$(OBJ): %.c %.$(OBJ): %.c
$(CC) $(CFLAGS) $(COFLAG) $< $(CC) $(CFLAGS) $(COFLAG) $<
+168 -168
View File
File diff suppressed because it is too large Load Diff
+217 -217
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -1,4 +1,5 @@
abs_top_srcdir=../.. abs_top_srcdir=../..
LOCAL_INC=-I$(abs_top_srcdir)/src/control/
include Makefile.am include Makefile.am
include ../../rules.make include ../../rules.make
+110 -63
View File
@@ -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/>.
*/ */
@@ -103,7 +103,7 @@ void font_ResetDevFont (void)
#define MATCHED_FAMILY 0x02 #define MATCHED_FAMILY 0x02
#define MATCHED_CHARSET 0x04 #define MATCHED_CHARSET 0x04
static DEVFONT* get_matched_devfont (LOGFONT* log_font, DEVFONT* list_head, static DEVFONT* get_matched_devfont (LOGFONT* log_font, DEVFONT* list_head,
int list_len, char* req_charset) int list_len, char* req_charset)
{ {
int i = 0; int i = 0;
@@ -160,8 +160,8 @@ static DEVFONT* get_matched_devfont (LOGFONT* log_font, DEVFONT* list_head,
if ((match_bits [i] & MATCHED_TYPE) if ((match_bits [i] & MATCHED_TYPE)
&& (match_bits [i] & MATCHED_FAMILY) && (match_bits [i] & MATCHED_FAMILY)
&& (match_bits [i] & MATCHED_CHARSET)) { && (match_bits [i] & MATCHED_CHARSET)) {
error = log_font->size - error = log_font->size -
(*dev_font->font_ops->get_font_size) (log_font, dev_font, (*dev_font->font_ops->get_font_size) (log_font, dev_font,
log_font->size); log_font->size);
error = ABS (error); error = ABS (error);
if (min_error >= error) { /* use >=, make the later has a higher priority */ if (min_error >= error) { /* use >=, make the later has a higher priority */
@@ -178,7 +178,7 @@ static DEVFONT* get_matched_devfont (LOGFONT* log_font, DEVFONT* list_head,
FreeFixStr ((char*)match_bits); FreeFixStr ((char*)match_bits);
#endif #endif
matched_font->font_ops->get_font_size (log_font, matched_font, matched_font->font_ops->get_font_size (log_font, matched_font,
log_font->size); log_font->size);
return matched_font; return matched_font;
@@ -189,7 +189,7 @@ static DEVFONT* get_matched_devfont (LOGFONT* log_font, DEVFONT* list_head,
for (i = 0; i < list_len; i++) { for (i = 0; i < list_len; i++) {
int error; int error;
if (match_bits [i] & MATCHED_CHARSET) { if (match_bits [i] & MATCHED_CHARSET) {
error = log_font->size - error = log_font->size -
(*dev_font->font_ops->get_font_size) (log_font, dev_font, log_font->size); (*dev_font->font_ops->get_font_size) (log_font, dev_font, log_font->size);
error = ABS (error); error = ABS (error);
if (min_error >= error) { /* use >=, make the later has a higher priority */ if (min_error >= error) { /* use >=, make the later has a higher priority */
@@ -218,12 +218,12 @@ DEVFONT* font_GetMatchedSBDevFont (LOGFONT* log_font)
/*mbc logfont --- sbc devfont*/ /*mbc logfont --- sbc devfont*/
char sysfont_charset [LEN_FONT_NAME + 1]; char sysfont_charset [LEN_FONT_NAME + 1];
fontGetCharsetFromName (g_SysLogFont[0]->sbc_devfont->name, sysfont_charset); fontGetCharsetFromName (g_SysLogFont[0]->sbc_devfont->name, sysfont_charset);
matched_devfont = get_matched_devfont (log_font, sb_dev_font_head, matched_devfont = get_matched_devfont (log_font, sb_dev_font_head,
nr_sb_dev_fonts, sysfont_charset); nr_sb_dev_fonts, sysfont_charset);
} }
else { else {
/*sbc logfont --- sbc devfont*/ /*sbc logfont --- sbc devfont*/
matched_devfont = get_matched_devfont (log_font, sb_dev_font_head, matched_devfont = get_matched_devfont (log_font, sb_dev_font_head,
nr_sb_dev_fonts,log_font->charset); nr_sb_dev_fonts,log_font->charset);
} }
@@ -240,7 +240,7 @@ DEVFONT* font_GetMatchedMBDevFont (LOGFONT* log_font)
return NULL; return NULL;
/*mbc logfont --- mbc devfont*/ /*mbc logfont --- mbc devfont*/
else else
return get_matched_devfont (log_font, mb_dev_font_head, return get_matched_devfont (log_font, mb_dev_font_head,
nr_mb_dev_fonts, log_font->charset); nr_mb_dev_fonts, log_font->charset);
} }
@@ -265,7 +265,7 @@ unsigned short font_GetBestScaleFactor (int height, int expect)
{ {
int error, min_error; int error, min_error;
unsigned short scale = 1; unsigned short scale = 1;
min_error = height - expect; min_error = height - expect;
min_error = ABS (min_error); min_error = ABS (min_error);
@@ -322,10 +322,10 @@ void dbg_dumpDevFonts (void)
/***** Added in MiniGUI V2.2 for bitmap font *****/ /***** Added in MiniGUI V2.2 for bitmap font *****/
/* /*
* Removes an element from single-byte devfont linked list. If two elements * Removes an element from single-byte devfont linked list. If two elements
* contain the same data, only the first is removed. If none of the elements * contain the same data, only the first is removed. If none of the elements
* contain the data, the single-byte devfont linked list is unchanged * contain the data, the single-byte devfont linked list is unchanged
*/ */
void font_DelSBDevFont (DEVFONT* dev_font) void font_DelSBDevFont (DEVFONT* dev_font)
{ {
@@ -334,27 +334,27 @@ void font_DelSBDevFont (DEVFONT* dev_font)
tmp = sb_dev_font_head; tmp = sb_dev_font_head;
while (tmp != NULL) { while (tmp != NULL) {
if (tmp == dev_font) { if (tmp == dev_font) {
if (prev != NULL) if (prev != NULL)
prev->next = tmp->next; prev->next = tmp->next;
else else
sb_dev_font_head = tmp->next; sb_dev_font_head = tmp->next;
nr_sb_dev_fonts --; nr_sb_dev_fonts --;
break; break;
} }
prev = tmp; prev = tmp;
tmp = prev->next; tmp = prev->next;
} }
return; return;
} }
/* /*
* Removes an element from multiple-byte devfont linked list. If two elements * Removes an element from multiple-byte devfont linked list. If two elements
* contain the same data, only the first is removed. If none of the elements * contain the same data, only the first is removed. If none of the elements
* contain the data, the multiple-byte devfont linked list is unchanged * contain the data, the multiple-byte devfont linked list is unchanged
*/ */
void font_DelMBDevFont (DEVFONT* dev_font) void font_DelMBDevFont (DEVFONT* dev_font)
{ {
@@ -369,31 +369,55 @@ void font_DelMBDevFont (DEVFONT* dev_font)
mb_dev_font_head = tmp->next; mb_dev_font_head = tmp->next;
nr_mb_dev_fonts --; nr_mb_dev_fonts --;
break; break;
} }
prev = tmp; prev = tmp;
tmp = prev->next; tmp = prev->next;
} }
return; return;
} }
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filename) static DEVFONT* find_devfont(const char* font_name, BOOL is_mbc_list)
{
DEVFONT* head;
DEVFONT* cur;
if (is_mbc_list) {
head = mb_dev_font_head;
}
else {
head = sb_dev_font_head;
}
cur = head;
while (cur) {
if (strcasecmp (cur->name, font_name) == 0) {
return cur;
}
cur = cur->next;
}
return NULL;
}
static DEVFONT* make_devfont (const char* font_name, const void* data, BOOL is_filename)
{ {
FONTOPS_INFO* fontops_info = __mg_fontops_infos; FONTOPS_INFO* fontops_info = __mg_fontops_infos;
DEVFONT* devfont; DEVFONT* devfont;
CHARSETOPS* charset_ops; CHARSETOPS* charset_ops;
char charset [LEN_FONT_NAME + 1]; char charset [LEN_FONT_NAME + 1];
/*find the FONTOPS and LOADER*/ /*find the FONTOPS and LOADER*/
while (fontops_info->type) { while (fontops_info->type) {
if (strncmp (font_name, fontops_info->type, FONT_TYPE_NAME_LEN) == 0) if (strncmp (font_name, fontops_info->type, FONT_TYPE_NAME_LEN) == 0)
break; break;
fontops_info++; fontops_info++;
} }
if (fontops_info->type == NULL) { if (fontops_info->type == NULL) {
_MG_PRINTF ("FONT>DevFont: invalid font type: %s.\n", font_name); _MG_PRINTF ("FONT>DevFont: invalid font type: %s.\n", font_name);
return NULL; return NULL;
@@ -406,11 +430,17 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
} }
if ((charset_ops = GetCharsetOpsEx (charset)) == NULL) { if ((charset_ops = GetCharsetOpsEx (charset)) == NULL) {
_MG_PRINTF ("FONT>DevFont: Invalid charset name %s of font %s.\n", _MG_PRINTF ("FONT>DevFont: Invalid charset name %s of font %s.\n",
charset, font_name); charset, font_name);
return NULL; return NULL;
} }
if (find_devfont(font_name, (charset_ops->bytes_maxlen_char > 1))) {
_MG_PRINTF ("FONT>DevFont: Duplicated devfont name (%s)",
font_name);
return NULL;
}
devfont = calloc (1, sizeof (DEVFONT)); devfont = calloc (1, sizeof (DEVFONT));
devfont->font_ops = fontops_info->fontops; devfont->font_ops = fontops_info->fontops;
@@ -421,7 +451,7 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
devfont->data = devfont->font_ops->load_font_data (font_name, data); devfont->data = devfont->font_ops->load_font_data (font_name, data);
if (devfont->data == NULL) { if (devfont->data == NULL) {
_MG_PRINTF ("FONT>DevFont: error in loading font %s from %s file.\n", _MG_PRINTF ("FONT>DevFont: error in loading font %s from %s file.\n",
font_name, (const char*) data); font_name, (const char*) data);
free (devfont); free (devfont);
return NULL; return NULL;
@@ -429,7 +459,7 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
devfont->need_unload = TRUE; devfont->need_unload = TRUE;
} }
else { else {
devfont->data = data; devfont->data = (void*)data;
devfont->need_unload = FALSE; devfont->need_unload = FALSE;
} }
@@ -562,7 +592,7 @@ static UPFINFO* incore_upfonts [] = {
&__mgif_upf_times_12x10, &__mgif_upf_times_12x10,
&__mgif_upf_times_17x14, &__mgif_upf_times_17x14,
#endif #endif
NULL NULL
}; };
#define NR_UPFONTS (sizeof (incore_upfonts) / sizeof (UPFINFO*)) #define NR_UPFONTS (sizeof (incore_upfonts) / sizeof (UPFINFO*))
@@ -649,7 +679,7 @@ static void del_all_devfonts (void)
DEVFONT* cur; DEVFONT* cur;
DEVFONT* head; DEVFONT* head;
head = sb_dev_font_head; head = sb_dev_font_head;
one_list: one_list:
cur = head; cur = head;
while (cur) { while (cur) {
@@ -674,8 +704,8 @@ one_list:
*/ */
static inline void del_devfont_from_list(const char* font_name, BOOL is_mbc_list) static inline void del_devfont_from_list(const char* font_name, BOOL is_mbc_list)
{ {
DEVFONT* head; DEVFONT* head;
DEVFONT* cur; DEVFONT* cur;
DEVFONT* prev; DEVFONT* prev;
@@ -691,11 +721,11 @@ static inline void del_devfont_from_list(const char* font_name, BOOL is_mbc_list
prev = NULL; prev = NULL;
} }
while (cur) { while (cur) {
if (strcmp (cur->name, font_name) == 0) { if (strcmp (cur->name, font_name) == 0) {
/*unload cur->data*/ /*unload cur->data*/
if (!cur->relationship && cur->need_unload) if (!cur->relationship && cur->need_unload)
cur->font_ops->unload_font_data (cur->data); cur->font_ops->unload_font_data (cur->data);
if (cur == head) { if (cur == head) {
cur = cur->next; cur = cur->next;
@@ -705,20 +735,20 @@ static inline void del_devfont_from_list(const char* font_name, BOOL is_mbc_list
} }
else { else {
prev->next = cur->next; prev->next = cur->next;
free (cur); free (cur);
cur = prev->next; cur = prev->next;
} }
if (is_mbc_list) if (is_mbc_list)
nr_mb_dev_fonts--; nr_mb_dev_fonts--;
else else
nr_sb_dev_fonts--; nr_sb_dev_fonts--;
} }
else { else {
prev = cur; prev = cur;
cur = cur->next; cur = cur->next;
} }
} }
if (is_mbc_list) if (is_mbc_list)
mb_dev_font_head = head; mb_dev_font_head = head;
@@ -738,10 +768,22 @@ static void font_DelDevFont (const char* font_name)
del_devfont_from_list(font_name, FALSE); del_devfont_from_list(font_name, FALSE);
} }
DEVFONT* GUIAPI LoadDevFontFromFile DEVFONT* GUIAPI LoadDevFontFromIncoreData(const char *devfont_name,
(const char *devfont_name, const char *file_name) const void *data)
{ {
DEVFONT* devfont = make_devfont (devfont_name, (char*)file_name, TRUE); DEVFONT* devfont = make_devfont (devfont_name, data, FALSE);
if (devfont == NULL)
return NULL;
ADD_DEVFONT_TO_LINKLIST (devfont);
add_relating_devfonts_to_list (devfont);
return devfont;
}
DEVFONT* GUIAPI LoadDevFontFromFile(const char *devfont_name,
const char *file_name)
{
DEVFONT* devfont = make_devfont (devfont_name, file_name, TRUE);
if (devfont == NULL) if (devfont == NULL)
return NULL; return NULL;
@@ -752,7 +794,12 @@ DEVFONT* GUIAPI LoadDevFontFromFile
void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont) void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
{ {
font_DelDevFont ((*devfont)->name); char font_name [LEN_UNIDEVFONT_NAME + 1];
memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
font_DelDevFont (font_name);
*devfont = NULL; *devfont = NULL;
} }
@@ -763,13 +810,13 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
char font_name [LEN_UNIDEVFONT_NAME + 1]; char font_name [LEN_UNIDEVFONT_NAME + 1];
char font_file [MAX_PATH+1]; char font_file [MAX_PATH+1];
char font_path [MAX_PATH+1]; char font_path [MAX_PATH+1];
char *font_file_name = NULL; char *font_file_name = NULL;
MEM_RES* memres = NULL; MEM_RES* memres = NULL;
char key[12]; char key[32];
int added_num = 0; int added_num = 0;
font_file_name = font_file; font_file_name = font_file;
/*get font number in minigui etc*/ /*get font number in minigui etc*/
if (GetMgEtcIntValue (etc_section, "font_number", &font_num) < 0 ) { if (GetMgEtcIntValue (etc_section, "font_number", &font_num) < 0 ) {
@@ -782,14 +829,14 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
for (i=0; i<font_num; i++) { for (i=0; i<font_num; i++) {
snprintf (key, sizeof(key)-1, "name%d", i); snprintf (key, sizeof(key)-1, "name%d", i);
if (GetMgEtcValue (etc_section, key, font_name, LEN_UNIDEVFONT_NAME) < 0) { if (GetMgEtcValue (etc_section, key, font_name, LEN_UNIDEVFONT_NAME) < 0) {
_MG_PRINTF ("FONT>DevFont: can't get name of key %s in section %s.\n", _MG_PRINTF ("FONT>DevFont: can't get name of key %s in section %s.\n",
key, etc_section); key, etc_section);
continue; continue;
} }
snprintf (key, sizeof(key)-1, "fontfile%d", i); snprintf (key, sizeof(key)-1, "fontfile%d", i);
if (GetMgEtcValue (etc_section, key, font_file_name, MAX_PATH) < 0) { if (GetMgEtcValue (etc_section, key, font_file_name, MAX_PATH) < 0) {
_MG_PRINTF ("FONT>DevFont: can't get font_file of key %s in section %s.\n", _MG_PRINTF ("FONT>DevFont: can't get font_file of key %s in section %s.\n",
key, etc_section); key, etc_section);
continue; continue;
} }
@@ -808,7 +855,7 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
else { else {
/* [DK] Fix Bug #4801, which introduce a absolute path check error in Windows, /* [DK] Fix Bug #4801, which introduce a absolute path check error in Windows,
* first to load from sytem res path, else load it directly(relative or absolute path).*/ * first to load from sytem res path, else load it directly(relative or absolute path).*/
if ((0 == mg_path_joint(font_path, MAX_PATH + 1, sysres_get_system_res_path(), font_file)) if ((0 == mg_path_joint(font_path, MAX_PATH + 1, sysres_get_system_res_path(), font_file))
&& ((AddDevFont (font_name, font_path, TRUE)) == TRUE)) && ((AddDevFont (font_name, font_path, TRUE)) == TRUE))
added_num++; added_num++;
else if ((AddDevFont (font_name, font_file, TRUE)) == TRUE) else if ((AddDevFont (font_name, font_file, TRUE)) == TRUE)
+142 -150
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -294,7 +294,7 @@ static void start_str_output (LOGFONT* logfont, DEVFONT* devfont)
/* call this function before getting the bitmap/pixmap of the char /* call this function before getting the bitmap/pixmap of the char
* to get the bbox of the char */ * to get the bbox of the char */
static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont, static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
const Glyph32 glyph_value, Glyph32 glyph_value,
int* px, int* py, int* pwidth, int* pheight) int* px, int* py, int* pwidth, int* pheight)
{ {
TT_UShort uni_char; TT_UShort uni_char;
@@ -440,7 +440,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
/* call this function to get the bitmap/pixmap of the char */ /* call this function to get the bitmap/pixmap of the char */
static const void* static const void*
char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont, char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
const Glyph32 glyph_value, int* pitch, BOOL is_grey) Glyph32 glyph_value, SIZE* sz, int* pitch, BOOL is_grey)
{ {
TT_Raster_Map Raster; TT_Raster_Map Raster;
TT_Error error; TT_Error error;
@@ -538,23 +538,23 @@ char_bitmap_pixmap (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)
{ {
if (scale) *scale = 1; if (scale) *scale = 1;
return char_bitmap_pixmap (logfont, devfont, glyph_value, pitch, FALSE); return char_bitmap_pixmap (logfont, devfont, glyph_value, sz, pitch, FALSE);
} }
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont, static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
const Glyph32 glyph_value, int* pitch, unsigned short* scale) Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
{ {
if (scale) *scale = 1; if (scale) *scale = 1;
return char_bitmap_pixmap (logfont, devfont, glyph_value, pitch, TRUE); return char_bitmap_pixmap (logfont, devfont, glyph_value, sz, pitch, TRUE);
} }
/* call this function after getting the bitmap/pixmap of the char /* call this function after getting the bitmap/pixmap of the char
* to get the advance of the char */ * to get the advance of the char */
static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont, static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
const Glyph32 glyph_value, int* px, int* py) Glyph32 glyph_value, int* px, int* py)
{ {
TT_Pos vec_x, vec_y; TT_Pos vec_x, vec_y;
TTFINSTANCEINFO* ttf_inst_info = TTF_INST_INFO_P (devfont); TTFINSTANCEINFO* ttf_inst_info = TTF_INST_INFO_P (devfont);
+160 -136
View File
File diff suppressed because it is too large Load Diff
+12 -11
View File
@@ -63,13 +63,12 @@ extern "C" {
#ifdef _MGFONT_TTF_CACHE #ifdef _MGFONT_TTF_CACHE
typedef unsigned long HCACHE; typedef unsigned long 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
@@ -114,26 +113,28 @@ 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, DWORD style, int size, extern HCACHE __mg_ttc_create(const char *df_name,
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey); int style, int size, int rotation,
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, UChar32 unicode, int *size);
unsigned short unicode, int *size);
extern HCACHE __mg_ttc_is_exist(char *family, char *charset,
DWORD style, int size);
extern void __mg_ttc_refer(HCACHE hCache); extern void __mg_ttc_refer(HCACHE hCache);
#endif #endif
+2 -1
View File
@@ -1,4 +1,5 @@
abs_top_srcdir=../../../ abs_top_srcdir=../../..
LOCAL_INC=-I$(abs_top_srcdir)/src/font/
include Makefile.am include Makefile.am
include ../../../rules.make include ../../../rules.make
+6 -2
View File
@@ -259,10 +259,14 @@ PLOGFONT GUIAPI CreateLogFontIndirect (LOGFONT *logfont)
if (!logfont) return NULL; if (!logfont) return NULL;
if ((font = malloc (sizeof (LOGFONT))) == NULL) // VincentWei: make sure the logfont has the key for resource manager.
//if ((font = malloc (sizeof (LOGFONT))) == NULL)
if ((font = (PLOGFONT)malloc (sizeof (FONT_RES))) == NULL)
return INV_LOGFONT; return INV_LOGFONT;
// VincentWei: make sure the logfont has an invalid key for resource manager.
memcpy (font, logfont, sizeof(LOGFONT)); memcpy (font, logfont, sizeof(LOGFONT));
((FONT_RES *)font)->key = -1;
sbc_devfont = logfont->sbc_devfont; sbc_devfont = logfont->sbc_devfont;
if (sbc_devfont->font_ops->new_instance) if (sbc_devfont->font_ops->new_instance)
+3 -3
View File
@@ -329,7 +329,7 @@ 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;
@@ -345,7 +345,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */ if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
unsigned char ascii_ch = uc16; unsigned char ascii_ch = uc16;
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont, return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
logfont->sbc_devfont, ascii_ch, pitch, scale); logfont->sbc_devfont, ascii_ch, sz, pitch, scale);
} }
else else
glyph = &def_glyph; glyph = &def_glyph;
@@ -365,7 +365,7 @@ 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;
+1 -1
View File
@@ -208,7 +208,7 @@ 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; Glyph32 glyph_tmp = glyph_value;
+1 -1
View File
@@ -466,7 +466,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;
+1 -1
View File
@@ -101,7 +101,7 @@ BOOL mg_InitSysFont (void)
memset (sys_fonts, 0, nr_fonts * sizeof (PLOGFONT)); memset (sys_fonts, 0, nr_fonts * sizeof (PLOGFONT));
for (i = 0; i < nr_fonts; i++) { for (i = 0; i < nr_fonts; i++) {
char key [11]; char key [32];
char type [LEN_FONT_NAME + 1]; char type [LEN_FONT_NAME + 1];
char family [LEN_FONT_NAME + 1]; char family [LEN_FONT_NAME + 1];
char style [LEN_FONT_NAME + 1]; char style [LEN_FONT_NAME + 1];
+3 -3
View File
@@ -279,7 +279,7 @@ print_bitmap(char* bits, int width, int height, int pitch)
#endif #endif
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;
UPFGLYPH* glyph; UPFGLYPH* glyph;
@@ -300,7 +300,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */ if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
unsigned char ascii_ch = uc16; unsigned char ascii_ch = uc16;
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont, return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
logfont->sbc_devfont, ascii_ch, pitch, scale); logfont->sbc_devfont, ascii_ch, sz, pitch, scale);
} }
else else
glyph = &def_glyph; glyph = &def_glyph;
@@ -326,7 +326,7 @@ 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;
UPFGLYPH* glyph; UPFGLYPH* glyph;
+7 -5
View File
@@ -111,6 +111,9 @@ static int get_ch_width (LOGFONT* logfont, DEVFONT* devfont,
if (vbf_info->bits_offset == NULL) if (vbf_info->bits_offset == NULL)
return vbf_info->max_width * scale; return vbf_info->max_width * scale;
if (glyph_value < vbf_info->first_glyph || glyph_value > vbf_info->last_glyph)
glyph_value = vbf_info->def_glyph;
return vbf_info->advance_x [glyph_value - vbf_info->first_glyph] * scale; return vbf_info->advance_x [glyph_value - vbf_info->first_glyph] * scale;
} }
@@ -234,10 +237,9 @@ static int get_glyph_advance (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 offset; int offset;
Glyph32 eff_value = glyph_value;
Glyph32 first_value; Glyph32 first_value;
Glyph32 last_value; Glyph32 last_value;
VBFINFO* vbf_info = VARFONT_INFO_P (devfont); VBFINFO* vbf_info = VARFONT_INFO_P (devfont);
@@ -246,13 +248,13 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
last_value = vbf_info->last_glyph; last_value = vbf_info->last_glyph;
if (glyph_value < first_value || glyph_value > last_value) if (glyph_value < first_value || glyph_value > last_value)
eff_value = vbf_info->def_glyph; glyph_value = vbf_info->def_glyph;
if (vbf_info->bits_offset == NULL) if (vbf_info->bits_offset == NULL)
offset = (((size_t)vbf_info->max_width + 7) >> 3) * vbf_info->height offset = (((size_t)vbf_info->max_width + 7) >> 3) * vbf_info->height
* (eff_value - first_value); * (glyph_value - first_value);
else { else {
offset = vbf_info->bits_offset [eff_value - vbf_info->first_glyph]; offset = vbf_info->bits_offset [glyph_value - vbf_info->first_glyph];
#if MGUI_BYTEORDER == MGUI_BIG_ENDIAN #if MGUI_BYTEORDER == MGUI_BIG_ENDIAN
if (vbf_info->font_size) if (vbf_info->font_size)
offset = ArchSwap16 (offset); offset = ArchSwap16 (offset);
+1 -1
View File
@@ -259,7 +259,7 @@ BOOL GUIAPI SetWindowElementRenderer (HWND hWnd, const char* werdr_name,
pwnd = MG_GET_WINDOW_PTR(hWnd); pwnd = MG_GET_WINDOW_PTR(hWnd);
if (NULL == pwnd || if (NULL == pwnd ||
((NULL == werdr_name || '\0' == werdr_name) && NULL == we_attrs)) ((NULL == werdr_name || '\0' == *werdr_name) && NULL == we_attrs))
{ {
return FALSE; return FALSE;
} }
+395 -395
View File
File diff suppressed because it is too large Load Diff
+12 -27
View File
@@ -1,39 +1,39 @@
/* /*
* 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/>.
*/ */
/* /*
** comminput.c: Common Input Engine for eCos, uC/OS-II, VxWorks, ... ** comminput.c: Common Input Engine for eCos, uC/OS-II, VxWorks, ...
** **
** Created by Zhong Shuyi, 2004/02/29 ** Created by Zhong Shuyi, 2004/02/29
*/ */
@@ -50,24 +50,9 @@
#include "comminput.h" #include "comminput.h"
#define COMM_MOUSEINPUT 0x01 #include "exstubs.h"
#define COMM_KBINPUT 0x02
#define COMM_MOUSELBUTTON 0x01
#define COMM_MOUSERBUTTON 0x04
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
// OS input driver or application must implement these input functions
// hardware must be initialized before this engine can be used.
extern int __comminput_init (void);
extern int __comminput_ts_getdata (short *x, short *y, short *button);
extern int __comminput_kb_getdata (short *key, short *status);
extern int __comminput_wait_for_input (struct timeval *timeout);
extern void __comminput_deinit (void);
/* ----------------------------------------------------------------------- */
static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0; static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0;
static short KEYCODE = 0, KEYSTATUS = 0; static short KEYCODE = 0, KEYSTATUS = 0;
@@ -142,7 +127,7 @@ static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *ex
else if (retvalue < 0) { else if (retvalue < 0) {
retvalue = -1; retvalue = -1;
} }
return retvalue; return retvalue;
} }
+29 -27
View File
@@ -1,39 +1,39 @@
/* /*
* 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/>.
*/ */
/* /*
** dummy.c: The dummy IAL engine. ** dummy.c: The dummy IAL engine.
** **
** Created by Wei Yongming, 2001/09/13 ** Created by Wei Yongming, 2001/09/13
*/ */
@@ -53,9 +53,9 @@ static int mouse_x, mouse_y, mouse_button;
typedef struct tagPOS typedef struct tagPOS
{ {
short x; short x;
short y; short y;
short b; short b;
} POS; } POS;
/************************ Low Level Input Operations **********************/ /************************ Low Level Input Operations **********************/
@@ -64,28 +64,28 @@ typedef struct tagPOS
*/ */
static int mouse_update(void) static int mouse_update(void)
{ {
return 1; return 1;
} }
static void mouse_getxy (int* x, int* y) static void mouse_getxy (int* x, int* y)
{ {
*x = mouse_x; *x = mouse_x;
*y = mouse_y; *y = mouse_y;
} }
static int mouse_getbutton(void) static int mouse_getbutton(void)
{ {
return mouse_button; return mouse_button;
} }
static int keyboard_update(void) static int keyboard_update(void)
{ {
return 0; return 0;
} }
static const char * keyboard_get_state (void) static const char * keyboard_get_state (void)
{ {
return NULL; return NULL;
} }
static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *except, static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *except,
@@ -93,23 +93,25 @@ static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *ex
{ {
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
__mg_os_time_delay (300); __mg_os_time_delay (300);
timeout->tv_sec = 0;
timeout->tv_usec = 0;
#else #else
fd_set rfds; fd_set rfds;
int e; int e;
if (!in) { if (!in) {
in = &rfds; in = &rfds;
mg_fd_zero (in); mg_fd_zero (in);
} }
e = mg_select (maxfd + 1, in, out, except, timeout) ; e = mg_select (maxfd + 1, in, out, except, timeout) ;
if (e < 0) { if (e < 0) {
return -1; return -1;
} }
#endif #endif
return 0; return 0;
} }
BOOL InitDummyInput (INPUT* input, const char* mdev, const char* mtype) BOOL InitDummyInput (INPUT* input, const char* mdev, const char* mtype)
@@ -125,9 +127,9 @@ BOOL InitDummyInput (INPUT* input, const char* mdev, const char* mtype)
input->set_leds = NULL; input->set_leds = NULL;
input->wait_event = wait_event; input->wait_event = wait_event;
mouse_x = 0; mouse_x = 0;
mouse_y = 0; mouse_y = 0;
mouse_button= 0; mouse_button= 0;
return TRUE; return TRUE;
} }
+1
View File
@@ -37,6 +37,7 @@
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/sysmacros.h> // for makedev
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
+93 -91
View File
@@ -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/>.
*/ */
@@ -35,15 +35,17 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "common.h"
#ifdef _MGIAL_NET
#include <linux/input.h> #include <linux/input.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include "mgconfig.h"
#include "common.h"
#include "minigui.h" #include "minigui.h"
#include "netial.h" #include "netial.h"
#ifdef _MGIAL_NET
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/poll.h> #include <sys/poll.h>
@@ -74,9 +76,9 @@ typedef struct {
typedef struct typedef struct
{ {
int x; int x;
int y; int y;
int pressure; int pressure;
}MOUSE_EVENT; }MOUSE_EVENT;
static int mousex = 0; static int mousex = 0;
@@ -108,15 +110,15 @@ static int mouse_update(void)
static void mouse_getxy(int *x, int* y) static void mouse_getxy(int *x, int* y)
{ {
if (mousex < 0) if (mousex < 0)
mousex = 0; mousex = 0;
if (mousex > g_rcScr.right) if (mousex > g_rcScr.right)
mousex = g_rcScr.right; mousex = g_rcScr.right;
if (mousey < 0) if (mousey < 0)
mousey = 0; mousey = 0;
if (mousey > g_rcScr.bottom) if (mousey > g_rcScr.bottom)
mousey = g_rcScr.bottom; mousey = g_rcScr.bottom;
*x = mousex; *x = mousex;
*y = mousey; *y = mousey;
} }
@@ -149,98 +151,98 @@ static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *ex
e = select (FD_SETSIZE, in, out, except, timeout) ; e = select (FD_SETSIZE, in, out, except, timeout) ;
#endif #endif
if (e > 0) if (e > 0)
{ {
if (temp_sock_descriptor >= 0 && FD_ISSET (temp_sock_descriptor, in)) if (temp_sock_descriptor >= 0 && FD_ISSET (temp_sock_descriptor, in))
{ {
FD_CLR (temp_sock_descriptor, in); FD_CLR (temp_sock_descriptor, in);
n = recv (temp_sock_descriptor, event_buf, 100, 0); n = recv (temp_sock_descriptor, event_buf, 100, 0);
if (n == 0) if (n == 0)
{ {
printf ("recv == 0\n"); printf ("recv == 0\n");
exit (1); exit (1);
} }
if (n == sizeof (MOUSE_EVENT)/sizeof (char)) if (n == sizeof (MOUSE_EVENT)/sizeof (char))
{ {
mouse_event = (MOUSE_EVENT*)event_buf; mouse_event = (MOUSE_EVENT*)event_buf;
mousex += mouse_event->x * 2; mousex += mouse_event->x * 2;
mousey += mouse_event->y * 2; mousey += mouse_event->y * 2;
switch (mouse_event->pressure) switch (mouse_event->pressure)
{ {
case 1: case 1:
ts_event.pressure = IAL_MOUSE_LEFTBUTTON; ts_event.pressure = IAL_MOUSE_LEFTBUTTON;
break; break;
case 2: case 2:
ts_event.pressure = IAL_MOUSE_RIGHTBUTTON; ts_event.pressure = IAL_MOUSE_RIGHTBUTTON;
break; break;
case 0: case 0:
ts_event.pressure = 0; ts_event.pressure = 0;
break; break;
} }
return IAL_MOUSEEVENT; return IAL_MOUSEEVENT;
} }
} }
} }
else if (e < 0) else if (e < 0)
{ {
return -1; return -1;
} }
return 0; return 0;
} }
BOOL InitNetInput (INPUT* input, const char* mdev, const char* mtype) BOOL InitNetInput (INPUT* input, const char* mdev, const char* mtype)
{ {
sock_descriptor = socket (AF_INET, SOCK_STREAM, 0); sock_descriptor = socket (AF_INET, SOCK_STREAM, 0);
if (sock_descriptor == -1) if (sock_descriptor == -1)
{ {
perror ("call to socket"); perror ("call to socket");
exit (1); exit (1);
} }
bzero (&sin, sizeof (sin)); bzero (&sin, sizeof (sin));
sin.sin_family = AF_INET; sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY; sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = htons (port); sin.sin_port = htons (port);
if (bind (sock_descriptor, (struct sockaddr*)&sin, sizeof (sin)) == -1) if (bind (sock_descriptor, (struct sockaddr*)&sin, sizeof (sin)) == -1)
{ {
perror("call to bind"); perror("call to bind");
exit (1); exit (1);
} }
if (listen (sock_descriptor, 20) == -1) if (listen (sock_descriptor, 20) == -1)
{ {
perror ("call to listen"); perror ("call to listen");
exit (1); exit (1);
} }
printf ("Please start the PC side of the client process.\n"); printf ("Please start the PC side of the client process.\n");
temp_sock_descriptor = accept (sock_descriptor, (struct sockaddr *)&pin, &address_size); temp_sock_descriptor = accept (sock_descriptor, (struct sockaddr *)&pin, (socklen_t *)&address_size);
if (temp_sock_descriptor == -1) if (temp_sock_descriptor == -1)
{ {
perror ("call to accept"); perror ("call to accept");
exit (1); exit (1);
} }
input->update_mouse = mouse_update; input->update_mouse = mouse_update;
input->get_mouse_xy = mouse_getxy; input->get_mouse_xy = mouse_getxy;
input->set_mouse_xy = NULL; input->set_mouse_xy = NULL;
input->get_mouse_button = mouse_getbutton; input->get_mouse_button = mouse_getbutton;
input->set_mouse_range = NULL; input->set_mouse_range = NULL;
input->update_keyboard = NULL; input->update_keyboard = NULL;
input->get_keyboard_state = NULL; input->get_keyboard_state = NULL;
input->wait_event = wait_event; input->wait_event = wait_event;
return TRUE; return TRUE;
} }
void TermNetInput(void) void TermNetInput(void)
{ {
if (temp_sock_descriptor >= 0) if (temp_sock_descriptor >= 0)
close(temp_sock_descriptor); close(temp_sock_descriptor);
} }
#endif /* _MGIAL_NET */ #endif /* _MGIAL_NET */
+2 -34
View File
@@ -35,10 +35,11 @@
#ifndef GUI_IAL_NET_H #ifndef GUI_IAL_NET_H
#define GUI_IAL_NET_H #define GUI_IAL_NET_H
#include "ial.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
#include "customial.h"
#define IAL_MOUSE_LEFTBUTTON 1 #define IAL_MOUSE_LEFTBUTTON 1
#define IAL_MOUSE_RIGHTBUTTON 2 #define IAL_MOUSE_RIGHTBUTTON 2
@@ -50,42 +51,9 @@ extern "C" {
#define IAL_MOUSEEVENT 1 #define IAL_MOUSEEVENT 1
#define IAL_KEYEVENT 2 #define IAL_KEYEVENT 2
/*
typedef struct tagINPUT
{
char* id;
// Initialization and termination
BOOL (*init_input) (struct tagINPUT *input, const char* mdev, const char* mtype);
void (*term_input) (void);
// Mouse operations
int (*update_mouse) (void);
void (*get_mouse_xy) (int* x, int* y);
void (*set_mouse_xy) (int x, int y);
int (*get_mouse_button) (void);
void (*set_mouse_range) (int minx, int miny, int maxx, int maxy);
void (*suspend_mouse) (void);
int (*resume_mouse) (void);
// Keyboard operations
int (*update_keyboard) (void);
const char* (*get_keyboard_state) (void);
void (*suspend_keyboard) (void);
int (*resume_keyboard) (void);
void (*set_leds) (unsigned int leds);
// Event
int (*wait_event) (int which, int maxfd, fd_set *in, fd_set *out,
fd_set *except, struct timeval *timeout);
char mdev [MAX_PATH + 1];
}INPUT;
*/
#ifdef _MGIAL_NET
extern BOOL InitNetInput (INPUT* input, const char* mdev, const char* mtype); extern BOOL InitNetInput (INPUT* input, const char* mdev, const char* mtype);
extern void TermNetInput (void); extern void TermNetInput (void);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+2 -2
View File
@@ -225,11 +225,11 @@ struct _FONTOPS
/** The method to get mono-bitmap function. */ /** The method to get mono-bitmap function. */
const void* (*get_glyph_monobitmap) (LOGFONT* logfont, DEVFONT* devfont, 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);
/** The method to get grey bitmap, pitch and scale function */ /** The method to get grey bitmap, pitch and scale function */
const void* (*get_glyph_greybitmap) (LOGFONT* logfont, DEVFONT* devfont, const void* (*get_glyph_greybitmap) (LOGFONT* logfont, DEVFONT* devfont,
const Glyph32 galph_value, int* pitch, unsigned short* scale); Glyph32 galph_value, SIZE* sz, int* pitch, unsigned short* scale);
/** The method to get the pre-rendered bitmap of one glyph. */ /** The method to get the pre-rendered bitmap of one glyph. */
int (*get_glyph_prbitmap) (LOGFONT* logfont, DEVFONT* devfont, int (*get_glyph_prbitmap) (LOGFONT* logfont, DEVFONT* devfont,
+34 -32
View File
@@ -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/>.
*/ */
@@ -72,6 +72,7 @@ extern "C" {
#define _ROT_DIR_HFLIP 0x08 #define _ROT_DIR_HFLIP 0x08
#define _ROT_DIR_VFLIP 0x10 #define _ROT_DIR_VFLIP 0x10
#endif #endif
extern void (*__mg_ial_change_mouse_xy_hook) (int* x, int* y); extern void (*__mg_ial_change_mouse_xy_hook) (int* x, int* y);
extern DWORD __mg_shadow_rotate_flags; extern DWORD __mg_shadow_rotate_flags;
@@ -89,36 +90,36 @@ extern INPUT* __mg_cur_input;
#define IAL_UpdateMouse (*__mg_cur_input->update_mouse) #define IAL_UpdateMouse (*__mg_cur_input->update_mouse)
//#define IAL_GetMouseXY (*__mg_cur_input->get_mouse_xy) //#define IAL_GetMouseXY (*__mg_cur_input->get_mouse_xy)
static inline void IAL_GetMouseXY(int *x, int* y) { static inline void IAL_GetMouseXY(int *x, int* y)
{
if (__mg_cur_input && __mg_cur_input->get_mouse_xy) { if (__mg_cur_input && __mg_cur_input->get_mouse_xy) {
(*__mg_cur_input->get_mouse_xy) (x, y); (*__mg_cur_input->get_mouse_xy) (x, y);
#ifdef _MGHAVE_MOUSECALIBRATE #ifdef _MGHAVE_MOUSECALIBRATE
__mg_mouse_org_pos.x = *x; __mg_mouse_org_pos.x = *x;
__mg_mouse_org_pos.y = *y; __mg_mouse_org_pos.y = *y;
#endif #endif
} }
#ifdef _MGHAVE_MOUSECALIBRATE #ifdef _MGHAVE_MOUSECALIBRATE
if (__mg_do_mouse_calibrate) __mg_do_mouse_calibrate (x, y); if (__mg_do_mouse_calibrate) __mg_do_mouse_calibrate (x, y);
#endif #endif
if (*x < 0) *x = 0; if (*x < 0) *x = 0;
if (*y < 0) *y = 0; if (*y < 0) *y = 0;
if (__mg_ial_change_mouse_xy_hook) if (__mg_ial_change_mouse_xy_hook)
__mg_ial_change_mouse_xy_hook (x, y); __mg_ial_change_mouse_xy_hook (x, y);
else else
{ {
if (*x > (__gal_screen->w-1)) *x = (__gal_screen->w-1); if (*x > (__gal_screen->w-1)) *x = (__gal_screen->w-1);
if (*y > (__gal_screen->h-1)) *y = (__gal_screen->h-1); if (*y > (__gal_screen->h-1)) *y = (__gal_screen->h-1);
} }
} }
#define IAL_GetMouseButton (*__mg_cur_input->get_mouse_button) #define IAL_GetMouseButton (*__mg_cur_input->get_mouse_button)
//#define IAL_SetMouseXY if (__mg_cur_input->set_mouse_xy) (*__mg_cur_input->set_mouse_xy) static inline void IAL_SetMouseXY (int x, int y)
static inline void IAL_SetMouseXY (int x, int y) { {
if (__mg_cur_input->set_mouse_xy) { if (__mg_cur_input->set_mouse_xy) {
#ifdef _MGGAL_SHADOW #ifdef _MGGAL_SHADOW
if (__mg_shadow_rotate_flags & _ROT_DIR_CW){ if (__mg_shadow_rotate_flags & _ROT_DIR_CW){
@@ -140,14 +141,15 @@ static inline void IAL_SetMouseXY (int x, int y) {
} }
} }
//#define IAL_SetMouseRange if (__mg_cur_input->set_mouse_range) (*__mg_cur_input->set_mouse_range) static inline void IAL_SetMouseRange (int minx, int miny, int maxx, int maxy)
static inline void IAL_SetMouseRange (int minx, int miny, int maxx, int maxy) { {
#ifdef _MGGAL_SHADOW #ifdef _MGGAL_SHADOW
if (__mg_shadow_rotate_flags) if (__mg_shadow_rotate_flags)
return; return;
#endif #endif
if (__mg_cur_input->set_mouse_range) (*__mg_cur_input->set_mouse_range)(minx, miny, maxx, maxy); if (__mg_cur_input->set_mouse_range)
__mg_cur_input->set_mouse_range(minx, miny, maxx, maxy);
} }
+9 -14
View File
@@ -248,36 +248,31 @@ failure:
static void sig_handler (int v) static void sig_handler (int v)
{ {
if (v == SIGSEGV) { if (v == SIGSEGV) {
#ifdef WIN32
raise(SIGABRT);
#else
kill (getpid(), SIGABRT); /* cause core dump */ kill (getpid(), SIGABRT); /* cause core dump */
#endif }
}else if (__mg_quiting_stage > 0) { else if (v == SIGINT) {
_exit(1); /* force to quit */
}
else if (__mg_quiting_stage > 0) {
ExitGUISafely(-1); ExitGUISafely(-1);
}else{ }
else {
exit(1); /* force to quit */ exit(1); /* force to quit */
} }
} }
static BOOL InstallSEGVHandler (void) static BOOL InstallSEGVHandler (void)
{ {
#ifdef WIN32
signal(SIGSEGV, sig_handler);
signal(SIGTERM, sig_handler);
signal(SIGINT, sig_handler);
#else
struct sigaction siga; struct sigaction siga;
siga.sa_handler = sig_handler; siga.sa_handler = sig_handler;
siga.sa_flags = 0; siga.sa_flags = 0;
memset (&siga.sa_mask, 0, sizeof (sigset_t)); memset (&siga.sa_mask, 0, sizeof (sigset_t));
sigaction (SIGSEGV, &siga, NULL); sigaction (SIGSEGV, &siga, NULL);
sigaction (SIGTERM, &siga, NULL); sigaction (SIGTERM, &siga, NULL);
sigaction (SIGINT, &siga, NULL); sigaction (SIGINT, &siga, NULL);
sigaction (SIGPIPE, &siga, NULL); sigaction (SIGPIPE, &siga, NULL);
#endif
return TRUE; return TRUE;
} }
+9 -4
View File
@@ -321,9 +321,14 @@ static void sig_handler (int v)
{ {
if (v == SIGSEGV) { if (v == SIGSEGV) {
kill (getpid(), SIGABRT); /* cause core dump */ kill (getpid(), SIGABRT); /* cause core dump */
}else if (__mg_quiting_stage > 0) { }
else if (v == SIGINT) {
_exit(1);
}
else if (__mg_quiting_stage > 0) {
ExitGUISafely(-1); ExitGUISafely(-1);
}else{ }
else {
exit(1); /* force to quit */ exit(1); /* force to quit */
} }
} }
@@ -331,10 +336,10 @@ static void sig_handler (int v)
static BOOL InstallSEGVHandler (void) static BOOL InstallSEGVHandler (void)
{ {
struct sigaction siga; struct sigaction siga;
siga.sa_handler = sig_handler; siga.sa_handler = sig_handler;
siga.sa_flags = 0; siga.sa_flags = 0;
memset (&siga.sa_mask, 0, sizeof (sigset_t)); memset (&siga.sa_mask, 0, sizeof (sigset_t));
sigaction (SIGSEGV, &siga, NULL); sigaction (SIGSEGV, &siga, NULL);
sigaction (SIGTERM, &siga, NULL); sigaction (SIGTERM, &siga, NULL);
+3 -2
View File
@@ -1230,8 +1230,9 @@ int GUIAPI ThrowAwayMessages (HWND hWnd)
for (slot = 0; slot < DEF_NR_TIMERS; slot++) { for (slot = 0; slot < DEF_NR_TIMERS; slot++) {
if (pMsgQueue->TimerMask & (0x01UL << slot)) { if (pMsgQueue->TimerMask & (0x01UL << slot)) {
HWND timer_wnd = __mg_get_timer_hwnd (slot); HWND timer_wnd = __mg_get_timer_hwnd (slot);
if (timer_wnd == hWnd if (timer_wnd == hWnd
|| gui_GetMainWindowPtrOfControl (timer_wnd) == (PMAINWIN)hWnd){ || (MG_IS_MAIN_WINDOW (hWnd) &&
gui_GetMainWindowPtrOfControl (timer_wnd) == (PMAINWIN)hWnd)) {
RemoveMsgQueueTimerFlag (pMsgQueue, slot); RemoveMsgQueueTimerFlag (pMsgQueue, slot);
} }
} }
+22 -20
View File
@@ -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/>.
*/ */
@@ -37,7 +37,7 @@
** Current maintainer: Wei Yongming. ** Current maintainer: Wei Yongming.
** **
** Create date: 1999/04/21 ** Create date: 1999/04/21
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -83,8 +83,10 @@ static pthread_mutex_t timerLock;
#endif /* __LINUX__ */ #endif /* __LINUX__ */
#ifdef _MG_USE_BETTER_TIMER #ifdef _MG_USE_BETTER_TIMER
#ifdef _MGRM_THREADS
#include <sys/times.h> #include <sys/times.h>
static clock_t g_timer_started; static clock_t g_timer_started;
#endif
static clock_t g_last_tick; static clock_t g_last_tick;
#endif #endif
@@ -95,7 +97,7 @@ static void __mg_timer_action (void *data)
SHAREDRES_TIMER_COUNTER += 1; SHAREDRES_TIMER_COUNTER += 1;
#else #else
#if defined(__uClinux__) && defined(_MGRM_STANDALONE) #if defined(_MGRM_STANDALONE)
__mg_timer_counter += 10; __mg_timer_counter += 10;
#else #else
# ifdef _MG_USE_BETTER_TIMER # ifdef _MG_USE_BETTER_TIMER
@@ -136,7 +138,6 @@ static void* TimerEntry (void* data)
__mg_os_time_delay (10); __mg_os_time_delay (10);
__mg_timer_action (NULL); __mg_timer_action (NULL);
} }
/* printf("quit from TimerEntry()\n"); */ /* printf("quit from TimerEntry()\n"); */
return NULL; return NULL;
} }
@@ -150,13 +151,14 @@ int __mg_timer_init (void)
} }
#ifdef __AOS__ #ifdef __AOS__
__mg_os_timer = tp_os_timer_create ("mgtimer", __mg_timer_action, __mg_os_timer = tp_os_timer_create ("mgtimer", __mg_timer_action,
NULL, AOS_TIMER_TICKT, NULL, AOS_TIMER_TICKT,
OS_AUTO_ACTIVATE | OS_AUTO_LOAD); OS_AUTO_ACTIVATE | OS_AUTO_LOAD);
#else /* NOT __AOS__ */ #else /* NOT __AOS__ */
{ {
sem_t wait; sem_t wait;
sem_init (&wait, 0, 0); sem_init (&wait, 0, 0);
pthread_create (&__mg_timer, NULL, TimerEntry, &wait); pthread_create (&__mg_timer, NULL, TimerEntry, &wait);
sem_wait (&wait); sem_wait (&wait);
sem_destroy (&wait); sem_destroy (&wait);
@@ -193,7 +195,7 @@ BOOL mg_InstallIntervalTimer (void)
{ {
struct itimerval timerv; struct itimerval timerv;
struct sigaction siga; struct sigaction siga;
sigaction (SIGALRM, NULL, &old_alarm_handler); sigaction (SIGALRM, NULL, &old_alarm_handler);
siga = old_alarm_handler; siga = old_alarm_handler;
@@ -304,7 +306,7 @@ void mg_dispatch_timer_message (DWORD inter)
timerstr[i]->tick_count = __mg_timer_counter; timerstr[i]->tick_count = __mg_timer_counter;
#endif #endif
/* setting timer flag is simple, we do not need to lock msgq, /* setting timer flag is simple, we do not need to lock msgq,
or else we may encounter dead lock here */ or else we may encounter dead lock here */
SetMsgQueueTimerFlag (timerstr[i]->msg_queue, i); SetMsgQueueTimerFlag (timerstr[i]->msg_queue, i);
timerstr[i]->count -= timerstr[i]->speed; timerstr[i]->count -= timerstr[i]->speed;
} }
@@ -375,7 +377,7 @@ void __mg_move_timer_last (TIMER* timer, int slot)
} }
#endif #endif
BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed, BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
TIMERPROC timer_proc) TIMERPROC timer_proc)
{ {
int i; int i;
@@ -436,7 +438,7 @@ BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
TIMER_UNLOCK (); TIMER_UNLOCK ();
return TRUE; return TRUE;
badret: badret:
TIMER_UNLOCK (); TIMER_UNLOCK ();
return FALSE; return FALSE;
@@ -517,7 +519,7 @@ int GUIAPI KillTimer (HWND hWnd, LINT id)
TIMER_LOCK (); TIMER_LOCK ();
for (i = 0; i < DEF_NR_TIMERS; i++) { for (i = 0; i < DEF_NR_TIMERS; i++) {
if ((timerstr [i] && timerstr [i]->hWnd == hWnd) && if ((timerstr [i] && timerstr [i]->hWnd == hWnd) &&
(id == 0 || timerstr [i]->id == id)) { (id == 0 || timerstr [i]->id == id)) {
RemoveMsgQueueTimerFlag (pMsgQueue, i); RemoveMsgQueueTimerFlag (pMsgQueue, i);
free (timerstr[i]); free (timerstr[i]);
@@ -537,7 +539,7 @@ int GUIAPI KillTimer (HWND hWnd, LINT id)
return killed; return killed;
} }
BOOL GUIAPI ResetTimerEx (HWND hWnd, LINT id, DWORD speed, BOOL GUIAPI ResetTimerEx (HWND hWnd, LINT id, DWORD speed,
TIMERPROC timer_proc) TIMERPROC timer_proc)
{ {
int i; int i;
+25 -25
View File
@@ -1,39 +1,39 @@
/* /*
* 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/>.
*/ */
/* /*
** nposix.c: This file include some miscelleous functions not ** nposix.c: This file include some miscelleous functions not
** provided by POSIX. ** provided by POSIX.
** **
** Create date: 2003/11/22 ** Create date: 2003/11/22
** **
@@ -104,7 +104,7 @@ int strncasecmp (const char *s1, const char *s2, unsigned int n)
#ifdef WIN32 #ifdef WIN32
int fread_long_win32(char* buff, size_t size, int count, FILE* fp) int fread_long_win32(char* buff, size_t size, int count, FILE* fp)
{ {
char *tmp; char *tmp;
size_t ret, rest = size * count; size_t ret, rest = size * count;
int len; int len;
@@ -116,7 +116,7 @@ int fread_long_win32(char* buff, size_t size, int count, FILE* fp)
tmp = buff; tmp = buff;
ret = 0; ret = 0;
while(rest > 0) while(rest > 0)
{ {
if((len = fread(tmp, 1, 1024, fp)) != 1024) if((len = fread(tmp, 1, 1024, fp)) != 1024)
{ {
ret += len; ret += len;
@@ -140,7 +140,7 @@ double hypot(double x, double y)
#if defined (__VXWORKS__) ||defined(WIN32) || defined (__NUCLEUS_MNT__) || defined (_EM86_IAL) || defined (_EM85_IAL) #if defined (__VXWORKS__) ||defined(WIN32) || defined (__NUCLEUS_MNT__) || defined (_EM86_IAL) || defined (_EM85_IAL)
/* /*
* Implementation of cbrt(x) for Win32 platform. * Implementation of cbrt(x) for Win32 platform.
* cbrt(x): Return cube root of x * cbrt(x): Return cube root of x
*/ */
@@ -218,7 +218,7 @@ do { \
} while (0) } while (0)
static const Uint32 static const Uint32
B1 = 715094163, /* B1 = (682-0.03306235651)*2**20 */ B1 = 715094163, /* B1 = (682-0.03306235651)*2**20 */
B2 = 696219795; /* B2 = (664-0.03306235651)*2**20 */ B2 = 696219795; /* B2 = (664-0.03306235651)*2**20 */
@@ -229,7 +229,7 @@ E = 1.41428571428571436819e+00, /* 99/70 = 0x3FF6A0EA, 0x0EA0EA0F */
F = 1.60714285714285720630e+00, /* 45/28 = 0x3FF9B6DB, 0x6DB6DB6E */ F = 1.60714285714285720630e+00, /* 45/28 = 0x3FF9B6DB, 0x6DB6DB6E */
G = 3.57142857142857150787e-01; /* 5/14 = 0x3FD6DB6D, 0xB6DB6DB7 */ G = 3.57142857142857150787e-01; /* 5/14 = 0x3FD6DB6D, 0xB6DB6DB7 */
double cbrt (double x) double cbrt (double x)
{ {
Sint32 hx; Sint32 hx;
double r,s,t=0.0,w; double r,s,t=0.0,w;
@@ -241,7 +241,7 @@ double cbrt (double x)
hx ^=sign; hx ^=sign;
if(hx>=0x7ff00000) return(x+x); /* cbrt(NaN,INF) is itself */ if(hx>=0x7ff00000) return(x+x); /* cbrt(NaN,INF) is itself */
GET_LOW_WORD(low,x); GET_LOW_WORD(low,x);
if((hx|low)==0) if((hx|low)==0)
return(x); /* cbrt(0) is itself */ return(x); /* cbrt(0) is itself */
SET_HIGH_WORD(x,hx); /* x <- |x| */ SET_HIGH_WORD(x,hx); /* x <- |x| */
@@ -257,9 +257,9 @@ double cbrt (double x)
/* new cbrt to 23 bits, may be implemented in single precision */ /* new cbrt to 23 bits, may be implemented in single precision */
r=t*t/x; r=t*t/x;
s=C+r*t; s=C+r*t;
t*=G+F/(s+E+D/s); t*=G+F/(s+E+D/s);
/* chopped to 20 bits and make it larger than cbrt(x) */ /* chopped to 20 bits and make it larger than cbrt(x) */
GET_HIGH_WORD(high,t); GET_HIGH_WORD(high,t);
INSERT_WORDS(t,high+0x00000001,0); INSERT_WORDS(t,high+0x00000001,0);
@@ -284,7 +284,7 @@ double cbrt (double x)
double x1, x2; double x1, x2;
double x3; double x3;
if (x <= 1E-6) if (x <= 1E-6)
return 0.0; return 0.0;
x2 = x; x2 = x;
@@ -292,7 +292,7 @@ double cbrt (double x)
x1 = x2; x1 = x2;
x2 = (2.0 * x1 + x / (x1 *x1)) /3.0; x2 = (2.0 * x1 + x / (x1 *x1)) /3.0;
x3 = (x2 - x1) / x1; x3 = (x2 - x1) / x1;
if (x3 < 0.0) if (x3 < 0.0)
x3 = -x3; x3 = -x3;
if (x3 < 1E-6) break; if (x3 < 1E-6) break;
} }
@@ -411,9 +411,9 @@ void __mg_os_time_delay (int ms)
while (select (0, NULL, NULL, NULL, &timeout) < 0); while (select (0, NULL, NULL, NULL, &timeout) < 0);
#elif defined (__UCOSII__) #elif defined (__UCOSII__)
OSTimeDly (OS_TICKS_PER_SEC * ms / 1000); OSTimeDly (OS_TICKS_PER_SEC * ms / 1000);
#elif defined (__VXWORKS__) #elif defined (__VXWORKS__)
taskDelay (sysClkRateGet() * ms / 1000); taskDelay (sysClkRateGet() * ms / 1000);
#elif defined (__PSOS__) || defined (__ECOS__) #elif defined (__PSOS__) || defined (__ECOS__) || defined (__RTEMS__)
struct timespec ts; struct timespec ts;
ts.tv_sec = 0; ts.tv_sec = 0;
ts.tv_nsec = ms * 1000000; ts.tv_nsec = ms * 1000000;
@@ -481,8 +481,8 @@ int snprintf( char *s, size_t size, const char *format, ... )
int __modsi3 (int numer, int denom) int __modsi3 (int numer, int denom)
{ {
int quot = numer / denom; int quot = numer / denom;
return numer - (quot * denom); return numer - (quot * denom);
} }
#endif #endif
+23 -23
View File
@@ -1,39 +1,39 @@
/* /*
* 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/>.
*/ */
/* /*
** gif.c: Low-level GIF file read/save routines. ** gif.c: Low-level GIF file read/save routines.
** **
** Current maintainer: Wei Yongming ** Current maintainer: Wei Yongming
** **
** Create date: 2000/08/29 ** Create date: 2000/08/29
@@ -98,7 +98,7 @@ static int ReadColorMap(MG_RWops* src, int number, unsigned char buffer[3][MAXCO
static int GetDataBlock(MG_RWops* src, unsigned char *buf ,void * info_data); static int GetDataBlock(MG_RWops* src, unsigned char *buf ,void * info_data);
static int GetCode(MG_RWops* src, int code_size, int flag , void * info); static int GetCode(MG_RWops* src, int code_size, int flag , void * info);
static int LWZReadByte(MG_RWops* src, int flag, int input_code_size, void * info_data); static int LWZReadByte(MG_RWops* src, int flag, int input_code_size, void * info_data);
static int ReadImage(MG_RWops* src, MYBITMAP* bmp, int len, int height, static int ReadImage(MG_RWops* src, MYBITMAP* bmp, int len, int height,
int interlace , CB_ONE_SCANLINE cb, void* context , void * info); int interlace , CB_ONE_SCANLINE cb, void* context , void * info);
/* /*
* *
@@ -132,7 +132,7 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
info->width = 0; info->width = 0;
info->height = 0; info->height = 0;
info->interlace = 0; info->interlace = 0;
info->gif89.transparent = -1; info->gif89.transparent = -1;
info->gif89.delayTime = -1; info->gif89.delayTime = -1;
info->gif89.inputFlag = -1; info->gif89.inputFlag = -1;
@@ -168,10 +168,10 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
_MG_PRINTF ("MYBMP>Gif: no image \n" ); _MG_PRINTF ("MYBMP>Gif: no image \n" );
goto fini; goto fini;
} }
if ('!' == c) /* Start of the Extension*/ if ('!' == c) /* Start of the Extension*/
{ {
if (!ReadOK (fp, &c, 1)) if (!ReadOK (fp, &c, 1))
goto fini; goto fini;
if (0xfe == c) { if (0xfe == c) {
while (GetDataBlock(fp, (unsigned char *) buf , info) != 0); while (GetDataBlock(fp, (unsigned char *) buf , info) != 0);
@@ -179,18 +179,18 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
if (0xff == c) { if (0xff == c) {
while (GetDataBlock(fp, (unsigned char *) buf , info) != 0); while (GetDataBlock(fp, (unsigned char *) buf , info) != 0);
} }
if (0xf9 == c) { if (0xf9 == c) {
GetDataBlock (fp, (unsigned char *) buf , info); GetDataBlock (fp, (unsigned char *) buf , info);
info->gif89.disposal = (buf[0] >> 2) & 0x7;//000 000 0 0 the middle 2 bit is disposal info->gif89.disposal = (buf[0] >> 2) & 0x7;//000 000 0 0 the middle 2 bit is disposal
info->gif89.inputFlag = (buf[0] >> 1) & 0x1;//000 000 0 0 the secand last bit info->gif89.inputFlag = (buf[0] >> 1) & 0x1;//000 000 0 0 the secand last bit
//is user input flag //is user input flag
info->gif89.delayTime = LM_to_uint(buf[1], buf[2]); info->gif89.delayTime = LM_to_uint(buf[1], buf[2]);
if ((buf[0] & 0x1) != 0)// 000 000 0 0 the last bit is transparent flag if ((buf[0] & 0x1) != 0)// 000 000 0 0 the last bit is transparent flag
info->gif89.transparent = buf[3]; info->gif89.transparent = buf[3];
} }
} }
if (',' == c) /* Start of the Image Descriptor*/ if (',' == c) /* Start of the Image Descriptor*/
break; break;
@@ -227,13 +227,13 @@ void* __mg_init_gif (MG_RWops* fp, MYBITMAP *gif, RGB *pal)
info->width = LM_to_uint(buf[4], buf[5]); info->width = LM_to_uint(buf[4], buf[5]);
info->height = LM_to_uint(buf[6], buf[7]); info->height = LM_to_uint(buf[6], buf[7]);
info->interlace = BitSet(buf[8], INTERLACE); info->interlace = BitSet(buf[8], INTERLACE);
gif->w = info->width; gif->w = info->width;
gif->h = info->height; gif->h = info->height;
gif->frames = 1; gif->frames = 1;
gif->depth = 8; gif->depth = 8;
bmp_ComputePitch (8, info->width, &gif->pitch, TRUE); bmp_ComputePitch (8, info->width, &gif->pitch, TRUE);
gif->flags |= MYBMP_FLOW_DOWN; gif->flags |= MYBMP_FLOW_DOWN;
if ( info->gif89.transparent > 0 ) { if ( info->gif89.transparent > 0 ) {
gif->flags |= MYBMP_TRANSPARENT; gif->flags |= MYBMP_TRANSPARENT;
@@ -254,7 +254,7 @@ int __mg_load_gif (MG_RWops* fp, void* init_info, MYBITMAP *gif, CB_ONE_SCANLINE
GifInfo * info = (GifInfo *)init_info; GifInfo * info = (GifInfo *)init_info;
if (!info ->useGColormap) { if (!info ->useGColormap) {
ok = ReadImage (fp, gif, info->width, ok = ReadImage (fp, gif, info->width,
info->height, info->height,
info->interlace, info->interlace,
cb, context, info); cb, context, info);
@@ -273,7 +273,7 @@ int __mg_load_gif (MG_RWops* fp, void* init_info, MYBITMAP *gif, CB_ONE_SCANLINE
void __mg_cleanup_gif (void* init_info) void __mg_cleanup_gif (void* init_info)
{ {
free (init_info); /* free the GifInfo struct */ free (init_info); /* free the GifInfo struct */
} }
static int static int
@@ -371,7 +371,7 @@ LWZReadByte(MG_RWops *src, int flag, int input_code_size , void * info_data)
static int clear_code, end_code; static int clear_code, end_code;
static int table[2][(1 << MAX_LWZ_BITS)]; static int table[2][(1 << MAX_LWZ_BITS)];
static int stack[(1 << (MAX_LWZ_BITS)) * 2], *sp; static int stack[(1 << (MAX_LWZ_BITS)) * 2], *sp;
GifInfo * info = info_data; GifInfo * info = info_data;
if (flag) { if (flag) {
@@ -470,7 +470,7 @@ LWZReadByte(MG_RWops *src, int flag, int input_code_size , void * info_data)
} }
static int static int
ReadImage(MG_RWops* src, MYBITMAP* bmp, int len, int height, ReadImage(MG_RWops* src, MYBITMAP* bmp, int len, int height,
int interlace , CB_ONE_SCANLINE cb, void* context , void * info) int interlace , CB_ONE_SCANLINE cb, void* context , void * info)
{ {
unsigned char c; unsigned char c;
+1 -1
View File
@@ -208,7 +208,7 @@ static int L2F50113T00_getscreeninfo (struct commlcd_info *li, int width, int he
li->width = SCREEN_WIDTH; li->width = SCREEN_WIDTH;
li->fb = (void*)VRAM_ADDR_1; li->fb = (void*)VRAM_ADDR_1;
li->bpp = LCD_BPP; li->bpp = LCD_BPP;
li->rlen = SCREEN_WIDTH * LCD_BPP_UNIT; li->pitch = SCREEN_WIDTH * LCD_BPP_UNIT;
li->async_update = 0; li->async_update = 0;
return 0; return 0;
+71 -47
View File
@@ -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/>.
*/ */
@@ -47,6 +47,7 @@
#include "newgal.h" #include "newgal.h"
#include "sysvideo.h" #include "sysvideo.h"
#include "pixels_c.h" #include "pixels_c.h"
#include "misc.h"
#ifdef _MGGAL_COMMLCD #ifdef _MGGAL_COMMLCD
@@ -78,6 +79,23 @@ static void COMMLCD_DeleteDevice(GAL_VideoDevice *device)
free (device); free (device);
} }
static void COMMLCD_UpdateRects_Sync (_THIS, int numrects, GAL_Rect *rects)
{
int i;
/* sync update */
for (i = 0; i < numrects; i++) {
RECT rc;
SetRect (&rc, rects[i].x, rects[i].y,
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
if (!IsRectEmpty (&rc)) {
__mg_commlcd_ops.update (&rc);
}
}
}
static BOOL _valid_async_updater = TRUE;
static void* task_do_update (void* data) static void* task_do_update (void* data)
{ {
_THIS; _THIS;
@@ -92,41 +110,23 @@ static void* task_do_update (void* data)
this->hidden->dirty = FALSE; this->hidden->dirty = FALSE;
} }
pthread_mutex_unlock (&this->hidden->update_lock); pthread_mutex_unlock (&this->hidden->update_lock);
usleep (50*1000); /* 50 ms */ __mg_os_time_delay(50); /* 50 ms */
} while (1); } while (_valid_async_updater);
return NULL; return NULL;
} }
static void COMMLCD_UpdateRects (_THIS, int numrects, GAL_Rect *rects) static void COMMLCD_UpdateRects_Async (_THIS, int numrects, GAL_Rect *rects)
{ {
int i; int i;
RECT bound; RECT bound;
if (__mg_commlcd_ops.update == NULL) {
return;
}
if (this->hidden->update_th == 0) {
/* sync update */
for (i = 0; i < numrects; i++) {
RECT rc;
SetRect (&rc, rects[i].x, rects[i].y,
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
if (!IsRectEmpty (&rc)) {
__mg_commlcd_ops.update (&rc);
}
}
return;
}
pthread_mutex_lock (&this->hidden->update_lock); pthread_mutex_lock (&this->hidden->update_lock);
bound = this->hidden->rc_dirty; bound = this->hidden->rc_dirty;
for (i = 0; i < numrects; i++) { for (i = 0; i < numrects; i++) {
RECT rc; RECT rc;
SetRect (&rc, rects[i].x, rects[i].y, SetRect (&rc, rects[i].x, rects[i].y,
rects[i].x + rects[i].w, rects[i].y + rects[i].h); rects[i].x + rects[i].w, rects[i].y + rects[i].h);
if (IsRectEmpty (&bound)) if (IsRectEmpty (&bound))
bound = rc; bound = rc;
@@ -180,8 +180,8 @@ static GAL_VideoDevice *COMMLCD_CreateDevice (int devindex)
device->SetHWColorKey = NULL; device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL; device->SetHWAlpha = NULL;
device->FreeHWSurface = COMMLCD_FreeHWSurface; device->FreeHWSurface = COMMLCD_FreeHWSurface;
device->UpdateRects = COMMLCD_UpdateRects; device->UpdateRects = NULL;
device->free = COMMLCD_DeleteDevice; device->free = COMMLCD_DeleteDevice;
return device; return device;
} }
@@ -193,11 +193,11 @@ VideoBootStrap COMMLCD_bootstrap = {
static int COMMLCD_VideoInit(_THIS, GAL_PixelFormat *vformat) static int COMMLCD_VideoInit(_THIS, GAL_PixelFormat *vformat)
{ {
fprintf (stderr, "NEWGAL>COMMLCD: Calling init method!\n"); _ERR_PRINTF ("NEWGAL>COMMLCD: Calling init method!\n");
/* Initialize LCD screen */ /* Initialize LCD screen */
if (__mg_commlcd_ops.init ()) { if (__mg_commlcd_ops.init ()) {
fprintf (stderr, "NEWGAL>COMMLCD: Couldn't initialize LCD\n"); _ERR_PRINTF ("NEWGAL>COMMLCD: Couldn't initialize LCD\n");
return -1; return -1;
} }
@@ -214,22 +214,26 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
int width, int height, int bpp, Uint32 flags) int width, int height, int bpp, Uint32 flags)
{ {
Uint32 Rmask = 0, Gmask = 0, Bmask = 0, Amask = 0; Uint32 Rmask = 0, Gmask = 0, Bmask = 0, Amask = 0;
struct commlcd_info li; struct commlcd_info li;
memset (&li, 0, sizeof (struct commlcd_info)); memset (&li, 0, sizeof (struct commlcd_info));
if (__mg_commlcd_ops.getinfo (&li, width, height, bpp)) { if (__mg_commlcd_ops.getinfo (&li, width, height, bpp)) {
fprintf (stderr, "NEWGAL>COMMLCD: " _ERR_PRINTF ("NEWGAL>COMMLCD: "
"Couldn't get the LCD information\n"); "Couldn't get the LCD information\n");
return NULL; return NULL;
} }
if (li.bpp != bpp) {
_ERR_PRINTF ("NEWGAL>COMMLCD: "
"Returned color depth (%d) does not matched the requested color depth (%d)\n",
li.bpp, bpp);
}
this->hidden->w = li.width; this->hidden->w = li.width;
this->hidden->h = li.height; this->hidden->h = li.height;
this->hidden->pitch = li.rlen; this->hidden->pitch = li.pitch;
this->hidden->fb = li.fb; this->hidden->fb = li.fb;
memset (li.fb, 0, li.rlen * height);
switch (li.type) { switch (li.type) {
case COMMLCD_PSEUDO_RGB332: case COMMLCD_PSEUDO_RGB332:
Rmask = 0xE0; Rmask = 0xE0;
@@ -264,6 +268,12 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
Gmask = 0x0000FF00; Gmask = 0x0000FF00;
Bmask = 0x000000FF; Bmask = 0x000000FF;
break; break;
case COMMLCD_TRUE_ABRG8888:
Amask = 0xFF000000;
Bmask = 0x00FF0000;
Rmask = 0x0000FF00;
Gmask = 0x000000FF;
break;
} }
/* Allocate the new pixel format for the screen */ /* Allocate the new pixel format for the screen */
@@ -272,7 +282,7 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
__mg_commlcd_ops.release (); __mg_commlcd_ops.release ();
this->hidden->fb = NULL; this->hidden->fb = NULL;
fprintf (stderr, "NEWGAL>COMMLCD: " _ERR_PRINTF ("NEWGAL>COMMLCD: "
"Couldn't allocate new pixel format for requested mode\n"); "Couldn't allocate new pixel format for requested mode\n");
return NULL; return NULL;
} }
@@ -284,17 +294,29 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
current->pitch = this->hidden->pitch; current->pitch = this->hidden->pitch;
current->pixels = this->hidden->fb; current->pixels = this->hidden->fb;
if (li.async_update && __mg_commlcd_ops.update) { if (li.update_method == COMMLCD_UPDATE_NONE) {
this->UpdateRects = NULL;
this->hidden->update_th = 0;
}
else if (li.update_method == COMMLCD_UPDATE_ASYNC) {
this->UpdateRects = COMMLCD_UpdateRects_Async;
#if 0
pthread_attr_t new_attr; pthread_attr_t new_attr;
pthread_attr_init (&new_attr); pthread_attr_init (&new_attr);
pthread_attr_setdetachstate (&new_attr, PTHREAD_CREATE_DETACHED); pthread_attr_setdetachstate (&new_attr, PTHREAD_CREATE_DETACHED);
pthread_create (&this->hidden->update_th, &new_attr, pthread_create (&this->hidden->update_th, &new_attr,
task_do_update, this); task_do_update, this);
pthread_attr_destroy (&new_attr); pthread_attr_destroy (&new_attr);
#else
pthread_create (&this->hidden->update_th, NULL,
task_do_update, this);
#endif
pthread_mutex_init (&this->hidden->update_lock, NULL); pthread_mutex_init (&this->hidden->update_lock, NULL);
} }
else { else {
this->UpdateRects = COMMLCD_UpdateRects_Sync;
this->hidden->update_th = 0; this->hidden->update_th = 0;
} }
@@ -308,8 +330,10 @@ static void COMMLCD_VideoQuit (_THIS)
this->screen->pixels = NULL; this->screen->pixels = NULL;
} }
if (__mg_commlcd_ops.update) { if (this->hidden->update_th) {
/* quit the update task */ /* quit the update task */
_valid_async_updater = FALSE;
pthread_join(this->hidden->update_th, NULL);
} }
if (__mg_commlcd_ops.release) if (__mg_commlcd_ops.release)
@@ -318,7 +342,7 @@ static void COMMLCD_VideoQuit (_THIS)
return; return;
} }
static GAL_Rect **COMMLCD_ListModes (_THIS, GAL_PixelFormat *format, static GAL_Rect **COMMLCD_ListModes (_THIS, GAL_PixelFormat *format,
Uint32 flags) Uint32 flags)
{ {
return (GAL_Rect **) -1; return (GAL_Rect **) -1;
@@ -335,11 +359,11 @@ static void COMMLCD_FreeHWSurface (_THIS, GAL_Surface *surface)
surface->pixels = NULL; surface->pixels = NULL;
} }
static int COMMLCD_SetColors (_THIS, int firstcolor, int ncolors, static int COMMLCD_SetColors (_THIS, int firstcolor, int ncolors,
GAL_Color *colors) GAL_Color *colors)
{ {
if (__mg_commlcd_ops.setclut) if (__mg_commlcd_ops.setclut)
return __mg_commlcd_ops.setclut (firstcolor, ncolors, colors); return __mg_commlcd_ops.setclut (firstcolor, ncolors, colors);
return 0; return 0;
} }

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