Compare commits

..
Author SHA1 Message Date
gengyue d68561769d modified for cross compile 2020-04-12 21:26:40 +08:00
102 changed files with 2973 additions and 6545 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
+78 -174
View File
File diff suppressed because it is too large Load Diff
+78 -174
View File
File diff suppressed because it is too large Load Diff
+78 -174
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,5 +1,5 @@
MAJOR_VERSION = 5
MINOR_VERSION = 0
MAJOR_VERSION = 4
MINOR_VERSION = 1
MICRO_VERSION = 0
EXTRAVERSION =
+102 -184
View File
File diff suppressed because it is too large Load Diff
+20 -130
View File
@@ -1,17 +1,7 @@
# Release Notes
- [Version 5.0.6](#version-506)
+ [What's new in version 5.0.6](#whats-new-in-version-506)
- [Version 5.0.5](#version-505)
+ [What's new in version 5.0.5](#whats-new-in-version-505)
- [Version 5.0.4](#version-504)
+ [What's new in version 5.0.4](#whats-new-in-version-504)
- [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)
@@ -20,130 +10,25 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis)
## Version 5.0.6
## Version 4.9.2
The MiniGUI development team announces the availability of MiniGUI 5.0.6,
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.6
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 optimizations and enhancements:
* BUGFIXING:
- Fix bugs of switching layers under MiniGUI-Processes.
- Fix bugs of `FBCon` and `PC_XVFB` engines: the dirty rectangles are
not set empty after calling `SyncUpdate`.
- Fix memory leaks when using block heap.
- Fix a bug in ServerGetWinZNodeRegion.
* ENHANCEMENTS:
- Enhance `GetGlyphInfo` to return the FreeType face, font file path, and glyph
index.
- NEW API `StretchBltEx` to support different scaling filters and rotation.
- Use Pixman to support color blending methods for `BitBlt` and `StretchBlt`.
- Enhance fallback compositor to support animation when switching among layers.
- New API `SetMainWindowGestureFlags` and `MSG_GESTURETEST` message for
gesture test and setting the gesture flags of a specific main window.
- Tune implementation of Tooltip window.
* OPTIMIZATIONS:
- Optimize the fallback compositor for lucent windows.
- Use Pixman to optimize `FillBox`, `BitBlt`, and `StretchBlt`.
- Optimize the management of BLOCKHEAP.
- Optimize the `__mg_lookfor_unused_slot`.
Note that the binary backward-compatibility was broken, two operations added to
`CompositorOps`. You should rebuild all MiniGUI applications.
Also note that the compositing schema is now enabled by default.
## Version 5.0.5
The MiniGUI development team announces the availability of MiniGUI 5.0.5,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.5
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Adjust the constants for `WS_XXXX` macros to avoid duplicated values.
Note that the binary backward-compatibility was broken. You should
rebuild all MiniGUI applications.
## Version 5.0.4
The MiniGUI development team announces the availability of MiniGUI 5.0.4,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.4
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Fix bugs in ServerGetWinZNodeRegion: must check for possible empty mask rect
and bad assignment of maskrect
- Fix a potential bug: only increase `nr_mask_rects` for not empty mask rectangle.
- Fix a bug: update surface of controls surface in `travel_children_with_priv_cdc`.
* ENHANCEMENTS:
- New IAL engine: `--enable-singletouchkeyial` to build the IAL engine for
single touch screen and key buttons.
## Version 5.0.3
The MiniGUI development team announces the availability of MiniGUI 5.0.3,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.3
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:
@@ -181,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.
@@ -197,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.6 (2021/05/20)
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.6.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+=
##################################################
+18 -87
View File
File diff suppressed because it is too large Load Diff
+1 -14
View File
@@ -80,20 +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
#}}
#{{ifdef _MGIAL_SINGLETOUCHKEY
[singletouchkey]
# The touch device; use none to disable touch event.
touch_dev=/dev/input/event0
# The key device; use none to disable key event.
key_dev=none
# The number of keys; only valid if the key device is not `none` and can be opened.
nr_keys=2
# The maps from Linux keycode to MiniGUI scancode; only valid if `nr_keys` > 0.
keycode2scancode0=20,1
keycode2scancode1=50,2
exdriver=libhidrmdrivers.so.0
#}}
#{{ifdef _MGIAL_LIBINPUT
+1
View File
@@ -237,6 +237,7 @@ MG_EXPORT void GUIAPI NotifyParentEx (HWND hwnd, LINT id, int code,
NotifyParentEx(hwnd, id, code, 0)
/**
* \var typedef int (*STRCMP) (const char* s1, const char* s2, size_t n)
* \brief Type of general strncmp function.
*
* The function compares the two strings \a s1 and \a s2. It returns
+1
View File
@@ -698,6 +698,7 @@ extern "C" {
#define EM_SETREADONLY 0xF0CF
/**
* \var typedef int (*ED_DRAWSEL_FUNC) (HWND hWnd, HDC hdc, int startx, int starty, const char* content, int len, int selout)
* \brief Type of the edit control callback function on drawing selected strings.
*
* \param hWnd Handle of the edit control.
+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.
+81 -192
View File
File diff suppressed because it is too large Load Diff
+8 -115
View File
File diff suppressed because it is too large Load Diff
+51 -117
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -50,7 +50,7 @@ MGLIBADD = $(COMMON_LADD) \
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD) @DEP_LIBS@
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD)
libminigui_@MGLIB_SUFFIX@_la_SOURCES=$(MGSOURCES)
libminigui_@MGLIB_SUFFIX@_la_LDFLAGS=$(MGLDFLAGS)
+27 -72
View File
@@ -154,31 +154,9 @@ int GUIAPI GetSockFD2Server (void)
#include "debug.h"
static void check_live (BOOL woken)
{
static DWORD last_ticks;
REQUEST req;
__mg_update_tick_count (NULL);
// Since 5.0.6, only send IAMLIVE if the current ticks > (last_ticks + 100)
if (woken || __mg_tick_counter > last_ticks + 100) {
last_ticks = __mg_tick_counter;
/* Tell server that I am live */
req.id = REQID_IAMLIVE;
req.data = &__mg_tick_counter;
req.len_data = sizeof (unsigned int);
ClientRequest (&req, NULL, 0);
}
}
static void process_socket_message (MSG *msg)
{
if (msg->message == MSG_WAKEUP_CLIENT) {
check_live (TRUE);
}
else if (msg->message == MSG_UPDATECLIWIN &&
if (msg->message == MSG_UPDATECLIWIN &&
__mg_client_check_hwnd (msg->hwnd, __mg_client_id)) {
__mg_update_window (msg->hwnd,
LOSWORD(msg->wParam), HISWORD(msg->wParam),
@@ -388,6 +366,27 @@ sock_error:
return -1;
}
static void check_live (void)
{
REQUEST req;
#if 0 /* deprecated code */
/* Since 5.0.0, call __mg_update_tick_count instead */
if (__mg_tick_counter != SHAREDRES_TIMER_COUNTER) {
AlertDesktopTimerEvent ();
__mg_tick_counter = SHAREDRES_TIMER_COUNTER;
}
#endif /* deprecated code */
__mg_update_tick_count (NULL);
/* Tell server that I am live */
req.id = REQID_IAMLIVE;
req.data = &__mg_tick_counter;
req.len_data = sizeof (unsigned int);
ClientRequest (&req, NULL, 0);
}
BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
{
static DWORD old_timer;
@@ -399,7 +398,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
struct timeval sel_timeout;
MSG Msg;
check_live (FALSE);
check_live ();
/* rset gets modified each time around */
rset = msg_queue->rfdset;
@@ -434,14 +433,14 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
static unsigned int old_mouse_move_serial = 0xdeadbeef;
int flag = 0, mouse_x = -1, mouse_y = -1, buttons = -1;
check_live (FALSE);
check_live ();
if (wait && (__mg_tick_counter - old_timer) >= repeat_timeout) {
Msg.hwnd = HWND_DESKTOP;
Msg.message = MSG_TIMEOUT;
Msg.wParam = (WPARAM)__mg_tick_counter;
Msg.lParam = 0;
Msg.time = __mg_tick_counter;
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
// kernel_QueueMessage (msg_queue, &Msg);
old_timer = __mg_tick_counter;
@@ -508,7 +507,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
/* go through registered listen fds */
n += __mg_kernel_check_listen_fds (msg_queue, &rset, wsetptr, esetptr);
check_live (FALSE);
check_live ();
if (n > 0) {
old_timer = __mg_tick_counter;
@@ -570,23 +569,12 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
__mg_layer = layer_handle;
zi = (ZORDERINFO*) shmat (joined_info.zi_shmid, 0, SHM_RDONLY);
zi = (ZORDERINFO*) shmat (joined_info.zo_shmid, 0, SHM_RDONLY);
if (zi == (void*)-1) {
return INV_LAYER_HANDLE;
}
__mg_zorder_info = zi;
if (joined_info.zi_shmid == joined_info.def_zi_shmid) {
__mg_def_zorder_info = zi;
}
else {
zi = (ZORDERINFO*) shmat (joined_info.def_zi_shmid, 0, SHM_RDONLY);
if (zi == (void*)-1) {
return INV_LAYER_HANDLE;
}
__mg_def_zorder_info = zi;
}
}
__mg_tick_counter = SHAREDRES_TIMER_COUNTER;
@@ -723,39 +711,6 @@ BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid)
__mg_layer = layer_handle;
__mg_zorder_info = zi;
#if 0 /* obsolete */
ZORDERNODE* nodes;
int slot;
nodes = GET_ZORDERNODE(zi);
slot = zi->first_tooltip;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
slot = zi->first_topmost;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
slot = zi->first_normal;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
#endif /* obsolete */
return TRUE;
}
+9 -7
View File
@@ -63,17 +63,21 @@
#include "ctrlmisc.h"
#define _ID_TIMER 100
#define _MARGIN 10
static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static int iBorder;
switch (message) {
case MSG_CREATE:
{
const WINDOWINFO *info;
int timeout = (int)GetWindowAdditionalData (hWnd);
if (timeout >= 10)
SetTimer (hWnd, _ID_TIMER, timeout / 10);
info = GetWindowInfo (hWnd);
iBorder =
info->we_rdr->calc_we_area (hWnd, LFRDR_METRICS_BORDER, NULL);
SetWindowFont (hWnd,
(PLOGFONT)GetWindowElementAttr(hWnd, WE_FONT_TOOLTIP));
break;
@@ -98,7 +102,7 @@ static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
SetTextColor (hdc,
GetWindowElementPixelEx(hWnd, hdc, WE_FGC_TOOLTIP));
TabbedTextOut (hdc, _MARGIN, _MARGIN, text);
TabbedTextOut (hdc, iBorder, iBorder, text);
EndPaint (hWnd, hdc);
return 0;
@@ -160,7 +164,6 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
CreateInfo.dwStyle = WS_VISIBLE;
CreateInfo.dwExStyle = WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_USEPARENTRDR;
CreateInfo.dwExStyle |= WS_EX_WINTYPE_TOOLTIP | WS_EX_TROUNDCNS | WS_EX_BROUNDCNS;
CreateInfo.spCaption = buf ? buf : text;
CreateInfo.hMenu = 0;
CreateInfo.hCursor = GetSystemCursor (IDC_ARROW);
@@ -168,8 +171,8 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
CreateInfo.MainWindowProc = ToolTipWinProc;
CreateInfo.lx = x;
CreateInfo.ty = y;
CreateInfo.rx = CreateInfo.lx + text_size.cx + _MARGIN * 2;
CreateInfo.by = CreateInfo.ty + text_size.cy + _MARGIN * 2;
CreateInfo.rx = CreateInfo.lx + text_size.cx;
CreateInfo.by = CreateInfo.ty + text_size.cy;
CreateInfo.iBkColor =
GetWindowElementPixelEx (hParentWnd, HDC_SCREEN, WE_BGC_TOOLTIP);
CreateInfo.dwAddData = (DWORD) timeout_ms;
@@ -215,8 +218,7 @@ void ResetToolTipWin (HWND hwnd, int x, int y, const char* text, ...)
if (y + text_size.cy > g_rcScr.bottom)
y = g_rcScr.bottom - text_size.cy;
MoveWindow (hwnd, x, y,
text_size.cx + _MARGIN * 2, text_size.cy + _MARGIN * 2, TRUE);
MoveWindow (hwnd, x, y, text_size.cx, text_size.cy, TRUE);
ShowWindow (hwnd, SW_SHOWNORMAL);
}
+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;
}
+12 -10
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;
}
else
{
return FALSE;
}
}
BOOL font_InitSpecificalFonts (char* etc_section)
+1 -1
View File
@@ -735,9 +735,9 @@ get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
pcache->valid_advance = 1;
}
}
done:
#endif
done:
FT_UNLOCK(&ft_lock);
if (px) {
+3 -2
View File
@@ -88,6 +88,7 @@ typedef int (* MakeHashKeyFunc)(Glyph32 gv);
typedef struct tagFTFACEINFO {
char* filepathname;
FT_Face face;
BOOL valid;
#ifdef _MGFONT_TTF_CACHE
int face_index;
int cmap_index;
@@ -162,13 +163,13 @@ extern void __mg_ttc_sys_deinit(void);
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
extern void __mg_ttc_refer(HCACHE hCache);
#endif /* _MGFONT_TTF_CACHE */
#ifdef _MGCOMPLEX_SCRIPTS
extern void __mg_init_harzbuff_funcs(void);
extern void __mg_term_harzbuff_funcs(void);
#endif
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
+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",
+11 -26
View File
@@ -2401,9 +2401,8 @@ static void wndDrawNCFrame(MAINWIN* pWin, HDC hdc, const RECT* prcInvalid)
}
#endif
if (fGetDC) {
if (fGetDC)
release_effective_dc (pWin, hdc);
}
}
/* this function is CONTROL safe. */
@@ -3040,6 +3039,11 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
while (hosted) {
PMAINWIN found;
ctxt->hosting = hosted;
if ((found = search_win_tree_dfs (ctxt))) {
return found;
}
if (hosted->id == ctxt->id &&
(((ctxt->flags & WIN_SEARCH_FILTER_MAIN) &&
hosted->WinType == TYPE_MAINWIN) ||
@@ -3048,11 +3052,6 @@ static PMAINWIN search_win_tree_dfs (struct _search_context *ctxt)
return hosted;
}
ctxt->hosting = hosted;
if ((found = search_win_tree_dfs (ctxt))) {
return found;
}
hosted = GetNextHosted (hosting, hosted);
}
@@ -3075,13 +3074,12 @@ static PMAINWIN search_win_tree_bfs (struct _search_context *ctxt)
return hosted;
}
if ((ctxt->hosting = GetNextHosted (hosting, hosted))) {
ctxt->hosting = hosted;
if ((found = search_win_tree_bfs (ctxt))) {
return found;
}
}
hosted = GetFirstHosted (hosted);
hosted = GetNextHosted (hosting, hosted);
}
return NULL;
@@ -3167,8 +3165,8 @@ HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild)
HWND GUIAPI GetNextMainWindow (HWND hMainWnd)
{
MG_CHECK_RET (hMainWnd != HWND_NULL &&
!MG_IS_NORMAL_MAIN_WINDOW (hMainWnd), HWND_INVALID);
MG_CHECK_RET (hMainWnd == HWND_NULL || MG_IS_NORMAL_MAIN_WINDOW (hMainWnd),
HWND_INVALID);
return (HWND)SendMessage (HWND_DESKTOP,
MSG_GETNEXTMAINWIN, (WPARAM)hMainWnd, 0L);
@@ -5395,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;
}
@@ -5576,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;
@@ -7028,19 +7026,6 @@ BOOL GUIAPI SetMainWindowAlwaysTop (HWND hMainWnd, BOOL fSet)
MSG_SETALWAYSTOP, (WPARAM)pMainWin, (LPARAM)fSet);
}
/* Since 5.0.6 */
BOOL GUIAPI SetMainWindowGestureFlags (HWND hMainWnd, DWORD dwFlags)
{
PMAINWIN pMainWin;
if (!(pMainWin = checkAndGetMainWinIfMainWin (hMainWnd))) {
return FALSE;
}
return (BOOL)SendMessage (HWND_DESKTOP,
MSG_SETGESTUREFLAGS, (WPARAM)pMainWin, (LPARAM)dwFlags);
}
#ifdef _MGSCHEMA_COMPOSITING
BOOL GUIAPI SetMainWindowCompositing (HWND hMainWnd, int type, DWORD arg)
{
+1 -3
View File
@@ -50,7 +50,6 @@ DFB_SRCS = dfb.h dfb.c
USVFB_SRCS = usvfbinput.c usvfbinput.h
LIBINPUT_SRCS = linux-libinput.c linux-libinput.h
SINGLETOUCHKEY_SRCS = singletouchkey.c singletouchkey.h
if MGIAL_CONSOLE
native_libial_la_LIBADD = native/libnative.la
@@ -77,5 +76,4 @@ libial_la_SOURCES = $(COMMON_SRCS) $(DUMMY_SRCS) $(JZ4740_SRCS) \
$(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \
$(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \
$(TSLIB_SRCS) $(SHANDONG_LIDE_SRCS) $(CISCO_TOUCHPAD_SRCS) \
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS) \
$(SINGLETOUCHKEY_SRCS)
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS)
+1 -7
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* 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
@@ -133,9 +133,6 @@
#ifdef _MGIAL_LIBINPUT
#include "linux-libinput.h"
#endif
#ifdef _MGIAL_SINGLETOUCHKEY
#include "singletouchkey.h"
#endif
static INPUT inputs [] =
{
@@ -215,9 +212,6 @@ static INPUT inputs [] =
#ifdef _MGIAL_LIBINPUT
{"libinput", ial_InitLibInput, TermLibInput},
#endif
#ifdef _MGIAL_SINGLETOUCHKEY
{"singletouchkey", ial_InitSingleTouchKey, TermSingleTouchKey},
#endif
/* ... end of general IAL engines */
};
+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
View File
@@ -65,6 +65,7 @@
#include <sys/time.h>
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include "gdi.h"
#include "window.h"
+6 -12
View File
@@ -67,6 +67,8 @@
#include "gal.h"
#include "native.h"
static const char* event_dev;
static int EVENT_Open(const char *);
static void EVENT_Close(void);
static void EVENT_GetModifierInfo(int *modifiers);
@@ -83,7 +85,6 @@ KBDDEVICE kbddev_event = {
EVENT_Resume
};
static char* kbd_dev;
static int kbd_fd; /* file descriptor for keyboard */
/*
@@ -143,7 +144,6 @@ static int EVENT_Open (const char *device)
if (kbd_fd < 0)
return -1;
kbd_dev = strdup (device);
return kbd_fd;
}
@@ -153,11 +153,8 @@ static int EVENT_Open (const char *device)
*/
static void EVENT_Close(void)
{
close (kbd_fd);
close(kbd_fd);
kbd_fd = -1;
free (kbd_dev);
kbd_dev = NULL;
}
/*
@@ -206,8 +203,7 @@ static int EVENT_Read(unsigned char *buf, int *modifiers)
*/
static void EVENT_Suspend(void)
{
close (kbd_fd);
kbd_fd = -1;
EVENT_Close();
}
/* deactivate_keyboard:
@@ -215,12 +211,10 @@ static void EVENT_Suspend(void)
*/
static int EVENT_Resume(void)
{
kbd_fd = open (kbd_dev, O_NONBLOCK);
kbd_fd = open (event_dev, O_NONBLOCK);
if (kbd_fd < 0) {
return -1;
}
else {
}else{
return kbd_fd;
}
}
+1
View File
@@ -56,6 +56,7 @@
#include <sys/ioctl.h>
#include <signal.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include <errno.h>
#include "common.h"
File diff suppressed because it is too large Load Diff
-68
View File
@@ -1,68 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.cn/exception-list
//
//////////////////////////////////////////////////////////////////////////////
/*
* 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~2020, 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/blog/minigui-licensing-policy/>.
*/
/*
** linux-libinput.h: the head file of the IAL engine based on libinput.
**
** Created by Wei YongMing, 2019/06/10
*/
#ifndef GUI_IAL_SINGLETOUCHKEY_H
#define GUI_IAL_SINGLETOUCHKEY_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype);
void TermSingleTouchKey (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GUI_IAL_SINGLETOUCHKEY_H */
+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
+10 -17
View File
@@ -52,28 +52,21 @@
#ifndef GUI_BLOCKHEAP_H
#define GUI_BLOCKHEAP_H
#define BDS_FREE 0x0000
#define BDS_SPECIAL 0x0001
#define BDS_USED 0x0002
#ifndef _MGUI_GDI_H /* included in include/gdi.h */
struct _BLOCKHEAP {
typedef struct tagBLOCKHEAP {
#ifdef _MGRM_THREADS
pthread_mutex_t lock;
#endif
/* Size of one block element. */
size_t sz_block;
/* Size of the heap in blocks. */
size_t sz_heap;
/* The first free element in the heap. */
size_t sz_usage_bmp;
/* The number of blocks extra allocated. */
size_t nr_alloc;
/* Pointer to the pre-allocated heap. */
unsigned char* heap;
/* Pointer to the usage bitmap. */
unsigned char* usage_bmp;
};
typedef struct _BLOCKHEAP BLOCKHEAP;
size_t bd_size;
size_t heap_size;
int free;
void* heap;
} BLOCKHEAP;
typedef BLOCKHEAP* PBLOCKHEAP;
#ifdef __cplusplus
+1 -4
View File
@@ -164,8 +164,7 @@ typedef struct JoinLayerInfo {
typedef struct JoinedClientInfo {
GHANDLE layer;
int cli_id;
int def_zi_shmid;
int zi_shmid;
int zo_shmid;
} JOINEDCLIENTINFO;
typedef struct LayerInfo {
@@ -223,8 +222,6 @@ typedef struct _MovedClientInfo {
#define ID_ZOOP_MASKRECT_SET 17
#define ID_ZOOP_MASKRECT_FREE 18
#define ID_ZOOP_SETGESTUREFLAGS 19 /* since 5.0.6 */
#ifndef MAX_CAPTION_LEN
#define MAX_CAPTION_LEN 39 //40
#endif
+22 -15
View File
@@ -71,24 +71,19 @@
#define NR_DIRTY_RECTS 16
/* constants for layers and z-order nodes */
#define MAX_NR_LAYERS 16
#define MAX_NR_LAYERS 8
/* Since 5.0.0: the number of the fixed znodes - DONOT adjust */
#define NR_FIXED_ZNODES 1
/* the numbers of znodes in different levels - should be mulitples of 8 */
#define DEF_NR_POPUPMENUS 16
#define DEF_NR_TOOLTIPS 16
#define DEF_NR_GLOBALS 15 // reserve one slot for fixed znode
#define DEF_NR_TOOLTIPS 8
#define DEF_NR_GLOBALS 15 // reserve slots for fixed znodes
#define DEF_NR_SCREENLOCKS 8
#define DEF_NR_DOCKERS 8
#ifdef _MGRM_PROCESSES // per layer basis
# define DEF_NR_TOPMOSTS 8
# define DEF_NR_NORMALS 32
#else
# define DEF_NR_TOPMOSTS 16
# define DEF_NR_NORMALS 128
#endif
#define DEF_NR_TOPMOSTS 16
#define DEF_NR_NORMALS 128
#define DEF_NR_LAUNCHERS 8
/* Since 5.0.0: the number of the zorder levels - DONOT adjust */
@@ -107,10 +102,10 @@ enum {
#define ZNIDX_DESKTOP 0
/* The heap size for mask rectangles */
#define DEF_NR_MASKRECTS 1024
#define DEF_NR_MASKRECT 1024
#if IS_COMPOSITING_SCHEMA
/* max number of shared surfaces (512) */
/* max number of shared surfaces */
# define MAX_NR_SHARED_SURF (DEF_NR_NORMALS * (MAX_NR_LAYERS >> 1))
#endif
@@ -155,9 +150,21 @@ enum {
#endif
/* constants for fix string module */
#define MAX_LEN_FIXSTR 64
#define NR_HEAP 5
#define LEN_BITMAP (1+2+4+8+16)
#if defined (__NOUNIX__) || defined (__uClinux__)
#define MAX_LEN_FIXSTR 64
#define NR_HEAP 5
#define LEN_BITMAP (1+2+4+8+16)
#else
#ifdef _MGRM_THREADS
#define MAX_LEN_FIXSTR 2048
#define NR_HEAP 10
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256+512)
#else
#define MAX_LEN_FIXSTR 1024
#define NR_HEAP 9
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256)
#endif
#endif
/* constants for engine name and video mode */
#define LEN_SO_NAME 127 // name length of a shared object (library)
-2
View File
@@ -713,8 +713,6 @@ void __mg_update_secondary_dc (PMAINWIN pWin, HDC secondary_dc,
HDC __mg_get_common_rgba8888_dc (void);
BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch,
void* pixels);
/* Since 5.0.6 */
void __mg_destroy_common_rgba8888_dc (void);
/* Since 5.0.0.
helpers to update the private client DC of window and it's descendants */
+1 -4
View File
@@ -527,10 +527,7 @@ int __mg_free_hook_wins (int cli);
/************************* Initialization/Termination ************************/
void __mg_init_local_sys_text (void);
/* the zorder information for the default layer */
extern ZORDERINFO* __mg_def_zorder_info;
/* the zorder information for the current layer */
/* the zorder information of the server */
extern ZORDERINFO* __mg_zorder_info;
#ifdef _MGRM_STANDALONE
+9 -32
View File
@@ -120,60 +120,37 @@ int __mg_alloc_sem_for_shared_surf (void);
int __mg_free_sem_for_shared_surf (int sem_num);
#endif /* _MGSCHEMA_COMPOSITING */
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set);
int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set);
static inline
void __mg_slot_set_use (unsigned char* bitmap, size_t index) {
void __mg_slot_set_use (unsigned char* bitmap, int index) {
bitmap += index >> 3;
*bitmap &= (~(0x80 >> (index % 8)));
}
static inline
int __mg_slot_clear_use (unsigned char* bitmap, size_t index) {
bitmap += index >> 3;
*bitmap |= (0x80 >> (index % 8));
return 1;
}
static inline
int __mg_slot_is_used (unsigned char* bitmap, size_t index) {
int __mg_slot_clear_use (unsigned char* bitmap, int index) {
bitmap += index >> 3;
if (*bitmap & (0x80 >> (index % 8)))
return 0;
*bitmap |= (0x80 >> (index % 8));
return 1;
}
/* get the number of idle mask rectangles */
static inline
size_t __mg_get_nr_idle_slots (unsigned char* bitmap, size_t len_bmp)
int __mg_get_nr_idle_slots (unsigned char* bitmap, int len_bmp)
{
size_t idle = 0;
size_t i, j;
int idle = 0;
int i, j;
for (i = 0; i < len_bmp; i++) {
if (*bitmap) {
if (*bitmap == 0xFF) {
idle += 8;
}
else {
if (*bitmap & 0xF0) {
for (j = 0; j < 4; j++) {
for (j = 0; j < 8; j++) {
if (*bitmap & (0x80 >> j))
idle++;
}
}
if (*bitmap & 0x0F) {
for (j = 0; j < 4; j++) {
if (*bitmap & (0x08 >> j))
idle++;
}
}
}
}
bitmap++;
}
return idle;
}
+25 -113
View File
File diff suppressed because it is too large Load Diff
+1 -6
View File
@@ -154,12 +154,7 @@ int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd);
int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info);
int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
#ifdef _MGSCHEMA_COMPOSITING
int __mg_prepare_layer_for_compositing (MG_Layer* layer);
int __mg_end_up_layer_for_compositing (MG_Layer* layer);
#endif
int __mg_do_change_topmost_layer (MG_Layer* new_topmost);
int __mg_do_change_topmost_layer (void);
MG_Layer* __mg_find_layer_by_name (const char* name);
+17 -22
View File
@@ -87,7 +87,7 @@ typedef struct _ZORDERNODE {
int nr_dirty_rcs; /* the number of dirty rects */
const RECT* dirty_rcs; /* the pointer to the dirty rectangles */
#else /* defined _MGSCHEMA_COMPOSITING */
DWORD age; /* znode age */
unsigned int age; /* znode age */
RECT dirty_rc; /* dirty rectangle */
#endif /* not defined _MGSCHEMA_COMPOSITING */
@@ -133,8 +133,6 @@ typedef struct _ZORDERINFO {
int first_launcher;
int active_win;
int old_active;
int next_active;
int cli_trackmenu;
@@ -158,13 +156,12 @@ typedef struct _ZORDERINFO {
typedef ZORDERINFO* PZORDERINFO;
#define MAX_NR_SPECIAL_ZNODES(zi) \
(zi->max_nr_globals + \
(zi->max_nr_tooltips + zi->max_nr_globals + \
zi->max_nr_screenlocks + zi->max_nr_dockers + \
zi->max_nr_launchers + NR_FIXED_ZNODES)
#define MAX_NR_GENERAL_ZNODES(zi) \
(zi->max_nr_tooltips + zi->max_nr_topmosts + \
zi->max_nr_normals)
(zi->max_nr_topmosts + zi->max_nr_normals)
#define MAX_NR_ZNODES(zi) \
MAX_NR_SPECIAL_ZNODES(zi) + MAX_NR_GENERAL_ZNODES(zi)
@@ -181,7 +178,7 @@ typedef ZORDERINFO* PZORDERINFO;
(ZORDERNODE*)((char*)((zi)+1)+ (zi)->size_usage_bmp)
#define GET_MASKRECT_USAGEBMP(zi) \
((unsigned char *)((zi) + 1) + (zi)->size_usage_bmp + \
((char *)((zi) + 1) + (zi)->size_usage_bmp + \
sizeof (ZORDERNODE) * (MAX_NR_ZNODES_WITH_PPP(zi)))
#define GET_MASKRECT(zi) \
@@ -190,25 +187,25 @@ typedef ZORDERINFO* PZORDERINFO;
/* round to multiple of 8 to aoivd alignment issue */
#define SIZE_MASKRECT_USAGE_BMP \
ROUND_TO_MULTIPLE((DEF_NR_MASKRECTS >> 3), 8)
ROUND_TO_MULTIPLE((DEF_NR_MASKRECT >> 3), 8)
#define NR_SPECIAL_ZNODES(zi) \
(zi->nr_globals + \
(zi->nr_tooltips + zi->nr_globals + \
zi->nr_screenlocks + zi->nr_dockers + \
zi->nr_launchers + NR_FIXED_ZNODES)
#define NR_GENERAL_ZNODES(zi) \
(zi->nr_tooltips + zi->nr_topmosts + zi->nr_normals)
(zi->nr_topmosts + zi->nr_normals)
#define NR_ZNODES(zi) \
NR_SPECIAL_ZNODES(zi) + NR_GENERAL_ZNODES(zi)
/* Since 5.0.0: more levels */
#define SIZE_USAGE_BMP_GENERAL(max_nr_t, max_nr_n) \
((7 + DEF_NR_TOOLTIPS + (max_nr_t) + (max_nr_n)) >> 3)
((7 + (max_nr_t) + (max_nr_n)) >> 3)
#define SIZE_USAGE_BMP_SPECIAL(max_nr_g) \
((7 + max_nr_g + \
((7 + DEF_NR_TOOLTIPS + max_nr_g + \
DEF_NR_SCREENLOCKS + DEF_NR_DOCKERS + \
DEF_NR_LAUNCHERS + NR_FIXED_ZNODES) >> 3)
@@ -237,15 +234,15 @@ typedef ZORDERINFO* PZORDERINFO;
MG_UNLIKELY ((idx) > MAX_NR_ZNODES(zi))
#define IS_TYPE_GENERAL(type) \
((type) == ZOF_TYPE_TOOLTIP || \
(type) == ZOF_TYPE_HIGHER || \
(type) == ZOF_TYPE_NORMAL)
(type == ZOF_TYPE_HIGHER || \
type == ZOF_TYPE_NORMAL)
#define IS_TYPE_SPECIAL(type) \
((type) == ZOF_TYPE_GLOBAL || \
(type) == ZOF_TYPE_SCREENLOCK || \
(type) == ZOF_TYPE_DOCKER || \
(type) == ZOF_TYPE_LAUNCHER)
(type == ZOF_TYPE_TOOLTIP || \
type == ZOF_TYPE_GLOBAL || \
type == ZOF_TYPE_SCREENLOCK || \
type == ZOF_TYPE_DOCKER || \
type == ZOF_TYPE_LAUNCHER)
#define ZOF_TYPE_TO_LEVEL_IDX(type) ((int)(8 - ((type) >> 28)))
@@ -253,14 +250,12 @@ typedef ZORDERINFO* PZORDERINFO;
extern "C" {
#endif /* __cplusplus */
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_maskrc_heap);
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals);
void __kernel_free_z_order_info (ZORDERINFO* zi);
int __kernel_get_window_region (HWND pWin, CLIPRGN* region);
int __kernel_get_next_znode (const ZORDERINFO* zi, int from);
int __kernel_get_prev_znode (const ZORDERINFO* zi, int from);
void __mg_sync_special_nodes (ZORDERINFO* from, ZORDERINFO* to);
#ifdef __cplusplus
}
#endif /* __cplusplus */
+62 -85
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+15 -74
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2021, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
@@ -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,8 +301,7 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
}
}
/* check wallpaper pattern; only call for topmost layer */
if (layer == mgTopmostLayer) {
/* check wallpaper pattern */
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
assert (pdc->surface->dirty_info);
@@ -313,12 +311,11 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
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,16 +338,13 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
}
}
/* unlock the znode surfaces for wallpaper pattern;
only for topmost layer */
if (layer == mgTopmostLayer) {
/* 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);
}
}
}
void __mg_composite_dirty_znodes (void)
@@ -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,12 +391,8 @@ 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;
// 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) {
@@ -410,43 +400,16 @@ static void purge_all_znodes_private_data (const CompositorOps* ops,
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;
}
}
@@ -489,7 +452,7 @@ const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name)
return NULL;
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
if (compositors [i].name && strcmp (compositors [i].name, name) == 0) {
if (strcmp (compositors [i].name, name) == 0) {
return compositors [i].ops;
}
}
@@ -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);
}
@@ -583,24 +543,5 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
return NULL;
}
const char* GUIAPI ServerGetCurrentCompositor (
const CompositorOps** ops, CompositorCtxt** ctxt)
{
int i;
const CompositorOps* the_ops;
the_ops = ServerSelectCompositor (NULL, ctxt);
if (ops) {
*ops = the_ops;
}
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
if (compositors [i].ops == the_ops)
return compositors [i].name;
}
return NULL;
}
#endif /* defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING) */
+2 -2
View File
@@ -48,7 +48,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
{
FILE* fp;
WORD16 wTemp;
int w=0, h=0, xhot=0, yhot=0, colornum=0;
int w, h, xhot, yhot, colornum;
#if 0
DWORD32 size;
#endif
@@ -152,7 +152,7 @@ static HCURSOR load_cursor_from_mem (const void* area)
const Uint8* p = (Uint8*)area;
WORD16 wTemp;
int w=0, h=0, xhot=0, yhot=0, colornum=0;
int w = 0, h = 0, xhot = 0, yhot = 0, colornum = 0;
#if 0
DWORD32 size;
#endif
+10 -20
View File
@@ -104,7 +104,7 @@ static PMAINWIN dskSetActiveWindow (PMAINWIN pWin)
if (pWin == pOldActive)
return pOldActive;
pOldActive = (PMAINWIN) dskSetActiveZOrderNode (__mg_zorder_info, 0, pWin?pWin->idx_znode:0);
pOldActive = (PMAINWIN) dskSetActiveZOrderNode (0, pWin?pWin->idx_znode:0);
#ifndef _MGRM_PROCESSES /*for MiniGUI-Threads, not for MiniGUI-StandAlone*/
if (pOldActive != (PMAINWIN)HWND_INVALID && __mg_ime_wnd)
@@ -368,15 +368,6 @@ static BOOL dskSetMainWindowAlwaysTop (PMAINWIN pWin, BOOL fSet)
return TRUE;
}
/* Since 5.0.6 */
static inline int dskSetMainWindowGestureFlags (PMAINWIN pWin, DWORD dwFlags)
{
if (dskSetZNodeGestureFlags (0, pWin->idx_znode, dwFlags))
return FALSE;
return TRUE;
}
/* Since 5.0.0 */
static int dskSetWindowMask (HWND pWin, const WINMASKINFO* mask_info)
{
@@ -676,7 +667,7 @@ static LRESULT KeyMessageHandler (UINT message, int scancode, DWORD status)
if (next_node) {
dskMove2Top (0, next_node);
dskSetActiveZOrderNode (__mg_zorder_info, 0, next_node);
dskSetActiveZOrderNode (0, next_node);
}
return 0;
}
@@ -1433,11 +1424,7 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
/* Since 5.0.0 */
case MSG_SETALWAYSTOP:
return dskSetMainWindowAlwaysTop (pWin, (BOOL)lParam);
/* Since 5.0.6 */
case MSG_SETGESTUREFLAGS:
return dskSetMainWindowGestureFlags (pWin, (DWORD)lParam);
return dskSetMainWindowAlwaysTop(pWin, (BOOL)lParam);
/* Since 5.0.0 */
case MSG_SETWINDOWMASK:
@@ -1868,7 +1855,7 @@ void GUIAPI DesktopUpdateAllWindow(void)
SendMessage(HWND_DESKTOP, MSG_PAINT, 0, 0);
}
static void dskOnTimeout (void)
static void dskOnTimer (void)
{
static DWORD uCounter = 0;
static DWORD blink_counter = 0;
@@ -2150,10 +2137,7 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
break;
#endif
/* Since 5.0.6, the desktop handles caret blinking in MSG_TIMEOUT
message, and the interval for this message changes to about 0.05s. */
case MSG_TIMEOUT:
dskOnTimeout ();
// Since 5.0.0: MSG_IDLE messages will be generated by PeekMessage.
// BroadcastMessageInThisThread (MSG_IDLE, wParam, 0);
break;
@@ -2187,6 +2171,12 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
dsk_ops->mouse_handler(dt_context, message, wParam, lParam);
break;
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
message, and the interval for this MSG_TIMER changes to about 0.05s. */
case MSG_TIMER:
dskOnTimer ();
break;
default:
break;
}
+179 -488
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -113,8 +113,7 @@ BOOL mg_InitDesktop (void)
/*
* Init ZOrderInfo here.
*/
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS,
TRUE);
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
if (ret < 0) {
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
return FALSE;
+1 -2
View File
@@ -112,8 +112,7 @@ BOOL mg_InitDesktop (void)
/*
* Init ZOrderInfo here.
*/
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS,
TRUE);
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
if (ret < 0) {
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
return FALSE;
+254 -502
View File
File diff suppressed because it is too large Load Diff
+2 -8
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",
@@ -611,10 +609,6 @@ void TerminateGUI (int rcByGUI)
if (_is_server) {
mg_TerminateDesktop ();
#ifdef _MGSCHEMA_COMPOSITING
mg_TerminateCompositor ();
#endif
/* Cleanup UNIX domain socket and other IPC objects. */
server_ServerCleanup ();
}
+1 -1
View File
@@ -112,7 +112,7 @@ static void ParseEvent (PLWEVENT lwe)
Msg.message = MSG_TIMEOUT;
Msg.wParam = (WPARAM)lwe->count;
Msg.lParam = 0;
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
// QueueDeskMessage (&Msg);
}
else if (lwe->type == LWETYPE_KEY) {
+1 -6
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) {
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
@@ -860,7 +860,7 @@ checkagain:
/* handle desktop timer here */
if (pMsgQueue == __mg_dsk_msg_queue && pMsgQueue->dwState & QS_DESKTIMER) {
pMsg->hwnd = HWND_DESKTOP;
pMsg->message = MSG_TIMEOUT;
pMsg->message = MSG_TIMER;
pMsg->wParam = 0;
pMsg->lParam = 0;
+6 -29
View File
@@ -51,41 +51,18 @@
** Create date: 2005/08/16
*/
#include <stdlib.h>
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set)
int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set)
{
size_t unused = 0;
size_t i, j;
int unused = 0;
int i, j;
for (i = 0; i < len_bmp; i++) {
if (*bitmap) {
unsigned char half_byte = *bitmap & 0xF0;
unsigned char test_byte = 0x80;
if (half_byte) {
for (j = 0; j < 4; j++) {
if (half_byte & test_byte) {
for (j = 0; j < 8; j++) {
if (*bitmap & (0x80 >> j)) {
if (set)
*bitmap ^= test_byte;
*bitmap &= (~(0x80 >> j));
return unused + j;
}
test_byte = test_byte >> 1;
}
}
half_byte = *bitmap & 0x0F;
test_byte = 0x08;
for (j = 4; j < 8; j++) {
if (half_byte & test_byte) {
if (set)
*bitmap ^= test_byte;
return unused + j;
}
test_byte = test_byte >> 1;
}
}
unused += 8;
+2 -2
View File
@@ -94,7 +94,7 @@ void __mg_update_tick_count (void *data)
__mg_tick_counter = __mg_os_get_time_ticks ();
#endif /* not defined _MGRM_PROCESSES */
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
message, and the interval for the timer of desktop changes to 0.05s. */
if (__mg_tick_counter >
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
@@ -129,7 +129,7 @@ void __mg_update_tick_count (void *data)
__mg_tick_counter += elapsed_ticks;
#endif /* not defined _MGRM_PROCESSES */
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
message, and the interval for the timer of desktop changes to 0.05s. */
if (__mg_tick_counter >
__mg_dsk_msg_queue->last_ticks_desktop + DESKTOP_TIMER_INERTVAL) {
+132 -7
View File
@@ -100,7 +100,7 @@ inline static key_t get_layer_shm_key (void)
}
#endif /* defined _MGRM_PROCESSES */
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_maskrc_heap)
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
{
#ifdef _MGRM_PROCESSES
int size_usage_bmp = SIZE_USAGE_BMP (SHAREDRES_NR_GLOBALS,
@@ -125,8 +125,8 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_mask
nr_normals + /* for the normal windows */
DEF_NR_LAUNCHERS + /* for the launcher ones */
NR_FIXED_ZNODES) + /* for the fixed znodes */
with_maskrc_heap ? (SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECTS) : 0,
SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECT,
SHM_PARAM | IPC_CREAT | IPC_EXCL);
return zorder_shmid;
@@ -150,7 +150,7 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_mask
DEF_NR_LAUNCHERS + /* for the launcher ones */
NR_FIXED_ZNODES) + /* for the fixed znodes */
SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECTS);
sizeof (MASKRECT) * DEF_NR_MASKRECT);
if (!__mg_zorder_info) {
_MG_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
@@ -214,8 +214,6 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_mask
__mg_slot_set_use ((unsigned char*)(__mg_zorder_info + 1), 0);
__mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0);
__mg_def_zorder_info = __mg_zorder_info;
#if 0 /* deprecated code */
/* Since 5.0.0; allocate znodes for other fixed main windows */
{
@@ -272,7 +270,134 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
#endif
free (zi);
__mg_zorder_info = NULL;
__mg_def_zorder_info = NULL;
#endif
}
#if 0 /* deprecated code */
#if IS_SHAREDFB_SCHEMA_PROCS
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
{
key_t shm_key;
int zorder_shmid;
if ((shm_key = get_layer_shm_key ()) == -1) {
return -1;
}
zorder_shmid = shmget (shm_key,
sizeof (ZORDERINFO) + SIZE_USAGE_BMP +
sizeof (ZORDERNODE) *
(DEF_NR_POPUPMENUS + /* for the popup menus */
SHAREDRES_NR_GLOBALS + /* for the global windows */
nr_topmosts + /* for the topmost windows */
nr_normals)+ /* for the normal windows */
SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECT,
SHM_PARAM | IPC_CREAT | IPC_EXCL);
return zorder_shmid;
}
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
ZORDERINFO* __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
{
ZORDERINFO* zi;
ZORDERNODE* znodes;
void* maskrect_usage_bmp;
zi = (PZORDERINFO) calloc (1,
sizeof (ZORDERINFO) + SIZE_USAGE_BMP +
sizeof (ZORDERNODE) *
(DEF_NR_POPUPMENUS + /* for the popup menus */
SHAREDRES_NR_GLOBALS + /* for global window: 0 */
nr_topmosts + /* for the topmost windows */
nr_normals)+ /* for the normal windows */
SIZE_MASKRECT_USAGE_BMP +
sizeof (MASKRECT) * DEF_NR_MASKRECT);
if (!zi) {
_WRN_PRINTF ("KERNEL>ZOrder: calloc zorderinfo failure. \n");
return NULL;
}
zi->size_usage_bmp = SIZE_USAGE_BMP;
zi->size_maskrect_usage_bmp = SIZE_MASKRECT_USAGE_BMP;
zi->max_nr_popupmenus = DEF_NR_POPUPMENUS;
zi->max_nr_globals = 0;
zi->max_nr_topmosts = nr_topmosts;
zi->max_nr_normals = nr_normals;
zi->nr_popupmenus = 0;
zi->nr_globals = 0;
zi->nr_topmosts = 0;
zi->nr_normals = 0;
zi->first_global = 0;
zi->first_topmost = 0;
zi->first_normal = 0;
zi->active_win = 0;
zi->cli_trackmenu = -1;
zi->ptmi_in_cli = (HWND)-1;
/* Set zorder node usage map. */
memset (zi + 1, 0xFF, SIZE_USAGE_BMP);
/* Set zorder mask rect usage map. */
maskrect_usage_bmp = GET_MASKRECT_USAGEBMP(zi);
memset (maskrect_usage_bmp, 0xFF,
zi->size_maskrect_usage_bmp);
/* init z-order node for desktop */
znodes = GET_ZORDERNODE(zi);
znodes [0].flags = ZOF_TYPE_DESKTOP | ZOF_VISIBLE;
znodes [0].rc = g_rcScr;
znodes [0].age = 0;
znodes [0].cli = 0;
znodes [0].hwnd = HWND_DESKTOP;
znodes [0].next = 0;
znodes [0].prev = 0;
znodes [0].idx_mask_rect = 0;
__mg_slot_set_use ((unsigned char*)(zi + 1), 0);
__mg_slot_set_use ((unsigned char*)(maskrect_usage_bmp), 0);
#ifdef _MGRM_THREADS
#ifndef __NOUNIX__
pthread_rwlock_init(&zi->rwlock, NULL);
#else
pthread_mutex_init(&zi->rwlock, NULL);
#endif
#endif /* _MGRM_THREADS */
return zi;
}
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
void __kernel_free_z_order_info (ZORDERINFO* zi)
{
#if IS_SHAREDFB_SCHEMA_PROCS
if (shmdt (zi) < 0)
perror ("Detaches shared zorder nodes");
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
#ifdef _MGRM_THREADS
#ifndef __NOUNIX__
pthread_rwlock_destroy(&zi->rwlock);
#else
pthread_mutex_destroy(&zi->rwlock);
#endif
#endif /* _MGRM_THREADS */
free (zi);
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
}
#endif /* deprecated code */
+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)
+1 -1
View File
@@ -228,7 +228,7 @@ HWND GUIAPI OpenAboutDialog (HWND hHosting)
SysPixelColor[IDX_COLOR_darkgray].g,
SysPixelColor[IDX_COLOR_darkgray].b,
0xA0),
CT_ALPHAPIXEL, COLOR_BLEND_LEGACY);
CT_ALPHAPIXEL, 0x80);
if (hMainWnd == HWND_INVALID)
return HWND_INVALID;
+2 -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>
@@ -69,8 +71,6 @@
#include <linux/memfd.h>
#include <stdlib.h>
#else
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#endif
-1
View File
@@ -310,7 +310,6 @@ void __mg_splash_draw_framework (void)
SetBrushColor(HDC_SCREEN_SYS, old_brush);
SetTextColor(HDC_SCREEN_SYS, old_text);
SetBkMode(HDC_SCREEN_SYS, BM_OPAQUE);
SyncUpdateDC(HDC_SCREEN_SYS);
}
+6 -3
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 \
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 -6
View File
@@ -1,6 +1,6 @@
## Makefile.am for the NEWGAL library
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include $(PIXMAN_CFLAGS)
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
noinst_LTLIBRARIES = libnewgal.la
@@ -17,9 +17,6 @@ DRIVERS = @VIDEO_DRIVERS@
# Include the architecture-independent sources
COMMON_SRCS = \
video.c \
newgal.c \
surface.c \
RLEaccel.c \
RLEaccel_c.h \
blit.c \
@@ -32,9 +29,12 @@ COMMON_SRCS = \
leaks.h \
pixels.c \
pixels_c.h \
surface.c \
stretch.c \
stretch_c.h \
sysvideo.h \
video.c \
newgal.c \
videomem-bucket.h \
videomem-bucket.c \
surface-shared.c \
@@ -42,8 +42,6 @@ COMMON_SRCS = \
surface-shm.c \
shadow-screen.h \
shadow-screen.c \
concurrent-tasks.h \
concurrent-tasks.c \
$(NULL_FILE)
libnewgal_la_SOURCES = $(COMMON_SRCS)
+2 -136
View File
@@ -77,13 +77,13 @@ static int GAL_SoftBlit(GAL_Surface *src, GAL_Rect *srcrect,
GAL_loblit RunBlit;
/* Set up the blit information */
info.s_pixels = (Uint8 *)src->pixels + src->pixels_off +
info.s_pixels = (Uint8 *)src->pixels +
(Uint16)srcrect->y*src->pitch +
(Uint16)srcrect->x*src->format->BytesPerPixel;
info.s_width = srcrect->w;
info.s_height = srcrect->h;
info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel;
info.d_pixels = (Uint8 *)dst->pixels + dst->pixels_off +
info.d_pixels = (Uint8 *)dst->pixels +
(Uint16)dstrect->y*dst->pitch +
(Uint16)dstrect->x*dst->format->BytesPerPixel;
info.d_width = dstrect->w;
@@ -162,13 +162,6 @@ static void GAL_BlitCopyOverlap(GAL_BlitInfo *info)
}
}
#ifdef _MGUSE_PIXMAN
#include <pixman.h>
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
struct GAL_Surface *dst, GAL_Rect *dstrect);
#endif
/* Figure out which of many blit routines to set up on a surface */
int GAL_CalculateBlit(GAL_Surface *surface)
{
@@ -308,135 +301,8 @@ int GAL_CalculateBlit(GAL_Surface *surface)
}
if ( surface->map->sw_blit == NULL ) {
#ifdef _MGUSE_PIXMAN
if (blit_index & 1) {
// have colorkey
surface->map->sw_blit = GAL_SoftBlit;
}
else if (surface->pix_img && surface->map->dst->pix_img &&
surface != surface->map->dst) {
surface->map->sw_blit = GAL_PixmanBlit;
}
else {
surface->map->sw_blit = GAL_SoftBlit;
}
#else
surface->map->sw_blit = GAL_SoftBlit;
#endif
}
return(0);
}
#ifdef _MGUSE_PIXMAN
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
{
if (GAL_CheckPixmanFormats (src, dst)) {
GAL_BlittingContext* ctxt;
src->blit_ctxt = malloc (sizeof (GAL_BlittingContext));
if (src->blit_ctxt == NULL)
return -1;
ctxt = src->blit_ctxt;
if ((src->flags & GAL_SRCALPHA) && src->format->alpha != GAL_ALPHA_OPAQUE) {
memset (&ctxt->alpha_bits, src->format->alpha, sizeof(uint32_t));
ctxt->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
&ctxt->alpha_bits, 4);
if (ctxt->msk_img)
pixman_image_set_repeat (ctxt->msk_img, PIXMAN_REPEAT_NORMAL);
}
else
ctxt->msk_img = NULL;
ops &= COLOR_BLEND_FLAGS_MASK;
if (ops == COLOR_BLEND_LEGACY) {
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
ctxt->op = PIXMAN_OP_OVER;
}
else {
ctxt->op = PIXMAN_OP_SRC;
}
}
else {
ctxt->op = ops;
}
if (ctxt->op > PIXMAN_OP_HSL_LUMINOSITY ||
ctxt->op < PIXMAN_OP_CLEAR) {
ctxt->op = PIXMAN_OP_SRC;
}
}
return 0;
}
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst)
{
if (src->blit_ctxt) {
GAL_BlittingContext* ctxt = src->blit_ctxt;
if (ctxt->msk_img)
pixman_image_unref (ctxt->msk_img);
free (src->blit_ctxt);
src->blit_ctxt = NULL;
}
return 0;
}
static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
struct GAL_Surface *dst, GAL_Rect *dstrect)
{
pixman_image_t *src_img = src->pix_img, *dst_img = dst->pix_img;
pixman_image_t *msk_img;
pixman_op_t op;
if (src->blit_ctxt) {
GAL_BlittingContext* ctxt = src->blit_ctxt;
msk_img = ctxt->msk_img;
op = (pixman_op_t)ctxt->op;
}
else {
msk_img = NULL;
op = PIXMAN_OP_SRC;
}
_DBG_PRINTF ("srcrect: %d, %d, %dx%d; dstrect: %d, %d, %dx%d\n",
srcrect->x, srcrect->y, srcrect->w, srcrect->h,
dstrect->x, dstrect->y, dstrect->w, dstrect->h);
#if 0
pixman_region32_t clip_region;
pixman_region32_init_rect (&clip_region,
dst->clip_rect.x, dst->clip_rect.y, dst->clip_rect.w, dst->clip_rect.h);
pixman_image_set_clip_region32 (dst_img, &clip_region);
#endif
#if 0
// pixman_blt does not work
if (pixman_image_get_format (src_img) == pixman_image_get_format (dst_img) &&
op == PIXMAN_OP_SRC && msk_img == NULL) {
pixman_blt ((uint32_t *)((char*)src->pixels + src->pixels_off),
(uint32_t *)((char*)dst->pixels + dst->pixels_off),
src->pitch, dst->pitch,
GAL_BytesPerPixel (src),
GAL_BytesPerPixel (dst),
srcrect->x, srcrect->y,
dstrect->x, dstrect->y,
srcrect->w, srcrect->h);
}
else
#endif
{
pixman_image_composite32 (op, src_img, msk_img, dst_img,
srcrect->x, srcrect->y,
0, 0,
dstrect->x, dstrect->y,
srcrect->w, srcrect->h);
}
//pixman_region32_fini (&clip_region);
return 0;
}
#endif // _MGUSE_PIXMAN
+1 -1
View File
@@ -77,13 +77,13 @@ struct private_swaccel {
/* Blit mapping definition */
typedef struct GAL_BlitMap {
GAL_Surface *dst;
int identity;
Uint8 *table;
GAL_blit hw_blit;
GAL_blit sw_blit;
struct private_hwaccel *hw_data;
struct private_swaccel *sw_data;
int identity;
/* the version count matches the destination; mismatch indicates
an invalid mapping */
unsigned int format_version;
+71
View File
@@ -52,10 +52,28 @@
/* Function to check the CPU flags */
#define MMX_CPU 0x800000
#ifdef USE_ASMBLIT
#define CPU_Flags() Hermes_X86_CPU()
#else
#define CPU_Flags() 0L
#endif
/* Functions to blit from N-bit surfaces to other surfaces */
#ifdef USE_ASMBLIT
/* Heheheh, we coerce Hermes into using GAL blit information */
#define X86_ASSEMBLER
#define HermesConverterInterface GAL_BlitInfo
#define HermesClearInterface void
#define STACKCALL
typedef Uint32 int32;
#include "HeadMMX.h"
#include "HeadX86.h"
#else
/* This is now endian dependent */
#if ( GAL_BYTEORDER == GAL_LIL_ENDIAN )
#define HI 1
@@ -410,6 +428,9 @@ static void Blit_RGB888_RGB565(GAL_BlitInfo *info)
#endif /* USE_DUFFS_LOOP */
}
#endif /* USE_ASMBLIT */
/* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */
#if ( GAL_BYTEORDER == GAL_LIL_ENDIAN )
#define RGB565_32(dst, src, map) (map[src[0]*2] + map[src[1]*2+1])
@@ -1437,6 +1458,14 @@ static const struct blit_table normal_blit_1[] = {
{ 0,0,0, 0, 0,0,0, 0, NULL, NULL },
};
static const struct blit_table normal_blit_2[] = {
#ifdef USE_ASMBLIT
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800,
0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA },
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x00007C00,0x000003E0,0x0000001F,
0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA },
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000003E0,0x00007C00,
0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA },
#endif
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x00FF0000,0x0000FF00,0x000000FF,
0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA },
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x000000FF,0x0000FF00,0x00FF0000,
@@ -1454,10 +1483,39 @@ static const struct blit_table normal_blit_3[] = {
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
};
static const struct blit_table normal_blit_4[] = {
#ifdef USE_ASMBLIT
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
MMX_CPU, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
0, ConvertX86p32_16RGB565, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
MMX_CPU, ConvertMMXpII32_16BGR565, ConvertMMX, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
0, ConvertX86p32_16BGR565, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
MMX_CPU, ConvertMMXpII32_16RGB555, ConvertMMX, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
0, ConvertX86p32_16RGB555, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
MMX_CPU, ConvertMMXpII32_16BGR555, ConvertMMX, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
0, ConvertX86p32_16BGR555, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF,
0, ConvertX86p32_24RGB888, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x000000FF,0x0000FF00,0x00FF0000,
0, ConvertX86p32_24BGR888, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x000000FF,0x0000FF00,0x00FF0000,
0, ConvertX86p32_32BGR888, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0xFF000000,0x00FF0000,0x0000FF00,
0, ConvertX86p32_32RGBA888, ConvertX86, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x0000FF00,0x00FF0000,0xFF000000,
0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA },
#else
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
0, NULL, Blit_RGB888_RGB565, NO_ALPHA },
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
0, NULL, Blit_RGB888_RGB555, NO_ALPHA },
#endif
/* Default for 32-bit RGB source, used if no other blitter matches */
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
};
@@ -1517,7 +1575,12 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
if ( surface->map->table ) {
blitfun = Blit_RGB888_index8_map;
} else {
#ifdef USE_ASMBLIT
sdata->aux_data = ConvertX86p32_8RGB332;
blitfun = ConvertX86;
#else
blitfun = Blit_RGB888_index8;
#endif
}
} else {
blitfun = BlitNto1;
@@ -1548,6 +1611,14 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
}
#ifdef DEBUG_ASM
#ifdef USE_ASMBLIT
if ( blitfun == ConvertMMX )
fprintf(stderr, "Using mmx blit\n");
else
if ( blitfun == ConvertX86 )
fprintf(stderr, "Using asm blit\n");
else
#endif
if ( (blitfun == GAL_BlitNtoN) || (blitfun == GAL_BlitNto1) )
fprintf(stderr, "Using C blit\n");
else
File diff suppressed because it is too large Load Diff
-72
View File
@@ -1,72 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.cn/exception-list
//
//////////////////////////////////////////////////////////////////////////////
/*
* 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~2020, 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/blog/minigui-licensing-policy/>.
*/
/*
** The helpers for concurrent tasks.
**
** Current maintainer: Wei Yongming.
**
** Create date: 2021/05/21
*/
#ifndef _GAL_concurrent_tasks_h
#define _GAL_concurrent_tasks_h
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef void (*CCTaskProc)(void* context, int loop_idx);
int concurrentTasks_Init (void);
int concurrentTasks_Term (void);
int concurrentTasks_SplitRect (GAL_Rect* rcs, const GAL_Rect* rc, int count);
int concurrentTasks_Do (void* context, CCTaskProc proc);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _GAL_concurrent_tasks_h */
+5 -80
View File
@@ -47,6 +47,7 @@
#include <stdlib.h>
#include <string.h>
#define _DEBUG
#include "common.h"
#ifdef _MGGAL_DRM
@@ -794,10 +795,6 @@ static GAL_Surface* create_surface_from_buffer (_THIS,
surface->h = surface_buffer->height;
surface->pitch = surface_buffer->pitch;
surface->pixels_off = 0;
#ifdef _MGUSE_PIXMAN
surface->pix_img = NULL;
surface->blit_ctxt = NULL;
#endif
#if IS_COMPOSITING_SCHEMA
surface->shared_header = NULL;
surface->dirty_info = NULL;
@@ -1248,43 +1245,16 @@ static GAL_VideoDevice *DRM_CreateDevice(int devindex)
strcasecmp (tmp, "yes") == 0) {
device->hidden->dbl_buff = 1;
}
#ifndef _MGSCHEMA_COMPOSITING
#ifndef _MGRM_STANDALONE
if (device->hidden->dbl_buff) {
mode_t old_mask = umask (0000);
sem_unlink (SEM_UPDATE_LOCK);
device->hidden->update_lock = sem_open (SEM_UPDATE_LOCK,
O_CREAT | O_RDWR | O_EXCL, 0666, 1);
umask (old_mask);
if (device->hidden->update_lock == SEM_FAILED) {
_WRN_PRINTF ("Failed to create update lock: %s\n", strerror (errno));
device->hidden->dbl_buff = 0;
}
}
#else /* not defined _MGRM_STANDALONE */
device->hidden->update_lock = SEM_FAILED;
#endif /* defined _MGRM_STANDALONE */
#endif /* not defined _MGSCHEMA_COMPOSITING */
}
#ifdef _MGRM_PROCESSES
else {
device->hidden->dbl_buff = SHAREDRES_VIDEO_DBL_BUFF;
#ifdef _MGSCHEMA_SHAREDFB
if (device->hidden->dbl_buff) {
device->hidden->update_lock = sem_open (SEM_UPDATE_LOCK, O_RDWR);
if (device->hidden->update_lock == SEM_FAILED) {
_WRN_PRINTF ("Failed to open update lock: %s\n", strerror (errno));
return NULL;
}
}
#endif
}
#endif /* defined _MGRM_PROCESSES */
/* override double buffering */
#if IS_COMPOSITING_SCHEMA
/* force to use double buffering for compositing schema */
/* force to use double buffering to compositing schema */
if (mgIsServer) {
device->hidden->dbl_buff = 1;
#if 0 /* test code */
@@ -1677,18 +1647,6 @@ static void DRM_VideoQuit(_THIS)
this->screen->pixels = NULL;
}
#if IS_SHAREDFB_SCHEMA_PROCS
if (mgIsServer)
#endif
#ifndef _MGSCHEMA_COMPOSITING
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
if (sem_unlink (SEM_UPDATE_LOCK)) {
_ERR_PRINTF ("Failed to unlink the update lock semaphore: %s\n",
strerror (errno));
}
}
#endif /* not defined _MGSCHEMA_COMPOSITING */
#if 0 /* test code */
#ifdef _MBSCHEMA_COMPOSITING
if (this->hidden->update_th) {
@@ -2047,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));
@@ -2176,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);
@@ -3240,12 +3198,6 @@ static void DRM_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
RECT* dirty_rc;
RECT bound;
#ifndef _MGSCHEMA_COMPOSITING
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
sem_wait (this->hidden->update_lock);
}
#endif
#if IS_SHAREDFB_SCHEMA_PROCS
GAL_ShadowSurfaceHeader* hdr;
if (this->hidden->shadow_screen->flags & GAL_HWSURFACE) {
@@ -3278,12 +3230,6 @@ static void DRM_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
bound = GetScreenRect();
if (!IntersectRect (dirty_rc, dirty_rc, &bound))
SetRectEmpty (dirty_rc);
#ifndef _MGSCHEMA_COMPOSITING
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
sem_post (this->hidden->update_lock);
}
#endif
}
static BOOL DRM_SyncUpdate (_THIS)
@@ -3292,12 +3238,6 @@ static BOOL DRM_SyncUpdate (_THIS)
RECT* dirty_rc;
RECT bound;
#ifndef _MGSCHEMA_COMPOSITING
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
sem_wait (this->hidden->update_lock);
}
#endif
#if IS_SHAREDFB_SCHEMA_PROCS
GAL_ShadowSurfaceHeader* hdr;
if (this->hidden->shadow_screen->flags & GAL_HWSURFACE) {
@@ -3350,12 +3290,8 @@ static BOOL DRM_SyncUpdate (_THIS)
src_rect.h = RECTH (bound);
dst_rect = src_rect;
GAL_SetupBlitting (this->hidden->shadow_screen,
this->hidden->real_screen, 0);
GAL_BlitSurface (this->hidden->shadow_screen, &src_rect,
this->hidden->real_screen, &dst_rect);
GAL_CleanupBlitting (this->hidden->shadow_screen,
this->hidden->real_screen);
#endif /* use blitting */
}
@@ -3378,12 +3314,8 @@ static BOOL DRM_SyncUpdate (_THIS)
dst_rect.y = eff_rc.top;
dst_rect.w = src_rect.w;
dst_rect.h = src_rect.h;
GAL_SetupBlitting (this->hidden->cursor,
this->hidden->real_screen, 0);
GAL_BlitSurface (this->hidden->cursor, &src_rect,
this->hidden->real_screen, &dst_rect);
GAL_CleanupBlitting (this->hidden->cursor,
this->hidden->real_screen);
}
}
#endif /* _MGSCHEMA_COMPOSITING */
@@ -3401,14 +3333,7 @@ static BOOL DRM_SyncUpdate (_THIS)
}
SetRectEmpty (dirty_rc);
ret:
#ifndef _MGSCHEMA_COMPOSITING
if (this->hidden->dbl_buff && this->hidden->update_lock != SEM_FAILED) {
sem_post (this->hidden->update_lock);
}
#endif
return retval;
}
@@ -3568,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;
+7 -9
View File
@@ -50,14 +50,6 @@
#include "sysvideo.h"
#ifndef _MGSCHEMA_COMPOSITING
#include <fcntl.h> /* For O_* constants */
#include <sys/stat.h> /* For mode constants */
#include <semaphore.h>
#define SEM_UPDATE_LOCK "mginit-drm-update"
#endif
/* Hidden "this" pointer for the video functions */
#define _THIS GAL_VideoDevice *this
@@ -77,6 +69,13 @@ typedef struct GAL_PrivateVideoData {
GAL_Surface *cursor;
int csr_x, csr_y;
int hot_x, hot_y;
#if 0 /* test code */
/* for asynchronous update */
pthread_t update_th;
pthread_mutex_t update_lock;
sem_t sem_update;
#endif /* test code */
#else /* defined _MGSCHEMA_COMPOSITING */
/* When double buffering supported, the real surface represents the ultimate
* scan-out frame buffer, and the shadow screen represents the rendering
@@ -85,7 +84,6 @@ typedef struct GAL_PrivateVideoData {
/* the global names of real screen and shadow screen */
uint32_t real_name, shadow_name;
sem_t *update_lock;
#endif /* not defined _MGSCHEMA_COMPOSITING */
#if !IS_SHAREDFB_SCHEMA_PROCS
+7 -13
View File
@@ -59,6 +59,7 @@
#include <linux/version.h>
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include "common.h"
#include "minigui.h"
@@ -110,10 +111,8 @@ static BOOL FB_SyncUpdate (_THIS)
if (IsRectEmpty (&this->hidden->dirty_rc))
return FALSE;
if (shadowScreen_BlitToReal (this) == 0) {
SetRectEmpty (&this->hidden->dirty_rc);
if (shadowScreen_BlitToReal (this) == 0)
return TRUE;
}
return FALSE;
}
@@ -258,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
@@ -867,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;
@@ -958,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? */
@@ -1019,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);
+37 -63
View File
@@ -138,36 +138,17 @@ static int shm_init_lock (key_t key)
}
sem.val = 1;
semctl (semid, 0, SETVAL, sem);
return 0;
}
static void shm_lock (int semid)
{
static int shm_lock (int semid) {
struct sembuf sops = {0, -1, SEM_UNDO};
try_again:
if (semop (semid, &sops, 1) < 0) {
if (errno == EINTR)
goto try_again;
else
_WRN_PRINTF ("NEWGAL>PCXVFB: failed to lock sempahore id: %d; pid (%d): %s\n",
semid, getpid(), strerror (errno));
}
return (semop (semid, &sops, 1));
}
static void shm_unlock (int semid)
{
static int shm_unlock (int semid) {
struct sembuf sops = {0, +1, SEM_UNDO};
try_again:
if (semop (semid, &sops, 1)) {
if (errno == EINTR)
goto try_again;
else
_WRN_PRINTF ("NEWGAL>PCXVFB: failed to unlock sempahore id: %d; pid (%d): %s\n",
semid, getpid(), strerror (errno));
}
return (semop (semid, &sops, 1));
}
static int execl_pcxvfb (void)
@@ -243,16 +224,40 @@ static void PCXVFB_DeleteDevice (GAL_VideoDevice *device)
free (device);
}
#if 0 // deprecated code
#if 0 /* deprecated code: call common helpers for shadow screen */
static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
{
int i;
RECT bound;
#ifdef WIN32
win_PCXVFbLock ();
#else
shm_lock(semid);
#endif
shadowScreen_UpdateRects (this, numrects, rects);
bound.left = this->hidden->hdr->dirty_rc_l;
bound.top = this->hidden->hdr->dirty_rc_t;
bound.right = this->hidden->hdr->dirty_rc_r;
bound.bottom = this->hidden->hdr->dirty_rc_b;
if (bound.right == -1) bound.right = 0;
if (bound.bottom == -1) bound.bottom = 0;
bound = this->hidden->dirty_rc;
for (i = 0; i < numrects; i++) {
RECT rc;
SetRect (&rc, rects[i].x, rects[i].y,
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
if (IsRectEmpty (&bound))
bound = rc;
else
GetBoundRect (&bound, &bound, &rc);
}
this->hidden->dirty_rc = bound;
#ifdef WIN32
win_PCXVFbUnlock ();
@@ -260,12 +265,10 @@ static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
shm_unlock(semid);
#endif
}
#endif // deprecated code
#endif /* deprecated code */
static BOOL PCXVFB_SyncUpdate (_THIS)
{
RECT dirty_rc;
if (IsRectEmpty (&this->hidden->dirty_rc))
return FALSE;
@@ -275,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;
@@ -293,8 +286,6 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
this->hidden->hdr->dirty_rc_b = this->hidden->dirty_rc.bottom;
this->hidden->hdr->dirty = TRUE;
SetRectEmpty (&this->hidden->dirty_rc);
#ifdef WIN32
win_PCXVFbUnlock ();
#else
@@ -334,19 +325,8 @@ static GAL_VideoDevice *PCXVFB_CreateDevice (int devindex)
this->AllocHWSurface = PCXVFB_AllocHWSurface;
this->FreeHWSurface = PCXVFB_FreeHWSurface;
#if IS_COMPOSITING_SCHEMA
if (mgIsServer) {
this->UpdateRects = shadowScreen_UpdateRects;
this->SyncUpdate = PCXVFB_SyncUpdate;
}
else {
this->UpdateRects = NULL;
this->SyncUpdate = NULL;
}
#else
this->UpdateRects = shadowScreen_UpdateRects;
this->SyncUpdate = PCXVFB_SyncUpdate;
#endif
this->CheckHWBlit = NULL;
this->FillHWRect = NULL;
@@ -495,6 +475,8 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
listen (__mg_pcxvfb_server_sockfd, 3);
//shm_init_lock(getpid());
if ((pid = fork()) < 0) {
_ERR_PRINTF ("NEWGAL>PCXVFB: fork() error.\n");
}
@@ -624,8 +606,8 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
GAL_SetError ("NEWGAL>PCXVFB: failed to open tmp file\n");
return -1;
}
fwrite (&shmid, sizeof(int), 1, fp);
fwrite (&semid, sizeof(int), 1, fp);
fclose (fp);
#endif /* _MGRM_PROCESSES */
}
@@ -640,16 +622,11 @@ static int PCXVFB_VideoInit (_THIS, GAL_PixelFormat *vformat)
}
if (fread (&shmid, sizeof(int), 1, fp) < 1) {
GAL_SetError ("NEWGAL>PCXVFB: can't read shmid from tmp file\n");
GAL_SetError ("NEWGAL>PCXVFB: can't read from tmp file\n");
fclose (fp);
return -1;
}
if (fread (&semid, sizeof(int), 1, fp) < 1) {
GAL_SetError ("NEWGAL>PCXVFB: can't read semid from tmp file\n");
fclose (fp);
return -1;
}
fclose(fp);
if (shmid != -1) {
@@ -843,14 +820,11 @@ static void PCXVFB_VideoQuit (_THIS)
munmap (this->hidden->shmrgn, size);
close (fd);
remove (mapFile);
semctl (semid, 0, IPC_RMID);
#else // linux
shmdt (this->hidden->shmrgn);
#endif
#if defined(_MGRM_PROCESSES)
if (mgIsServer)
#endif
semctl (semid, 0, IPC_RMID);
#endif
}
#endif /* _MGGAL_PCXVFB*/
-8
View File
@@ -247,12 +247,8 @@ int shadowScreen_BlitToReal (_THIS)
src_rect.h = RECTH (bound);
dst_rect = src_rect;
GAL_SetupBlitting (this->hidden->shadow_screen,
this->hidden->real_screen, 0);
GAL_BlitSurface (this->hidden->shadow_screen, &src_rect,
this->hidden->real_screen, &dst_rect);
GAL_CleanupBlitting (this->hidden->shadow_screen,
this->hidden->real_screen);
#ifdef _MGSCHEMA_COMPOSITING
if (this->hidden->cursor) {
RECT csr_rc, eff_rc;
@@ -271,12 +267,8 @@ int shadowScreen_BlitToReal (_THIS)
dst_rect.y = eff_rc.top;
dst_rect.w = src_rect.w;
dst_rect.h = src_rect.h;
GAL_SetupBlitting (this->hidden->cursor,
this->hidden->real_screen, 0);
GAL_BlitSurface (this->hidden->cursor, &src_rect,
this->hidden->real_screen, &dst_rect);
GAL_CleanupBlitting (this->hidden->cursor,
this->hidden->real_screen);
}
}
#endif /* _MGSCHEMA_COMPOSITING */
+142 -290
View File
File diff suppressed because it is too large Load Diff
-4
View File
@@ -103,10 +103,6 @@ GAL_Surface * GAL_CreateCursorSurface (GAL_VideoDevice *video,
surface->hwdata = NULL;
surface->map = NULL;
surface->format_version = 0;
#ifdef _MGUSE_PIXMAN
surface->pix_img = NULL;
surface->blit_ctxt = NULL;
#endif
surface->shared_header = NULL;
surface->dirty_info = NULL;
GAL_SetClipRect (surface, NULL);
+1 -29
View File
@@ -136,10 +136,6 @@ GAL_Surface * GAL_CreateSharedRGBSurface (GAL_VideoDevice *video,
surface->hwdata = NULL;
surface->map = NULL;
surface->format_version = 0;
#ifdef _MGUSE_PIXMAN
surface->pix_img = NULL;
surface->blit_ctxt = NULL;
#endif
surface->shared_header = NULL;
surface->dirty_info = NULL;
GAL_SetClipRect (surface, NULL);
@@ -276,10 +272,6 @@ error:
surface->shared_header->map_size);
}
#ifdef _MGUSE_PIXMAN
surface->pix_img = NULL;
surface->blit_ctxt = NULL;
#endif
surface->shared_header = NULL;
surface->dirty_info = NULL;
}
@@ -326,10 +318,6 @@ void GAL_FreeSharedSurfaceData (GAL_Surface *surface)
}
surface->pixels = NULL;
#ifdef _MGUSE_PIXMAN
surface->pix_img = NULL;
surface->blit_ctxt = NULL;
#endif
surface->shared_header = NULL;
surface->dirty_info = NULL;
}
@@ -370,7 +358,7 @@ GAL_Surface * GAL_AttachSharedRGBSurface (int fd, size_t map_size,
}
surface->video = video;
surface->flags = flags & ~GAL_FORMAT_CHECKED;
surface->flags = flags;
surface->shared_header = NULL;
surface->hwdata = NULL;
@@ -422,10 +410,6 @@ GAL_Surface * GAL_AttachSharedRGBSurface (int fd, size_t map_size,
surface->dpi = GDCAP_DPI_DEFAULT;
surface->map = NULL;
surface->format_version = 0;
#ifdef _MGUSE_PIXMAN
surface->pix_img = NULL;
surface->blit_ctxt = NULL;
#endif
GAL_SetClipRect (surface, NULL);
#ifdef _MGUSE_UPDATE_REGION
@@ -479,10 +463,6 @@ void GAL_DettachSharedSurfaceData (GAL_Surface *surface)
}
surface->pixels = NULL;
#ifdef _MGUSE_PIXMAN
surface->pix_img = NULL;
surface->blit_ctxt = NULL;
#endif
surface->shared_header = NULL;
surface->dirty_info = NULL;
}
@@ -558,14 +538,6 @@ GAL_Surface *GAL_CreateSurfaceForZNode (unsigned surf_flag, int width, int heigh
Bmask = 0x000000FF;
break;
case ST_PIXEL_XRGB565:
bpp = 16;
Amask = 0x0000;
Rmask = 0xF800;
Gmask = 0x07E0;
Bmask = 0x001F;
break;
default:
bpp = __gal_screen->format->BitsPerPixel;
Amask = __gal_screen->format->Amask;
+154 -279
View File
File diff suppressed because it is too large Load Diff
+2 -25
View File
@@ -58,7 +58,6 @@
#include "pixels_c.h"
#include "license.h"
#include "debug.h"
#include "concurrent-tasks.h"
/* Available video drivers */
static VideoBootStrap *bootstrap[] = {
@@ -289,12 +288,6 @@ int GAL_VideoInit (const char *driver_name, Uint32 flags)
video->info.vfmt = GAL_VideoSurface->format;
#ifdef _MGRM_PROCESSES
// we use concurrent tasks only under MiniGUI-Processes.
if (concurrentTasks_Init ())
return -1;
#endif
return(0);
}
@@ -635,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;
@@ -831,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)
@@ -937,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);
@@ -1161,12 +1148,6 @@ void GAL_VideoQuit (void)
DestroyFreeClipRectList (&__mg_free_update_region_list);
#endif
}
#ifdef _MGRM_PROCESSES
// we use concurrent tasks only under MiniGUI-Processes.
concurrentTasks_Term ();
#endif
return;
}
@@ -1268,10 +1249,6 @@ static GAL_Surface *Slave_CreateSurface (GAL_VideoDevice *this,
surface->hwdata = NULL;
surface->map = NULL;
surface->format_version = 0;
#ifdef _MGUSE_PIXMAN
surface->pix_img = NULL;
surface->blit_ctxt = NULL;
#endif
#if IS_COMPOSITING_SCHEMA
surface->shared_header = NULL;
surface->dirty_info = NULL;
+42
View File
@@ -118,7 +118,21 @@
/* Function to check the CPU flags */
#define MMX_CPU 0x800000
#ifdef USE_ASMBLIT
#define CPU_Flags() Hermes_X86_CPU()
#else
#define CPU_Flags() 0L
#endif
#ifdef USE_ASMBLIT
#define X86_ASSEMBLER
#define HermesConverterInterface void
#define HermesClearInterface void
#define STACKCALL
typedef Uint32 int32;
#include "HeadX86.h"
#endif
/* The functions used to manipulate software video overlays */
static struct private_yuvhwfuncs sw_yuvfuncs = {
@@ -1091,7 +1105,21 @@ GAL_Overlay *GAL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, GAL_S
case GAL_IYUV_OVERLAY:
cpu_mmx = CPU_Flags() & MMX_CPU;
if ( display->format->BytesPerPixel == 2 ) {
#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
/* inline assembly functions */
if ( cpu_mmx && (Rmask == 0xF800) &&
(Gmask == 0x07E0) &&
(Bmask == 0x001F) &&
(width & 15) == 0) {
/*printf("Using MMX 16-bit 565 dither\n");*/
swdata->Display1X = Color565DitherYV12MMX1X;
} else {
/*printf("Using C 16-bit dither\n");*/
swdata->Display1X = Color16DitherYV12Mod1X;
}
#else
swdata->Display1X = Color16DitherYV12Mod1X;
#endif
swdata->Display2X = Color16DitherYV12Mod2X;
}
if ( display->format->BytesPerPixel == 3 ) {
@@ -1099,7 +1127,21 @@ GAL_Overlay *GAL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, GAL_S
swdata->Display2X = Color24DitherYV12Mod2X;
}
if ( display->format->BytesPerPixel == 4 ) {
#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
/* inline assembly functions */
if ( cpu_mmx && (Rmask == 0x00FF0000) &&
(Gmask == 0x0000FF00) &&
(Bmask == 0x000000FF) &&
(width & 15) == 0) {
/*printf("Using MMX 32-bit dither\n");*/
swdata->Display1X = ColorRGBDitherYV12MMX1X;
} else {
/*printf("Using C 32-bit dither\n");*/
swdata->Display1X = Color32DitherYV12Mod1X;
}
#else
swdata->Display1X = Color32DitherYV12Mod1X;
#endif
swdata->Display2X = Color32DitherYV12Mod2X;
}
break;
+1 -1
View File
@@ -1,4 +1,4 @@
AM_CPPFLAGS = $(FT2_INC_DIR) $(HB_INC_DIR) $(PIXMAN_CFLAGS)
AM_CPPFLAGS = $(FT2_INC_DIR) $(HB_INC_DIR)
AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
noinst_LTLIBRARIES = libnewgdi.la
+141 -177
View File
File diff suppressed because it is too large Load Diff
+4 -31
View File
@@ -116,15 +116,8 @@ static pthread_mutex_t dcslot;
BLOCKHEAP __mg_FreeClipRectList;
/************************* static functions declaration **********************/
static inline void dc_InitClipRgnInfo (void)
{
return;
}
static inline void dc_DeinitClipRgnInfo(void)
{
return;
}
static void dc_InitClipRgnInfo (void);
static void dc_DeinitClipRgnInfo(void);
static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient);
static void dc_InitMemDCFrom (PDC pdc, const PDC pdc_ref);
static void dc_InitScreenDC (PDC pdc, GAL_Surface* surface);
@@ -267,12 +260,7 @@ static BOOL RestrictControlMemDCECRGNEx (RECT* minimal,
/******************* Initialization and termination of GDI *******************/
BOOL mg_InitScreenDC (void)
{
#ifdef _MGSCHEMA_COMPOSITING
InitFreeClipRectList (&__mg_FreeClipRectList,
mgIsServer ? SIZE_CLIPRECTHEAP * 8 : SIZE_CLIPRECTHEAP);
#else
InitFreeClipRectList (&__mg_FreeClipRectList, SIZE_CLIPRECTHEAP);
#endif
INIT_LOCK (&__mg_gdilock, NULL);
INIT_LOCK (&dcslot, NULL);
@@ -329,9 +317,6 @@ void mg_TerminateScreenDC (void)
dc_DeinitClipRgnInfo();
/* Since 5.0.6 */
__mg_destroy_common_rgba8888_dc ();
DESTROY_LOCK (&__mg_gdilock);
DESTROY_LOCK (&dcslot);
@@ -532,7 +517,6 @@ Uint32 GUIAPI GetGDCapability (HDC hdc, int iItem)
return iret;
}
#if 0 /* Since 5.0.6: deprecated */
/* This function init clip region in all DC slots. */
static void dc_InitClipRgnInfo(void)
{
@@ -563,7 +547,7 @@ static void dc_DeinitClipRgnInfo(void)
EmptyClipRgn (&DCSlot[i].ecrgn);
}
}
#endif /* Since 5.0.6: deprecated */
static inline void dc_CalculateDevRC4GenDC (PDC pdc);
@@ -4264,9 +4248,9 @@ HDC drmCreateDCFromPrimeFdEx (GHANDLE video, int prime_fd, size_t size,
#endif /* defined _MGGAL_DRM */
/* Since 5.0.0 */
static HDC _dc_common_rgba8888 = HDC_INVALID;
HDC __mg_get_common_rgba8888_dc (void)
{
static HDC _dc_common_rgba8888 = HDC_INVALID;
static char fake_bits [4];
if (_dc_common_rgba8888 == HDC_INVALID) {
@@ -4320,14 +4304,6 @@ BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch,
return TRUE;
}
void __mg_destroy_common_rgba8888_dc (void)
{
if (_dc_common_rgba8888 != HDC_INVALID) {
DeleteMemDC (_dc_common_rgba8888);
_dc_common_rgba8888 = HDC_INVALID;
}
}
struct _travel_context;
typedef void (*on_control_fn) (struct _travel_context* ctxt, PCONTROL child);
@@ -4437,9 +4413,6 @@ static void travel_children_with_priv_cdc (struct _travel_context* ctxt)
child = (PCONTROL)(ctxt->parent->children);
while (child) {
#ifdef _MGSCHEMA_COMPOSITING
child->surf = ctxt->surface;
#endif
if (child->privCDC) {
ctxt->cb (ctxt, child);
+2 -29
View File
@@ -149,12 +149,9 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
{
/* get the relative device font */
DEVFONT* devfont = SELECT_DEVFONT_BY_GLYPH(logfont, glyph_value);
glyph_value = REAL_GLYPH (glyph_value);
SIZE sz;
if (glyph_value == INV_GLYPH_VALUE)
return -1;
glyph_value = REAL_GLYPH (glyph_value);
/* get metrics of the glyph */
if ((glyph_info->mask & GLYPH_INFO_METRICS) ||
(glyph_info->mask & GLYPH_INFO_BMP)) {
@@ -164,7 +161,7 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
glyph_info->bbox_y = 0;
_font_get_glyph_advance (logfont, devfont, glyph_value, TRUE,
0, 0, 0, &glyph_info->advance_x, &glyph_info->advance_y,
0, 0, 0, &glyph_info->advance_x, &glyph_info->advance_x,
(BBOX*)(&glyph_info->bbox_x));
sz.cx = glyph_info->bbox_w;
@@ -201,30 +198,6 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
}
}
/* get FreeType face and glyph index */
if (glyph_info->mask & GLYPH_INFO_FACE) {
glyph_info->index = glyph_value;
if (devfont->font_ops->get_ft_face) {
/* keep sync with tagFTFACEINFO in freetype2.h */
struct _FTFACEINFO {
char* path;
void* face;
};
struct _FTFACEINFO* face_info = (struct _FTFACEINFO*)
devfont->font_ops->get_ft_face (logfont, devfont);
assert (face_info);
glyph_info->ft_face = face_info->face;
glyph_info->file_path = face_info->path;
}
else {
glyph_info->ft_face = NULL;
glyph_info->file_path = NULL;
}
}
glyph_info->bmp_width = sz.cx;
glyph_info->bmp_height = sz.cy;
return 0;
-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);
+45 -78
View File
File diff suppressed because it is too large Load Diff
+5 -8
View File
@@ -338,10 +338,6 @@ static int move_to_layer (int cli, int clifd, void* buff, size_t len)
moved_info.layer = dst_layer;
moved_info.zo_shmid = dst_layer->zorder_shmid;
}
else {
moved_info.layer = INV_LAYER_HANDLE;
moved_info.zo_shmid = 0;
}
ret:
return ServerSendReply (clifd, &moved_info, sizeof (MOVEDCLIENTINFO));
@@ -574,8 +570,9 @@ static int sigma8654_client_get_surface(int cli, int clifd, void* buff, size_t l
REQ_SIGMA8654_GETSURFACE *request;
REP_SIGMA8654_GETSURFACE reply;
if (Sigma8654_ServerOnGetSurface(request, &reply) < 0) {
_ERR_PRINTF ("Nexus_ServerOnGetSurface() failed\n");
if (Sigma8654_ServerOnGetSurface(request, &reply) < 0)
{
fprintf(stderr, "Nexus_ServerOnGetSurface() failed\n");
return -1;
}
return ServerSendReply (clifd, &reply, sizeof (reply));
@@ -593,7 +590,7 @@ static int nexus_client_get_surface(int cli, int clifd, void* buff, size_t len)
if (Nexus_ServerOnGetSurface(request, &reply) < 0)
{
_ERR_PRINTF ("Nexus_ServerOnGetSurface() failed\n");
fprintf(stderr, "Nexus_ServerOnGetSurface() failed\n");
return -1;
}
return ServerSendReply (clifd, &reply, sizeof (reply));
@@ -815,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);
+3 -10
View File
@@ -125,7 +125,7 @@ static void ParseEvent (PMSGQUEUE msg_que, int event)
Msg.wParam = (WPARAM)lwe.count;
Msg.lParam = 0;
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
// kernel_QueueMessage (msg_que, &Msg);
}
else if (lwe.type == LWETYPE_KEY) {
@@ -334,6 +334,7 @@ BOOL GUIAPI ServerStartup (int nr_globals,
_ERR_PRINTF ("mginit: failed to initialize compositor!\n");
goto fail;
}
atexit (mg_TerminateCompositor);
#endif
return TRUE;
@@ -402,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
+1 -1
View File
@@ -107,7 +107,7 @@ static void ParseEvent (PMSGQUEUE msg_que, int event)
Msg.wParam = (WPARAM)lwe.count;
Msg.lParam = 0;
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here.
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
// kernel_QueueMessage (msg_que, &Msg);
}
else if (lwe.type == LWETYPE_KEY) {

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