mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-26 20:45:36 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38aa40042c | ||
|
|
991472894b | ||
|
|
ca249ba378 | ||
|
|
04adac288f | ||
|
|
fcd401128c | ||
|
|
067df2ea37 | ||
|
|
c47dad1ad5 | ||
|
|
28d907165f | ||
|
|
8a8cdd18ed | ||
|
|
2e5a8804bf | ||
|
|
173171b653 | ||
|
|
b4e46463cd | ||
|
|
d7c818080c | ||
|
|
c03ed8d23a | ||
|
|
f965c4b8ea | ||
|
|
3710611ebd | ||
|
|
d50c5c25ed | ||
|
|
b7820d888f | ||
|
|
a068f25519 | ||
|
|
f6ad9a960e | ||
|
|
29a6e0f0f9 | ||
|
|
868548cf0d | ||
|
|
a9daa05807 | ||
|
|
5e0500411e |
+2
-2
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Processes)"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = v4.0.0
|
||||
PROJECT_NUMBER = v4.0.1
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -58,7 +58,7 @@ PROJECT_LOGO =
|
||||
# entered, it will be relative to the location where doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-procs-4.0.0
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-procs-4.0.1
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||
# directories (in 2 levels) under the output directory of each output format and
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Standalone)"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = v4.0.0
|
||||
PROJECT_NUMBER = v4.0.1
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -58,7 +58,7 @@ PROJECT_LOGO =
|
||||
# entered, it will be relative to the location where doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-sa-4.0.0
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-sa-4.0.1
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||
# directories (in 2 levels) under the output directory of each output format and
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Threads)"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = v4.0.0
|
||||
PROJECT_NUMBER = v4.0.1
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -58,7 +58,7 @@ PROJECT_LOGO =
|
||||
# entered, it will be relative to the location where doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-ths-4.0.0
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-ths-4.0.1
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||
# directories (in 2 levels) under the output directory of each output format and
|
||||
|
||||
@@ -5,17 +5,20 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
||||
|
||||
## TABLE OF CONTENTS
|
||||
|
||||
1. Introduction
|
||||
1. A brief building instruction
|
||||
1. New features in version 4.0.x
|
||||
1. New features in version 3.2.x
|
||||
1. The runtime modes of MiniGUI
|
||||
1. History
|
||||
1. About the authors
|
||||
1. If you have a problem
|
||||
1. A little FAQ
|
||||
1. Not free for commercial use
|
||||
1. Copying
|
||||
- [INTRODUCTION](#introduction)
|
||||
- [A BRIEF BUILDING INSTRUCTION](#a-brief-building-instruction)
|
||||
* [Prerequisites](#prerequisites)
|
||||
* [Building MiniGUI Core](#building-minigui-core)
|
||||
* [Building the Comprehensive Demo](#building-the-comprehensive-demo)
|
||||
* [Unit Tests](#unit-tests)
|
||||
- [NEW FEATURES IN VERSION 4.0.x](#new-features-in-version-40x)
|
||||
- [NEW FEATURES IN VERSION 3.2.x](#new-features-in-version-32x)
|
||||
- [THE RUNTIME MODES OF MINIGUI](#the-runtime-modes-of-minigui)
|
||||
- [HISTORY](#history)
|
||||
- [AUTHORS AND COPYING](#authors-and-copying)
|
||||
* [Not Free for Commercial Use](#not-free-for-commercial-use)
|
||||
* [Special Statement](#special-statement)
|
||||
- [A LITTLE FAQ](#a-little-faq)
|
||||
|
||||
|
||||
## INTRODUCTION
|
||||
@@ -30,43 +33,37 @@ use.
|
||||
MiniGUI aims to provide a fast, stable, full-featured, and cross-platform
|
||||
windowing and GUI support system, which is especially fit for
|
||||
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
|
||||
traditional RTOSes, such as VxWorks, ThreadX, Nucleus, pSOS, uC/OS-II,
|
||||
and OSE.
|
||||
traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX,
|
||||
Nucleus, pSOS, uC/OS-II, and OSE.
|
||||
|
||||
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
|
||||
for the developers to develop app much easier:
|
||||
|
||||
* mGUtils: A MiniGUI component which contains miscellaneous utilities
|
||||
like ColorSelectionDialogBox, FileOpenDialogBox, and so on.
|
||||
|
||||
* mGPlus: A MiniGUI component which provides support for advanced graphics
|
||||
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.
|
||||
|
||||
* mGNCS: This component provides a new control set for MiniGUI app.
|
||||
|
||||
* mGNCS4Touch: This component provides some new controls, which are
|
||||
compliant to the new control API spec of mGNCS, for devices with
|
||||
touch screens.
|
||||
* mGUtils: A MiniGUI component which contains miscellaneous utilities
|
||||
like `ColorSelectionDialogBox`, `FileOpenDialogBox`, and so on.
|
||||
* mGPlus: A MiniGUI component which provides support for advanced graphics
|
||||
functions like path, gradient, anti-aliased stretch, and color combination.
|
||||
* mGEff: mGEff provides an animation framework for MiniGUI app.
|
||||
It also provides some popular UI/UE special effects.
|
||||
* mGNCS: This component provides a new control set for MiniGUI app.
|
||||
* mGNCS4Touch: This component provides some new controls, which are
|
||||
compliant to the new control API spec of mGNCS, for devices with
|
||||
touch screens.
|
||||
|
||||
There are also some legacy MiniGUI components. But we will not maintain these
|
||||
components since MiniGUI v3.2.0:
|
||||
|
||||
* mGi: An input method component for MiniGUI. This component provides
|
||||
some typical input methods (such as softkey, hand-writing, and predict
|
||||
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.
|
||||
* mGi: An input method component for MiniGUI. This component provides
|
||||
some typical input methods (such as soft keyboard, hand-writing, and predict
|
||||
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.
|
||||
|
||||
MiniGUI is a free software project. In December 1998, the initiator of
|
||||
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
|
||||
@@ -78,34 +75,34 @@ as a free software project.
|
||||
You can download the source code tarball of MiniGUI and the dependent libraries
|
||||
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,
|
||||
for examples:
|
||||
|
||||
* mDolphin, licensed under Apache 2.0, is a full-featured
|
||||
WEB/WAP browser, which is developed based on the open source browser
|
||||
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
|
||||
* mDolphin, licensed under Apache 2.0, is a full-featured
|
||||
WEB/WAP browser, which is developed based on the open source browser
|
||||
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
|
||||
|
||||
FMSoft had created the public repositories for MiniGUI core, MiniGUI
|
||||
components, and other open source apps on GitHub. You can visit them on:
|
||||
|
||||
https://github.com/VincentWei
|
||||
<https://github.com/VincentWei>
|
||||
|
||||
We now maintain the documents about MiniGUI on GitHub Wiki:
|
||||
and
|
||||
|
||||
https://github.com/VincentWei/minigui/wiki
|
||||
<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
|
||||
|
||||
@@ -172,37 +169,31 @@ If you are interested in hacking the MiniGUI code, please visit this repository.
|
||||
In this version, we enhanced and tuned the APIs related to text rendering,
|
||||
in order to support [HybridOS Foundation Class Library].
|
||||
|
||||
* Since 4.0.2, MiniGUI provides support for RTEMS, RT-Thread, and FreeRTOS.
|
||||
* MiniGUI now provides complete APIs for Unicode characters processing.
|
||||
These APIs conform to Unicode 12.0.
|
||||
|
||||
* MiniGUI also provides new APIs to lay out, shape, and render glyphs
|
||||
from complex and mixed scripts, such as Arabic, Thai, and Indic.
|
||||
|
||||
* We tuned and optimized MiniGUI's logical and device font interfaces to
|
||||
support the new features above.
|
||||
|
||||
* MiniGUI now is enhanced to support input events which may be generated
|
||||
by input devices other than standard mouse (or single-touch panel) and
|
||||
keyboard, such as multi-touch panel (gesture), joystick, tablet tool,
|
||||
table pad, and switch. In MiniGUI 4.0, we introduce `MSG_EXIN_XXX` messages
|
||||
to support the input events from devices other than standard mouse
|
||||
and keyboard. We call these messages as 'extra input messages'.
|
||||
|
||||
* The NEWGAL engine of `dri` to support modern DRI/DRM-driven graphics cards
|
||||
or GPUs on Linux.
|
||||
|
||||
* The IAL engine of `libinput` to support all modern input devices including
|
||||
mouse, keyboard, joystick, switch, multiple touch panel, gesture, tablet tool,
|
||||
and table pad on Linux.
|
||||
|
||||
* We introduced a Slice Memory Allocator for fast concurrent memory chunk
|
||||
allocation.
|
||||
|
||||
* Cleanup and tune code for GCC 7.3.
|
||||
|
||||
For more information, please refer to `RELEASE-NOTES.md` file:
|
||||
|
||||
https://github.com/VincentWei/minigui/blob/master/RELEASE-NOTES.md
|
||||
<https://github.com/VincentWei/minigui/blob/master/RELEASE-NOTES.md>
|
||||
|
||||
Because of the changes of some APIs, we recommended strongly that you
|
||||
use this version for new projects.
|
||||
@@ -217,26 +208,26 @@ We introduce some new features in MiniGUI Version 3.2.x:
|
||||
|
||||
For more information, please refer to `RELEASE-NOTES.md` file:
|
||||
|
||||
https://github.com/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md
|
||||
<https://github.com/VincentWei/minigui/blob/rel-3-2/RELEASE-NOTES.md>
|
||||
|
||||
## THE RUNTIME MODES OF MINIGUI
|
||||
|
||||
You can configure and compile MiniGUI as one of three runtime modes:
|
||||
|
||||
* `MiniGUI-Threads`: A program running on MiniGUI-Threads can create
|
||||
multiple cascaded windows in different threads, and all the windows
|
||||
belong to a single process. MiniGUI-Threads is fit for some real-time
|
||||
systems on Linux/uClinux, eCos, uC/OS-II, VxWorks, pSOS, ThreadX,
|
||||
and OSE.
|
||||
* `MiniGUI-Threads`: A program running on MiniGUI-Threads can create
|
||||
multiple cascaded windows in different threads, and all the windows
|
||||
belong to a single process. MiniGUI-Threads is fit for some real-time
|
||||
systems on Linux/uClinux, eCos, uC/OS-II, VxWorks, pSOS, ThreadX,
|
||||
and OSE.
|
||||
|
||||
* `MiniGUI-Processes`: A program running on MiniGUI-Processes is
|
||||
an independent process, which can also create multiple windows.
|
||||
MiniGUI-Processes is fit for some complex embedded systems, such as
|
||||
PDAs, Thin-Clients or STBs. This mode is only useful for full-featured
|
||||
UNIX-like operating systems, like Linux.
|
||||
* `MiniGUI-Processes`: A program running on MiniGUI-Processes is
|
||||
an independent process, which can also create multiple windows.
|
||||
MiniGUI-Processes is fit for some complex embedded systems, such as
|
||||
PDAs, Thin-Clients or STBs. This mode is only useful for full-featured
|
||||
UNIX-like operating systems, like Linux.
|
||||
|
||||
* `MiniGUI-Standalone`: A single process version of MiniGUI. This mode
|
||||
is useful for some small systems, like uClinux or RTOSes.
|
||||
* `MiniGUI-Standalone`: A single process version of MiniGUI. This mode
|
||||
is useful for some small systems, like uClinux or RTOSes.
|
||||
|
||||
The original MiniGUI (version 1.0) run in MiniGUI-Threads mode.
|
||||
It is based on POSIX-compliant thread library. And this thread-based
|
||||
@@ -251,7 +242,7 @@ 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
|
||||
is a full-featured multi-process version of original MiniGUI -- You
|
||||
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.
|
||||
|
||||
Clients connect to the server via UNIX domain socket, and the server
|
||||
@@ -363,58 +354,12 @@ A brief history description of the development progress lay below:
|
||||
1. Apr., 2019: FMSoft released MiniGUI version 3.2.2.
|
||||
1. Jul., 2019: FMSoft released MiniGUI version 4.0.0.
|
||||
|
||||
## ABOUT THE AUTHORS
|
||||
## AUTHORS AND COPYING
|
||||
|
||||
The original author of MiniGUI is WEI Yongming, and now MiniGUI is
|
||||
maintained by FMSoft. For more information, please refer to
|
||||
<http://www.fmsoft.cn>.
|
||||
|
||||
|
||||
## IF YOU HAVE A PROBLEM
|
||||
|
||||
If you have any technical problem, advice or comment, please send
|
||||
messages to consult@minigui.com.
|
||||
|
||||
|
||||
## A LITTLE FAQ
|
||||
|
||||
Q: Is GPL'd MiniGUI free for commercial use?
|
||||
|
||||
A: Simply no. FMSoft releases MiniGUI under GPLv3 license.
|
||||
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
|
||||
for commerce, you should get the commercial license from FMSoft first.
|
||||
|
||||
Q: Which operating system does MiniGUI support?
|
||||
|
||||
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
|
||||
be supported theoretically.
|
||||
|
||||
Q: Which architecture does MiniGUI support?
|
||||
|
||||
A: x86 32/64-bit, ARM 32/64-bit (e.g., ARMv7 and ARM Cortex-A7),
|
||||
PowerPC, MIPS, DragonBall, ColdFire, Blackfin, and so on.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
## NOT FREE FOR COMMERCIAL USE
|
||||
|
||||
MiniGUI and its components are licensed under the GPL license.
|
||||
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
|
||||
the commercial license of MiniGUI, please refer to the LICENSE-POLICY file.
|
||||
|
||||
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
|
||||
the commercial license of MiniGUI, please write to sales@minigui.com.
|
||||
|
||||
|
||||
## COPYING
|
||||
|
||||
Copyright (C) 2002 ~ 2019, Beijing FMSoft Technologies Co., Ltd.
|
||||
Copyright (C) 1998 ~ 2002, WEI Yongming
|
||||
|
||||
@@ -460,3 +405,31 @@ 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>.
|
||||
|
||||
### Not Free for Commercial Use
|
||||
|
||||
As stated above, MiniGUI and its components are licensed under GPL.
|
||||
So any links about MiniGUI must follow GPL. If you cannot accept GPL,
|
||||
you need to be licensed from FMSoft.
|
||||
|
||||
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
|
||||
the commercial license of MiniGUI, please write to <sales@minigui.com>.
|
||||
|
||||
## A LITTLE FAQ
|
||||
|
||||
Q: Which operating systems does MiniGUI support?
|
||||
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
|
||||
be supported theoretically.
|
||||
|
||||
Q: Which architecture does MiniGUI support?
|
||||
A: x86 32/64-bit, ARM 32/64-bit (e.g., ARMv7 and ARM Cortex-A7),
|
||||
PowerPC, MIPS, DragonBall, ColdFire, Blackfin, and so on.
|
||||
|
||||
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.
|
||||
|
||||
Q: Can I get the tech support from MiniGUI team?
|
||||
A: Yes, FMSoft can provide you with guaranteed commercial technical
|
||||
support services. Please send messages to <sales@minigui.com>.
|
||||
|
||||
|
||||
+108
-68
@@ -1,5 +1,45 @@
|
||||
# Release Notes
|
||||
|
||||
## Version 4.0.2
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 4.0.2.
|
||||
We strongly recommend that you use this version for any new MiniGUI
|
||||
apps, especially if the new features of MiniGUI 4.0 are must for your
|
||||
new apps.
|
||||
|
||||
Please report any bugs and incompatibilities in
|
||||
|
||||
<https://github.com/VincentWei/minigui>
|
||||
|
||||
### What's new in this version
|
||||
|
||||
* ENHANCEMENTS:
|
||||
- Support for RTEMS operating system
|
||||
- Basic support for RT-Thread and FreeRTOS operating systems.
|
||||
* BUGFIXES:
|
||||
- Fixed errors in makefile.ng files.
|
||||
* CLEANUP:
|
||||
- `README.md` for correct markdown tags.
|
||||
|
||||
## Version 4.0.1
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 4.0.1.
|
||||
We strongly recommend that you use this version for any new MiniGUI
|
||||
apps, especially if the new features of MiniGUI 4.0 are must for your
|
||||
new apps.
|
||||
|
||||
Please report any bugs and incompatibilities in
|
||||
|
||||
<https://github.com/VincentWei/minigui>
|
||||
|
||||
### What's new in this version
|
||||
|
||||
This version mainly fixed some minor issues:
|
||||
|
||||
- Use FVN algorithm to implement `Str2Key`.
|
||||
- Tune some API description.
|
||||
- Tune format string to use '%z' instead of '%l' or '%ll' for `size_t` values.
|
||||
|
||||
## Version 4.0.0
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 4.0.0.
|
||||
@@ -9,7 +49,7 @@ new apps.
|
||||
|
||||
Please report any bugs and incompatibilities in
|
||||
|
||||
https://github.com/VincentWei/minigui
|
||||
<https://github.com/VincentWei/minigui>
|
||||
|
||||
### What's new in this version
|
||||
|
||||
@@ -26,7 +66,7 @@ rendering in order that MiniGUI can handle complex writing systems
|
||||
|
||||
* MiniGUI also provides new APIs to lay out, shape, and render glyphs
|
||||
from complex and mixed scripts, such as Arabic, Thai, and Indic.
|
||||
The new APIs also conform to the specification of [CSS Text Module Level 3]
|
||||
The new APIs also conform to the specifications of [CSS Text Module Level 3]
|
||||
and [CSS Writing Modes Level 3].
|
||||
|
||||
* We tuned and optimized MiniGUI's logical and device font interfaces to
|
||||
@@ -114,7 +154,7 @@ function. You can call `CreateLogFontForMChar2UChar` function to create
|
||||
a dummy logfont object for this purpose in order to expense a minimal memory.
|
||||
|
||||
If the text is in simple scripts, like Latin or Chinese, you can call
|
||||
`GetGlyphsExtentPointEx` function to lay out the paragraph. This function
|
||||
`GetGlyphsExtentFromUChars` function to lay out the paragraph. This function
|
||||
returns a glyph string which can fit in a line with the specified
|
||||
maximal extent and rendering flags. After this, you call
|
||||
`DrawGlyphStringEx` function to draw the glyph string to the
|
||||
@@ -271,7 +311,7 @@ run MiniGUI apps on a Linux box on which the DRI
|
||||
|
||||
The `dri` engine uses `libdrm` developed by Free Desktop project:
|
||||
|
||||
https://dri.freedesktop.org/wiki/
|
||||
<https://dri.freedesktop.org/wiki/>
|
||||
|
||||
Libdrm is a user-space library implements the Direct Rendering Manager.
|
||||
MiniGUI mainly uses this library to support the dumb frame buffer
|
||||
@@ -822,38 +862,38 @@ The MiniGUI development team announces the availability of MiniGUI 3.0.13.
|
||||
All users of MiniGUI are encouraged to test this version carefully, and
|
||||
report any bugs and incompatibilities in
|
||||
|
||||
https://github.com/VincentWei/minigui.
|
||||
<https://github.com/VincentWei/minigui>.
|
||||
|
||||
### What's new in this version
|
||||
|
||||
* Merge new APIs which are introduced by miniStudio.
|
||||
* The autoconf/automake config scripts are cleaned up.
|
||||
* Remove most of compilation warnings (not used variables).
|
||||
* Remove some inline function definitions, especially GetIMEPos/SetIMEPos.
|
||||
* Fix some bugs.
|
||||
* Merge new APIs which are introduced by miniStudio.
|
||||
* The autoconf/automake config scripts are cleaned up.
|
||||
* Remove most of compilation warnings (not used variables).
|
||||
* Remove some inline function definitions, especially GetIMEPos/SetIMEPos.
|
||||
* Fix some bugs.
|
||||
|
||||
### API changes
|
||||
|
||||
* [NEW] CopyCursor: Copies a cursor object.
|
||||
* [NEW] GetKeyboardState: Gets status of all keys on keyboard.
|
||||
* [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] InvalidateRegion: Invalidates the client area within the specified region.
|
||||
* [NEW] ValidateRect: Validates the client area within a rectangle by removing the
|
||||
rectangle from the update region of the specified window.
|
||||
* [NEW] ValidateRegion: Validates the client area within a region by removing the
|
||||
region from the current update region of the specified window.
|
||||
* [NEW] GetUpdateRegion: Copy the update region of a window to a region.
|
||||
* [NEW] AdjustWindowRectEx: Calculates the required size of the window rectangle
|
||||
based on the desired size of the client rectangle.
|
||||
* [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
|
||||
speicified point and meets the certain criteria.
|
||||
* [NEW] ScrollWindowEx: Scrolls the content of a window's client area.
|
||||
* [ADJUST] GetIMEPos/SetIMEPos: inline functions -> normal functions.
|
||||
* [ADJUST] WindowFromPoint: normal function -> inline function.
|
||||
* [ADJUST] ChildWindowFromPoint: normal function -> inline function.
|
||||
* [ADJUST] ScrollWindow: normal function -> inline function.
|
||||
* [NEW] CopyCursor: Copies a cursor object.
|
||||
* [NEW] GetKeyboardState: Gets status of all keys on keyboard.
|
||||
* [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] InvalidateRegion: Invalidates the client area within the specified region.
|
||||
* [NEW] ValidateRect: Validates the client area within a rectangle by removing the
|
||||
rectangle from the update region of the specified window.
|
||||
* [NEW] ValidateRegion: Validates the client area within a region by removing the
|
||||
region from the current update region of the specified window.
|
||||
* [NEW] GetUpdateRegion: Copy the update region of a window to a region.
|
||||
* [NEW] AdjustWindowRectEx: Calculates the required size of the window rectangle
|
||||
based on the desired size of the client rectangle.
|
||||
* [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
|
||||
speicified point and meets the certain criteria.
|
||||
* [NEW] ScrollWindowEx: Scrolls the content of a window's client area.
|
||||
* [ADJUST] GetIMEPos/SetIMEPos: inline functions -> normal functions.
|
||||
* [ADJUST] WindowFromPoint: normal function -> inline function.
|
||||
* [ADJUST] ChildWindowFromPoint: normal function -> inline function.
|
||||
* [ADJUST] ScrollWindow: normal function -> inline function.
|
||||
|
||||
|
||||
## Version 3.0.2
|
||||
@@ -866,48 +906,48 @@ https://github.com/VincentWei/minigui.
|
||||
|
||||
### What's new in this version
|
||||
|
||||
* Append non-rectangle window support.
|
||||
* Append support of double buffer of maindow.
|
||||
* Support for Look and Feel (LF) concept.
|
||||
* Remove SKIN interfaces of MGExt library, move MGExt library and vcongui into mGUtils component.
|
||||
* Newly added bitmap font.
|
||||
* Developing interfaces of desktop for MiniGUI.
|
||||
* Support direct draw to DC for higher efficiency.
|
||||
* Enhancement of resource management
|
||||
* Enhancement of controls: Support of independent scrollbar and transparent control.
|
||||
* Enhancement of font and character set, support bidi text support.
|
||||
* Enhancement of zoom of picture
|
||||
* Append non-rectangle window support.
|
||||
* Append support of double buffer of maindow.
|
||||
* Support for Look and Feel (LF) concept.
|
||||
* Remove SKIN interfaces of MGExt library, move MGExt library and vcongui into mGUtils component.
|
||||
* Newly added bitmap font.
|
||||
* Developing interfaces of desktop for MiniGUI.
|
||||
* Support direct draw to DC for higher efficiency.
|
||||
* Enhancement of resource management
|
||||
* Enhancement of controls: Support of independent scrollbar and transparent control.
|
||||
* Enhancement of font and character set, support bidi text support.
|
||||
* Enhancement of zoom of picture
|
||||
|
||||
|
||||
### API changes
|
||||
|
||||
* [NEW] ScaleBitmapEx: a bilinear interpolation algorithm which is better than the original.
|
||||
* [NEW] GetWindowInfo: get New structure WINDOWINFO.
|
||||
* [NEW] CreateMainWindowEx: enhance of CreeateMainWindow, compatiable with CreeateMainWindow.
|
||||
* [NEW] CreateWindowEx2:enhance of CreateWindowEx2, compatiable with CreateWindowEx2.
|
||||
* [NEW] DialogBoxIndirectParamEx: new create dialog.
|
||||
* [NEW] CreateMainWindowIndirectParamEx:new create dialog.
|
||||
* [NEW] GetWindowRendererFromName: get LF renderer by name
|
||||
* [NEW] AddWindowElementRenderer: append a LF renderer to MiniGU
|
||||
* [NEW] RemoveWindowElementRenderer: delete a LF renderer from MiniG
|
||||
* [NEW] GetDefaultWindowElementRenderer: get default LF renderer
|
||||
* [NEW] SetDefaultWindowElementRenderer: set default LF renderer
|
||||
* [NEW] SetWindowElementRenderer: set a LF renderer for one window’s render
|
||||
* [NEW] SetWindowElementAttr: set window’s attributes.
|
||||
* [NEW] GetWindowElementAttr: get window’s attributes value
|
||||
* [NEW] CreateBMPDevFont: create an bitmap device font.
|
||||
* [NEW] AddGlyphsToBMPFont: add an bitmap font glyph.
|
||||
* [NEW] DestroyBMPFont: destroy bitmap device font.
|
||||
* [NEW] SetCustomDesktopOperationSet: set the custom desktop operation set.
|
||||
* [NEW] DesktopUpdateAllWindow: refresh all windows on the desktop.
|
||||
* [NEW] PopupDesktopMenu: pop up a menu on the desktop
|
||||
* [NEW] GetTextAlign: get the current text-alignment flags of a DC.
|
||||
* [NEW] SetTextAlign: set text-alignment flags of a DC.
|
||||
* [NEW] SetWindowMask: set non-rectangle window mask rect.
|
||||
* [NEW] SetWindowRegion: set non-rectangle window visible region
|
||||
* [NEW] LockDCEx: support for directly read and write the pixels in a DC.
|
||||
* [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] ScaleBitmapEx: a bilinear interpolation algorithm which is better than the original.
|
||||
* [NEW] GetWindowInfo: get New structure WINDOWINFO.
|
||||
* [NEW] CreateMainWindowEx: enhance of CreeateMainWindow, compatiable with CreeateMainWindow.
|
||||
* [NEW] CreateWindowEx2:enhance of CreateWindowEx2, compatiable with CreateWindowEx2.
|
||||
* [NEW] DialogBoxIndirectParamEx: new create dialog.
|
||||
* [NEW] CreateMainWindowIndirectParamEx:new create dialog.
|
||||
* [NEW] GetWindowRendererFromName: get LF renderer by name
|
||||
* [NEW] AddWindowElementRenderer: append a LF renderer to MiniGU
|
||||
* [NEW] RemoveWindowElementRenderer: delete a LF renderer from MiniG
|
||||
* [NEW] GetDefaultWindowElementRenderer: get default LF renderer
|
||||
* [NEW] SetDefaultWindowElementRenderer: set default LF renderer
|
||||
* [NEW] SetWindowElementRenderer: set a LF renderer for one window’s render
|
||||
* [NEW] SetWindowElementAttr: set window’s attributes.
|
||||
* [NEW] GetWindowElementAttr: get window’s attributes value
|
||||
* [NEW] CreateBMPDevFont: create an bitmap device font.
|
||||
* [NEW] AddGlyphsToBMPFont: add an bitmap font glyph.
|
||||
* [NEW] DestroyBMPFont: destroy bitmap device font.
|
||||
* [NEW] SetCustomDesktopOperationSet: set the custom desktop operation set.
|
||||
* [NEW] DesktopUpdateAllWindow: refresh all windows on the desktop.
|
||||
* [NEW] PopupDesktopMenu: pop up a menu on the desktop
|
||||
* [NEW] GetTextAlign: get the current text-alignment flags of a DC.
|
||||
* [NEW] SetTextAlign: set text-alignment flags of a DC.
|
||||
* [NEW] SetWindowMask: set non-rectangle window mask rect.
|
||||
* [NEW] SetWindowRegion: set non-rectangle window visible region
|
||||
* [NEW] LockDCEx: support for directly read and write the pixels in a DC.
|
||||
* [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.
|
||||
|
||||
|
||||
[HybridOS]: https://github.com/FMSoftCN/hybridos
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Version 4.0.0 (2019/06/30)
|
||||
Version 4.0.2 (2019/10/31)
|
||||
|
||||
This release needs the following resource packages:
|
||||
|
||||
@@ -6,4 +6,4 @@ This release needs the following resource packages:
|
||||
|
||||
The latest samples package is:
|
||||
|
||||
* mg-samples-4.0.0.tar.gz
|
||||
* mg-samples-4.0.1.tar.gz
|
||||
|
||||
@@ -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` -I/usr/local/include/harfbuzz
|
||||
LDFLAGS+=
|
||||
##################################################
|
||||
|
||||
+44
-16
@@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT(libminigui, 4.0.0)
|
||||
AC_INIT(libminigui, 4.0.2)
|
||||
AC_CONFIG_SRCDIR(src/main/main.c)
|
||||
|
||||
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=4
|
||||
MINIGUI_MINOR_VERSION=0
|
||||
MINIGUI_MICRO_VERSION=0
|
||||
MINIGUI_INTERFACE_AGE=0
|
||||
MINIGUI_BINARY_AGE=0
|
||||
MINIGUI_MICRO_VERSION=2
|
||||
MINIGUI_INTERFACE_AGE=2
|
||||
MINIGUI_BINARY_AGE=2
|
||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||
|
||||
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
||||
@@ -62,7 +62,7 @@ dnl ========================================================================
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
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.
|
||||
AC_C_CONST
|
||||
@@ -90,10 +90,9 @@ detail_debug="no"
|
||||
trace_message="no"
|
||||
message_string="no"
|
||||
|
||||
osname="unspecified"
|
||||
runtime_mode="procs"
|
||||
|
||||
stand_alone="no"
|
||||
|
||||
incore_res="no"
|
||||
use_miniguientry="no"
|
||||
fixed_math="yes"
|
||||
@@ -314,10 +313,6 @@ AC_ARG_WITH(runmode,
|
||||
[ --with-runmode=procs/ths/sa the MiniGUI runtime mode <default=procs>],
|
||||
runtime_mode=$withval)
|
||||
|
||||
AC_ARG_ENABLE(standalone,
|
||||
[ --enable-standalone build MiniGUI-Standalone version <default=no>],
|
||||
stand_alone=$enableval)
|
||||
|
||||
AC_ARG_ENABLE(incoreres,
|
||||
[ --enable-incoreres use incore resource instead file IO to initialize MiniGUI <default=no>],
|
||||
incore_res=$enableval)
|
||||
@@ -754,9 +749,8 @@ AC_ARG_ENABLE(ctrlbidisledit,
|
||||
[ --enable-ctrlbidisledit include Single-Line BIDI EDIT control <default=no>],
|
||||
build_ctrl_bidisledit=$enableval)
|
||||
|
||||
dnl enable new textedit
|
||||
AC_ARG_ENABLE(newtextedit,
|
||||
[ --enable-ctrlnewtextedit include the new implementation of TEXTEDIT control <default=yes>],
|
||||
AC_ARG_ENABLE(ctrlnewtextedit,
|
||||
[ --disable-ctrlnewtextedit include the new implementation of TEXTEDIT control <default=yes>],
|
||||
build_ctrl_textedit_new=$enableval)
|
||||
|
||||
AC_ARG_ENABLE(ctrllistbox,
|
||||
@@ -906,7 +900,6 @@ CheckDRM()
|
||||
VIDEO_SUBDIRS="$VIDEO_SUBDIRS dri"
|
||||
VIDEO_DRIVERS="$VIDEO_DRIVERS dri/libvideo_dri.la"
|
||||
DEP_LIBS="$DEP_LIBS -ldrm"
|
||||
need_udev="yes"
|
||||
DRM_INC_DIR="`$PKG_CONFIG --variable includedir libdrm`/drm"
|
||||
AC_SUBST(DRM_INC_DIR)
|
||||
else
|
||||
@@ -1486,7 +1479,7 @@ case "$with_libsuffix" in
|
||||
esac
|
||||
|
||||
AC_ARG_WITH(osname,
|
||||
[ --with-osname=linux/uclinux/ecos/ucos2/swlinux/vxworks/win32/darwin/threadx/cygwin/nucleus/ose/psos])
|
||||
[ --with-osname=linux/uclinux/rtt/rtems/freertos/ecos/ucos2/swlinux/vxworks/win32/darwin/threadx/cygwin/nucleus/ose/psos])
|
||||
|
||||
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.
|
||||
@@ -1495,18 +1488,42 @@ case "$with_osname" in
|
||||
uclinux)
|
||||
AC_DEFINE(__uClinux__, 1,
|
||||
[Define if compile for uClinux])
|
||||
osname="uClinux"
|
||||
;;
|
||||
rtt)
|
||||
AC_DEFINE(__RTTHREAD__, 1,
|
||||
[Define if compile for RT-Thread])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="RT-Thread"
|
||||
;;
|
||||
rtems)
|
||||
AC_DEFINE(__RTEMS__, 1,
|
||||
[Define if compile for RTEMS])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="RTEMS"
|
||||
;;
|
||||
freertos)
|
||||
AC_DEFINE(__FREERTOS__, 1,
|
||||
[Define if compile for FreeRTOS])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="FreeRTOS"
|
||||
;;
|
||||
ecos)
|
||||
AC_DEFINE(__ECOS__, 1,
|
||||
[Define if compile for eCos])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="eCos"
|
||||
;;
|
||||
ucos2)
|
||||
AC_DEFINE(__UCOSII__, 1,
|
||||
[Define if compile for uC/OS-II])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="uC/OS-II"
|
||||
incore_res="yes"
|
||||
use_own_malloc="yes"
|
||||
use_own_stdio="yes"
|
||||
@@ -1517,32 +1534,38 @@ case "$with_osname" in
|
||||
[Define if compile for Winbond SWLinux])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="SWLinux"
|
||||
;;
|
||||
vxworks)
|
||||
AC_DEFINE(__VXWORKS__, 1,
|
||||
[Define if compile for VxWorks])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="VxWorks"
|
||||
;;
|
||||
cygwin)
|
||||
AC_DEFINE(__CYGWIN__, 1,
|
||||
[Define if compile for Cygwin platform])
|
||||
osname="Cygwin"
|
||||
;;
|
||||
win32)
|
||||
AC_DEFINE(WIN32, 1,
|
||||
[Define if compile for Win32 platform])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="Windows"
|
||||
;;
|
||||
darwin)
|
||||
AC_DEFINE(__DARWIN__, 1,
|
||||
[Define if compile for OpenDarwin])
|
||||
osname="macOS"
|
||||
;;
|
||||
threadx)
|
||||
AC_DEFINE(__THREADX__, 1,
|
||||
[Define if compile for ThreadX])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="ThreadX"
|
||||
incore_res="yes"
|
||||
use_own_malloc="yes"
|
||||
use_own_stdio="yes"
|
||||
@@ -1553,6 +1576,7 @@ case "$with_osname" in
|
||||
[Define if compile for Nucleus])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="Nucleus"
|
||||
incore_res="yes"
|
||||
use_own_malloc="yes"
|
||||
use_own_stdio="yes"
|
||||
@@ -1563,6 +1587,7 @@ case "$with_osname" in
|
||||
[Define if compile for OSE])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="OSE"
|
||||
incore_res="yes"
|
||||
use_own_pthread="yes"
|
||||
;;
|
||||
@@ -1571,9 +1596,11 @@ case "$with_osname" in
|
||||
[Define if compile for pSOS])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
osname="pSOS"
|
||||
;;
|
||||
*)
|
||||
with_osname="linux"
|
||||
osname="Linux"
|
||||
AC_DEFINE(__LINUX__, 1,
|
||||
[Define if compile for Linux])
|
||||
;;
|
||||
@@ -2675,6 +2702,7 @@ AC_MSG_NOTICE([
|
||||
# Main building configuration:
|
||||
|
||||
## Global Features:
|
||||
* Operating system: ${osname}
|
||||
* Runtime mode: ${runtime_mode}
|
||||
* Incore resource: ${incore_res}
|
||||
* Developer mode: ${devel_mode}
|
||||
|
||||
+1
-1
@@ -1963,7 +1963,7 @@ typedef struct _GAL_Rect {
|
||||
#endif
|
||||
|
||||
/* Commonly used definitions */
|
||||
#if !defined(__NOUNIX__) || defined (__ECOS__)
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
|
||||
+185
-38
@@ -78,6 +78,12 @@ extern "C" {
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* \defgroup external_stubs_dri External Stubs for DRI sub driver
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* The struct type represents the DRI sub driver.
|
||||
* The concrete struct should be defined by the driver.
|
||||
@@ -96,7 +102,6 @@ typedef struct _DriSurfaceBuffer {
|
||||
uint32_t pitch;
|
||||
|
||||
uint32_t drm_format;
|
||||
//uint32_t depth:8;
|
||||
uint16_t bpp:8;
|
||||
uint16_t cpp:8;
|
||||
|
||||
@@ -125,35 +130,38 @@ enum DriColorLogicOp {
|
||||
COLOR_LOGICOP_SET = 15
|
||||
};
|
||||
|
||||
/**
|
||||
* The struct type defines the operations for a DRI driver.
|
||||
*/
|
||||
typedef struct _DriDriverOps {
|
||||
/**
|
||||
* This operator creates the DriDriver object.
|
||||
* This operation creates the DriDriver object.
|
||||
*
|
||||
* \note The driver must implement this operator.
|
||||
* \note The driver must implement this operation.
|
||||
*/
|
||||
DriDriver* (*create_driver) (int device_fd);
|
||||
|
||||
/**
|
||||
* This operator destroies the DriDriver object.
|
||||
* This operation destroies the DriDriver object.
|
||||
*
|
||||
* \note The driver must implement this operator.
|
||||
* \note The driver must implement this operation.
|
||||
*/
|
||||
void (*destroy_driver) (DriDriver *driver);
|
||||
|
||||
/**
|
||||
* This operator flushs the batch buffer of the driver or the hardware cache.
|
||||
* This operation flushs the batch buffer of the driver or the hardware cache.
|
||||
*
|
||||
* \note This operator can be NULL.
|
||||
* \note This operation can be NULL.
|
||||
*/
|
||||
void (* flush_driver) (DriDriver *driver);
|
||||
|
||||
/**
|
||||
* This operator creates a buffer with the specified pixel format,
|
||||
* This operation creates a buffer with the specified pixel format,
|
||||
* width, and height. If succeed, a valid (not zero) buffer identifier
|
||||
* and the picth (row stride in bytes) will be returned.
|
||||
* If failed, it returns 0.
|
||||
*
|
||||
* \note The driver must implement this operator.
|
||||
* \note The driver must implement this operation.
|
||||
*/
|
||||
uint32_t (* create_buffer) (DriDriver *driver,
|
||||
uint32_t drm_format,
|
||||
@@ -166,53 +174,53 @@ typedef struct _DriDriverOps {
|
||||
unsigned int *pitch);
|
||||
|
||||
/**
|
||||
* This operator maps the buffer into the current process's virtual memory
|
||||
* This operation maps the buffer into the current process's virtual memory
|
||||
* space, and returns the virtual address. If failed, it returns NULL.
|
||||
*
|
||||
* \note The driver must implement this operator.
|
||||
* \note The driver must implement this operation.
|
||||
*/
|
||||
DriSurfaceBuffer* (* map_buffer) (DriDriver *driver,
|
||||
uint32_t buffer_id);
|
||||
|
||||
/**
|
||||
* This operator un-maps a buffer.
|
||||
* This operation un-maps a buffer.
|
||||
*
|
||||
* \note The driver must implement this operator.
|
||||
* \note The driver must implement this operation.
|
||||
*/
|
||||
void (* unmap_buffer) (DriDriver *driver, DriSurfaceBuffer* buffer);
|
||||
|
||||
/**
|
||||
* This operator destroies a buffer.
|
||||
* This operation destroies a buffer.
|
||||
*
|
||||
* \note The driver must implement this operator.
|
||||
* \note The driver must implement this operation.
|
||||
*/
|
||||
void (* destroy_buffer) (DriDriver *driver, uint32_t buffer_id);
|
||||
|
||||
/**
|
||||
* This operator clears the specific rectangle area of a buffer
|
||||
* This operation clears the specific rectangle area of a buffer
|
||||
* with the specific pixel value. If succeed, it returns 0.
|
||||
*
|
||||
* \note If this operator is set as NULL, the driver does not support
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated clear operation.
|
||||
*/
|
||||
int (* clear_buffer) (DriDriver *driver,
|
||||
DriSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value);
|
||||
|
||||
/**
|
||||
* This operator checks whether a hardware accelerated blit
|
||||
* This operation checks whether a hardware accelerated blit
|
||||
* can be done between the source buffer and the destination buffer.
|
||||
* If succeed, it returns 0.
|
||||
*
|
||||
* \note If this operator is set as NULL, it will be supposed that
|
||||
* \note If this operation is set as NULL, it will be supposed that
|
||||
* the driver does not support any hardware accelerated blit operation.
|
||||
*/
|
||||
int (* check_blit) (DriDriver *driver,
|
||||
DriSurfaceBuffer* src_buf, DriSurfaceBuffer* dst_buf);
|
||||
|
||||
/**
|
||||
* This operator copies bits from a source buffer to a destination buffer.
|
||||
* This operation copies bits from a source buffer to a destination buffer.
|
||||
*
|
||||
* \note If this operator is set as NULL, the driver does not support
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated copy blit.
|
||||
*/
|
||||
int (* copy_blit) (DriDriver *driver,
|
||||
@@ -221,10 +229,10 @@ typedef struct _DriDriverOps {
|
||||
enum DriColorLogicOp logic_op);
|
||||
|
||||
/**
|
||||
* This operator blits pixles from a source buffer with the source alpha value
|
||||
* This operation blits pixles from a source buffer with the source alpha value
|
||||
* specified to a destination buffer.
|
||||
*
|
||||
* \note If this operator is set as NULL, the driver does not support
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blit with alpha.
|
||||
*/
|
||||
int (* alpha_blit) (DriDriver *driver,
|
||||
@@ -232,10 +240,10 @@ typedef struct _DriDriverOps {
|
||||
DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint8_t alpha);
|
||||
|
||||
/**
|
||||
* This operator blits pixles from a source buffer to a destination buffer,
|
||||
* This operation blits pixles from a source buffer to a destination buffer,
|
||||
* but skipping the pixel value specified by \a color_key.
|
||||
*
|
||||
* \note If this operator is set as NULL, the driver does not support
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blit with color key.
|
||||
*/
|
||||
int (* key_blit) (DriDriver *driver,
|
||||
@@ -243,10 +251,10 @@ typedef struct _DriDriverOps {
|
||||
DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint32_t color_key);
|
||||
|
||||
/**
|
||||
* This operator blits pixles from a source buffer with the source alpha value
|
||||
* This operation blits pixles from a source buffer with the source alpha value
|
||||
* specified to a destination buffer, but skipping the pixel value specified.
|
||||
*
|
||||
* \note If this operator is set as NULL, the driver does not support
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blit with alpha and color key.
|
||||
*/
|
||||
int (* alpha_key_blit) (DriDriver *driver,
|
||||
@@ -256,14 +264,22 @@ typedef struct _DriDriverOps {
|
||||
|
||||
} DriDriverOps;
|
||||
|
||||
/** Implement this stub to return the DRI driver operators */
|
||||
/** Implement this stub to return the DRI driver operations */
|
||||
DriDriverOps* __dri_ex_driver_get (const char* driver_name);
|
||||
|
||||
/** @} end of external_stubs_dri */
|
||||
|
||||
#endif /* _MGGAL_DRI */
|
||||
|
||||
#ifdef _MGGAL_COMMLCD
|
||||
|
||||
/* external stubs for COMMLCD NEWGAL engine */
|
||||
/**
|
||||
* \defgroup external_stubs_commlcd External Stubs for CommLCD NEWGAL Engine
|
||||
*
|
||||
* The external stubs for COMMLCD NEWGAL engine.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* The pixel format defined by depth */
|
||||
#define COMMLCD_PSEUDO_RGB332 1
|
||||
@@ -279,28 +295,116 @@ DriDriverOps* __dri_ex_driver_get (const char* driver_name);
|
||||
#define COMMLCD_UPDATE_SYNC 1
|
||||
#define COMMLCD_UPDATE_ASYNC 2
|
||||
|
||||
/**
|
||||
* The structue represented the screen information of CommmLCD engine.
|
||||
*/
|
||||
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
|
||||
/** The vertical resolution of the screen. */
|
||||
int height;
|
||||
|
||||
/** The horizontal resolution of the screen. */
|
||||
int width;
|
||||
|
||||
/** The length of one scan line in bytes. */
|
||||
int pitch;
|
||||
|
||||
/** The color depth (bits-per-pixel). */
|
||||
int bpp;
|
||||
|
||||
/**
|
||||
* The pixel type, can be one of the following values:
|
||||
* - COMMLCD_PSEUDO_RGB332
|
||||
* - COMMLCD_TRUE_RGB555
|
||||
* - COMMLCD_TRUE_RGB565
|
||||
* - COMMLCD_TRUE_RGB888
|
||||
* - COMMLCD_TRUE_RGB0888
|
||||
* - COMMLCD_TRUE_ARGB1555
|
||||
* - COMMLCD_TRUE_ARGB8888
|
||||
* - COMMLCD_TRUE_ABRG8888
|
||||
*/
|
||||
int type;
|
||||
|
||||
/**
|
||||
* The update method, can be one of the following values:
|
||||
* - COMMLCD_UPDATE_NONE\n
|
||||
* No update method.
|
||||
* - COMMLCD_UPDATE_SYNC
|
||||
* The update method should be called synchronously.
|
||||
* - COMMLCD_UPDATE_ASYNC
|
||||
* The update method should be called asynchronously.
|
||||
*/
|
||||
int update_method;
|
||||
|
||||
/**
|
||||
* The pointer to the frame buffer of the screen.
|
||||
*/
|
||||
Uint8* fb;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implement this stub to initialize the CommLCD engine.
|
||||
* Return 0 for success.
|
||||
*/
|
||||
int __commlcd_drv_init (void);
|
||||
|
||||
/**
|
||||
* Implement this stub to initialize the CommLCD engine.
|
||||
*
|
||||
* \param li The pointer to struct commlcd_info. This structure
|
||||
* will be used to return the LCD surface information.
|
||||
* \param width The desired horizontal resolution of the screen.
|
||||
* \param height The desired vertical resolution of the screen.
|
||||
* \param depth The desired depth of the screen.
|
||||
*
|
||||
* Return 0 for success, otherwise for failure.
|
||||
*/
|
||||
int __commlcd_drv_getinfo (struct commlcd_info *li,
|
||||
int width, int height, int depth);
|
||||
|
||||
/**
|
||||
* Implement this stub to release (destroy) the CommLCD engine.
|
||||
*
|
||||
* Return 0 for success, otherwise for failure.
|
||||
*/
|
||||
int __commlcd_drv_release (void);
|
||||
|
||||
/**
|
||||
* Implement this stub to set the pallete when the pixel type
|
||||
* is COMMLCD_PSEUDO_RGB332.
|
||||
*
|
||||
* \param firstcolor
|
||||
* The index value of the first entry of the pallete.
|
||||
* \param ncolors
|
||||
* The number of entries of the pallete.
|
||||
* \param colors
|
||||
* The array of the colors for each entries in the pallete.
|
||||
*
|
||||
* Return 0 for success, otherwise for failure.
|
||||
*/
|
||||
int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
|
||||
|
||||
/**
|
||||
* Implement this stub to update the screen.
|
||||
*
|
||||
* \param rc_dirty The rectangle contains the dirty region.
|
||||
*
|
||||
* Return 0 for success, otherwise for failure.
|
||||
*/
|
||||
int __commlcd_drv_update (const RECT* rc_dirty);
|
||||
|
||||
/** @} end of external_stubs_commlcd */
|
||||
|
||||
#endif /* _MGGAL_COMMLCD */
|
||||
|
||||
#ifdef _MGIAL_COMM
|
||||
|
||||
/* external stubs for COMM IAL engine */
|
||||
/**
|
||||
* \defgroup external_stubs_commial External Stubs for COMM IAL Engine
|
||||
*
|
||||
* The external stubs for COMM IAL engine
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define COMM_MOUSEINPUT 0x01
|
||||
#define COMM_KBINPUT 0x02
|
||||
@@ -308,19 +412,62 @@ int __commlcd_drv_update (const RECT* rc_dirty);
|
||||
#define COMM_MOUSELBUTTON 0x01
|
||||
#define COMM_MOUSERBUTTON 0x04
|
||||
|
||||
/**
|
||||
* Implement this stub to initialize the COMM IAL engine.
|
||||
* Return 0 for success, otherwise for failure.
|
||||
*/
|
||||
int __comminput_init (void);
|
||||
|
||||
/**
|
||||
* Implement this stub to return the mouse event data.
|
||||
* The implementation should return the position of mouse or touch,
|
||||
* and the button status through the pointers \a x, \a y, and \a button.
|
||||
* The position should be in absolute coordinates, and the button
|
||||
* will have \a COMM_MOUSELBUTTON set if left button was pressed,
|
||||
* and \a COMM_MOUSERBUTTON set if right button was pressed.
|
||||
*
|
||||
* Return 0 for success, otherwise for failure.
|
||||
*/
|
||||
int __comminput_ts_getdata (short *x, short *y, short *button);
|
||||
|
||||
/**
|
||||
* Implement this stub to return the keyboard event data.
|
||||
* The implementation should return the key scancode pressed or released
|
||||
* through the pointer \a key, and the pressed or released status of the
|
||||
* key through \a status.
|
||||
*
|
||||
* Return 0 for success, otherwise for failure.
|
||||
*/
|
||||
int __comminput_kb_getdata (short *key, short *status);
|
||||
|
||||
/**
|
||||
* Implement this stub to wait for an event.
|
||||
*
|
||||
* \retval 0
|
||||
* The timeout period expires.
|
||||
* \retval COMM_MOUSEINPUT
|
||||
* There is an mouse moved, button pressed, or button released event.
|
||||
* \retval COMM_KBINPUT
|
||||
* There is a key pressed or released event.
|
||||
* \retval others
|
||||
* Failed.
|
||||
*/
|
||||
int __comminput_wait_for_input (struct timeval *timeout);
|
||||
|
||||
/**
|
||||
* Implement this stub to de-initialize the COMM IAL engine.
|
||||
*/
|
||||
void __comminput_deinit (void);
|
||||
|
||||
/** @} end of external_stubs_commial */
|
||||
|
||||
#endif /* _MGIAL_COMM */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @} end of general_rw_fns */
|
||||
/** @} end of external_stubs */
|
||||
|
||||
#endif /* GUI_EXSTUBS_H */
|
||||
|
||||
|
||||
+3
-3
@@ -1155,7 +1155,7 @@ MG_EXPORT BOOL GUIAPI InitPolygonRegion (PCLIPRGN dst,
|
||||
#define GDCAP_DPI_MINIMAL 36
|
||||
|
||||
/**
|
||||
* \fn unsigned int GUIAPI GetGDCapability (HDC hdc, int iItem)
|
||||
* \fn Uint32 GUIAPI GetGDCapability (HDC hdc, int iItem)
|
||||
* \brief Returns a capability of a DC.
|
||||
*
|
||||
* This function returns the capability of the specified item \a iItem of
|
||||
@@ -1201,7 +1201,7 @@ MG_EXPORT BOOL GUIAPI InitPolygonRegion (PCLIPRGN dst,
|
||||
*
|
||||
* \return The capbility.
|
||||
*/
|
||||
MG_EXPORT unsigned int GUIAPI GetGDCapability (HDC hdc, int iItem);
|
||||
MG_EXPORT Uint32 GUIAPI GetGDCapability (HDC hdc, int iItem);
|
||||
|
||||
/**
|
||||
* \fn HDC GUIAPI GetDC (HWND hwnd)
|
||||
@@ -1911,7 +1911,7 @@ typedef int (* ON_UPDATE_SECONDARYDC)(HWND hwnd, HDC secondary_dc,
|
||||
const RECT* main_update_rc);
|
||||
|
||||
#define ON_UPDSECDC_DEFAULT ((ON_UPDATE_SECONDARYDC)0)
|
||||
#define ON_UPDSECDC_DONOTHING ((ON_UPDATE_SECONDARYDC)0xFFFFFFFF)
|
||||
#define ON_UPDSECDC_DONOTHING ((ON_UPDATE_SECONDARYDC)-1)
|
||||
|
||||
/**
|
||||
* \fn HDC GUIAPI SetSecondaryDC (HWND hwnd, HDC secondary_dc, \
|
||||
|
||||
+41
-33
@@ -5361,7 +5361,7 @@ MG_EXPORT void GUIAPI UnregisterSystemBitmap (HDC hdc, const char* rdr_name,
|
||||
const char* id);
|
||||
|
||||
/* define the key of resource */
|
||||
typedef unsigned long RES_KEY;
|
||||
typedef DWORD RES_KEY;
|
||||
#define RES_KEY_INVALID 0
|
||||
|
||||
/* define the incore res type */
|
||||
@@ -5378,38 +5378,40 @@ typedef struct _INNER_RES {
|
||||
const void* additional;
|
||||
} INNER_RES;
|
||||
|
||||
/* the type of resource */
|
||||
enum emResType{
|
||||
/** The type of resource */
|
||||
enum emResType {
|
||||
RES_TYPE_INVALID = 0xFF,
|
||||
|
||||
/* All kinds of image supported by MiniGUI
|
||||
* such as png, jpeg, bmp and so on
|
||||
* This type will make LoadResource return a
|
||||
* PBITMAP pointer
|
||||
/**
|
||||
* Images supported by MiniGUI, such as PNG, JPEG, BMP and so on.
|
||||
* Fot this type, LoadResource returns a BITMAP object.
|
||||
*/
|
||||
RES_TYPE_IMAGE = 0,
|
||||
|
||||
/* All kinds of image supported by MiniGUI
|
||||
* This Type will make LoadResource return a MYBITMAP* pointer
|
||||
/**
|
||||
* All kinds of image supported by MiniGUI.
|
||||
* For this type, LoadResource returns a MYBITMAP object.
|
||||
*/
|
||||
RES_TYPE_MYBITMAP,
|
||||
|
||||
/* the icon file and mem
|
||||
* it only make LoadResource load or get the FIRST
|
||||
* icon, and return HICON
|
||||
/**
|
||||
* The icon file or data.
|
||||
* For this type, LoadResource loads the icon and returns HICON.
|
||||
*/
|
||||
RES_TYPE_ICON,
|
||||
|
||||
#ifdef _MGHAVE_CURSOR
|
||||
/* the cursor file or data
|
||||
* Make LoadResource return HCURSOR
|
||||
/**
|
||||
* The cursor file or data.
|
||||
* For this type, LoadResource returns HCURSOR.
|
||||
*/
|
||||
RES_TYPE_CURSOR,
|
||||
#endif
|
||||
|
||||
/* the config file or data support by minigui
|
||||
* make LoadResource return GHANDLE
|
||||
* it should be accessed by GetValueFromEtc and GetIntValueFromEtc
|
||||
/**
|
||||
* The runtime config file or data support by MiniGUI.
|
||||
* For this type, LoadResource returns GHANDLE.
|
||||
* You can use it for \a GetValueFromEtc and \a GetIntValueFromEtc.
|
||||
*/
|
||||
RES_TYPE_ETC,
|
||||
|
||||
@@ -5418,24 +5420,30 @@ enum emResType{
|
||||
/* NOT IMPLEMENT */
|
||||
RES_TYPE_MENU,
|
||||
/* NOT IMPLEMENT */
|
||||
|
||||
RES_TYPE_WINDOW,
|
||||
/* Make the LoadResource return the
|
||||
* raw data of INNER_RES, it's a pointer
|
||||
* of MEM_RES
|
||||
* only support incore Resource,
|
||||
* if the resource is stored in disk, LoadResource will return NULL
|
||||
|
||||
/**
|
||||
* The type for inner resource..
|
||||
* Fot this type, LoadResource returns the raw data of INNER_RES,
|
||||
* it's a pointer of MEM_RES.
|
||||
* Only support incore Resource, if the resource is stored in file
|
||||
* LoadResource will return NULL.
|
||||
*/
|
||||
RES_TYPE_MEM_RES,
|
||||
|
||||
/**
|
||||
* Make the LoadResource return a logfont object.
|
||||
*/
|
||||
RES_TYPE_FONT,
|
||||
|
||||
/* the beginning of user defined type
|
||||
/**
|
||||
* The beginning of user defined resource type.
|
||||
*/
|
||||
RES_TYPE_USER,
|
||||
|
||||
/* the max valid value of type
|
||||
* used defined type must less this value
|
||||
/*
|
||||
* The max valid value of resource type;
|
||||
* the user defined type must less this value.
|
||||
*/
|
||||
RES_TYPE_USER_MAX = 0x7F
|
||||
};
|
||||
@@ -5544,11 +5552,11 @@ MG_EXPORT int SetResPath (const char* path);
|
||||
* \brief Add some incore resource into the resource manager in order to
|
||||
* call LoadResource to get those resource.
|
||||
*
|
||||
* \param inner_res The pointer to the incore resource.
|
||||
* \param count The bytes count of inner_res.
|
||||
* \param copy TRUE indicate that resource manager will copy the value of
|
||||
* inner_res array, otherwise, resource manager just save the
|
||||
* pointer to inner_res.
|
||||
* \param inner_res The pointer to the incore resource entry array.
|
||||
* \param count The number of the inner resource entries.
|
||||
* \param copy TRUE indicate that resource manager will copy the entries of
|
||||
* the inner resource array, or the resource manager will just save the
|
||||
* pointer.
|
||||
*
|
||||
* \return RES_RET_OK for success or error code.
|
||||
*/
|
||||
@@ -5628,8 +5636,8 @@ MG_EXPORT void* LoadResource (const char* res_name, int type, DWORD usr_param);
|
||||
* \fn void* GetResource (RES_KEY key);
|
||||
* \brief Retrive and return a buffered resource by the key.
|
||||
*
|
||||
* You should call LoadResource firstly, and then call GetResource when you need it.
|
||||
* Note that GetResource will not increase the reference count automatically.
|
||||
* You should call LoadResource firstly, and then call GetResource when you need it.
|
||||
* Note that GetResource will not increase the reference count automatically.
|
||||
*
|
||||
* \param key The key of the resource (use Str2Key(res_name) to get the key).
|
||||
*
|
||||
|
||||
+2
-13
@@ -14,7 +14,6 @@ include $(abs_top_srcdir)/$(TARGET_RULES)
|
||||
# Flags that can be set on the nmake command line:
|
||||
# DEBUG=1 for compiling a debugging version
|
||||
# PREFIX=Some/Directory Base directory for installation
|
||||
# CONFIGH=YourConfigHeader for defining the mgconfig.h file to use
|
||||
|
||||
ifndef DEBUG
|
||||
DEBUG=0
|
||||
@@ -37,8 +36,6 @@ docdir = $(datadir)/doc/minigui
|
||||
|
||||
# The directory where the include files will be installed
|
||||
libminiguiincludedir = $(includedir)/minigui
|
||||
libmgextincludedir = $(includedir)/minigui
|
||||
|
||||
|
||||
# Programs used by "make":
|
||||
CP = cp
|
||||
@@ -93,14 +90,6 @@ TIFF_LIBS = $(TIFF_NOLZW_LIBS)
|
||||
ZLIB_CFLAGS = -I $(ZLIB)
|
||||
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
|
||||
@@ -119,10 +108,10 @@ endif
|
||||
|
||||
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
|
||||
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
|
||||
$(CC) $(CFLAGS) $(COFLAG) $<
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
abs_top_srcdir=../..
|
||||
LOCAL_INC=-I$(abs_top_srcdir)/src/control/
|
||||
|
||||
include Makefile.am
|
||||
include ../../rules.make
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
abs_top_srcdir=../../../
|
||||
LOCAL_INC=-I$(abs_top_srcdir)/src/font/
|
||||
|
||||
include Makefile.am
|
||||
include ../../../rules.make
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define _DEBUG
|
||||
#include "common.h"
|
||||
|
||||
#ifdef _MGIAL_LIBINPUT
|
||||
@@ -602,7 +601,7 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
|
||||
device = libinput_event_get_device(event);
|
||||
seat = libinput_device_get_seat(device);
|
||||
seat_name = libinput_seat_get_logical_name(seat);
|
||||
_DBG_PRINTF("IAL>LIBINPUT: a new event device added: %s\n", seat_name);
|
||||
_MG_PRINTF("IAL>LIBINPUT: a new event device added: %s\n", seat_name);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -614,7 +613,7 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
|
||||
device = libinput_event_get_device(event);
|
||||
seat = libinput_device_get_seat(device);
|
||||
seat_name = libinput_seat_get_logical_name(seat);
|
||||
_DBG_PRINTF("IAL>LIBINPUT: an event device removed: %s\n", seat_name);
|
||||
_MG_PRINTF("IAL>LIBINPUT: an event device removed: %s\n", seat_name);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+93
-91
@@ -11,35 +11,35 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* 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 smart IoT devices.
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Or,
|
||||
*
|
||||
*
|
||||
* As this program is a library, any link to this program must follow
|
||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||
* GPLv3, you need to be licensed from FMSoft.
|
||||
*
|
||||
*
|
||||
* If you have got a commercial license of this program, please use it
|
||||
* under the terms and conditions of the commercial license.
|
||||
*
|
||||
*
|
||||
* For more information about the commercial license, please refer to
|
||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||
*/
|
||||
@@ -47,15 +47,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef _MGIAL_NET
|
||||
|
||||
#include <linux/input.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "mgconfig.h"
|
||||
#include "common.h"
|
||||
#include "minigui.h"
|
||||
#include "netial.h"
|
||||
#ifdef _MGIAL_NET
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/poll.h>
|
||||
@@ -86,9 +88,9 @@ typedef struct {
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int pressure;
|
||||
int x;
|
||||
int y;
|
||||
int pressure;
|
||||
}MOUSE_EVENT;
|
||||
|
||||
static int mousex = 0;
|
||||
@@ -120,15 +122,15 @@ static int mouse_update(void)
|
||||
|
||||
static void mouse_getxy(int *x, int* y)
|
||||
{
|
||||
if (mousex < 0)
|
||||
mousex = 0;
|
||||
if (mousex > g_rcScr.right)
|
||||
mousex = g_rcScr.right;
|
||||
if (mousex < 0)
|
||||
mousex = 0;
|
||||
if (mousex > g_rcScr.right)
|
||||
mousex = g_rcScr.right;
|
||||
|
||||
if (mousey < 0)
|
||||
mousey = 0;
|
||||
if (mousey > g_rcScr.bottom)
|
||||
mousey = g_rcScr.bottom;
|
||||
if (mousey < 0)
|
||||
mousey = 0;
|
||||
if (mousey > g_rcScr.bottom)
|
||||
mousey = g_rcScr.bottom;
|
||||
*x = mousex;
|
||||
*y = mousey;
|
||||
}
|
||||
@@ -161,98 +163,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) ;
|
||||
#endif
|
||||
|
||||
if (e > 0)
|
||||
{
|
||||
if (temp_sock_descriptor >= 0 && FD_ISSET (temp_sock_descriptor, in))
|
||||
{
|
||||
FD_CLR (temp_sock_descriptor, in);
|
||||
n = recv (temp_sock_descriptor, event_buf, 100, 0);
|
||||
if (n == 0)
|
||||
{
|
||||
printf ("recv == 0\n");
|
||||
exit (1);
|
||||
}
|
||||
if (n == sizeof (MOUSE_EVENT)/sizeof (char))
|
||||
{
|
||||
mouse_event = (MOUSE_EVENT*)event_buf;
|
||||
mousex += mouse_event->x * 2;
|
||||
mousey += mouse_event->y * 2;
|
||||
switch (mouse_event->pressure)
|
||||
{
|
||||
case 1:
|
||||
ts_event.pressure = IAL_MOUSE_LEFTBUTTON;
|
||||
break;
|
||||
case 2:
|
||||
ts_event.pressure = IAL_MOUSE_RIGHTBUTTON;
|
||||
break;
|
||||
case 0:
|
||||
ts_event.pressure = 0;
|
||||
break;
|
||||
}
|
||||
return IAL_MOUSEEVENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (e > 0)
|
||||
{
|
||||
if (temp_sock_descriptor >= 0 && FD_ISSET (temp_sock_descriptor, in))
|
||||
{
|
||||
FD_CLR (temp_sock_descriptor, in);
|
||||
n = recv (temp_sock_descriptor, event_buf, 100, 0);
|
||||
if (n == 0)
|
||||
{
|
||||
printf ("recv == 0\n");
|
||||
exit (1);
|
||||
}
|
||||
if (n == sizeof (MOUSE_EVENT)/sizeof (char))
|
||||
{
|
||||
mouse_event = (MOUSE_EVENT*)event_buf;
|
||||
mousex += mouse_event->x * 2;
|
||||
mousey += mouse_event->y * 2;
|
||||
switch (mouse_event->pressure)
|
||||
{
|
||||
case 1:
|
||||
ts_event.pressure = IAL_MOUSE_LEFTBUTTON;
|
||||
break;
|
||||
case 2:
|
||||
ts_event.pressure = IAL_MOUSE_RIGHTBUTTON;
|
||||
break;
|
||||
case 0:
|
||||
ts_event.pressure = 0;
|
||||
break;
|
||||
}
|
||||
return IAL_MOUSEEVENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL InitNetInput (INPUT* input, const char* mdev, const char* mtype)
|
||||
{
|
||||
sock_descriptor = socket (AF_INET, SOCK_STREAM, 0);
|
||||
if (sock_descriptor == -1)
|
||||
{
|
||||
perror ("call to socket");
|
||||
exit (1);
|
||||
}
|
||||
sock_descriptor = socket (AF_INET, SOCK_STREAM, 0);
|
||||
if (sock_descriptor == -1)
|
||||
{
|
||||
perror ("call to socket");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
bzero (&sin, sizeof (sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_addr.s_addr = INADDR_ANY;
|
||||
sin.sin_port = htons (port);
|
||||
bzero (&sin, sizeof (sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_addr.s_addr = INADDR_ANY;
|
||||
sin.sin_port = htons (port);
|
||||
|
||||
if (bind (sock_descriptor, (struct sockaddr*)&sin, sizeof (sin)) == -1)
|
||||
{
|
||||
perror("call to bind");
|
||||
exit (1);
|
||||
}
|
||||
if (bind (sock_descriptor, (struct sockaddr*)&sin, sizeof (sin)) == -1)
|
||||
{
|
||||
perror("call to bind");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if (listen (sock_descriptor, 20) == -1)
|
||||
{
|
||||
perror ("call to listen");
|
||||
exit (1);
|
||||
}
|
||||
printf ("Please start the PC side of the client process.\n");
|
||||
if (listen (sock_descriptor, 20) == -1)
|
||||
{
|
||||
perror ("call to listen");
|
||||
exit (1);
|
||||
}
|
||||
printf ("Please start the PC side of the client process.\n");
|
||||
|
||||
temp_sock_descriptor = accept (sock_descriptor, (struct sockaddr *)&pin, &address_size);
|
||||
if (temp_sock_descriptor == -1)
|
||||
{
|
||||
perror ("call to accept");
|
||||
exit (1);
|
||||
}
|
||||
temp_sock_descriptor = accept (sock_descriptor, (struct sockaddr *)&pin, &address_size);
|
||||
if (temp_sock_descriptor == -1)
|
||||
{
|
||||
perror ("call to accept");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
input->update_mouse = mouse_update;
|
||||
input->get_mouse_xy = mouse_getxy;
|
||||
input->set_mouse_xy = NULL;
|
||||
input->get_mouse_button = mouse_getbutton;
|
||||
input->set_mouse_range = NULL;
|
||||
|
||||
input->update_keyboard = NULL;
|
||||
|
||||
input->update_keyboard = NULL;
|
||||
input->get_keyboard_state = NULL;
|
||||
|
||||
input->wait_event = wait_event;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TermNetInput(void)
|
||||
{
|
||||
if (temp_sock_descriptor >= 0)
|
||||
close(temp_sock_descriptor);
|
||||
close(temp_sock_descriptor);
|
||||
}
|
||||
|
||||
#endif /* _MGIAL_NET */
|
||||
|
||||
+51
-51
@@ -11,35 +11,35 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* 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 smart IoT devices.
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Or,
|
||||
*
|
||||
*
|
||||
* As this program is a library, any link to this program must follow
|
||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||
* GPLv3, you need to be licensed from FMSoft.
|
||||
*
|
||||
*
|
||||
* If you have got a commercial license of this program, please use it
|
||||
* under the terms and conditions of the commercial license.
|
||||
*
|
||||
*
|
||||
* For more information about the commercial license, please refer to
|
||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||
*/
|
||||
@@ -205,8 +205,8 @@ void mg_DestroyMsgQueue (PMSGQUEUE pMsgQueue)
|
||||
}
|
||||
|
||||
/*
|
||||
* hWnd may belong to a different thread,
|
||||
* so this function should be thread-safe
|
||||
* hWnd may belong to a different thread,
|
||||
* so this function should be thread-safe
|
||||
*/
|
||||
PMSGQUEUE kernel_GetMsgQueue (HWND hWnd)
|
||||
{
|
||||
@@ -230,7 +230,7 @@ BOOL kernel_QueueMessage (PMSGQUEUE msg_que, PMSG msg)
|
||||
msg->time = __mg_timer_counter;
|
||||
|
||||
/* check for the duplicated messages */
|
||||
if (msg->message == MSG_MOUSEMOVE
|
||||
if (msg->message == MSG_MOUSEMOVE
|
||||
|| msg->message == MSG_NCMOUSEMOVE
|
||||
|| msg->message == MSG_DT_MOUSEMOVE) {
|
||||
int readpos = msg_que->readpos;
|
||||
@@ -255,7 +255,7 @@ BOOL kernel_QueueMessage (PMSGQUEUE msg_que, PMSG msg)
|
||||
goto ret;
|
||||
}
|
||||
}
|
||||
else if (msg->message == MSG_TIMEOUT
|
||||
else if (msg->message == MSG_TIMEOUT
|
||||
|| msg->message == MSG_IDLE
|
||||
|| msg->message == MSG_CARETBLINK) {
|
||||
int readpos = msg_que->readpos;
|
||||
@@ -264,7 +264,7 @@ BOOL kernel_QueueMessage (PMSGQUEUE msg_que, PMSG msg)
|
||||
while (readpos != msg_que->writepos) {
|
||||
a_msg = msg_que->msg + readpos;
|
||||
|
||||
if (a_msg->message == msg->message
|
||||
if (a_msg->message == msg->message
|
||||
&& a_msg->hwnd == msg->hwnd) {
|
||||
a_msg->wParam = msg->wParam;
|
||||
a_msg->lParam = msg->lParam;
|
||||
@@ -335,7 +335,7 @@ HWND kernel_CheckInvalidRegion (PMAINWIN pWin)
|
||||
static PMAINWIN msgGetHostingRoot (PMAINWIN pHosted)
|
||||
{
|
||||
PMAINWIN pHosting;
|
||||
|
||||
|
||||
pHosting = pHosted->pHosting;
|
||||
if (pHosting)
|
||||
return msgGetHostingRoot (pHosting);
|
||||
@@ -405,9 +405,9 @@ BOOL GUIAPI HavePendingMessageEx (HWND hWnd, BOOL bNoDeskTimer)
|
||||
if (pMsgQueue->TimerMask)
|
||||
goto retok;
|
||||
#ifndef _MGRM_THREADS
|
||||
/*
|
||||
/*
|
||||
* FIXME
|
||||
* We do not need to check QS_DESKTIMER, because it is for the
|
||||
* We do not need to check QS_DESKTIMER, because it is for the
|
||||
* desktop window, and user don't care it.
|
||||
*/
|
||||
if (!bNoDeskTimer && (pMsgQueue->dwState & QS_DESKTIMER)) {
|
||||
@@ -435,7 +435,7 @@ BOOL GUIAPI HavePendingMessage (HWND hWnd)
|
||||
int GUIAPI BroadcastMessage (UINT nMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
|
||||
msg.message = nMsg;
|
||||
msg.wParam = wParam;
|
||||
msg.lParam = lParam;
|
||||
@@ -462,7 +462,7 @@ const char* GUIAPI Message2Str (UINT message)
|
||||
return "MSG_USER";
|
||||
}
|
||||
|
||||
void GUIAPI PrintMessage (FILE* fp, HWND hWnd,
|
||||
void GUIAPI PrintMessage (FILE* fp, HWND hWnd,
|
||||
UINT nMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
fprintf (fp, "Message %s: hWnd: %p, wP: %p, lP: %p.\n",
|
||||
@@ -473,9 +473,9 @@ void GUIAPI PrintMessage (FILE* fp, HWND hWnd,
|
||||
|
||||
static inline void CheckCapturedMouseMessage (PMSG pMsg)
|
||||
{
|
||||
if (__mg_capture_wnd == pMsg->hwnd
|
||||
&& pMsg->message >= MSG_FIRSTMOUSEMSG
|
||||
&& pMsg->message <= MSG_LASTMOUSEMSG
|
||||
if (__mg_capture_wnd == pMsg->hwnd
|
||||
&& pMsg->message >= MSG_FIRSTMOUSEMSG
|
||||
&& pMsg->message <= MSG_LASTMOUSEMSG
|
||||
&& !(pMsg->wParam & KS_CAPTURED)) {
|
||||
int x, y;
|
||||
x = LOSWORD (pMsg->lParam);
|
||||
@@ -493,7 +493,7 @@ static inline void CheckCapturedMouseMessage (PMSG pMsg)
|
||||
(nMsgFilterMin > 0 && nMsgFilterMax >= nMsgFilterMin && \
|
||||
message >= nMsgFilterMin && message <= nMsgFilterMax) )
|
||||
|
||||
BOOL PeekMessageEx (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax,
|
||||
BOOL PeekMessageEx (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax,
|
||||
BOOL bWait, UINT uRemoveMsg)
|
||||
{
|
||||
PMSGQUEUE pMsgQueue;
|
||||
@@ -537,7 +537,7 @@ checkagain:
|
||||
pMsgQueue->dwState &= ~QS_QUIT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UNLOCK_MSGQ (pMsgQueue);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -614,7 +614,7 @@ checkagain:
|
||||
PMAINWIN pHostingRoot;
|
||||
HWND hNeedPaint;
|
||||
PMAINWIN pWin;
|
||||
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
/* REMIND this */
|
||||
if (hWnd == HWND_DESKTOP) {
|
||||
@@ -650,7 +650,7 @@ checkagain:
|
||||
UNLOCK_MSGQ (pMsgQueue);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* no paint message */
|
||||
pMsgQueue->dwState &= ~QS_PAINT;
|
||||
}
|
||||
@@ -719,7 +719,7 @@ checkagain:
|
||||
UNLOCK_MSGQ (pMsgQueue);
|
||||
|
||||
/* calling the timer callback procedure */
|
||||
ret_timer_proc = timer->proc (timer->hWnd,
|
||||
ret_timer_proc = timer->proc (timer->hWnd,
|
||||
timer->id, timer->tick_count);
|
||||
|
||||
/* lock the message queue again */
|
||||
@@ -730,7 +730,7 @@ checkagain:
|
||||
__mg_remove_timer (timer, slot);
|
||||
}
|
||||
UNLOCK_MSGQ (pMsgQueue);
|
||||
goto checkagain;
|
||||
goto checkagain;
|
||||
}
|
||||
else {
|
||||
pMsg->message = MSG_TIMER;
|
||||
@@ -765,17 +765,17 @@ checkagain:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
The following two functions are moved to window.h as inline functions.
|
||||
int GUIAPI GetMessage (PMSG pMsg, HWND hWnd)
|
||||
{
|
||||
return PeekMessageEx (pMsg, hWnd, 0, 0, TRUE, PM_REMOVE);
|
||||
}
|
||||
|
||||
BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
|
||||
BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
|
||||
UINT nMsgFilterMax, UINT uRemoveMsg)
|
||||
{
|
||||
return PeekMessageEx (pMsg, hWnd, nMsgFilterMin, nMsgFilterMax,
|
||||
return PeekMessageEx (pMsg, hWnd, nMsgFilterMin, nMsgFilterMax,
|
||||
FALSE, uRemoveMsg);
|
||||
}
|
||||
*/
|
||||
@@ -826,7 +826,7 @@ checkagain:
|
||||
if (pMsgQueue->dwState & QS_PAINT) {
|
||||
goto getit;
|
||||
}
|
||||
|
||||
|
||||
#ifndef _MGRM_THREADS
|
||||
if (pMsgQueue->dwState & QS_DESKTIMER) {
|
||||
goto getit;
|
||||
@@ -853,7 +853,7 @@ getit:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
|
||||
BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
|
||||
UINT nMsgFilterMax, UINT uRemoveMsg)
|
||||
{
|
||||
PMSGQUEUE pMsgQueue;
|
||||
@@ -869,7 +869,7 @@ BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
|
||||
memset (pMsg, 0, sizeof(MSG));
|
||||
|
||||
if (pMsgQueue->dwState & QS_POSTMSG) {
|
||||
|
||||
|
||||
if (pMsgQueue->readpos != pMsgQueue->writepos) {
|
||||
|
||||
pPostMsg = pMsgQueue->msg + pMsgQueue->readpos;
|
||||
@@ -882,7 +882,7 @@ BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
|
||||
UNLOCK_MSGQ (pMsgQueue);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
SET_PADD (NULL);
|
||||
|
||||
if (uRemoveMsg == PM_REMOVE) {
|
||||
@@ -915,7 +915,7 @@ LRESULT GUIAPI SendMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
|
||||
if (!BE_THIS_THREAD(hWnd))
|
||||
return SendSyncMessage (hWnd, nMsg, wParam, lParam);
|
||||
#endif
|
||||
|
||||
|
||||
if ( !(WndProc = GetWndProc(hWnd)) )
|
||||
return ERR_INV_HWND;
|
||||
|
||||
@@ -933,7 +933,7 @@ LRESULT SendTopNotifyMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam
|
||||
|
||||
if (!(pMsgQueue = kernel_GetMsgQueue(hWnd)))
|
||||
return ERR_INV_HWND;
|
||||
|
||||
|
||||
pqmsg = QMSGAlloc();
|
||||
|
||||
LOCK_MSGQ (pMsgQueue);
|
||||
@@ -973,7 +973,7 @@ int GUIAPI SendNotifyMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam
|
||||
|
||||
if (!(pMsgQueue = kernel_GetMsgQueue(hWnd)))
|
||||
return ERR_INV_HWND;
|
||||
|
||||
|
||||
pqmsg = QMSGAlloc();
|
||||
|
||||
LOCK_MSGQ (pMsgQueue);
|
||||
@@ -1091,7 +1091,7 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
|
||||
sem_post (pSyncMsg->sem_handle);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MGHAVE_TRACE_MSG
|
||||
if (pMsg->message != MSG_TIMEOUT && pMsg->message != MSG_CARETBLINK) {
|
||||
fprintf (stderr, "Message %u (%s) has been thrown away.\n",
|
||||
@@ -1157,11 +1157,11 @@ int GUIAPI ThrowAwayMessages (HWND hWnd)
|
||||
|
||||
if (pMsgQueue->pFirstNotifyMsg) {
|
||||
pQMsg = pMsgQueue->pFirstNotifyMsg;
|
||||
|
||||
|
||||
while (pQMsg) {
|
||||
pMsg = &pQMsg->Msg;
|
||||
|
||||
if (pMsg->hwnd == hWnd || gui_GetMainWindowPtrOfControl (pMsg->hwnd)
|
||||
if (pMsg->hwnd == hWnd || gui_GetMainWindowPtrOfControl (pMsg->hwnd)
|
||||
== (PMAINWIN)hWnd) {
|
||||
pMsg->hwnd = HWND_INVALID;
|
||||
nCountN ++;
|
||||
@@ -1179,7 +1179,7 @@ int GUIAPI ThrowAwayMessages (HWND hWnd)
|
||||
if (pMsgQueue->pFirstSyncMsg) {
|
||||
PSYNCMSG pSyncMsg, pSyncPrev = NULL;
|
||||
pSyncMsg = pMsgQueue->pFirstSyncMsg;
|
||||
|
||||
|
||||
while (pSyncMsg) {
|
||||
pMsg = &pSyncMsg->Msg;
|
||||
|
||||
@@ -1188,8 +1188,8 @@ int GUIAPI ThrowAwayMessages (HWND hWnd)
|
||||
pMsg->hwnd = HWND_INVALID;
|
||||
nCountS ++;
|
||||
|
||||
/*
|
||||
* notify the waiting thread and remove the node from
|
||||
/*
|
||||
* notify the waiting thread and remove the node from
|
||||
* msg queue
|
||||
*/
|
||||
pSyncMsg->retval = ERR_MSG_CANCELED;
|
||||
@@ -1211,7 +1211,7 @@ int GUIAPI ThrowAwayMessages (HWND hWnd)
|
||||
pSyncMsg = pSyncMsg->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG_TAM
|
||||
printf ("ThrowAwayMessages: %d sync messages thrown\n", nCountS);
|
||||
#endif
|
||||
@@ -1227,7 +1227,7 @@ int GUIAPI ThrowAwayMessages (HWND hWnd)
|
||||
pMsg->hwnd = HWND_INVALID;
|
||||
nCountP ++;
|
||||
}
|
||||
|
||||
|
||||
readpos++;
|
||||
#if 0
|
||||
if (readpos >= pMsgQueue->len) readpos = 0;
|
||||
@@ -1303,7 +1303,7 @@ LRESULT SendSyncMessage (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
return ERR_INV_HWND;
|
||||
|
||||
#define _SYNC_NEED_REENTERABLE
|
||||
#ifndef _SYNC_NEED_REENTERABLE
|
||||
#ifndef _SYNC_NEED_REENTERABLE
|
||||
if ((thinfo = GetMsgQueueThisThread ())) {
|
||||
/* avoid to create a new semaphore object, Note: it's not reenterable.*/
|
||||
SyncMsg.sem_handle = &thinfo->sync_msg;
|
||||
@@ -1330,7 +1330,7 @@ LRESULT SendSyncMessage (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
SyncMsg.pNext = NULL;
|
||||
|
||||
#if 1
|
||||
/* add by houhh 20081030, deal with itself's SyncMsg first before
|
||||
/* add by houhh 20081030, deal with itself's SyncMsg first before
|
||||
* SendSyncMessage to other thread, because other thread maybe wait
|
||||
* for SyncMsg for you.*/
|
||||
if (thinfo) {
|
||||
@@ -1379,11 +1379,11 @@ LRESULT SendSyncMessage (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
/* suspend until the message has been handled. */
|
||||
if (sem_wait (SyncMsg.sem_handle) < 0) {
|
||||
fprintf (stderr,
|
||||
fprintf (stderr,
|
||||
"KERNEL>SendSyncMessage: thread is interrupted abnormally!\n");
|
||||
}
|
||||
|
||||
#ifndef _SYNC_NEED_REENTERABLE
|
||||
#ifndef _SYNC_NEED_REENTERABLE
|
||||
if (thinfo == NULL)
|
||||
sem_destroy (&sync_msg);
|
||||
#else
|
||||
@@ -1406,7 +1406,7 @@ LRESULT GUIAPI PostSyncMessage (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
|
||||
LRESULT GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
WNDPROC WndProc;
|
||||
|
||||
|
||||
MG_CHECK_RET (MG_IS_WINDOW(hWnd), -1);
|
||||
|
||||
if (!(WndProc = GetWndProc(hWnd)))
|
||||
|
||||
+5
-5
@@ -795,7 +795,7 @@ void *mg_slice_alloc (size_t mem_size)
|
||||
if (MG_UNLIKELY (allocator->config.debug_blocks))
|
||||
smc_notify_alloc (mem, mem_size);
|
||||
|
||||
_DBG_PRINTF("%s: slice allocated: %p (%lu)\n",
|
||||
_DBG_PRINTF("%s: slice allocated: %p (%zu)\n",
|
||||
__FUNCTION__, (void*)mem, mem_size);
|
||||
|
||||
return mem;
|
||||
@@ -855,7 +855,7 @@ void mg_slice_free (size_t mem_size, void *mem_block)
|
||||
free (mem_block);
|
||||
}
|
||||
|
||||
_DBG_PRINTF("%s: slice freed: %p (%lu)\n",
|
||||
_DBG_PRINTF("%s: slice freed: %p (%zu)\n",
|
||||
__FUNCTION__, (void*)mem_block, mem_size);
|
||||
}
|
||||
|
||||
@@ -1236,19 +1236,19 @@ static int smc_notify_free (void *pointer, size_t size)
|
||||
found_one = smc_tree_lookup (address, &real_size);
|
||||
|
||||
if (!found_one) {
|
||||
_ERR_PRINTF("MGSlice: MemChecker: attempt to release non-allocated block: %p size=%lu\n",
|
||||
_ERR_PRINTF("MGSlice: MemChecker: attempt to release non-allocated block: %p size=%zu\n",
|
||||
pointer, size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (real_size != size && (real_size || size)) {
|
||||
_ERR_PRINTF("MGSlice: MemChecker: attempt to release block with invalid size: %p size=%lu invalid-size=%lu\n",
|
||||
_ERR_PRINTF("MGSlice: MemChecker: attempt to release block with invalid size: %p size=%zu invalid-size=%zu\n",
|
||||
pointer, real_size, size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!smc_tree_remove (address)) {
|
||||
_ERR_PRINTF("MGSlice: MemChecker: attempt to release non-allocated block: %p size=%lu\n",
|
||||
_ERR_PRINTF("MGSlice: MemChecker: attempt to release non-allocated block: %p size=%zu\n",
|
||||
pointer, size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+13
-1
@@ -407,6 +407,11 @@ unsigned int __mg_os_get_random_seed (void)
|
||||
return 0;
|
||||
#elif defined (__UCOSII__)
|
||||
return 0;
|
||||
#elif defined (__RTTHREAD__)
|
||||
// rt_tick_t rt_tick_get(void);
|
||||
unsigned int rt_tick_get(void);
|
||||
return rt_tick_get();
|
||||
#elif defined (__FREERTOS__)
|
||||
#else
|
||||
/*other os use time, for example: linux, OSE, etc.*/
|
||||
return time (NULL);
|
||||
@@ -425,7 +430,7 @@ void __mg_os_time_delay (int ms)
|
||||
OSTimeDly (OS_TICKS_PER_SEC * ms / 1000);
|
||||
#elif defined (__VXWORKS__)
|
||||
taskDelay (sysClkRateGet() * ms / 1000);
|
||||
#elif defined (__PSOS__) || defined (__ECOS__)
|
||||
#elif defined (__PSOS__) || defined (__ECOS__) || defined (__RTEMS__)
|
||||
struct timespec ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = ms * 1000000;
|
||||
@@ -439,6 +444,13 @@ void __mg_os_time_delay (int ms)
|
||||
NU_Sleep (ms/10);
|
||||
#elif defined (__OSE__)
|
||||
delay(ms);
|
||||
#elif defined (__RTTHREAD__)
|
||||
// rt_err_t rt_thread_mdelay(rt_int32_t ms);
|
||||
extern int rt_thread_mdelay(int ms);
|
||||
rt_thread_mdelay(ms);
|
||||
#elif defined (__FREERTOS__)
|
||||
#else
|
||||
#error "Please implement __mg_os_time_delay for your OS"
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
abs_top_srcdir=../../..
|
||||
LOCAL_INC=-I$(abs_top_srcdir)/src/newgal/
|
||||
|
||||
include Makefile.am
|
||||
include ../../../rules.make
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
abs_top_srcdir=../../..
|
||||
LOCAL_INC=-I$(abs_top_srcdir)/src/newgal/
|
||||
|
||||
include Makefile.am
|
||||
include ../../../rules.make
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
abs_top_srcdir=../../..
|
||||
LOCAL_INC=-I$(abs_top_srcdir)/src/newgal/
|
||||
|
||||
include Makefile.am
|
||||
include ../../../rules.make
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define _DEBUG
|
||||
#include "common.h"
|
||||
#include "newgal.h"
|
||||
#include "sysvideo.h"
|
||||
|
||||
+3
-3
@@ -337,17 +337,17 @@ void mg_TerminateGDI( void )
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Function: int GUIAPI GetGDCapability( int iItem)
|
||||
* Function: Uint32 GUIAPI GetGDCapability( int iItem)
|
||||
* This Function return DC parameters.
|
||||
* Parameters:
|
||||
* The element want to retrive.
|
||||
* Return:
|
||||
* The parameter.
|
||||
*/
|
||||
unsigned int GUIAPI GetGDCapability (HDC hdc, int iItem)
|
||||
Uint32 GUIAPI GetGDCapability (HDC hdc, int iItem)
|
||||
{
|
||||
PDC pdc;
|
||||
unsigned int iret = 0xFFFFFFFF;
|
||||
Uint32 iret = 0xFFFFFFFF;
|
||||
|
||||
pdc = dc_HDC2PDC (hdc);
|
||||
|
||||
|
||||
+13
-13
@@ -6,23 +6,23 @@ noinst_LTLIBRARIES = libnewgdi.la
|
||||
|
||||
ifdef MG_MINIMALGDI
|
||||
SRC_FILES = gdi.c attr.c clip.c coor.c rect.c \
|
||||
bitmap.c \
|
||||
pixel.c pixel_ops.c \
|
||||
region.c polygon.c
|
||||
bitmap.c pixel.c pixel_ops.c \
|
||||
region.c polygon.c
|
||||
else
|
||||
SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \
|
||||
palette.c readbmp.c icon.c screen.c bitmap.c \
|
||||
pixel.c line.c arc.c pixel_ops.c \
|
||||
region.c generators.c polygon.c flood.c \
|
||||
advapi.c midash.c mispans.c miwideline.c \
|
||||
mifillarc.c mifpolycon.c miarc.c rotatebmp.c \
|
||||
text.c glyph.c bidi.c \
|
||||
textout.c tabbedtextout.c drawtext.c
|
||||
palette.c readbmp.c icon.c screen.c bitmap.c \
|
||||
pixel.c line.c arc.c pixel_ops.c \
|
||||
region.c generators.c polygon.c flood.c \
|
||||
advapi.c midash.c mispans.c miwideline.c \
|
||||
mifillarc.c mifpolycon.c miarc.c rotatebmp.c \
|
||||
text.c achar-uchar.c glyph.c legacy-bidi.c \
|
||||
textout.c tabbedtextout.c drawtext.c \
|
||||
simple-glyph-renderer.c glyph-shaped.c \
|
||||
textruns.c \
|
||||
shape-glyphs-basic.c shape-glyphs-complex.c \
|
||||
layout.c layout-utils.c layout-ellipsize.c
|
||||
endif
|
||||
|
||||
HDR_FILES = drawtext.h mi.h midc.h mistruct.h miwideline.h \
|
||||
pixel_ops.h mifillarc.h mispans.h polygon.h mifpoly.h
|
||||
|
||||
libnewgdi_la_SOURCES = $(SRC_FILES) $(HDR_FILES)
|
||||
|
||||
LIB_NAME=libnewgdi
|
||||
|
||||
+1
-1
@@ -496,7 +496,7 @@ static char* _flat_values[]={
|
||||
"1",
|
||||
"16",
|
||||
//window element colors
|
||||
"0xFFFFFFFFF",
|
||||
"0xFFFFFFFF",
|
||||
"0xFF000000",
|
||||
"0xFF000000",
|
||||
"0xFF000000",
|
||||
|
||||
@@ -497,7 +497,7 @@ static char* _flat_values[]={
|
||||
"1",
|
||||
"16",
|
||||
//window element colors
|
||||
"0xFFFFFFFFF",
|
||||
"0xFFFFFFFF",
|
||||
"0xFF000000",
|
||||
"0xFF000000",
|
||||
"0xFF000000",
|
||||
|
||||
+90
-221
@@ -11,35 +11,35 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* 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 smart IoT devices.
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Or,
|
||||
*
|
||||
*
|
||||
* As this program is a library, any link to this program must follow
|
||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||
* GPLv3, you need to be licensed from FMSoft.
|
||||
*
|
||||
*
|
||||
* If you have got a commercial license of this program, please use it
|
||||
* under the terms and conditions of the commercial license.
|
||||
*
|
||||
*
|
||||
* For more information about the commercial license, please refer to
|
||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||
*/
|
||||
@@ -194,7 +194,6 @@ static RES_TYPE_INFO pre_def_types[RES_TYPE_USER] = {
|
||||
// the hash table operations
|
||||
//
|
||||
#define Key2Idx(t,key) ((key)%((t)->size))
|
||||
#define IsValidKey(key) ((key)>0 && (key)<0xFFFFFFFF)
|
||||
static void init_hash_table(HASH_TABLE* table, int size)
|
||||
{
|
||||
if(table == NULL)
|
||||
@@ -211,7 +210,7 @@ static RES_ENTRY* get_entry(HASH_TABLE* table, RES_KEY key, BOOL create)
|
||||
RES_ENTRY* entry;
|
||||
int idx;
|
||||
|
||||
if(table == NULL || table->size<=0 || table->entries == NULL || !IsValidKey(key))
|
||||
if(table == NULL || table->size<=0 || table->entries == NULL)
|
||||
return NULL;
|
||||
|
||||
idx = Key2Idx(table,key);
|
||||
@@ -244,17 +243,16 @@ static void remove_entry(HASH_TABLE* table, RES_KEY key)
|
||||
RES_ENTRY* entry, *prev;
|
||||
int idx;
|
||||
|
||||
if(table == NULL && IsValidKey(key))
|
||||
return ;
|
||||
if (table == NULL)
|
||||
return;
|
||||
|
||||
idx = Key2Idx(table,key);
|
||||
if(idx <0 || idx >= table->size)
|
||||
return ;
|
||||
idx = Key2Idx(table, key);
|
||||
if (idx < 0 || idx >= table->size)
|
||||
return;
|
||||
|
||||
//get the entry begin list
|
||||
entry = table->entries[idx];
|
||||
|
||||
if(entry->key == key){
|
||||
if (entry->key == key) {
|
||||
table->entries[idx] = entry->next;
|
||||
DELETE(entry);
|
||||
return;
|
||||
@@ -262,23 +260,21 @@ static void remove_entry(HASH_TABLE* table, RES_KEY key)
|
||||
|
||||
prev = entry;
|
||||
entry = entry->next;
|
||||
while(entry && entry->key != key){
|
||||
while (entry && entry->key != key){
|
||||
prev = entry;
|
||||
entry = entry->next;
|
||||
}
|
||||
|
||||
if(entry )
|
||||
{
|
||||
if (entry) {
|
||||
prev->next = entry->next;
|
||||
DELETE(entry);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void release_hash_table(HASH_TABLE* table)
|
||||
{
|
||||
if(table){
|
||||
if(table->entries)
|
||||
if (table) {
|
||||
if (table->entries)
|
||||
DELETE(table->entries);
|
||||
table->entries = NULL;
|
||||
table->count = 0;
|
||||
@@ -368,10 +364,17 @@ static void delete_entry_data(RES_ENTRY* entry)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////
|
||||
//inside functions
|
||||
/* The hash table size should be a prime. The following table gives all primes
|
||||
* less than 1000:
|
||||
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107
|
||||
109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223
|
||||
227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337
|
||||
347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457
|
||||
461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593
|
||||
599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719
|
||||
727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857
|
||||
859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997
|
||||
*/
|
||||
BOOL InitializeResManager(int hash_table_size)
|
||||
{
|
||||
char szpath[MAX_PATH+1];
|
||||
@@ -382,9 +385,9 @@ BOOL InitializeResManager(int hash_table_size)
|
||||
#if !defined(__NOUNIX__) || defined(WIN32)
|
||||
if ((p = getenv ("MG_RES_PATH"))) {
|
||||
int len = strlen(p);
|
||||
if (p[len-1] == '/')
|
||||
if (p[len-1] == '/')
|
||||
sprintf(szpath, "%s", p);
|
||||
else
|
||||
else
|
||||
sprintf(szpath, "%s/", p);
|
||||
cfg_res_path = strdup(szpath);
|
||||
}
|
||||
@@ -446,69 +449,6 @@ const char* sysres_get_system_res_path()
|
||||
return cfg_res_path;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////
|
||||
//outside functions
|
||||
#if 0
|
||||
static int get_respath_count()
|
||||
{
|
||||
int cnt;
|
||||
if(res_paths == NULL)
|
||||
return 0;
|
||||
|
||||
for(cnt=0; res_paths[cnt]; cnt++);
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
int strstrcnt(const char* strs, int s)
|
||||
{
|
||||
int i;
|
||||
if(strs == NULL)
|
||||
return 0;
|
||||
i = 1;
|
||||
while((strs = strchr(strs,s))){
|
||||
i ++;
|
||||
strs ++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
int AddResPath(const char* paths)
|
||||
{
|
||||
int cnt;
|
||||
int p_ctn = 0;
|
||||
const char* str;
|
||||
if(path == NULL)
|
||||
return RES_RET_INVALID_PARAM;
|
||||
|
||||
cnt = get_respath_count();
|
||||
|
||||
if(cnt <= 0) cnt = 1;
|
||||
|
||||
//the path is "[path1]:[path2]:..."
|
||||
//get the count of paths
|
||||
p_cnt = strstrcnt(paths,':');
|
||||
if(p_cnt <= 0)
|
||||
return RES_RES_INVALID_PARAM;
|
||||
|
||||
res_pahts = SNEW(char*, res_paths, cnt+p_cnt);
|
||||
|
||||
str = paths;
|
||||
cnt --;
|
||||
while((str = strchr(paths,':')))
|
||||
{
|
||||
res_paths[cnt++] = strndup(paths, str-paths);
|
||||
paths = str + 1;
|
||||
}
|
||||
|
||||
res_paths[cnt++] = strdup(paths);
|
||||
res_paths[cnt] = NULL;
|
||||
|
||||
return RES_RET_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const char* GetResPath (void)
|
||||
{
|
||||
return usr_res_path;
|
||||
@@ -571,9 +511,8 @@ int AddInnerRes(INNER_RES* inner_res, int count, BOOL bcopy)
|
||||
}
|
||||
else
|
||||
{
|
||||
//if the resource is not copyed,
|
||||
//we didnot free it until the system
|
||||
//is exist
|
||||
//if the resource is not copied,
|
||||
//we did not free it until the system exits.
|
||||
entry->source = &inner_res[i];
|
||||
}
|
||||
SetUsed(entry);
|
||||
@@ -731,7 +670,7 @@ void* LoadResource(const char* res_name, int type, DWORD usr_param)
|
||||
if(entry == NULL){
|
||||
RES_UNLOCK();
|
||||
#ifdef _DEBUG
|
||||
ERR_RETV(NULL, type, "%s is not exists", res_name);
|
||||
ERR_RETV(NULL, type, "%s does not exist", res_name);
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
@@ -808,7 +747,7 @@ void* GetResource(RES_KEY key)
|
||||
|
||||
if (entry == NULL || entry->data == NULL) {
|
||||
#ifdef _DEBUG
|
||||
ERR_RETV (NULL, -1, "data is not exist");
|
||||
ERR_RETV (NULL, -1, "data does not exist");
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
@@ -826,7 +765,7 @@ int AddResRef(RES_KEY key)
|
||||
RES_UNLOCK();
|
||||
if (entry == NULL) {
|
||||
#ifdef _DEBUG
|
||||
ERR_RETV (-1, -1, "resouce is not exist(key=%x)", key);
|
||||
ERR_RETV (-1, -1, "resouce does not exist(key=%x)", key);
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
@@ -870,6 +809,7 @@ int ReleaseRes(RES_KEY key)
|
||||
return ref;
|
||||
}
|
||||
|
||||
#if 0
|
||||
RES_KEY Str2Key (const char* str)
|
||||
{
|
||||
int i,l;
|
||||
@@ -887,6 +827,53 @@ RES_KEY Str2Key (const char* str)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
// We use FNV-1a algrithm for Str2Key:
|
||||
// http://isthe.com/chongo/tech/comp/fnv/
|
||||
|
||||
#if SIZEOF_PTR == 8
|
||||
// 2^40 + 2^8 + 0xb3 = 1099511628211
|
||||
# define FNV_PRIME ((RES_KEY)0x100000001b3ULL)
|
||||
# define FNV_INIT ((RES_KEY)0xcbf29ce484222325ULL)
|
||||
#else
|
||||
// 2^24 + 2^8 + 0x93 = 16777619
|
||||
# define FNV_PRIME ((RES_KEY)0x01000193)
|
||||
# define FNV_INIT ((RES_KEY)0x811c9dc5)
|
||||
#endif
|
||||
|
||||
RES_KEY Str2Key(const char* str)
|
||||
{
|
||||
const unsigned char* s = (const unsigned char*)str;
|
||||
RES_KEY hval = FNV_INIT;
|
||||
|
||||
if (str == NULL)
|
||||
return RES_KEY_INVALID;
|
||||
|
||||
/*
|
||||
* FNV-1a hash each octet in the buffer
|
||||
*/
|
||||
while (*s) {
|
||||
|
||||
/* xor the bottom with the current octet */
|
||||
hval ^= (RES_KEY)*s++;
|
||||
|
||||
/* multiply by the FNV magic prime */
|
||||
#ifdef __GNUC__
|
||||
# if SIZEOF_PTR == 8
|
||||
hval += (hval << 1) + (hval << 4) + (hval << 5) +
|
||||
(hval << 7) + (hval << 8) + (hval << 40);
|
||||
# else
|
||||
hval += (hval<<1) + (hval<<4) + (hval<<7) + (hval<<8) + (hval<<24);
|
||||
# endif
|
||||
#else
|
||||
hval *= FNV_PRIME;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* return our new hash value */
|
||||
return hval;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
static void res_error(int type, const char* funcname, const char* strinfo, ... )
|
||||
@@ -894,12 +881,12 @@ static void res_error(int type, const char* funcname, const char* strinfo, ... )
|
||||
char strbuff [256];
|
||||
static const char* errinfo[]={
|
||||
"invalid param",
|
||||
"key is not exits",
|
||||
"load file failed",
|
||||
"load mem failed",
|
||||
"key does not exist",
|
||||
"failed to load file",
|
||||
"failed to load from memory",
|
||||
"unknown type",
|
||||
"not implement",
|
||||
"res is in used"
|
||||
"res is in use"
|
||||
};
|
||||
va_list va;
|
||||
|
||||
@@ -981,124 +968,6 @@ static void img_unload (RESOURCE* res, int src_type)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////
|
||||
//icons
|
||||
#if 0
|
||||
typedef struct _icon_res_t{
|
||||
DWORD dwMask;
|
||||
HICON *icons;
|
||||
}icon_res_t;
|
||||
|
||||
static inline int icon_res_which_to_idx(DWORD dwMask, int which)
|
||||
{
|
||||
int idx = 0;
|
||||
while(which>=0)
|
||||
{
|
||||
if(dwMask&1) idx ++;
|
||||
dwMask >>= 1;
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
static inline int icon_res_get_cnt(icon_res_t* res)
|
||||
{
|
||||
DWORD dw = res->dwMask;
|
||||
int cnt = 0;
|
||||
while(dw!=0)
|
||||
{
|
||||
cnt ++;
|
||||
dw >>= 1;
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
static BOOL icon_get_res_data(RESOURCE* res, int src_type, void* usr_param)
|
||||
{
|
||||
int which;
|
||||
icon_res_t* res_icon;
|
||||
if(res == NULL)
|
||||
return FALSE;
|
||||
|
||||
which = (int)usr_param;
|
||||
|
||||
if(which < 0 || which>=32)
|
||||
which = 0;
|
||||
|
||||
if(res->data == NULL)
|
||||
{
|
||||
res_icon = NEW(icon_res_t);
|
||||
res->data = res_icon;
|
||||
}
|
||||
|
||||
if(res_icon->dwMask & (1<<which)){
|
||||
return res_icon->icons[icon_res_which_to_idx(res_icon->dwMask, which)];
|
||||
}
|
||||
else
|
||||
{
|
||||
//load icon
|
||||
HICON hi;
|
||||
if(res->source.src == NULL)
|
||||
return NULL;
|
||||
|
||||
switch(src_type)
|
||||
{
|
||||
case REF_SRC_FILE:
|
||||
{
|
||||
char szpath[512];
|
||||
RES_FILE_SRC* file = res->source.file;
|
||||
sprintf(szpath, "%s/%s", file->path, file->filename);
|
||||
hi = LoadIconFromFile(HDC_SCREEN, szpath, which);
|
||||
break;
|
||||
}
|
||||
case REF_SRC_INNER:
|
||||
{
|
||||
INNER_RES* inner = res->source.inner;
|
||||
hi = LoadIconFromMem(HDC_SCREEN, inner->data, inner->data_len, which);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(hi != 0)
|
||||
{
|
||||
//insrt at which
|
||||
int idx;
|
||||
int cnt;
|
||||
int i;
|
||||
res_icon->dwMask |= (1<<which);
|
||||
idx = icon_res_which_to_idx(res_icon->dwMask, which);
|
||||
cnt = icon_res_get_cnt(res_icon);
|
||||
res_icon->icons = SNEW(HICON, res_icon->icons,cnt+1);
|
||||
//move elements
|
||||
for(i=cnt; i>idx; i--)
|
||||
{
|
||||
res_icon->icons[i] = res_icon->icons[i-1];
|
||||
}
|
||||
res_icon->icons[idx] = hi;
|
||||
return hi;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void icon_unload(RESOURCE* res, int src_type)
|
||||
{
|
||||
if(res && res->data)
|
||||
{
|
||||
icon_res_t* ir = (icon_res_t*)res->data;
|
||||
if(ir->icons)
|
||||
{
|
||||
int cnt = icon_res_get_cnt(ir);
|
||||
while(cnt>0)
|
||||
DestroyIcon(ir->icons[--cnt]);
|
||||
DELETE(ir->icons);
|
||||
}
|
||||
DELETE(ir);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void* icon_get_res_data(RESOURCE* res, int src_type, DWORD usr_param)
|
||||
{
|
||||
if (res == NULL)
|
||||
|
||||
+14
-3
@@ -333,16 +333,27 @@ void GUIAPI UnregisterSystemBitmap (HDC hdc, const char* rdr_name, const char* i
|
||||
|
||||
}
|
||||
|
||||
/* The hash table size should be a prime. The following table gives all primes
|
||||
* less than 1000:
|
||||
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107
|
||||
109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223
|
||||
227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337
|
||||
347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457
|
||||
461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593
|
||||
599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719
|
||||
727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857
|
||||
859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997
|
||||
*/
|
||||
BOOL mg_InitSystemRes (void)
|
||||
{
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
# ifdef _MGCOMPLEX_SCRIPTS
|
||||
# define _SIZE_RES_HASH_TABLE 256
|
||||
# define _SIZE_RES_HASH_TABLE 277
|
||||
# else
|
||||
# define _SIZE_RES_HASH_TABLE 128
|
||||
# define _SIZE_RES_HASH_TABLE 167
|
||||
# endif
|
||||
#else
|
||||
# define _SIZE_RES_HASH_TABLE 64
|
||||
# define _SIZE_RES_HASH_TABLE 71
|
||||
#endif
|
||||
|
||||
InitializeResManager(_SIZE_RES_HASH_TABLE);
|
||||
|
||||
Reference in New Issue
Block a user