Compare commits

..
1 Commits
Author SHA1 Message Date
gengyue d68561769d modified for cross compile 2020-04-12 21:26:40 +08:00
45 changed files with 320 additions and 768 deletions
+1 -2
View File
@@ -4,8 +4,6 @@
*.al
*.a
*.so
\#
am--include-marker
Makefile
Makefile.in
.deps/
@@ -25,6 +23,7 @@ Makefile.in
/*config.h
/*config.h.in
/*config.h.in~
/src/font/utils/emoji/
/src/font/utils/ucd/
/src/sysres/font_list
+2 -2
View File
@@ -1,5 +1,5 @@
MAJOR_VERSION = 5
MINOR_VERSION = 0
MAJOR_VERSION = 4
MINOR_VERSION = 1
MICRO_VERSION = 0
EXTRAVERSION =
+41 -106
View File
@@ -6,22 +6,18 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
## TABLE OF CONTENTS
- [INTRODUCTION](#introduction)
+ [What's MiniGUI](#whats-minigui)
+ [MiniGUI Components](#minigui-components)
+ [Open Source Apps Based-on MiniGUI](#open-source-apps-based-on-minigui)
+ [MiniGUI and HybridOS](#minigui-and-hybridos)
+ [Source Code Repositories](#source-code-repositories)
- [NEW FEATURES IN VERSION 5.0.x](#new-features-in-version-50x)
+ [Compositing Schema](#compositing-schema)
+ [New Main Window Types](#new-main-window-types)
+ [Virtual Window](#virtual-window)
+ [Other Enhancements](#other-enhancements)
+ [Compositing schema](#compositing-schema)
+ [New main window types](#new-main-window-types)
+ [Virtual window](#virtual-window)
+ [Other enhancements](#other-enhancements)
- [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)
- [A BRIEF BUILDING INSTRUCTION](#a-brief-building-instruction)
+ [Building Whole MiniGUI](#building-whole-minigui)
+ [Prerequisites](#prerequisites)
+ [Building MiniGUI Core](#building-minigui-core)
+ [Building whole MiniGUI](#building-whole-minigui)
+ [Unit Tests](#unit-tests)
- [HISTORY](#history)
- [AUTHORS AND COPYING](#authors-and-copying)
@@ -32,8 +28,6 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
## INTRODUCTION
### What's MiniGUI
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
User Interface) support system for embedded systems and smart IoT devices.
This is the version 5.0.x of MiniGUI maintained by WEI Yongming.
@@ -50,8 +44,6 @@ Nucleus, pSOS, uC/OS-II, and OSE.
This is the source tree of MiniGUI Core, which provides the windowing
and graphics interfaces as well as a lot of standard controls (toolkit).
### MiniGUI Components
Besides MiniGUI Core, FMSoft also provides some components
for the developers to develop app much easier:
@@ -90,80 +82,22 @@ from the download zone of the site:
<http://www.minigui.com>
### Open Source Apps Based-on MiniGUI
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
* 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
* 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
* 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
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
### MiniGUI and HybridOS
HybridOS is another large open source project initiated by FMSoft. It is
a totally new open source operating system designed for smart IoT devices
and cloud computing environment.
In practice, MiniGUI and the software which are used to integrated with GPU
constitute the graphics stack of HybridOS.
HybridOS uses MiniGUI as the underlying windowing system, and the members of
HybridOS project are now maintaining the whole graphics stack.
The following chart shows the graphics stack of HybridOS:
```
-----------------------------------------------
| MiniGUI/HybridOS Apps |
|-----------------------------------------------|
| | (Graphics Stack) |
| | ---------------------|
| | | hiMesa |
| | hiCairo | ------------------|
| | MiniGUI | | EGL for MiniGUI |
| C++ libs | hiDRMDrivers | | GL, GLES, VG |
| C libs | libDRM | | GPU drivers |
|-----------------------------------------------|
| Linux Kernel |
| -----------------------------------|
| | DRI and DRI Drivers |
-----------------------------------------------
```
As shown in the chart above, the HybridOS graphics stack consists of
the following software:
- `libDRM` provides some user land APIs for Linux Direct Rendering Infrastructure.
- `hiDRMDrivers` contains the drivers (user land drivers, not kernel drivers) for
MiniGUI DRM engine. The drivers implement the basic hardware accelerated
2D graphics operations of various GPUs for MiniGUI.
- `hiMesa` is the Mesa derivative for HybridOS, while Mesa is the open source
implementation of OpenGL and other graphics APIs, including OpenGL ES
(versions 1, 2, 3), OpenCL, OpenMAX, and Vulkan. It contains the following
components:
+ The implementation of OpenGL, OpenGL ES (v1, 2, 3), and other
graphics APIs.
+ The EGL implementation for MiniGUI platform.
+ The graphics drivers for various GPUs and a software driver called `swrast`.
- `hiCairo` is the Cairo derivative for HybridOS. Cairo is a 2D vector graphics
library for Gtk. We provide support for MiniGUI backend in `hiCairo`.
For more information about HybridOS, please refer to:
<https://hybridos.fmsoft.cn/>
### Source Code Repositories
FMSoft had created the public repositories for MiniGUI Core, MiniGUI
components, HybridOS, and other open source apps on GitHub. You can visit
them on:
components, and other open source apps on GitHub. You can visit them on:
<https://github.com/VincentWei>
@@ -180,7 +114,7 @@ We now maintain all documents about MiniGUI on the following public repo:
In version 5.0.0, we introduced some new and exciting features, and refactored
a lot basic modules of MiniGUI Core.
### Compositing Schema
### Compositing schema
In this version, we enhanced the MiniGUI-Processes runtime mode to support
the compositing schema. Under compositing schema, regardless a main window
@@ -202,7 +136,7 @@ implementation for multi-process environment:
- Better security. One client created by different user cannot
read/write contents in/to another windows owned by other clients.
### New Main Window Types
### New main window types
In this version, we also enhanced the window manager of MiniGUI Core
to support some special main window types.
@@ -228,7 +162,7 @@ There are eight levels in MiniGUI from top to bottom:
This enhancement allows us to create a special app which acts as
screen lock, docker, or launcher.
### Virtual Window
### Virtual window
You know that we can post or send a message to other windows which
may run in another thread under MiniGUI-Threads. The MiniGUI
@@ -259,7 +193,7 @@ and the new thread.
This enhancement provides a very useful facility to you in order to
develop a well-designed multithreaded application.
### Other Enhancements
### Other enhancements
We also tune or enhance the following modules of MiniGUI Core:
@@ -292,7 +226,7 @@ so that the old applications can smoothly migrate to the new
version. However, there are still some slight changes you need to take care.
For more information, please refer to `RELEASE-NOTES.md` file:
<https://github.com/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
<https://github.com/VincentWei/minigui/blob/master/RELEASE-NOTES.md>
## NEW FEATURES IN VERSION 4.0.x
@@ -323,7 +257,7 @@ in order to support [HybridOS Foundation Class Library].
For more information, please refer to `RELEASE-NOTES.md` file:
<https://github.com/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md>
<https://github.com/VincentWei/minigui/blob/tree/rel-4-0/RELEASE-NOTES.md>
Because of the changes of some APIs, we recommended strongly that you
use this version for new projects.
@@ -385,30 +319,12 @@ clients and the server.
## A BRIEF BUILDING INSTRUCTION
### Building Whole MiniGUI
This instruction assumes that you are using Ubuntu Linux.
If you are anxious to see the comprehensive demo of MiniGUI Core
and MiniGUI components, please fetch one of the following repositories
from GitHub and follow the instructions to build MiniGUI Core,
MiniGUI components, the samples, and the demonstration programs:
### Prerequisites
<https://github.com/VincentWei/build-minigui-5.0>
or
<https://github.com/VincentWei/build-minigui-4.0>
or
<https://github.com/VincentWei/build-minigui-3.2>
### Building MiniGUI Core
We recommend that you use a latest Linux distribution with long term support,
for example, Ubuntu Linux LTS 16.04 or 18.04.
On Ubuntu Linux LTS 16.04 or 18.04, you should run `apt install <package_name>`
to install the following packages:
You should run `apt install <package_name>` to install the following packages
on your Ubuntu Linux.
* Building tools:
* autoconf
@@ -417,6 +333,8 @@ to install the following packages:
* libpng12-dev (use libpng-dev on Ubuntu Linux 18.04 LTS)
* libfreetype6-dev
### Building MiniGUI Core
MiniGUI Core uses GNU autoconf/automake scripts to configure and build the project.
Run
@@ -435,6 +353,23 @@ For more information, please run
$ ./configure --help
### Building whole MiniGUI
If you are anxious to see the comprehensive demo of MiniGUI Core
and MiniGUI components, please fetch one of the following repositories
from GitHub and follow the instructions to build MiniGUI Core,
MiniGUI components, the samples, and the demonstration programs:
<https://github.com/VincentWei/build-minigui-5.0>
or
<https://github.com/VincentWei/build-minigui-4.0>
or
<https://github.com/VincentWei/build-minigui-3.2>
### Unit Tests
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
@@ -548,7 +483,7 @@ A brief history description of the development progress is listed as follow:
1. Feb., 2018: FMSoft released MiniGUI version 3.2.0.
1. Apr., 2019: FMSoft released MiniGUI version 3.2.2.
1. Jul., 2019: FMSoft released MiniGUI version 4.0.0.
1. Mar., 2020: FMSoft released MiniGUI version 5.0.0.
1. Apr., 2020: FMSoft released MiniGUI version 5.0.0.
## AUTHORS AND COPYING
+20 -56
View File
@@ -1,11 +1,7 @@
# Release Notes
- [Version 5.0.3](#version-503)
+ [What's new in version 5.0.3](#whats-new-in-version-503)
- [Version 5.0.2](#version-502)
+ [What's new in version 5.0.2](#whats-new-in-version-502)
- [Version 5.0.0](#version-500)
+ [What's new in version 5.0.0](#whats-new-in-version-500)
- [Version 4.9.2](#version-492)
+ [What's new in this version](#whats-new-in-this-version)
+ [Compositing schema](#compositing-schema)
+ [New main window styles](#new-main-window-styles)
+ [Virtual window](#virtual-window)
@@ -14,62 +10,25 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis)
## Version 5.0.3
## Version 4.9.2
The MiniGUI development team announces the availability of MiniGUI 5.0.3,
which is the bug fixing release of MiniGUI 5.0.x.
The MiniGUI development team announces the availability of MiniGUI 4.9.2,
which is the third preview release of MiniGUI 5.0.0.
### What's new in version 5.0.3
This is an unstable release to show you some new and exciting features.
Here `unstable` means that the new APIs we introduced in this version
may change in the official release.
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Always check expired timers even got `EINTR`.
- Add static modifier to `refresh_dirty_region` method of the fallback compositor.
- Fix a bug in `RegisterListenFD`.
- Fix a bug in `allocate_more_fd_slots`.
* TUNING:
- Rebuild the private data for all visible z-nodes after selected a new compositor.
* ENHANCEMENTS:
- New configuration option: `--enable-mgslicefallback` to build a fallback
implementation of mgslice.
- New API: `ServerGetTopmostZNodeOfType`.
- Merge some code by @ehello (<https://github.com/ehello>) for FreeRTOS.
## Version 5.0.2
The MiniGUI development team announces the availability of MiniGUI 5.0.2,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.2
In this version, we tuned some code for GCC 9 and fixed some bugs:
* BUGFIXING:
- Initialize `cfg_res_path` in function `__sysres_get_system_res_path()`.
- Always return TRUE in `subtract_rgn_by_node()`.
* ADJUSTMENTS:
- Use upstream Harfbuzz for glyph shaping of complex scripts instead
of the modified version.
* TUNING:
- Tune some code to depress compilation warnings.
## Version 5.0.0
The MiniGUI development team announces the availability of MiniGUI 5.0.0,
which is the first official release of MiniGUI 5.0.x.
This version brings us some new and exciting features, and we did our best
to ensure backward compatibility of the existed APIs so that the old
applications can smoothly migrate to the new version.
We recommend that you use this version and report any bugs and
Nevertheless, we did our best to ensure backward compatibility of the
existed APIs so that the old applications can smoothly migrate to the new
version. We recommend that you test this version and report any bugs and
incompatibilities in
<https://github.com/VincentWei/minigui/tree/rel-5-0>
<https://github.com/VincentWei/minigui/tree/dev-4-1>
### What's new in version 5.0.0
### What's new in this version
In the development of version 5.0.x, we introduced the following new and
In the development of version 4.9.x, we introduced the following new and
exciting features for MiniGUI:
* ENHANCEMENTS:
@@ -107,7 +66,7 @@ exciting features for MiniGUI:
* ADJUSTMENTS:
- `g_rcScr` now is defined a macro calling function `GetScreenRect()`.
- `mgIsServer` now is define a macro calling function `IsServer()`.
* TUNING
* TUNNING
- Tune the `drm` (DRM) engine to support MiniGUI-Processes runtime mode
and compositing schema.
- Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema.
@@ -123,6 +82,11 @@ exciting features for MiniGUI:
message queue, event/message handling, and part of graphics abstract
layer.
The following new features will be developed in the successive versions of
4.9.x:
- Enhance other frequently used GAL engines to support compositing schema.
### Compositing schema
In this version, we enhanced the MiniGUI-Processes runtime mode to support
+4 -4
View File
@@ -1,11 +1,11 @@
Version 5.0.0 (2019/03/30)
Version 5.0.0 (2019/03/31)
This is the first official release of MiniGUI 5.0.x, the stable version.
This is the second preview version of MiniGUI 5.0.0, an unstable version.
Other packages for MiniGUI resource, tools, components, and samples:
- GVFB: `gvfb-1.2.5.tar.gz`
- The resource package: `minigui-res-5.0.0.tar.gz`
- GVFB: `gvfb-1.2.4.tar.gz`
- The resource package: `minigui-res-4.0.0.tar.gz`
- mGUtils component: `libmgutils-1.5.0.tar.gz`
- mGPlus component: `libmgplus-1.5.0.tar.gz`
- mGEff component: `libmgeff-1.5.0.tar.gz`
-44
View File
@@ -1,44 +0,0 @@
#!/bin/sh
rm config.cache config.status -f
./configure \
--disable-shared \
--enable-static \
--with-osname=freertos \
--with-targetname=external \
--with-runmode=sa \
--enable-mgslicefallback \
--disable-videopcxvfb \
--disable-videoqvfb \
--disable-videodrm \
--disable-videofbcon \
--enable-videocommlcd \
--enable-dummyial \
--disable-consoleial \
--disable-libinputial \
--enable-commial \
--disable-consoleimps2 \
--disable-mousecalibrate \
--enable-incoreres \
--disable-cursor \
--disable-clipboard \
--disable-adv2dapi \
--disable-savebitmap \
--disable-savescreen \
--disable-dblclk \
--disable-splash \
--disable-latin9support \
--disable-fullunicode \
--disable-rbfsupport \
--disable-vbfsupport \
--disable-upfsupport \
--disable-qpfsupport \
--disable-ttfsupport \
--disable-complexscripts \
--disable-ttfcache \
--disable-jpgsupport \
--disable-pngsupport \
--disable-flatlf \
--disable-textmode \
--disable-shmopen
-41
View File
@@ -1,41 +0,0 @@
#!/bin/sh
rm config.cache config.status -f
./configure \
--disable-shared \
--enable-static \
--with-osname=linux \
--with-targetname=external \
--with-runmode=sa \
--enable-mgslicefallback \
--disable-videopcxvfb \
--disable-videoqvfb \
--disable-videodrm \
--disable-videofbcon \
--enable-videocommlcd \
--enable-dummyial \
--disable-consoleial \
--disable-libinputial \
--enable-commial \
--disable-consoleimps2 \
--disable-mousecalibrate \
--enable-incoreres \
--disable-cursor \
--disable-savebitmap \
--disable-savescreen \
--disable-dblclk \
--disable-splash \
--disable-latin9support \
--disable-fullunicode \
--disable-rbfsupport \
--disable-vbfsupport \
--disable-upfsupport \
--disable-qpfsupport \
--disable-ttfsupport \
--disable-complexscripts \
--disable-ttfcache \
--disable-jpgsupport \
--disable-pngsupport \
--disable-flatlf \
--disable-textmode
-36
View File
@@ -1,36 +0,0 @@
# set your own targaet_os
TARGET_OS=freertos
##################################################
# set your compile tool #
CC=arm-linux-gnueabihf-gcc
CXX=arm-linux-gnueabihf-g++
CPP=arm-linux-gnueabihf-g++
AR=arm-linux-gnueabihf-ar
AS=arm-linux-gnueabihf-as
RANLIB=arm-linux-gnueabihf-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
LDFLAGS+=
##################################################
+8 -9
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(libminigui, 5.0.3)
AC_INIT(libminigui, 4.9.2)
AC_CONFIG_SRCDIR(src/main/main.c)
dnl Set various version strings - taken gratefully from the SDL sources
@@ -14,11 +14,11 @@ dnl Set various version strings - taken gratefully from the SDL sources
# if backwards compatibility has been broken,
# set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0.
#
MINIGUI_MAJOR_VERSION=5
MINIGUI_MINOR_VERSION=0
MINIGUI_MICRO_VERSION=3
MINIGUI_MAJOR_VERSION=4
MINIGUI_MINOR_VERSION=9
MINIGUI_MICRO_VERSION=2
MINIGUI_INTERFACE_AGE=0
MINIGUI_BINARY_AGE=3
MINIGUI_BINARY_AGE=0
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
AC_SUBST(MINIGUI_MAJOR_VERSION)
@@ -77,7 +77,7 @@ AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(time mktime localtime clock_gettime strdup strcasecmp strncasecmp strerror setlocale)
AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create access poll select)
AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create poll select)
PKG_CHECK_MODULES(UDEV, [libudev >= 200], have_udev="yes", have_udev="no; need libudev 200+")
@@ -1621,7 +1621,6 @@ case "$with_osname" in
*)
with_osname="linux"
osname="Linux"
use_shmopen="yes"
AC_DEFINE(__LINUX__, 1,
[Define if compile for Linux])
;;
@@ -2144,7 +2143,7 @@ if test "x$build_ttf_support" = "xyes"; then
if test "x$build_complex_scripts" = "xyes"; then
dnl Check for HarfBuzz library
AC_CHECK_LIB(harfbuzz, hb_version,
DEP_LIBS="$DEP_LIBS -lharfbuzz -lfreetype",
DEP_LIBS="$DEP_LIBS -lharfbuzzex -lfreetype",
build_complex_scripts="no; support for complex scripts requires libharfbuzz")
else
DEP_LIBS="$DEP_LIBS -lfreetype",
@@ -2224,7 +2223,7 @@ if test "x$build_complex_scripts" = "xyes"; then
[ --with-hb-includes=DIR where the HarfBuzz includes are])
if test "x$with_hb_includes" = "x"; then
HB_INC_DIR="-I/usr/include/harfbuzz"
HB_INC_DIR="-I/usr/local/include/harfbuzz"
else
HB_INC_DIR="-I$with_hb_includes"
fi
+1 -1
View File
@@ -80,7 +80,7 @@ double_buffering=true
# The filename of the shared library for the external driver.
# The equivalent environment variable: MG_GAL_DRM_DRIVER
exdriver=libhidrmdrivers-0.2.so.0
exdriver=libhidrmdrivers.so.0
#}}
#{{ifdef _MGIAL_LIBINPUT
+7 -7
View File
@@ -298,7 +298,7 @@ typedef struct _DrmDriverOps {
ColorLogicalOp logic_op);
/**
* This operation blits pixels from a source buffer with the source alpha
* This operation blits pixles from a source buffer with the source alpha
* value specified to a destination buffer.
*
* \note If this operation is set as NULL, the driver does not support
@@ -310,7 +310,7 @@ typedef struct _DrmDriverOps {
uint8_t alpha);
/**
* This operation blits pixels 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 operation is set as NULL, the driver does not support
@@ -322,7 +322,7 @@ typedef struct _DrmDriverOps {
uint32_t color_key);
/**
* This operation blits pixels from a source buffer with the source alpha
* This operation blits pixles from a source buffer with the source alpha
* value specified to a destination buffer, but skipping the pixel value
* specified.
*
@@ -335,7 +335,7 @@ typedef struct _DrmDriverOps {
uint8_t alpha, uint32_t color_key);
/**
* This operation blits pixels from a source buffer with the source alpha
* This operation blits pixles from a source buffer with the source alpha
* value of pixels to the destination buffer, and with the specified color
* compositing/blending method (\a ColorBlendMethod).
*
@@ -372,12 +372,12 @@ typedef struct _DrmDriverOps {
* For example, for Intel i915/i965 GPUs, the driver name will be `i915`.
* \param device_fd This argument gives the file descriptor of the
* opened DRI device.
* \param version A pointer to an integer which will be used to return
* the interface version of the DRM engine driver.
* \param version A pointer to an integer which will contain the
* versionc of the DRM engine driver.
*
* \return NULL or a valid pointer to DrmDriverOps.
*
* \note We use the version control since 4.0.7. It will be initialized
* \note We use the version control since 4.0.7. It will be intialized
* to zero by MiniGUI before calling this function. Because an old
* driver for MiniGUI 4.0.6 or earlier will not change the value,
* MiniGUI will deny to load the old driver.
+16 -50
View File
@@ -101,9 +101,9 @@ extern "C" {
#define ZOF_TYPE_NORMAL 0x30000000
#define ZOF_TYPE_HIGHER 0x40000000
#define ZOF_TYPE_DOCKER 0x50000000 // Since 5.0.0
#define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0
#define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0;
#define ZOF_TYPE_GLOBAL 0x70000000
#define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0
#define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0; fixed and only one.
#define ZOF_TYPE_POPUPMENU 0x90000000
#define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER
@@ -669,22 +669,21 @@ typedef void (* ON_NEW_DEL_CLIENT) (int op, int cli);
typedef void (* ON_CHANGE_LAYER) (int op, MG_Layer* layer,
MG_Client* client);
#define ZNOP_ALLOCATE 1
#define ZNOP_FREE 2
#define ZNOP_MOVE2TOP 3
#define ZNOP_SHOW 4
#define ZNOP_HIDE 5
#define ZNOP_MOVEWIN 6
#define ZNOP_SETACTIVE 7
#define ZNOP_ALLOCATE 1
#define ZNOP_FREE 2
#define ZNOP_MOVE2TOP 3
#define ZNOP_SHOW 4
#define ZNOP_HIDE 5
#define ZNOP_MOVEWIN 6
#define ZNOP_SETACTIVE 7
#define ZNOP_ENABLEWINDOW 11
#define ZNOP_DISABLEWINDOW 12
#define ZNOP_STARTDRAG 13
#define ZNOP_CANCELDRAG 14
#define ZNOP_CHANGECAPTION 15
#define ZNOP_REGIONCHANGED 16
#define ZNOP_COMPOSITINGCHANGED 17
#define ZNOP_ICONCHANGED 18 /* reserved for future */
#define ZNOP_ENABLEWINDOW 11
#define ZNOP_DISABLEWINDOW 12
#define ZNOP_STARTDRAG 13
#define ZNOP_CANCELDRAG 14
#define ZNOP_CHANGECAPTION 15
#define ZNOP_REGIONCHANGED 16
#define ZNOP_COMPOSITINGCHANGED 17
/**
* \var typedef void (* ON_ZNODE_OPERATION) (int op, int cli, int idx_znode)
@@ -890,39 +889,6 @@ MG_EXPORT BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer);
*/
MG_EXPORT BOOL GUIAPI ServerDeleteLayer (MG_Layer* layer);
/**
* \fn int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type,
* int* cli)
* \brief Get the topmost z-node in the specified layer for the specific
* window type from the server.
*
* This function gets the topmost z-node of the type specified by
* \a type in the specified layer \a layer from the server.
*
* \param layer The pointer to the layer, NULL for the current topmost layer.
* \param type The window type, can be one of the following values:
* - ZOF_TYPE_TOOLTIP
* - ZOF_TYPE_GLOBAL
* - ZOF_TYPE_SCREENLOCK
* - ZOF_TYPE_DOCKER
* - ZOF_TYPE_HIGHER
* - ZOF_TYPE_NORMAL
* - ZOF_TYPE_LAUNCHER
* \param cli The client identifier of the topmost z-node will be returned
* through this pointer. NULL is okay.
*
* \return The index of the topmost z-node of the specified type.
* Zero when there is no z-node in the level; < 0 when error.
*
* \note Server-only function. Note that this function will not return
* the z-node of the desktop, and the desktop always has the z-node index
* of zero.
*
* \sa ServerGetZNodeInfo
*/
MG_EXPORT int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type,
int* cli);
/**
* \fn int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode,
* int* cli)
+2 -4
View File
@@ -1433,12 +1433,10 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
item_info->add_data = item->add_data;
if (item_info->which & MTB_WHICH_TEXT)
//strncpy (item_info->text, item->text, NTB_TEXT_LEN);
strcpy (item_info->text, item->text);
strncpy (item_info->text, item->text, NTB_TEXT_LEN);
if (item_info->which & MTB_WHICH_TIP)
//strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
strcpy (item_info->tip, item->tip);
strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
return NTB_OKAY;
}
+13 -11
View File
@@ -1012,9 +1012,8 @@ void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
{
char font_name [LEN_UNIDEVFONT_NAME + 1];
//memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
//strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
strcpy(font_name, (*devfont)->name);
memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
font_DelDevFont (font_name);
*devfont = NULL;
@@ -1070,22 +1069,25 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
added_num ++;
}
else {
/* [DK] Fix Bug #4801, which introduce an absolute path check error in Windows,
* first to load from sytem res path, else load it directly (relative or absolute path).*/
if (add_dev_font (font_name, font_file, TRUE))
/* [DK] Fix Bug #4801, which introduce a absolute path check error in Windows,
* first to load from sytem res path, else load it directly(relative or absolute path).*/
if ((add_dev_font (font_name, font_file, TRUE)) == TRUE)
added_num++;
else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1,
__sysres_get_system_res_path(), font_file)) &&
add_dev_font (font_name, font_path, TRUE))
__sysres_get_system_res_path(), font_file))
&& ((add_dev_font (font_name, font_path, TRUE)) == TRUE))
added_num++;
}
}
if (is_unload || added_num > 0 || added_num == font_num) {
if (is_unload || added_num > 0 || added_num == font_num)
{
return TRUE;
}
return FALSE;
else
{
return FALSE;
}
}
BOOL font_InitSpecificalFonts (char* etc_section)
+31 -26
View File
@@ -120,42 +120,47 @@ hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
return UCharDecompose(ab, a, b);
}
/* extern hb_unicode_funcs_t *__mg_hb_unifuncs */
hb_unicode_funcs_t *__mg_hb_unifuncs;
static hb_unicode_funcs_t *_funcs;
static hb_unicode_funcs_t *get_unicode_funcs(void)
{
if (_funcs)
return _funcs;
_funcs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (_funcs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (_funcs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (_funcs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (_funcs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (_funcs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (_funcs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (_funcs);
return _funcs;
}
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
void __mg_init_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
if (__mg_hb_unifuncs)
return;
__mg_hb_unifuncs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (__mg_hb_unifuncs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (__mg_hb_unifuncs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (__mg_hb_unifuncs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (__mg_hb_unifuncs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (__mg_hb_unifuncs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (__mg_hb_unifuncs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (__mg_hb_unifuncs);
return;
__hb_extern_get_unicode_funcs = get_unicode_funcs;
}
void __mg_term_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
if (__mg_hb_unifuncs) {
hb_unicode_funcs_destroy(__mg_hb_unifuncs);
if (_funcs) {
hb_unicode_funcs_destroy(_funcs);
}
else {
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
+1 -1
View File
@@ -5393,7 +5393,6 @@ static BOOL _wndInvalidateRect(HWND hWnd, const RECT* prc, BOOL bEraseBkgnd, int
#endif
}
else {
_WRN_PRINTF ("The invalid region is forzen\n");
return FALSE;
}
@@ -5574,6 +5573,7 @@ HDC GUIAPI BeginPaint (HWND hWnd)
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), HDC_INVALID);
pWin = MG_GET_WINDOW_PTR (hWnd);
if (pWin->pCaretInfo && pWin->pCaretInfo->fBlink) {
HideCaretEx (hWnd, FALSE);
pWin->pCaretInfo->fBlink = TRUE;
+3 -1
View File
@@ -1243,9 +1243,11 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
break;
}
#if 0
default:
_WRN_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
_DBG_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
break;
#endif
}
libinput_event_destroy(event);
+1 -1
View File
@@ -7,4 +7,4 @@ noinst_HEADERS = \
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
glyph.h license.h mgsock.h unicode-ops.h \
linux-tty.h debug.h map.h
linux-tty.h debug.h
+18 -32
View File
@@ -77,7 +77,7 @@ struct _CompositorCtxt {
CLIPRGN wins_rgn; // visible region for all windows (subtract popup menus)
CLIPRGN dirty_rgn; // the dirty region
CLIPRGN inv_rgn; // the invalid region for a specific znode
Uint32 dirty_types;// the dirty znode types.
//Uint32 dirty_types;// the dirty znode types.
};
static CompositorCtxt* initialize (const char* name)
@@ -334,11 +334,9 @@ static void composite_ppp_znodes (CompositorCtxt* ctxt)
ClipRgnIntersect (&ctxt->inv_rgn, &ctxt->dirty_rgn, rgn);
if (IsEmptyClipRgn (&ctxt->inv_rgn)) {
ServerReleasePopupMenuZNodeHeader (zidx);
_DBG_PRINTF ("ppp %d skipped\n", zidx);
continue;
break;
}
else {
_DBG_PRINTF ("ppp %d composited\n", zidx);
// blit this popup menu to screen
SelectClipRegion (HDC_SCREEN_SYS, &ctxt->inv_rgn);
BitBlt (znode_hdr->mem_dc, 0, 0,
@@ -614,15 +612,14 @@ static BOOL reset_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
if (layer != mgTopmostLayer)
return FALSE;
ctxt->dirty_types = 0;
//ctxt->dirty_types = 0;
EmptyClipRgn (&ctxt->dirty_rgn);
return TRUE;
}
static BOOL merge_dirty_region (CompositorCtxt* ctxt,
static BOOL generate_dirty_region (CompositorCtxt* ctxt,
const ZNODEHEADER* znode_hdr, const CLIPRGN* znode_rgn)
{
EmptyClipRgn (&ctxt->inv_rgn);
if (znode_hdr && znode_hdr->dirty_rcs) {
int i;
for (i = 0; i < znode_hdr->nr_dirty_rcs; i++) {
@@ -631,23 +628,16 @@ static BOOL merge_dirty_region (CompositorCtxt* ctxt,
// device coordinates to screen coordinates
rc = znode_hdr->dirty_rcs [i];
OffsetRect (&rc, znode_hdr->rc.left, znode_hdr->rc.top);
AddClipRect (&ctxt->inv_rgn, &rc);
AddClipRect (&ctxt->dirty_rgn, &rc);
}
if (znode_rgn)
IntersectRegion (&ctxt->inv_rgn, &ctxt->inv_rgn, znode_rgn);
IntersectRegion (&ctxt->dirty_rgn, &ctxt->dirty_rgn, znode_rgn);
else
IntersectClipRect (&ctxt->inv_rgn, &ctxt->rc_screen);
IntersectClipRect (&ctxt->dirty_rgn, &ctxt->rc_screen);
}
if (IsEmptyClipRgn (&ctxt->inv_rgn)) {
return FALSE;
}
UnionRegion (&ctxt->dirty_rgn, &ctxt->dirty_rgn, &ctxt->inv_rgn);
EmptyClipRgn (&ctxt->inv_rgn);
return TRUE;
return !IsEmptyClipRgn (&ctxt->dirty_rgn);
}
static BOOL merge_dirty_ppp (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
@@ -659,16 +649,15 @@ static BOOL merge_dirty_ppp (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
_DBG_PRINTF("called: %d\n", zidx);
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer)
if (layer != mgTopmostLayer || zidx <= 0)
return rc;
znode_hdr = ServerGetPopupMenuZNodeHeader (zidx, (void**)&rgn, TRUE);
if (merge_dirty_region (ctxt, znode_hdr, rgn)) {
ctxt->dirty_types |= DIRTY_ZT_PPP;
if (generate_dirty_region (ctxt, znode_hdr, rgn)) {
//ctxt->dirty_types |= DIRTY_ZT_PPP;
rc = TRUE;
}
ServerReleasePopupMenuZNodeHeader (zidx);
return rc;
}
@@ -679,15 +668,15 @@ static BOOL merge_dirty_win (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
CLIPRGN *rgn;
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer)
if (layer != mgTopmostLayer || zidx <= 0)
return rc;
_DBG_PRINTF("called: %d\n", zidx);
/* merge the dirty region */
znode_hdr = ServerGetWinZNodeHeader (NULL, zidx, (void**)&rgn, TRUE);
if (merge_dirty_region (ctxt, znode_hdr, rgn)) {
ctxt->dirty_types |= DIRTY_ZT_WIN;
if (generate_dirty_region (ctxt, znode_hdr, rgn)) {
//ctxt->dirty_types |= DIRTY_ZT_WIN;
rc = TRUE;
}
ServerReleaseWinZNodeHeader (NULL, zidx);
@@ -700,10 +689,10 @@ static BOOL merge_dirty_wpp (CompositorCtxt* ctxt, MG_Layer* layer)
const ZNODEHEADER* znode_hdr;
znode_hdr = ServerGetWinZNodeHeader (NULL, 0, NULL, TRUE);
if (merge_dirty_region (ctxt, znode_hdr, NULL)) {
if (generate_dirty_region (ctxt, znode_hdr, NULL)) {
tile_dirty_region_for_wallpaper (ctxt);
//subtract_opaque_win_znodes_above (ctxt, 0);
ctxt->dirty_types |= DIRTY_ZT_WPP;
//ctxt->dirty_types |= DIRTY_ZT_WPP;
rc = TRUE;
}
@@ -711,19 +700,16 @@ static BOOL merge_dirty_wpp (CompositorCtxt* ctxt, MG_Layer* layer)
return rc;
}
static BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
{
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer || IsEmptyClipRgn (&ctxt->dirty_rgn))
return FALSE;
if (ctxt->dirty_types & DIRTY_ZT_PPP)
composite_ppp_znodes (ctxt);
composite_ppp_znodes (ctxt);
composite_on_dirty_region (ctxt, 0);
EmptyClipRgn (&ctxt->dirty_rgn);
SyncUpdateDC (HDC_SCREEN_SYS);
return TRUE;
}
+31 -71
View File
@@ -270,9 +270,8 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
if (!ops->reset_dirty_region (ctxt, layer))
return;
/* travel menu znodes on the layer;
this will only work for topmost layer */
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
/* travel menu znodes on the layer */
if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc);
@@ -302,23 +301,21 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
}
}
/* check wallpaper pattern; only call for topmost layer */
if (layer == mgTopmostLayer) {
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
assert (pdc->surface->dirty_info);
lock_znode_surface (pdc, nodes);
changes_in_dc = pdc->surface->dirty_info->dirty_age;
if (changes_in_dc != nodes[0].changes) {
ops->merge_dirty_wpp (ctxt, layer);
}
/* check wallpaper pattern */
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
assert (pdc->surface->dirty_info);
lock_znode_surface (pdc, nodes);
changes_in_dc = pdc->surface->dirty_info->dirty_age;
if (changes_in_dc != nodes[0].changes) {
ops->merge_dirty_wpp (ctxt, layer);
}
}
ops->refresh_dirty_region (ctxt, layer);
/* unlock the znode surfaces for popup menus */
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc);
@@ -341,15 +338,12 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
}
}
/* unlock the znode surfaces for wallpaper pattern;
only for topmost layer */
if (layer == mgTopmostLayer) {
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
nodes[0].changes = pdc->surface->dirty_info->dirty_age;
pdc->surface->dirty_info->nr_dirty_rcs = 0;
unlock_znode_surface (pdc, nodes);
}
/* unlock the znode surfaces for wallpaper patter */
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
nodes[0].changes = pdc->surface->dirty_info->dirty_age;
pdc->surface->dirty_info->nr_dirty_rcs = 0;
unlock_znode_surface (pdc, nodes);
}
}
@@ -377,16 +371,16 @@ void __mg_composite_dirty_znodes (void)
#endif /* optimized */
static void purge_all_znodes_private_data (const CompositorOps* ops,
CompositorCtxt* ctxt)
static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
CompositorCtxt* ctxt, MG_Layer* layer)
{
ZORDERINFO* zi;
ZORDERNODE* nodes;
int i, next;
MG_Layer* layer;
/* travel menu znodes on the topmost layer */
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
zi = (ZORDERINFO*)layer->zorder_info;
// travel popup menu znodes
if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
@@ -397,56 +391,25 @@ static void purge_all_znodes_private_data (const CompositorOps* ops,
}
}
/* travel all window znodes in all layers */
layer = mgLayers;
while (layer) {
zi = (ZORDERINFO*)layer->zorder_info;
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].priv_data && ops->purge_win_data) {
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
nodes[next].priv_data = NULL;
}
// travel window znodes
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].priv_data && ops->purge_win_data) {
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
nodes[next].priv_data = NULL;
}
layer = layer->next;
}
}
static void rebuild_all_znodes_private_data (const CompositorOps* ops,
static inline void purge_all_znodes_private_data (const CompositorOps* ops,
CompositorCtxt* ctxt)
{
ZORDERINFO* zi;
ZORDERNODE* nodes;
int i, next;
MG_Layer* layer;
/* travel menu znodes on the topmost layer */
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
if (nodes[i].flags & ZOF_VISIBLE) {
ops->on_showing_ppp (ctxt, i);
}
}
}
/* travel all window znodes in all layers */
layer = mgLayers;
while (layer) {
zi = (ZORDERINFO*)layer->zorder_info;
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].flags & ZOF_VISIBLE) {
ops->on_showing_win (ctxt, layer, next);
}
}
purge_znodes_private_data_in_layer (ops, ctxt, layer);
layer = layer->next;
}
}
@@ -570,9 +533,6 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
}
curr_ops = ops;
curr_ctxt = ctxt;
/* Since 5.0.3, to rebuild the private data of visible znodes */
rebuild_all_znodes_private_data (curr_ops, curr_ctxt);
curr_ops->refresh (ctxt);
}
+1 -1
View File
@@ -152,7 +152,7 @@ static HCURSOR load_cursor_from_mem (const void* area)
const Uint8* p = (Uint8*)area;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
int w = 0, h = 0, xhot = 0, yhot = 0, colornum = 0;
#if 0
DWORD32 size;
#endif
+8 -20
View File
@@ -298,10 +298,8 @@ static int update_client_window_rgn (int cli, HWND hwnd)
msg.lParam = MAKELONG (crc->rc.right, crc->rc.bottom);
ret = __mg_send2client (&msg, mgClients + cli);
if (ret < 0) {
_WRN_PRINTF ("__mg_send2client failed\n");
if (ret < 0)
break;
}
crc = crc->next;
}
@@ -832,6 +830,7 @@ static int srvAllocZOrderNode (int cli, HWND hwnd, HWND main_win,
if (surf) {
memdc = CreateMemDCFromSurface (surf);
_WRN_PRINTF ("surface (%p) refcount: %d\n", surf, surf->refcount);
if (memdc == HDC_INVALID) {
if (cli > 0) {
GAL_FreeSurface (surf);
@@ -868,25 +867,16 @@ static BOOL _cb_update_cli_znode (void* context,
if (znode->cli == cli && znode->flags & ZOF_VISIBLE && znode->hwnd) {
MSG msg = {znode->hwnd, MSG_UPDATECLIWIN, 0, 0, __mg_tick_counter};
if (!IsRectEmpty(&znode->dirty_rc)) {
if (!IsRectEmpty(&(znode->dirty_rc))) {
if (IntersectRect(&rcScr, &znode->rc, &rcScr) &&
IntersectRect(&rcInv, &znode->dirty_rc, &rcScr)) {
rcInv = znode->dirty_rc;
msg.wParam = MAKELONG (rcInv.left, rcInv.top);
msg.lParam = MAKELONG (rcInv.right, rcInv.bottom);
IntersectRect(&rcInv, &znode->dirty_rc, &rcScr);
_DBG_PRINTF ("Send MSG_UPDATECLIWIN to client window (%s): "
"%d, %d, %d x %d\n",
znode->caption,
rcInv.left, rcInv.top,
rcInv.right - rcInv.left,
rcInv.bottom - rcInv.top);
msg.wParam = MAKELONG (rcInv.left, rcInv.top);
msg.lParam = MAKELONG (rcInv.right, rcInv.bottom);
__mg_send2client (&msg, mgClients + znode->cli);
}
SetRectEmpty (&(znode->dirty_rc));
SetRectEmpty (&znode->dirty_rc);
__mg_send2client (&msg, mgClients + znode->cli);
return TRUE;
}
}
@@ -1211,7 +1201,6 @@ static int do_drag_drop_window (int msg, int x, int y)
#ifndef _MGSCHEMA_COMPOSITING
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
_dd_info.rc.right, _dd_info.rc.bottom);
SyncUpdateDC (HDC_SCREEN_SYS);
#else /* not defined _MGSCHEMA_COMPOSITING */
msg.wParam = MAKELONG (_dd_info.rc.left, _dd_info.rc.top);
@@ -1239,7 +1228,6 @@ static int do_drag_drop_window (int msg, int x, int y)
SetPenColor (HDC_SCREEN_SYS, PIXEL_lightwhite);
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
_dd_info.rc.right, _dd_info.rc.bottom);
SyncUpdateDC (HDC_SCREEN_SYS);
#endif /* not defined _MGSCHEMA_COMPOSITING */
/* post MSG_WINDOWDROPPED to the target window */
+30 -49
View File
@@ -188,7 +188,7 @@ static BOOL subtract_rgn_by_node (PCLIPRGN region, const ZORDERINFO* zi,
else
SubtractClipRect(region, &(node->rc));
return TRUE; // !IsEmptyClipRgn(region); We must return TRUE for this callback.
return TRUE;
}
#else /* not defined _MGSCHEMA_COMPOSITING */
@@ -427,18 +427,15 @@ void __mg_update_window (HWND hwnd,
((pWin->WinType == TYPE_CONTROL &&
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)) ||
pWin->WinType != TYPE_CONTROL) && pWin->dwStyle & WS_VISIBLE) {
RECT rcInv;
SetRect(&rcInv, left, top, right, bottom);
RECT invrc;
SetRect(&invrc, left, top, right, bottom);
_DBG_PRINTF ("Update window (%s): %d, %d, %d, %d\n",
pWin->spCaption, left, top, right, bottom);
if (IsRectEmpty (&rcInv)) {
if (IsRectEmpty (&invrc)) {
SendAsyncMessage ((HWND)pWin, MSG_NCPAINT, 0, 0);
InvalidateRect ((HWND)pWin, NULL, TRUE);
}
else {
RECT rcTemp, rcWin;
RECT rcTemp, rcInv, rcWin;
if (pWin->WinType == TYPE_CONTROL &&
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)){
@@ -447,18 +444,13 @@ void __mg_update_window (HWND hwnd,
else
GetWindowRect(hwnd, &rcWin);
/* XXX: when we move a window fast, there are some dirty rectangles
were not updated. We update whole area of the window for a work
around. */
if (IntersectRect (&rcTemp, &rcWin, &rcInv)) {
if (IntersectRect (&rcTemp,
&rcWin, &invrc)) {
dskScreenToWindow (pWin, &rcTemp, &rcInv);
SendAsyncMessage ((HWND)pWin,
MSG_NCPAINT, 0, 0); // (LPARAM)(&rcInv));
MSG_NCPAINT, 0, (LPARAM)(&rcInv));
dskScreenToClient (pWin, &rcTemp, &rcInv);
InvalidateRect ((HWND)pWin, NULL/*&rcInv*/, TRUE);
}
else {
_DBG_PRINTF ("IGNORED update\n");
InvalidateRect ((HWND)pWin, &rcInv, TRUE);
}
}
}
@@ -473,9 +465,6 @@ static int update_client_window (ZORDERNODE* znode, const RECT* rc)
if (znode->cli != 0) {
if (rc) {
_DBG_PRINTF ("Update window (%s): %d, %d, %d x %d\n",
znode->caption, rc->left, rc->top,
RECTWP(rc), RECTHP(rc));
if (IsRectEmpty (&znode->dirty_rc)) {
SetRect (&znode->dirty_rc,
@@ -484,8 +473,8 @@ static int update_client_window (ZORDERNODE* znode, const RECT* rc)
else {
GetBoundRect (&znode->dirty_rc, &znode->dirty_rc, rc);
}
mgClients [znode->cli].has_dirty = TRUE;
}
mgClients [znode->cli].has_dirty = TRUE;
}
else
#endif /* defined _MGRM_PROCESSES */
@@ -505,13 +494,7 @@ static BOOL _cb_update_znode (void* context,
{
const RECT* rc = (RECT*)context;
_DBG_PRINTF ("Checking window (%s), visibility: %s, referred: %s\n", znode->caption,
(znode->flags & ZOF_VISIBLE)? "TRUE" : "FALSE",
(znode->flags & ZOF_IF_REFERENCE)? "TRUE" : "FALSE");
if (znode->flags & ZOF_VISIBLE &&
znode->flags & ZOF_IF_REFERENCE) {
_DBG_PRINTF ("Widnow (%s) will be updated\n", znode->caption);
if (znode->flags & ZOF_VISIBLE && znode->flags & ZOF_IF_REFERENCE) {
update_client_window (znode, rc);
znode->flags &= ~ZOF_IF_REFERENCE;
return TRUE;
@@ -3252,7 +3235,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
slot = nodes [idx_znode].next;
for (; slot != 0; slot = nodes [slot].next) {
if (nodes [slot].flags & ZOF_VISIBLE &&
DoesIntersect (rcWin, &nodes [slot].rc)) {
DoesIntersect (rcWin, &nodes [slot].rc)) {
nodes [slot].age++;
}
}
@@ -3265,7 +3248,6 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
//SetClipRgn (&sg_UpdateRgn, rcInv + i);
SetClipRgn (&sg_UpdateRgn, &(nodes [idx_znode].rc));
/* znodes below current znode in the same level */
slot = nodes [idx_znode].next;
for (; slot > 0; slot = nodes [slot].next) {
if (nodes [slot].flags & ZOF_VISIBLE &&
@@ -3276,7 +3258,6 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
}
/* znodes below current level */
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
if (type > _zof_types_for_level[level]) {
slot = zi->first_in_levels[level];
@@ -3391,10 +3372,12 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
do_for_all_znodes (NULL, zi, _cb_exclude_rc, ZT_ALL);
}
while (slot) {
if (slot == idx_znode)
break;
while (slot && slot != idx_znode) {
#if 0
if (nodes [slot].flags & ZOF_VISIBLE) {
ExcludeClipRect (HDC_SCREEN_SYS, &nodes [slot].rc);
}
#endif
/* houhh 20090730, if slot window is no regular.*/
if (nodes [slot].flags & ZOF_VISIBLE) {
if (nodes[slot].idx_mask_rect == 0) {
@@ -3421,7 +3404,6 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
slot = nodes [slot].next;
}
BitBlt (HDC_SCREEN_SYS, rcOld.left, rcOld.top,
MIN (RECTWP (rcWin), RECTW (rcOld)),
MIN (RECTHP (rcWin), RECTH (rcOld)),
@@ -3435,22 +3417,17 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
#endif
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
nodes [0].flags &= ~ZOF_IF_REFERENCE;
}
/* check the invalid rectangles of the being moved window */
/* check the invalid rect of the window */
EmptyClipRgn (&sg_UpdateRgn);
nInvCount = SubtractRect (rcInv, &rcOld, &rcScr);
for (i = 0; i < nInvCount; i++) {
AddClipRect (&sg_UpdateRgn, rcInv + i);
}
/* Since 5.0.0: handle levels above the current level */
/* Since 5.0.0: handle levels */
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
if (type < _zof_types_for_level[level]) {
slot = zi->first_in_levels[level];
@@ -3462,7 +3439,6 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
}
/* handle znodes above the current znode */
slot = *first;
for (; slot != idx_znode; slot = nodes [slot].next) {
if (nodes [slot].flags & ZOF_VISIBLE &&
@@ -3470,15 +3446,20 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
AddClipRect(&sg_UpdateRgn, &rcInter);
}
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
nodes [0].flags &= ~ZOF_IF_REFERENCE;
}
OffsetRegion (&sg_UpdateRgn,
rcWin->left - rcOld.left,
rcWin->top - rcOld.top);
update_client_window_rgn (nodes [idx_znode].cli,
nodes [idx_znode].hwnd);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
}
else {
lock_zi_for_change (zi);
+2 -4
View File
@@ -478,10 +478,8 @@ int InitGUI (int argc, const char* agr[])
/* Since 5.0.0
* Copy the video engine information to the shared resource segement
*/
//strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
strcpy (SHAREDRES_VIDEO_ENGINE, engine);
//strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
strcpy (SHAREDRES_VIDEO_MODE, mode);
strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
#if 0 /* deprecated code */
// these fileds will be initialized by DRM engine.
if (GetMgEtcValue (engine, "device",
+2 -7
View File
@@ -140,8 +140,6 @@ static BOOL allocate_more_fd_slots (MSGQUEUE* msg_queue)
msg_queue->fd_slots[i] = NULL;
}
msg_queue->nr_fd_slots += MAX_NR_LISTEN_FD;
return TRUE;
}
return FALSE;
@@ -215,11 +213,8 @@ BOOL GUIAPI RegisterListenFD (int fd, int type, HWND hwnd, void* context)
}
}
if (ok) {
if (msg_queue->maxfd < fd) {
msg_queue->maxfd = fd;
}
if (ok && msg_queue->maxfd < fd) {
msg_queue->maxfd = fd;
return TRUE;
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ libkernel_la_SOURCES = timer.c \
desktop-ths.c desktop-sa.c desktop-procs.c \
cursor.c cursor-procs.c cursor-sa.c \
sharedres.c \
message.c event.c listenfd.c \
message.c event.c \
blockheap.c fixstr.c slotset.c zorder.c
endif
+1 -1
View File
@@ -362,7 +362,7 @@ static void mg_slice_init_nomessage (void)
sys_page_size = system_info.dwPageSize;
}
#else
sys_page_size = getpagesize(); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
sys_page_size = sysconf (_SC_PAGESIZE); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
#endif
mem_assert (sys_page_size >= 2 * LARGEALIGNMENT);
mem_assert ((sys_page_size & (sys_page_size - 1)) == 0);
-1
View File
@@ -13,7 +13,6 @@ MINIGUILIB=libminigui-$(MINIGUI_VER)
# specific defines
COMM_LDADD= \
standalone/libstandalone.$(LIBA) \
libc/liblibc.$(LIBA) \
misc/libmisc.$(LIBA) \
control/libcontrol.$(LIBA) \
+4 -1
View File
@@ -5,12 +5,15 @@ EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c error.c sockio.c rc4.c rc4.h \
makefile.ng makefile.msvc
LITE_SRCS=error.c sockio.c
if MG_MINIMALGDI
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
else
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c license.c anon_file.c rbtree.c map.c \
error.c sockio.c
$(LITE_SRCS)
endif
SRC_FILES = $(libmisc_la_SOURCES)
+2
View File
@@ -61,6 +61,8 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _MGUSE_SHMOPEN
#include <sys/mman.h>
+7 -4
View File
@@ -4,15 +4,18 @@ INCLUDES = -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/include
noinst_LTLIBRARIES = libmisc.la
EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c error.c sockio.c rc4.c rc4.h \
makefile.ng makefile.msvc
math.c about.c error.c sockio.c listenfd.c rc4.c rc4.h \
makefile.ng makefile.msvc
LITE_SRCS=error.c sockio.c listenfd.c
ifdef MG_MINIMALGDI
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
else
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c license.c anon_file.c rbtree.c map.c \
error.c sockio.c
math.c about.c license.c \
$(LITE_SRCS)
endif
SRC_FILES = $(libmisc_la_SOURCES)
+2 -11
View File
@@ -1433,9 +1433,7 @@ char * strtrimall( char *src)
return src;
}
// VW: use memmove instead of strcpy to avoid overlapping
// strcpy (src, src + nIndex1);
memmove (src, src + nIndex1, nLen - nIndex1 + 1);
strcpy (src, src + nIndex1);
nLen = strlen (src);
nIndex1 = nLen - 1;
@@ -1470,18 +1468,11 @@ int __mg_path_joint (char* dst, int dst_size,
if (__mg_is_abs_path(abs_path) && (!__mg_is_abs_path(sub_path))) {
if (dst_size >= strlen(abs_path) + strlen(sub_path)
+ 2/* size of split '/' and terminator '\0' */) {
strcpy (dst, abs_path);
strcat (dst, "/");
strcat (dst, sub_path);
//sprintf(dst, "%s/%s", abs_path, sub_path);
sprintf(dst, "%s/%s", abs_path, sub_path);
return 0;
}
else {
_WRN_PRINTF ("The buffer space for the full path is too short: %d\n", dst_size);
}
}
}
return -1;
}
+1 -3
View File
@@ -414,7 +414,6 @@ unsigned int __mg_os_get_random_seed (void)
unsigned int rt_tick_get(void);
return rt_tick_get();
#elif defined (__FREERTOS__)
return 0; // just return zero for now.
#else
/*other os use time, for example: linux, OSE, etc.*/
return time (NULL);
@@ -452,8 +451,7 @@ void __mg_os_time_delay (int ms)
extern int rt_thread_mdelay(int ms);
rt_thread_mdelay(ms);
#elif defined (__FREERTOS__)
extern void vTaskDelay(int xTicksToDelay);
vTaskDelay(ms);
#error "Please implement __mg_os_time_delay for your OS"
#else
#error "Please implement __mg_os_time_delay for your OS"
#endif
+4 -3
View File
@@ -47,6 +47,7 @@
#include <stdlib.h>
#include <string.h>
#define _DEBUG
#include "common.h"
#ifdef _MGGAL_DRM
@@ -2004,7 +2005,7 @@ static DrmSurfaceBuffer *drm_create_dumb_buffer(DrmVideoData* vdata,
surface_buffer->handle,
surface_buffer->width, surface_buffer->height,
surface_buffer->pitch,
surface_buffer->size, surface_buffer->offset);
(long unsigned int)surface_buffer->size, (long unsigned int)surface_buffer->offset);
/* prepare buffer for memory mapping */
memset(&mreq, 0, sizeof(mreq));
@@ -2133,7 +2134,7 @@ static DrmSurfaceBuffer *drm_create_dumb_buffer_from_prime_fd(DrmVideoData* vdat
return NULL;
}
_DBG_PRINTF("size got by calling lseek: %lu\n", size);
_DBG_PRINTF("size got by calling lseek: %lu\n", (long unsigned int)size);
}
ret = drmPrimeFDToHandle (vdata->dev_fd, prime_fd, &handle);
@@ -3492,7 +3493,7 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
/* called by drmCreateDCFromHandle */
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
unsigned long size, uint32_t drm_format, uint32_t pixels_off,
size_t size, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch)
{
GAL_VideoDevice *this = (GAL_VideoDevice *)video;
+5 -10
View File
@@ -257,11 +257,9 @@ static int FB_EnterGraphicsMode (_THIS)
_WRN_PRINTF ("Can't open %s: %m\n", tty_dev);
goto fail;
}
if (ioctl (ttyfd, KDSETMODE, KD_GRAPHICS) == -1) {
_WRN_PRINTF ("Error when setting the terminal (%s) "
"to graphics mode: %m\n", tty_dev);
_WRN_PRINTF ("It might is not a console.\n");
_WRN_PRINTF ("Error when setting the terminal to graphics mode: %m\n");
_WRN_PRINTF ("Maybe is not a console.\n");
goto fail;
}
#ifdef _MGRM_PROCESSES
@@ -866,8 +864,7 @@ static void FB_FreeHWSurfaces(_THIS)
surfaces.next = NULL;
}
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request,
REP_HWSURFACE* reply)
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURFACE* reply)
{
if (request->bucket == NULL) { /* alloc hw surface */
vidmem_bucket *bucket;
@@ -957,9 +954,9 @@ static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request,
break;
}
}
if (bucket && bucket->used) {
/* Add the memory back to the total */
_DBG_PRINTF ("Freeing bucket of %d bytes\n", bucket->size);
surfaces_memleft += bucket->size;
/* Can we merge the space with surrounding buckets? */
@@ -1018,14 +1015,12 @@ static int FB_AllocHWSurface (_THIS, GAL_Surface *surface)
surface->pitch = reply.pitch;
surface->pixels = mapped_mem + reply.offset;
surface->hwdata = (struct private_hwdata *)reply.bucket;
return 0;
}
static void FB_FreeHWSurface(_THIS, GAL_Surface *surface)
{
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0,
surface->hwdata};
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0, surface->hwdata};
REP_HWSURFACE reply = {0, 0};
request.offset = (char*)surface->pixels - (char*)mapped_mem;
+2 -2
View File
@@ -219,7 +219,7 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
screen->format->BitsPerPixel,
screen->format->Rmask, screen->format->Gmask,
screen->format->Bmask, screen->format->Amask);
_DBG_PRINTF ("GAL_CreateSharedRGBSurface: map size: %lu, fd: %d, RGBAmasks: %x, %x, %x, %x\n",
_WRN_PRINTF ("GAL_CreateSharedRGBSurface: map size: %lu, fd: %d, RGBAmasks: %x, %x, %x, %x\n",
wp_surf->shared_header->map_size, wp_surf->shared_header->fd,
wp_surf->format->Rmask, wp_surf->format->Gmask,
wp_surf->format->Bmask, wp_surf->format->Amask);
@@ -243,7 +243,7 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
&info, sizeof (SHAREDSURFINFO), &fd) < 0) || (fd < 0))
goto empty;
_DBG_PRINTF ("REQID_GETSHAREDSURFACE: size (%lu), flags (0x%x), fd: %d\n",
_WRN_PRINTF ("REQID_GETSHAREDSURFACE: size (%lu), flags (0x%x), fd: %d\n",
info.size, info.flags, fd);
wp_surf = GAL_AttachSharedRGBSurface (fd, info.size,
info.flags, TRUE);
-12
View File
@@ -269,8 +269,6 @@ static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
static BOOL PCXVFB_SyncUpdate (_THIS)
{
RECT dirty_rc;
if (IsRectEmpty (&this->hidden->dirty_rc))
return FALSE;
@@ -280,16 +278,6 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
shm_lock(semid);
#endif
dirty_rc.left = this->hidden->hdr->dirty_rc_l;
dirty_rc.top = this->hidden->hdr->dirty_rc_t;
dirty_rc.right = this->hidden->hdr->dirty_rc_r;
dirty_rc.bottom = this->hidden->hdr->dirty_rc_b;
if (dirty_rc.right == -1) dirty_rc.right = 0;
if (dirty_rc.bottom == -1) dirty_rc.bottom = 0;
GetBoundRect (&this->hidden->dirty_rc, &dirty_rc,
&this->hidden->dirty_rc);
shadowScreen_BlitToReal (this);
this->hidden->hdr->dirty_rc_l = this->hidden->dirty_rc.left;
+2 -8
View File
@@ -628,13 +628,6 @@ void GAL_SetVideoModeInfo(GAL_Surface* screen)
{
assert(screen);
if (GAL_VideoSurface) {
GAL_Surface *ready_to_go;
ready_to_go = GAL_VideoSurface;
GAL_VideoSurface = NULL;
GAL_FreeSurface (ready_to_go);
}
GAL_VideoSurface = screen;
__mg_current_video->info.vfmt = __gal_screen->format;
__mg_current_video->offset_x = 0;
@@ -824,7 +817,6 @@ static inline void add_rects_to_update_region (CLIPRGN* region,
rc.bottom = rects[i].y + rects[i].h;
AddClipRect (region, &rc);
}
}
void GAL_UpdateRects (GAL_Surface *surface, int numrects, GAL_Rect *rects)
@@ -930,6 +922,8 @@ BOOL GAL_SyncUpdate (GAL_Surface *surface)
if (this->SyncUpdate) {
rc = this->SyncUpdate (this);
}
_DBG_PRINTF ("%d rects updated\n", numrects);
}
EmptyClipRgn (&surface->update_region);
-11
View File
@@ -75,9 +75,6 @@
#include <hb.h>
#include <hb-ft.h>
/* __mg_hb_unifuncs is implemented in src/font/harzbuff-minigui-funcs.c */
extern hb_unicode_funcs_t *__mg_hb_unifuncs;
// define _CACHED_HB_FONT if you want use the cached HB fonts
#define _CACHED_HB_FONT 1
@@ -219,14 +216,6 @@ static BOOL shape_layout_run(SEInstance* inst,
if (hb_buf == NULL)
goto error;
/* use our own unicode functions */
if (__mg_hb_unifuncs) {
hb_buffer_set_unicode_funcs(hb_buf, __mg_hb_unifuncs);
}
else {
_DBG_PRINTF("Unicode functions for HarfBuzz does not initialized\n");
}
hb_buffer_set_content_type(hb_buf, HB_BUFFER_CONTENT_TYPE_UNICODE);
for (i = 0; i < run->len; i++) {
hb_buffer_add(hb_buf, run->ucs[i], i);
+1 -30
View File
@@ -409,7 +409,7 @@ int __mg_init_layers ()
return -1;
/* mark the first semphore is used; it is reserved for wallpaper pattern */
__mg_alloc_mutual_sem (_ssm_shared_surf, NULL);
assert (__mg_alloc_mutual_sem (_ssm_shared_surf, NULL) == 0);
on_exit (__mg_delete_sem_set_manager, _ssm_shared_surf);
#endif
@@ -742,34 +742,6 @@ void GUIAPI UpdateTopmostLayer (const RECT* dirty_rc)
SendMessage (HWND_DESKTOP, MSG_PAINT, 0, 0);
}
int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type, int* cli)
{
ZORDERINFO* zi;
int topmost;
if (layer == NULL)
layer = mgTopmostLayer;
else if (!__mg_is_valid_layer (layer))
return -1;
if (type < ZOF_TYPE_LAUNCHER || type > ZOF_TYPE_TOOLTIP)
return -1;
zi = (ZORDERINFO*)layer->zorder_info;
topmost = zi->first_in_levels [(ZOF_TYPE_TOOLTIP - type) >> 28];
if (topmost <= 0) {
return 0;
}
else if (cli) {
ZORDERNODE* nodes;
nodes = GET_ZORDERNODE(zi);
*cli = nodes [topmost].cli;
}
return topmost;
}
int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode, int* cli)
{
ZORDERINFO* zi;
@@ -898,7 +870,6 @@ const ZNODEHEADER* GUIAPI ServerGetWinZNodeHeader (MG_Layer* layer,
#ifdef _MGSCHEMA_COMPOSITING
if (lock && (pdc = dc_HDC2PDC (hdr->mem_dc))) {
assert (pdc->surface->dirty_info);
if (hdr->lock_count == 0) {
if (pdc->surface->shared_header) {
// XXX: consider timeout.
+1 -1
View File
@@ -812,10 +812,10 @@ static int get_shared_surface (int cli, int clifd, void* buff, size_t len)
static int authenticate_client (int cli, int clifd, void* buff, size_t len)
{
uint32_t magic;
int auth_result = 1;
#ifdef _MGGAL_DRM
uint32_t magic;
extern int __drm_auth_client(int, uint32_t);
magic = *(uint32_t*)buff;
auth_result = __drm_auth_client (cli, magic);
+1 -9
View File
@@ -403,16 +403,8 @@ BOOL server_IdleHandler4Server (PMSGQUEUE msg_queue, BOOL wait)
/* It is time to check event again. */
if (errno == EINTR) {
if (wait) {
if (wait)
ParseEvent (msg_queue, 0);
/* Since 5.0.3: Always check timers */
nevts += __mg_check_expired_timers (msg_queue,
SHAREDRES_TIMER_COUNTER - msg_queue->old_tick_count);
msg_queue->old_tick_count = SHAREDRES_TIMER_COUNTER;
return (nevts > 0);
}
return FALSE;
}
#ifdef _DEBUG
-16
View File
@@ -1,16 +0,0 @@
abs_top_srcdir=../..
INCLUDES = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
noinst_LTLIBRARIES = libstandalone.la
libstandalone_la_SOURCES = standalone.c
SRC_FILES = $(libstandalone_la_SOURCES)
LIB_NAME=libstandalone
include ../../rules.make
+3 -3
View File
@@ -70,10 +70,10 @@ static char* _system_keys[]={
};
static char* _system_values[]={
// GAL engine and default options
"commlcd",
"160x80-16bpp",
"pc_xvfb",
"800x600-16bpp",
// IAL engine
"comm",
"pc_xvfb",
"/dev/input/mice",
"IMPS2"
};
+40 -55
View File
@@ -397,10 +397,29 @@ static void free_val_bitmap (void *val)
map_t* __mg_sys_bmp_map;
BOOL mg_InitResManager(int hash_table_size)
{
// initialize paths
if (pwd_res_path == NULL)
pwd_res_path = strdup ("./");
__sysres_get_system_res_path();
char szpath[MAX_PATH+1];
char* p = NULL;
pwd_res_path = strdup("./");
//initialize paths
#if !defined(__NOUNIX__) || defined(WIN32)
if ((p = getenv ("MG_RES_PATH"))) {
int len = strlen(p);
if (p[len-1] == '/')
sprintf(szpath, "%s", p);
else
sprintf(szpath, "%s/", p);
cfg_res_path = strdup(szpath);
}
else
#endif
{
//step 2: get from MiniGUI.cfg
if (GetMgEtcValue("resinfo", "respath",
szpath, sizeof(szpath)-1) == ETC_OK) {
cfg_res_path = strdup(szpath);
}
}
//initialize hash table
init_hash_table (&hash_table, hash_table_size);
@@ -456,31 +475,6 @@ void TerminateResManager()
const char* __sysres_get_system_res_path()
{
char szpath [MAX_PATH+1];
char* p = NULL;
if (cfg_res_path)
return cfg_res_path;
#if !defined(__NOUNIX__) || defined(WIN32)
if ((p = getenv ("MG_RES_PATH"))) {
int len = strlen (p);
if (p[len-1] == '/')
sprintf (szpath, "%s", p);
else
sprintf (szpath, "%s/", p);
cfg_res_path = strdup (szpath);
}
else
#endif
{
// get from MiniGUI.cfg
if (GetMgEtcValue ("resinfo", "respath",
szpath, sizeof (szpath)-1) == ETC_OK) {
cfg_res_path = strdup (szpath);
}
}
return cfg_res_path;
}
@@ -502,7 +496,7 @@ int SetResPath(const char* path)
//test path is valid directory
#if !defined(__NOUNIX__) && !defined(WIN32)
struct stat buf;
if (stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
# ifdef _DEBUG
ERR_RETV (RES_RET_INVALID_PARAM, RES_RET_INVALID_PARAM, "param path (%s) is not a valid directory", path);
# else
@@ -511,7 +505,7 @@ int SetResPath(const char* path)
}
#endif
if (usr_res_path != NULL)
if(usr_res_path != NULL)
DELETE(usr_res_path);
usr_res_path = STR_DUP(path);
@@ -617,39 +611,39 @@ int UnregisterResType(int type)
return RES_RET_OK;
}
#ifdef HAVE_ACCESS
static char* get_res_file(const char* res_name, char* filename)
{
int i;
if (res_name == NULL || filename == NULL)
return NULL;
//test it is a full path or not
for (i = 0; res_name[i] && res_name[i] == '/'; i++);
if (i > 0) { // full path
for(i=0; res_name[i] && res_name[i] == '/'; i++);
if(i>0) //is full path
{
#ifndef __NOUNIX__
struct stat buf;
if(stat (res_name, &buf) == 0
&& !S_ISDIR(buf.st_mode)
&& (buf.st_mode&S_IRUSR))
if(stat(res_name, &buf) == 0
&& !S_ISDIR(buf.st_mode)
&& (buf.st_mode&S_IRUSR))
#endif
{
return (char*)res_name;
}
}
for (i = 0; res_paths[i]; i++) {
for(i=0; res_paths[i]; i++)
{
#ifndef __NOUNIX__
struct stat buf;
sprintf (filename,"%s/%s", res_paths[i], res_name);
if (stat (filename, &buf) == 0 &&
!S_ISDIR (buf.st_mode) && (buf.st_mode & S_IRUSR))
sprintf(filename,"%s/%s", res_paths[i], res_name);
if(stat(filename, &buf) == 0 && !S_ISDIR(buf.st_mode) && (buf.st_mode&S_IRUSR))
#else
sprintf (filename,"%s/%s", res_paths[i], res_name);
if (access (filename, 04) != -1)
sprintf(filename,"%s/%s", res_paths[i], res_name);
#ifndef __VXWORKS__
//in vxworks, don't support _access method.
if (_access(filename, 04) != -1)
#endif
#endif
{
return filename;
@@ -659,15 +653,6 @@ static char* get_res_file(const char* res_name, char* filename)
return NULL;
}
#else
static char* get_res_file(const char* res_name, char* filename)
{
return NULL;
}
#endif /* !HAVE_ACCESS */
static void* get_res_data (RES_ENTRY *entry, RES_TYPE_OPS *ops, DWORD usr_param)
{
if (entry == NULL && ops == NULL)