Compare commits

..
Author SHA1 Message Date
Vincent Wei 3cc16ababb update release notes 2022-09-28 15:11:52 +08:00
Vincent Wei d4097b577b tune 2022-09-27 21:54:36 +08:00
Vincent Wei 7ef6c14f3f relay MSG_IDLE to active child in PreDefControlProc 2022-09-27 21:54:30 +08:00
Vincent Wei cbb4e32992 Call UpdateInvalidClient in ScrollWindow; Only delaying MSG_IDLE to the child control if the main window is active 2022-09-27 13:20:18 +08:00
Vincent Wei 6bc85062b9 add an internal extended style: WS_EX_ACTIVATED 2022-09-27 13:17:15 +08:00
Vincent Wei b2dee57f4f tune relaying of MSG_IDLE 2022-09-27 11:44:26 +08:00
Vincent Wei a926754a6b Tuning: the MSG_IDLE message will be relayed to the descendant control if the control captured the mouse currently 2022-09-26 20:03:20 +08:00
Vincent Wei 7e470b0e78 tune code according to Issue #90 2022-09-26 20:01:47 +08:00
Vincent Wei 9f81cac662 reset binary age and interface age; update release notes 2022-09-26 14:30:49 +08:00
Vincent Wei a14bdd894a remove #include "window.h" 2022-09-26 14:18:14 +08:00
Vincent Wei 7004e156b8 use inline functions for SetCursor and SetDefaultCursor instead of macros 2022-09-26 14:17:55 +08:00
Vincent Wei e293cf03ba fix bugs when virtual window enabled for sa and procs runmodes 2022-09-26 14:06:09 +08:00
Vincent Wei 07f226f024 tune 2022-09-26 09:45:36 +08:00
Vincent Wei 4b2503e614 fix a bug when quiting dummy engine under compoisiting schema 2022-09-25 22:13:27 +08:00
Vincent Wei 2df5352356 fix a bug which may cause invalid values in log_clusters 2022-09-25 21:13:20 +08:00
Vincent Wei 67ccb2aafd give default RGBA masks for depth 32 when masks not specified 2022-09-24 14:33:49 +08:00
Vincent Wei 9a124dec50 fix a bug in search_win_tree_bfs; send MSG_MANAGE_MSGTHREAD messages only in message.c 2022-09-24 13:42:02 +08:00
Vincent Wei d013822979 add condition for loongarch 2022-09-23 21:45:00 +08:00
Vincent Wei 7f44e948d0 fix a bug mentioned in Issue #89 2022-09-23 16:04:11 +08:00
Vincent Wei 9a94fb9a7c enhance code for some uninitialized fields 2022-09-23 11:20:50 +08:00
Vincent Wei dfc7e95fcd fix the bug reported in Issue #89 2022-09-21 10:40:22 +08:00
Vincent Wei 362b852ec2 update anchor 2022-09-15 15:33:21 +08:00
Vincent Wei 9141e13640 suppress some warnings reported by GCC 12 2022-09-15 15:01:30 +08:00
Vincent Wei 4a22a38e63 update 2022-09-15 15:01:15 +08:00
Vincent Wei c7ce12449b use RUNMODE_LDADD and RUNMODE_SUBDIRS instead of conditions 2022-09-15 15:01:05 +08:00
Vincent Wei 824557b4f1 ignore configure~ 2022-09-15 11:20:18 +08:00
Vincent Wei 022542ef1b tune 2022-09-15 11:08:43 +08:00
Vincent Wei 3b12e71877 update README 2022-09-15 11:01:01 +08:00
Vincent Wei 9593168196 use recursive mutex for locking zorder info if not using *nix 2022-09-15 10:07:50 +08:00
Vincent Wei b5c5c3f8ae fix a deadlock bug (#87): use wrlock_owner to save the current thread holding the wrlock, skip rdlock if the wrlock owner is the current thread 2022-09-14 12:52:29 +08:00
Vincent Wei 492bd649ed update Release Notes for v5.0.10 2022-09-14 08:57:34 +08:00
Vincent Wei bc1a880479 cleanup and enhance shadow engine to use SyncUpdate method 2022-08-21 13:09:00 +08:00
Vincent Wei 0748f26f42 change version to 5.0.10; release notes for 5.0.10 2022-08-20 17:45:45 +08:00
Vincent Wei 2f72f24a49 debug 2022-08-20 17:29:43 +08:00
Vincent Wei 43e174a604 set dirty_rc empty initially 2022-08-20 17:23:16 +08:00
Vincent Wei 13d36a2785 add double_buffering options in fbcon section in MiniGUI.cfg 2022-08-20 16:26:23 +08:00
Vincent Wei 9ec3e9f7e6 support for double buffering for fbcon 2022-08-20 16:21:15 +08:00
Vincent Wei 148f1b1745 fix a typo 2022-04-24 11:48:37 +08:00
Vincent Wei f76c9187a8 remove _ERR_PRINTF 2022-03-21 17:52:01 +08:00
Vincent Wei 2e8eba7dd0 fix a deadlock bug: https://github.com/VincentWei/minigui/issues/83 2022-03-21 17:48:03 +08:00
Vincent Wei abeafa313d tune 2022-02-02 15:19:44 +08:00
Vincent Wei 310c0f3e7a The coordinates should be in device space for BitBlt and StretchBlt 2022-01-30 19:03:46 +08:00
Vincent Wei c426894ac9 change version to 5.0.9; change copyright year to 2022 2022-01-14 11:46:31 +08:00
Vincent Wei bf6998672f tune the fix 2021-12-17 15:02:21 +08:00
Vincent Wei ea83e92a16 Fix a bug: InitClipRgn on lrgn and ergn in InitSubDC; rename InitSubDC to dc_InitSubDC 2021-12-17 14:39:56 +08:00
Vincent Wei d95e827e93 update release notes for version 5.0.8 2021-10-20 16:36:28 +08:00
Vincent Wei 40f53732ff support for WebP is ready now (animation not supported) 2021-10-20 16:22:26 +08:00
Vincent Wei e2d2544ce6 cleanup 2021-10-20 16:20:50 +08:00
Vincent Wei 7cefc7d5ab initial support for WebP images 2021-10-20 12:09:40 +08:00
Vincent Wei b59ed4b7d1 implement __mg_check_webp, __mg_init_webp and __mg_cleanup_webp 2021-10-19 18:46:53 +08:00
Vincent Wei 5e43b76753 skeleton to support WebP file 2021-10-19 16:39:24 +08:00
Vincent Wei 894d0f64a2 Merge branch 'px30' into 'rel-5-0'
add option for platform px30

See merge request VincentWei/minigui!17
2021-06-21 16:29:17 +08:00
gengyue c18e0f3479 add option for platform px30 2021-06-21 16:24:31 +08:00
gengyue 8756b5de9f use inline for find_driver_for_device 2021-06-21 16:07:37 +08:00
gengyue 54a51ab02f add option for platform px30 2021-06-21 15:47:47 +08:00
gengyue 741a93aebd modifed find_driver_for_device for platfrom px30 2021-06-21 15:26:14 +08:00
gengyue aeb6642aad add option for platform px30 2021-06-21 14:45:53 +08:00
Vincent Wei 2fe23fa95b tune version 2021-06-08 14:26:14 +08:00
Vincent Wei a6eb81e916 cleanup: mark as deprected for old configuration options 2021-06-08 14:24:34 +08:00
Vincent Wei 93ec7e48b6 uncomment FBIO_ENABLE_CACHE for R818 2021-06-07 17:08:05 +08:00
Vincent Wei 956003092e fix conditional compilation errors 2021-06-07 16:46:13 +08:00
Vincent Wei 96b75c41c1 cleanup 2021-06-07 15:48:43 +08:00
Vincent Wei d6933b83e3 cleanup for the default values of TTF caches 2021-06-07 15:27:31 +08:00
Vincent Wei e2ba3681a1 cleanup: bad usage of __TARGET_UNKNOWN__ 2021-06-07 14:49:31 +08:00
Vincent Wei 0b47b83849 do not enable cache in fbvideo.c for R818 2021-06-07 10:53:26 +08:00
Vincent Wei 08419c0c95 tune fbcon code for compositing schema 2021-06-04 21:21:26 +08:00
Vincent Wei 03bc5befd5 tune fbcon code for r818 2021-06-04 19:50:41 +08:00
Vincent Wei ed37fa4fc2 tune fbcon code for r818 2021-06-04 19:29:58 +08:00
Vincent Wei 7268bcf92e tune fbcon code for r818 2021-06-04 19:12:30 +08:00
Vincent Wei 2d462ec749 tune fbcon code for r8181 2021-06-04 19:03:04 +08:00
Vincent Wei 11a4941dc7 tune 2021-06-04 17:22:45 +08:00
Vincent Wei d6281fd804 optimize calling of FBIO_CACHE_SYNC for R818 2021-06-04 16:50:41 +08:00
Vincent Wei 550fb04731 ioctls for FBVIDEO on R818 2021-06-04 15:52:03 +08:00
Vincent Wei e08a87fc93 add --with-target=r818 option 2021-06-04 15:29:11 +08:00
Vincent Wei cac16f1324 optimize to avoid using malloc/free for blit_ctxt; reset filter and transform of pixman images 2021-06-03 18:33:31 +08:00
Vincent Wei 2efb66cae0 change version to 5.0.7 2021-06-03 18:32:21 +08:00
78 changed files with 1367 additions and 1935 deletions
+1
View File
@@ -29,3 +29,4 @@ Makefile.in
/src/font/utils/ucd/ /src/font/utils/ucd/
/src/sysres/font_list /src/sysres/font_list
/src/sysres/license/dat_files/ /src/sysres/license/dat_files/
/configure~
+61 -50
View File
File diff suppressed because it is too large Load Diff
+67
View File
@@ -1,5 +1,11 @@
# Release Notes # Release Notes
- [Version 5.0.10](#version-5010)
+ [What's new in version 5.0.10](#whats-new-in-version-5010)
- [Version 5.0.9](#version-508)
+ [What's new in version 5.0.9](#whats-new-in-version-508)
- [Version 5.0.8](#version-508)
+ [What's new in version 5.0.8](#whats-new-in-version-508)
- [Version 5.0.6](#version-506) - [Version 5.0.6](#version-506)
+ [What's new in version 5.0.6](#whats-new-in-version-506) + [What's new in version 5.0.6](#whats-new-in-version-506)
- [Version 5.0.5](#version-505) - [Version 5.0.5](#version-505)
@@ -20,6 +26,67 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility) + [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis) + [Deprecated APIs](#deprecated-apis)
## Version 5.0.10
On Sep. 30, 2022, FMSoft announces the availability of MiniGUI 5.0.10,
which is a bug fixing release with bug fixes and some minor enhancements
of MiniGUI 5.0.x.
### What's new in version 5.0.10
In this version, we made some enhancements
* ENHANCEMENTS:
- Enhance `fbcon` engine to support double buffering for Threads and Standalone mode. (Runtime option: `fbcon.double_buffering`).
- Cleanup and enhance `shadow` engine to use `SyncUpdate` method.
- Relaying `MSG_IDLE` messages to the active descendant controls in every 0.5s.
* BUGFIXING:
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/83
- Fix a bug reported in https://github.com/VincentWei/minigui/issues/87
- Fix bugs reported in https://github.com/VincentWei/minigui/issues/89
- Fix some bugs when virtual window enabled under Standalone and Processes runtime modes.
* OPTIMIZATIONS:
* TUNING:
- Fix some warnings reported by GCC 12.
- Use inline functions for SetCursor and SetDefaultCursor instead of macros.
## Version 5.0.9
On Jan. 14, 2022, FMSoft announces the availability of MiniGUI 5.0.9,
which is a bug fixing release with minor enhancements of MiniGUI 5.0.x.
### What's new in version 5.0.9
In this version, we fixed some bugs:
* BUGFIXING:
- Fix a crash bug in `InitSubDC()` of `src/newgdi/gdi.c`.
* ENHANCEMENTS:
* OPTIMIZATIONS:
* TUNING:
- Change copyright year to 2022.
## Version 5.0.8
The MiniGUI development team announces the availability of MiniGUI 5.0.8,
which is a bug fixing release with minor enhancements of MiniGUI 5.0.x.
### What's new in version 5.0.8
In this version, we fixed some bugs and made some optimizations and enhancements:
* BUGFIXING:
* ENHANCEMENTS:
- Support for WebP image format based on `libwebp`.
- Support for two ARM64-based hardware platforms: PX30 and R818.
- New surface pixel format for main window: `ST_PIXEL_XRGB565` under compositing schema.
* OPTIMIZATIONS:
- Shrink heap size for fixed string.
- Optimize the memory use of blitting context.
* TUNING:
- Tune code of fbcon video engine for compositing schema.
- Fix warnings and errors for conditional compilation.
## Version 5.0.6 ## Version 5.0.6
The MiniGUI development team announces the availability of MiniGUI 5.0.6, The MiniGUI development team announces the availability of MiniGUI 5.0.6,
+2 -2
View File
@@ -1,6 +1,6 @@
Version 5.0.6 (2021/05/20) Version 5.0.9 (2022/01/14)
This is the first official release of MiniGUI 5.0.x, the stable version. This is a minor enhancement and bugfix release of MiniGUI 5.0.x, the stable version.
Other packages for MiniGUI resource, tools, components, and samples: Other packages for MiniGUI resource, tools, components, and samples:
+135 -186
View File
File diff suppressed because it is too large Load Diff
+7 -1
View File
@@ -105,6 +105,12 @@ seat=seat0
[fbcon] [fbcon]
defaultmode=1024x768-16bpp defaultmode=1024x768-16bpp
dpi=96 dpi=96
# Whether double buffering is enabled (only for threads and standalone runmodes).
# Use `true` or `yes` for enabled, anything else for disabled.
# Note that under compositing schema, double buffering is always enabled.
# Since 5.0.10.
double_buffering=true
#}} #}}
#{{ifdef _MGGAL_PCXVFB #{{ifdef _MGGAL_PCXVFB
@@ -121,7 +127,7 @@ defaultmode=800x600-16bpp
[shadow] [shadow]
real_engine=pc_xvfb real_engine=pc_xvfb
defaultmode=800x600-16bpp defaultmode=800x600-16bpp
rotate_screen=normal rotate_screen=ccw
#}} #}}
#{{ifdef _MGGAL_MLSHADOW #{{ifdef _MGGAL_MLSHADOW
+1
View File
@@ -311,6 +311,7 @@ MGUI_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
defined(__amd64) || \ defined(__amd64) || \
(defined(__alpha__) || defined(__alpha)) || \ (defined(__alpha__) || defined(__alpha)) || \
defined(__arm__) || defined(__aarch64__) || \ defined(__arm__) || defined(__aarch64__) || \
defined(__loongarch__) || \
defined(__riscv) || \ defined(__riscv) || \
(defined(__CC_ARM) && !defined(__BIG_ENDIAN)) || \ (defined(__CC_ARM) && !defined(__BIG_ENDIAN)) || \
(defined(__mips__) && defined(__MIPSEL__)) || \ (defined(__mips__) && defined(__MIPSEL__)) || \
+24 -25
View File
@@ -131,7 +131,31 @@
#define IAL_EVENT_GESTURE_PINCH_UPDATE 0x0084 #define IAL_EVENT_GESTURE_PINCH_UPDATE 0x0084
#define IAL_EVENT_GESTURE_PINCH_END 0x0085 #define IAL_EVENT_GESTURE_PINCH_END 0x0085
#define TABLET_TOOL_CHANGED_X (1 << 0)
#define TABLET_TOOL_CHANGED_Y (1 << 1)
#define TABLET_TOOL_CHANGED_PRESSURE (1 << 2)
#define TABLET_TOOL_CHANGED_DISTANCE (1 << 3)
#define TABLET_TOOL_CHANGED_TILT_X (1 << 4)
#define TABLET_TOOL_CHANGED_TILT_Y (1 << 5)
#define TABLET_TOOL_CHANGED_ROTATION (1 << 6)
#define TABLET_TOOL_CHANGED_SLIDER (1 << 7)
#define TABLET_TOOL_CHANGED_SIZE_MAJOR (1 << 8)
#define TABLET_TOOL_CHANGED_SIZE_MINOR (1 << 9)
#define TABLET_TOOL_CHANGED_WHEEL (1 << 10)
#ifndef TABLET_TOOL_X #ifndef TABLET_TOOL_X
#define TABLET_TOOL_X 0
#define TABLET_TOOL_Y 1
#define TABLET_TOOL_PRESSURE 2
#define TABLET_TOOL_DISTANCE 3
#define TABLET_TOOL_TILT_X 4
#define TABLET_TOOL_TILT_Y 5
#define TABLET_TOOL_ROTATION 6
#define TABLET_TOOL_SLIDER 7
#define TABLET_TOOL_SIZE_MAJOR 8
#define TABLET_TOOL_SIZE_MINOR 9
#define TABLET_TOOL_WHEEL 10
#define TABLET_TOOL_PROXIMITY_STATE_INVALID 0 #define TABLET_TOOL_PROXIMITY_STATE_INVALID 0
#define TABLET_TOOL_PROXIMITY_STATE_OUT 1 #define TABLET_TOOL_PROXIMITY_STATE_OUT 1
#define TABLET_TOOL_PROXIMITY_STATE_IN 2 #define TABLET_TOOL_PROXIMITY_STATE_IN 2
@@ -149,31 +173,6 @@
#define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0 #define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0
#define TABLET_PAD_STRIP_SOURCE_FINGER 1 #define TABLET_PAD_STRIP_SOURCE_FINGER 1
#define TABLET_TOOL_CHANGED_X (1 << 0)
#define TABLET_TOOL_CHANGED_Y (1 << 1)
#define TABLET_TOOL_CHANGED_PRESSURE (1 << 2)
#define TABLET_TOOL_CHANGED_DISTANCE (1 << 3)
#define TABLET_TOOL_CHANGED_TILT_X (1 << 4)
#define TABLET_TOOL_CHANGED_TILT_Y (1 << 5)
#define TABLET_TOOL_CHANGED_ROTATION (1 << 6)
#define TABLET_TOOL_CHANGED_SLIDER (1 << 7)
#define TABLET_TOOL_CHANGED_SIZE_MAJOR (1 << 8)
#define TABLET_TOOL_CHANGED_SIZE_MINOR (1 << 9)
#define TABLET_TOOL_CHANGED_WHEEL (1 << 10)
#define TABLET_TOOL_X 0
#define TABLET_TOOL_Y 1
#define TABLET_TOOL_PRESSURE 2
#define TABLET_TOOL_DISTANCE 3
#define TABLET_TOOL_TILT_X 4
#define TABLET_TOOL_TILT_Y 5
#define TABLET_TOOL_ROTATION 6
#define TABLET_TOOL_SLIDER 7
#define TABLET_TOOL_SIZE_MAJOR 8
#define TABLET_TOOL_SIZE_MINOR 9
#define TABLET_TOOL_WHEEL 10
#endif #endif
#define IAL_EVENT_TABLET_TOOL_AXIS 0x0090 #define IAL_EVENT_TABLET_TOOL_AXIS 0x0090
+1 -1
View File
@@ -587,7 +587,7 @@ enum {
* \sa InitBlockDataHeap, DestroyBlockDataHeap * \sa InitBlockDataHeap, DestroyBlockDataHeap
*/ */
typedef struct _BLOCKHEAP { typedef struct _BLOCKHEAP {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
/** Size of one block element in bytes. */ /** Size of one block element in bytes. */
+8 -4
View File
@@ -4097,7 +4097,7 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
#endif /* !_MGHAVE_CURSOR */ #endif /* !_MGHAVE_CURSOR */
/** /**
* \def SetCursor(hcsr) * \fn HCURSOR SetCursor(HCURSOR hcsr)
* \brief Changes the current cursor. * \brief Changes the current cursor.
* *
* This function changes the current cursor to be \a hcsr. * This function changes the current cursor to be \a hcsr.
@@ -4110,10 +4110,12 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
* *
* \sa SetCursorEx, SetDefaultCursor * \sa SetCursorEx, SetDefaultCursor
*/ */
#define SetCursor(hcsr) SetCursorEx (hcsr, FALSE) static inline HCURSOR SetCursor(HCURSOR hcsr) {
return SetCursorEx (hcsr, FALSE);
}
/** /**
* \def SetDefaultCursor(hcsr) * \fn HCURSOR SetDefaultCursor(HCURSOR hcsr)
* \brief Changes the current cursor, and set it as the default cursor. * \brief Changes the current cursor, and set it as the default cursor.
* *
* This function changes the current cursor to be \a hcsr, and set it as * This function changes the current cursor to be \a hcsr, and set it as
@@ -4127,7 +4129,9 @@ static inline int GUIAPI ShowCursor (BOOL fShow) {
* *
* \sa SetCursorEx, SetCursor * \sa SetCursorEx, SetCursor
*/ */
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE) static inline HCURSOR SetDefaultCursor(HCURSOR hcsr) {
return SetCursorEx (hcsr, TRUE);
}
/** @} end of cursor_fns */ /** @} end of cursor_fns */
+4 -1
View File
@@ -2905,6 +2905,9 @@ typedef struct _WINMASKINFO {
* *
* This message is sent to the all main windows when the system * This message is sent to the all main windows when the system
* enters idle loop. * enters idle loop.
*
* Since 5.0.10, this messasge will be relayed to the active child control
* if the main window is currently active.
*/ */
#define MSG_IDLE 0x0142 #define MSG_IDLE 0x0142
@@ -6455,7 +6458,7 @@ MG_EXPORT RES_KEY Str2Key (const char* str);
* \fn int GUIAPI GetWindowZOrder(HWND hWnd); * \fn int GUIAPI GetWindowZOrder(HWND hWnd);
* \brief Get The Control ZOrder in the parent window * \brief Get The Control ZOrder in the parent window
* *
* \param hWnd Handle of a control * \param hWnd Handler of a control
* *
* \return return index of ZOrder or 0 if hWnd is a MainWindow or -1 if error * \return return index of ZOrder or 0 if hWnd is a MainWindow or -1 if error
* *
+17 -42
View File
@@ -1,52 +1,27 @@
if MG_MINIMALGDI COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit newgal newgdi
COMMON_SUBDIRS = misc kernel sysres include
COMMON_LADD = \ COMMON_LADD = \
kernel/libkernel.la \ libc/liblibc.la \
sysres/libsysres.la \ misc/libmisc.la \
misc/libmisc.la control/libcontrol.la \
else ex_ctrl/libexctrl.la \
COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit font/libfont.la \
COMMON_LADD = \
libc/liblibc.la \
misc/libmisc.la \
control/libcontrol.la \
ex_ctrl/libexctrl.la \
font/libfont.la \
font/in-core/libincore.la \ font/in-core/libincore.la \
ial/libial.la \ ial/libial.la \
gui/libgui.la \ gui/libgui.la \
main/libmain.la \ main/libmain.la \
mybmp/libmybmp.la \ mybmp/libmybmp.la \
kernel/libkernel.la \ kernel/libkernel.la \
sysres/libsysres.la \ sysres/libsysres.la \
textedit/libtextedit.la textedit/libtextedit.la \
endif newgal/libnewgal.la \
newgdi/libnewgdi.la
if MGRM_STANDALONE
LITE_LADD = standalone/libstandalone.la
LITE_SUBDIRS = standalone
else
if MGRM_PROCESSES
LITE_LADD = server/libserver.la client/libclient.la
LITE_SUBDIRS = server client
else
LITE_LADD =
LITE_SUBDIRS =
endif
endif
NEWGAL_LADD = newgal/libnewgal.la newgdi/libnewgdi.la
NEWGAL_SUBDIRS = newgal newgdi
DIST_SUBDIRS = $(COMMON_SUBDIRS) newgal newgdi server client standalone DIST_SUBDIRS = $(COMMON_SUBDIRS) newgal newgdi server client standalone
SUBDIRS = $(COMMON_SUBDIRS) $(NEWGAL_SUBDIRS) $(LITE_SUBDIRS) SUBDIRS = $(COMMON_SUBDIRS) @RUNMODE_SUBDIRS@
MGSOURCES = template.c template.h MGSOURCES = template.c template.h
MGLIBADD = $(COMMON_LADD) \ MGLIBADD = $(COMMON_LADD) @RUNMODE_LADD@
$(LITE_LADD) \
$(NEWGAL_LADD)
MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) MGLDFLAGS = -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la lib_LTLIBRARIES=libminigui_@MGLIB_SUFFIX@.la
+12 -14
View File
@@ -299,7 +299,15 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
} }
} }
/*complete a click if the click if valid /* DK: When the radio or check button state changes do not erase the background,
* and the prospects for direct rendering */
btnGetRects (pctrl, &rcClient, &rcContent, &rcBitmap);
if (BUTTON_IS_PUSHBTN(pctrl) || (pctrl->dwStyle & BS_PUSHLIKE))
InvalidateRect((HWND)pctrl, NULL, TRUE);
else
InvalidateRect((HWND)pctrl, &rcBitmap, FALSE);
/* complete a click if the click if valid
* (mouse lbutton up in button )*/ * (mouse lbutton up in button )*/
if (old_pose == BST_PUSHED && new_pose != BST_DISABLE if (old_pose == BST_PUSHED && new_pose != BST_DISABLE
&& change_valid) && change_valid)
@@ -312,14 +320,6 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
NotifyParent ((HWND)pctrl, pctrl->id, BN_CLICKED); NotifyParent ((HWND)pctrl, pctrl->id, BN_CLICKED);
} }
/* DK: When the radio or check button state changes do not erase the background,
* and the prospects for direct rendering */
btnGetRects (pctrl, &rcClient, &rcContent, &rcBitmap);
if (BUTTON_IS_PUSHBTN(pctrl) || (pctrl->dwStyle & BS_PUSHLIKE))
InvalidateRect((HWND)pctrl, NULL, TRUE);
else
InvalidateRect((HWND)pctrl, &rcBitmap, FALSE);
} }
/*btnGetRects: /*btnGetRects:
@@ -423,8 +423,8 @@ static void draw_bitmap_button (PCONTROL pctrl, HDC hdc, DWORD dwStyle,
GetClientRect ((HWND)pctrl, &prcClient); GetClientRect ((HWND)pctrl, &prcClient);
if (dwStyle & BS_REALSIZEIMAGE) { if (dwStyle & BS_REALSIZEIMAGE) {
x += (w - bmp->bmWidth) >> 1; x += (int)(w - bmp->bmWidth) >> 1;
y += (h - bmp->bmHeight) >> 1; y += (int)(h - bmp->bmHeight) >> 1;
w = h = 0; w = h = 0;
if (bmp->bmWidth > RECTW(prcClient)){ if (bmp->bmWidth > RECTW(prcClient)){
@@ -847,8 +847,6 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break; break;
} }
case BM_SETSTYLE: case BM_SETSTYLE:
pctrl->dwStyle &= 0xFFFF0000; pctrl->dwStyle &= 0xFFFF0000;
pctrl->dwStyle |= (DWORD)(wParam & 0x0000FFFF); pctrl->dwStyle |= (DWORD)(wParam & 0x0000FFFF);
@@ -1054,7 +1052,7 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
} }
default: default:
break; break;
} }
return DefaultControlProc (hWnd, uMsg, wParam, lParam); return DefaultControlProc (hWnd, uMsg, wParam, lParam);
+9 -4
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -493,10 +493,15 @@ LRESULT ScrollViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
break; break;
} }
case MSG_DESTROY: case MSG_DESTROY: {
scrollview_destroy (psvdata); /* suppress a warning about calling free() before using the pointer */
free (psvdata); PSVDATA svdata = (PSVDATA) GetWindowAdditionalData2 (hWnd);
if (svdata) {
scrollview_destroy(svdata);
free (svdata);
}
break; break;
}
case MSG_GETDLGCODE: case MSG_GETDLGCODE:
return DLGC_WANTARROWS; return DLGC_WANTARROWS;
+2 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -283,7 +283,7 @@ static void DrawCoolBox (HWND hWnd, HDC hdc, PCOOLBARCTRL pdata)
WINDOWINFO *info; WINDOWINFO *info;
RECT rc; RECT rc;
if (tmpdata->Caption == NULL || tmpdata->Caption [0] == '\0') if (tmpdata->Caption [0] == '\0')
break; break;
GetTextExtent (hdc, tmpdata->Caption, -1, &size); GetTextExtent (hdc, tmpdata->Caption, -1, &size);
+2
View File
@@ -157,6 +157,8 @@ static int isInItem (MgList *mglst, int mouseX, int mouseY,
index = row * pivlist->nCol + col; index = row * pivlist->nCol + col;
pci = (IconviewItem *)mglist_getitem_byindex (mglst, index); pci = (IconviewItem *)mglist_getitem_byindex (mglst, index);
if (pci == NULL)
return -1;
if (pRet) if (pRet)
*pRet = (MgItem*)pci; *pRet = (MgItem*)pci;
-1
View File
@@ -59,7 +59,6 @@
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
#include "blockheap.h"
#include "accelkey.h" #include "accelkey.h"
static BLOCKHEAP ACHeap; static BLOCKHEAP ACHeap;
+2 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -803,7 +803,7 @@ BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
char buff [20]; char buff [20];
DWORD rgba; DWORD rgba;
if (!rdr || !rdr->name || rdr->name[0] == '\0') if (!rdr || rdr->name[0] == '\0')
return FALSE; return FALSE;
_DBG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n", _DBG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n",
-1
View File
@@ -71,7 +71,6 @@
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
#include "blockheap.h"
#include "menu.h" #include "menu.h"
#define SHORTEN 0 #define SHORTEN 0
+74 -36
View File
File diff suppressed because it is too large Load Diff
+14
View File
@@ -319,6 +319,19 @@ static void flush_rec (void)
#endif #endif
} }
static void close_rec (void)
{
#ifdef WIN32
/* TODO: */
#else
if (record_fd >= 0) {
close(record_fd);
record_fd = -1;
}
#endif
}
static void do_record(AUTO_IAL_INPUT_EVENT *event) static void do_record(AUTO_IAL_INPUT_EVENT *event)
{ {
@@ -744,6 +757,7 @@ void TermPCXVFBInput (void)
remove("/tmp/.pcxvfb_tmp"); remove("/tmp/.pcxvfb_tmp");
} }
#endif #endif
close_rec();
#endif /* WIN32 */ #endif /* WIN32 */
} }
+1 -1
View File
@@ -3,7 +3,7 @@ noinst_HEADERS = \
cursor.h dc.h event.h list.h element.h \ cursor.h dc.h event.h list.h element.h \
ial.h inline.h internals.h zorder.h menu.h misc.h \ ial.h inline.h internals.h zorder.h menu.h misc.h \
msgstr.h sysfont.h timer.h devfont.h fontname.h \ msgstr.h sysfont.h timer.h devfont.h fontname.h \
readbmp.h icon.h blockheap.h rbtree.h \ readbmp.h icon.h rbtree.h \
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \ ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \ gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
glyph.h license.h mgsock.h unicode-ops.h \ glyph.h license.h mgsock.h unicode-ops.h \
@@ -47,6 +47,8 @@
** blockheap.h: the head file of heap for block data. ** blockheap.h: the head file of heap for block data.
** **
** Create date: 2001/01/10 ** Create date: 2001/01/10
**
** DEPRECATED, USE window.h INSTEAD.
*/ */
#ifndef GUI_BLOCKHEAP_H #ifndef GUI_BLOCKHEAP_H
@@ -55,7 +57,7 @@
#ifndef _MGUI_GDI_H /* included in include/gdi.h */ #ifndef _MGUI_GDI_H /* included in include/gdi.h */
struct _BLOCKHEAP { struct _BLOCKHEAP {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
/* Size of one block element. */ /* Size of one block element. */
+1 -1
View File
@@ -93,7 +93,7 @@ typedef struct tagDC* PDC;
# else /* not defined _MGSCHEMA_COMPOSITING */ # else /* not defined _MGSCHEMA_COMPOSITING */
void __mg_lock_recalc_gcrinfo (PDC pdc); void __mg_lock_recalc_gcrinfo (PDC pdc);
void __mg_unlock_gcrinfo (PDC pdc); void __mg_unlock_gcrinfo (PDC pdc);
#define LOCK_GCRINFO(pdc) __mg_lock_recalc_gcrinfo (pdc) #define LOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_lock_recalc_gcrinfo (pdc)
#define UNLOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_unlock_gcrinfo (pdc) #define UNLOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_unlock_gcrinfo (pdc)
# endif /* not defined _MGSCHEMA_COMPOSITING */ # endif /* not defined _MGSCHEMA_COMPOSITING */
+13 -6
View File
@@ -84,15 +84,18 @@
#define WS_EX_MODALDISABLED 0x10000000L #define WS_EX_MODALDISABLED 0x10000000L
/* /*
* \def WS_EX_CTRLASMAINWIN * Internal extended style:
* \brief The control can be displayed out of the main window * The control can be displayed out of the main window
* which contains the control. * which contains the control.
*/ */
#define WS_EX_CTRLASMAINWIN 0x20000000L #define WS_EX_CTRLASMAINWIN 0x20000000L
/* Internal extended style. */ /* Internal extended style: dialog box. */
#define WS_EX_DIALOGBOX 0x40000000L #define WS_EX_DIALOGBOX 0x40000000L
/* Internal extended style: activated. */
#define WS_EX_ACTIVATED 0x80000000L
/* Make sure the internal window extended styles above are ok */ /* Make sure the internal window extended styles above are ok */
#define MGUI_COMPILE_TIME_ASSERT(name, x) \ #define MGUI_COMPILE_TIME_ASSERT(name, x) \
typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1] typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1]
@@ -101,6 +104,10 @@ MGUI_COMPILE_TIME_ASSERT(ws_ex_int_1,
WS_EX_INTERNAL_MASK & WS_EX_MODALDISABLED); WS_EX_INTERNAL_MASK & WS_EX_MODALDISABLED);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_2, MGUI_COMPILE_TIME_ASSERT(ws_ex_int_2,
WS_EX_INTERNAL_MASK & WS_EX_CTRLASMAINWIN); WS_EX_INTERNAL_MASK & WS_EX_CTRLASMAINWIN);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_3,
WS_EX_INTERNAL_MASK & WS_EX_DIALOGBOX);
MGUI_COMPILE_TIME_ASSERT(ws_ex_int_4,
WS_EX_INTERNAL_MASK & WS_EX_ACTIVATED);
#undef MGUI_COMPILE_TIME_ASSERT #undef MGUI_COMPILE_TIME_ASSERT
@@ -772,8 +779,8 @@ static inline PMSGQUEUE getMsgQueue (HWND hWnd)
} }
MSGQUEUE* mg_AllocMsgQueueForThisThread (void); MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in);
void mg_FreeMsgQueueForThisThread (void); void mg_FreeMsgQueueForThisThread (BOOL sign_off);
/* Since 5.0.0 */ /* Since 5.0.0 */
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd); int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd);
+9 -111
View File
@@ -54,26 +54,12 @@
# define MG_LOCAL /* NULL */ # define MG_LOCAL /* NULL */
#endif #endif
/*
* Common
*/
#if defined(_MG_ENABLE_SPLASH) || \
defined(_MG_ENABLE_SCREENSAVER) || \
defined(_MG_ENABLE_WATERMARK)
#define _MG_ENABLE_LICENSE 1
enum { enum {
SPLASH_MINIGUI, SPLASH_MINIGUI,
SPLASH_FMSOFT, SPLASH_FMSOFT,
SPLASH_FEIMAN, SPLASH_FEIMAN,
SPLASH_PROGRESSBAR, SPLASH_PROGRESSBAR,
SPLASH_PROGRESSBAR_BK, SPLASH_PROGRESSBAR_BK,
#if 0
WATERMARK_1,
WATERMARK_2,
WATERMARK_3,
#endif /* _MG_ENABLE_WATERMARK */
LICENSE_BITMAP_NR LICENSE_BITMAP_NR
}; };
@@ -85,14 +71,14 @@ extern MG_LOCAL BITMAP g_license_bitmaps[];
#define g_bitmap_progressbar g_license_bitmaps[SPLASH_PROGRESSBAR] #define g_bitmap_progressbar g_license_bitmaps[SPLASH_PROGRESSBAR]
#define g_bitmap_progressbar_bk g_license_bitmaps[SPLASH_PROGRESSBAR_BK] #define g_bitmap_progressbar_bk g_license_bitmaps[SPLASH_PROGRESSBAR_BK]
#if defined(_MG_ENABLE_SPLASH) || defined(_MG_ENABLE_SCREENSAVER)
# define _MG_ENABLE_LICENSE 1
MG_LOCAL void __mg_license_create(void); MG_LOCAL void __mg_license_create(void);
MG_LOCAL void __mg_license_destroy(void); MG_LOCAL void __mg_license_destroy(void);
#else #else
# define __mg_license_create() /* NULL */ # define __mg_license_create() /* NULL */
# define __mg_license_destroy() /* NULL */ # define __mg_license_destroy() /* NULL */
#endif /* endif _MG_ENABLE_SPLASH or _MG_ENABLE_SCREENSAVER or _MG_ENABLE_WATERMARK*/ #endif
#ifdef _MG_ENABLE_SCREENSAVER #ifdef _MG_ENABLE_SCREENSAVER
MG_LOCAL void __mg_screensaver_create(void); MG_LOCAL void __mg_screensaver_create(void);
@@ -102,9 +88,6 @@ MG_LOCAL void __mg_screensaver_destroy(void);
# define __mg_screensaver_destroy() /* NULL */ # define __mg_screensaver_destroy() /* NULL */
#endif #endif
/*
* Splash
*/
#ifdef _MG_ENABLE_SPLASH #ifdef _MG_ENABLE_SPLASH
MG_LOCAL void __mg_splash_draw_framework(void); MG_LOCAL void __mg_splash_draw_framework(void);
MG_LOCAL void __mg_splash_progress(void); MG_LOCAL void __mg_splash_progress(void);
@@ -115,96 +98,11 @@ MG_LOCAL void __mg_splash_delay(void);
# define __mg_splash_delay() /* NULL */ # define __mg_splash_delay() /* NULL */
#endif /* endif _MG_ENABLE_SPLASH */ #endif /* endif _MG_ENABLE_SPLASH */
/* #define __mg_license_on_input() /* NULL */
* ScreenSaver & Watermark #define __mg_license_on_timeout() /* NULL */
*/ #define LICENSE_CHECK_CUSTIMER_ID() /* NULL */
#if defined(_MG_ENABLE_SCREENSAVER) || defined(_MG_ENABLE_WATERMARK) #define license_get_processor_id() /* NULL */
MG_LOCAL void __mg_license_on_input(void); #define LICENSE_SET_MESSAGE_OFFSET() /* NULL */
MG_LOCAL void __mg_license_on_timeout(void); #define LICENSE_MODIFY_MESSAGE(x) /* NULL */
#else
# define __mg_license_on_input() /* NULL */
# define __mg_license_on_timeout() /* NULL */
#endif /* _MG_ENABLE_SCREENSAVER || _MG_ENABLE_WATERMARK */
/*
* Product ID
*/
#ifdef _MG_PRODUCTID
typedef struct _product_id {
/* Fixed 8-byte code, help us to locate the struct in .so file */
unsigned char prefix[8];
/* the ID of the customer */
int customer_id;
/* svn version */
int version;
/* When does we compile the .so, in seconds */
int compile_date;
/* The size of the .so file */
int file_size;
/* The check sum of the .so file */
unsigned char checksum[16];
} product_id_t;
#define PRODUCT_ID_PREFIX 0xca, 0x3f, 0x2b, 0x43, 0x00, 0x33, 0xb0, 0xc3
MG_LOCAL int license_get_customer_id(void);
#endif /* _MG_PRODUCTID */
/*
* Tools to encrypt const variables
*/
MG_LOCAL unsigned int LICENSE_ENCRYPTED_CONST_INT(unsigned int);
MG_LOCAL char *LICENSE_ENCRYPTED_CONST_STRING(unsigned char *, int);
/*
* Processor ID
*/
#ifdef _MG_PRODUCTID
# define LICENSE_CHECK_CUSTIMER_ID() \
do { \
if (! license_get_customer_id()) { \
return ERR_INVALID_ARGS; \
} \
} while(0)
#else
# define LICENSE_CHECK_CUSTIMER_ID() /* NULL */
#endif
#ifdef __TARGET_UNKNOWN__
# define license_get_processor_id() /* NULL */
# define LICENSE_SET_MESSAGE_OFFSET() /* NULL */
# define LICENSE_MODIFY_MESSAGE(x) /* NULL */
#else /* not __TARGET_UNKNOWN__ */
extern MG_LOCAL unsigned int g_license_processor_id; /* window.c */
MG_LOCAL void license_get_processor_id (void);
#define LICENSE_PROCESSOR_ID_NONE (0xFC1D8B2A)
extern MG_LOCAL unsigned int g_license_message_offset; /* zorder.c */
#if defined (_WITH_TARGET_S3C6410)
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x1AE2FDFD /* 0x36410101 */)
#elif defined (_WITH_TARGET_S3C2440)
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x3AA4FDFD /* 0x32440101 */)
#elif defined (_WITH_TARGET_S3C2410)
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x3AE2FDFD /* 0x32410101 */)
#elif defined (_WITH_TARGET_HI3560A)
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0xFC38C9AD /* 0x35600200 */)
#else
# define REAL_PROCESSOR_ID LICENSE_PROCESSOR_ID_NONE
#endif
#define LICENSE_SET_MESSAGE_OFFSET() do {g_license_message_offset=g_license_processor_id-(REAL_PROCESSOR_ID);}while (0)
#define LICENSE_MODIFY_MESSAGE(pMsg) \
do { \
pMsg->message += g_license_message_offset; \
pMsg->hwnd -= g_license_message_offset / 2; \
} while (0)
#endif /* __TARGET_UNKNOWN__ */
#endif /* LICENSE_H */ #endif /* LICENSE_H */
+7 -11
View File
@@ -55,9 +55,9 @@
#ifndef GUI_NEWGAL_H #ifndef GUI_NEWGAL_H
#define GUI_NEWGAL_H #define GUI_NEWGAL_H
#include "minigui.h"
#include "gdi.h" #include "gdi.h"
#include "constants.h" #include "constants.h"
#include "blockheap.h"
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
#include <sys/types.h> #include <sys/types.h>
@@ -216,7 +216,10 @@ typedef struct GAL_Surface {
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
pixman_image_t *pix_img; /* The pixman image object for this surface */ pixman_image_t *pix_img; /* The pixman image object for this surface */
void *blit_ctxt; /* blitting context */ pixman_image_t *msk_img;
uint16_t pix_op;
uint16_t pix_filter;
uint32_t pix_alpha_bits;
#endif #endif
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
@@ -818,13 +821,6 @@ static inline BOOL GAL_CheckPixmanFormats (GAL_Surface *src, GAL_Surface *dst)
return FALSE; return FALSE;
} }
typedef struct GAL_BlittingContext {
uint16_t op;
uint16_t filter;
uint32_t alpha_bits;
pixman_image_t *msk_img;
} GAL_BlittingContext;
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops); int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops);
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst); int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst);
@@ -1071,8 +1067,8 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
uint32_t name, uint32_t drm_format, uint32_t pixels_off, uint32_t name, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch); uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
uint32_t handle, size_t 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); uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video, GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
+8
View File
@@ -138,6 +138,14 @@ int __mg_save_png (MG_RWops* fp, MYBITMAP* bmp, RGB* pal);
BOOL __mg_check_png (MG_RWops* fp); BOOL __mg_check_png (MG_RWops* fp);
#endif #endif
#ifdef _MGIMAGE_WEBP
void* __mg_init_webp (MG_RWops* fp, MYBITMAP *png, RGB *pal);
int __mg_load_webp (MG_RWops* fp, void* init_info, MYBITMAP *png, CB_ONE_SCANLINE cb, void* context);
void __mg_cleanup_webp (void* init_info);
int __mg_save_webp (MG_RWops* fp, MYBITMAP* bmp, RGB* pal);
BOOL __mg_check_webp (MG_RWops* fp);
#endif
int __mg_bmp_compute_pitch (int bpp, Uint32 width, Uint32 *pitch, BOOL does_round); int __mg_bmp_compute_pitch (int bpp, Uint32 width, Uint32 *pitch, BOOL does_round);
#define fp_getc(fp) MGUI_RWgetc(fp) #define fp_getc(fp) MGUI_RWgetc(fp)
+8 -2
View File
@@ -141,11 +141,17 @@ typedef struct _ZORDERINFO {
/* The size of usage bitmap for mask rect. */ /* The size of usage bitmap for mask rect. */
int size_maskrect_usage_bmp; int size_maskrect_usage_bmp;
/* use read/write lock for Unix-like OS */
#ifndef __NOUNIX__
#define __ZI_USE_RWLOCK 1
#endif
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
# ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
pthread_rwlock_t rwlock; pthread_rwlock_t rwlock;
pthread_t rwlock_owner;
# else # else
pthread_mutex_t rwlock; pthread_mutex_t mutex;
# endif # endif
#elif defined(_MGRM_PROCESSES) #elif defined(_MGRM_PROCESSES)
int zi_semid; int zi_semid;
+1 -5
View File
@@ -1,19 +1,15 @@
# also for makefile.ng and makefile.msvc # also for makefile.ng and makefile.msvc
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
AM_CFLAGS = -Wno-zero-length-bounds
noinst_LTLIBRARIES = libkernel.la noinst_LTLIBRARIES = libkernel.la
if MG_MINIMALGDI
libkernel_la_SOURCES = init-lite.c fixstr.c \
blockheap.c
else
libkernel_la_SOURCES = timer.c init.c init-lite.c \ libkernel_la_SOURCES = timer.c init.c init-lite.c \
desktop-ths.c desktop-sa.c desktop-procs.c \ desktop-ths.c desktop-sa.c desktop-procs.c \
cursor.c cursor-procs.c cursor-sa.c \ cursor.c cursor-procs.c cursor-sa.c \
sharedres.c message.c event.c listenfd.c \ sharedres.c message.c event.c listenfd.c \
blockheap.c fixstr.c slotset.c zorder.c sem-manager.c \ blockheap.c fixstr.c slotset.c zorder.c sem-manager.c \
compsor-manager.c compsor-fallback.c compsor-manager.c compsor-fallback.c
endif
EXTRA_DIST= desktop.c desktop-comm.c cursor-comm.c makefile.ng makefile.msvc EXTRA_DIST= desktop.c desktop-comm.c cursor-comm.c makefile.ng makefile.msvc
+7 -7
View File
@@ -59,13 +59,13 @@
#include "common.h" #include "common.h"
#include "minigui.h" #include "minigui.h"
#include "gdi.h" #include "gdi.h"
#include "window.h"
#include "constants.h" #include "constants.h"
#include "blockheap.h"
#include "misc.h" #include "misc.h"
BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap) BOOL InitBlockDataHeap (PBLOCKHEAP heap, size_t sz_block, size_t sz_heap)
{ {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_init (&heap->lock, NULL); pthread_mutex_init (&heap->lock, NULL);
#endif #endif
@@ -99,7 +99,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
int free_slot; int free_slot;
unsigned char* block_data = NULL; unsigned char* block_data = NULL;
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&heap->lock); pthread_mutex_lock (&heap->lock);
#endif #endif
@@ -118,7 +118,7 @@ void* BlockDataAlloc (PBLOCKHEAP heap)
ret: ret:
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&heap->lock); pthread_mutex_unlock (&heap->lock);
#endif #endif
return block_data; return block_data;
@@ -128,7 +128,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
{ {
unsigned char* block_data = data; unsigned char* block_data = data;
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&heap->lock); pthread_mutex_lock (&heap->lock);
#endif #endif
@@ -146,7 +146,7 @@ void BlockDataFree (PBLOCKHEAP heap, void* data)
heap, slot); heap, slot);
} }
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&heap->lock); pthread_mutex_unlock (&heap->lock);
#endif #endif
} }
@@ -193,7 +193,7 @@ void DestroyBlockDataHeap (PBLOCKHEAP heap)
free (heap->usage_bmp); free (heap->usage_bmp);
heap->usage_bmp = NULL; heap->usage_bmp = NULL;
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_destroy (&heap->lock); pthread_mutex_destroy (&heap->lock);
#endif #endif
} }
+1 -1
View File
@@ -1303,7 +1303,7 @@ static void transit_to_layer (CompositorCtxt* ctxt, MG_Layer* to_layer)
} }
} }
_WRN_PRINTF ("Average time to composite the layers: %u (times: %u)\n", total_time_ms / total_times, total_times); _DBG_PRINTF ("Average time to composite the layers: %ums (times: %u)\n", total_time_ms / total_times, total_times);
} }
CompositorOps __mg_fallback_compositor = { CompositorOps __mg_fallback_compositor = {
+2 -2
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2021, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -489,7 +489,7 @@ const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name)
return NULL; return NULL;
for (i = 0; i < MAX_NR_COMPOSITORS; i++) { 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; return compositors [i].ops;
} }
} }
+1 -1
View File
@@ -1821,7 +1821,7 @@ static void dskRefreshAllWindow (const RECT* invrc)
info.is_empty_invrc = TRUE; info.is_empty_invrc = TRUE;
#ifdef _MGHAVE_MENU #ifdef _MGHAVE_MENU
dskForceCloseMenu (); dskForceCloseMenu ();
#endif #endif
SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0,
+1 -9
View File
@@ -231,14 +231,6 @@ static void init_desktop_win (void)
BOOL mg_InitDesktop (void) BOOL mg_InitDesktop (void)
{ {
#if 0 /* move to init-lite.c */
/* Since 5.0.0: allocate message queue for desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
_WRN_PRINTF ("failed to allocate message queue\n");
return FALSE;
}
#endif /* moved code */
#ifndef _MGSCHEMA_COMPOSITING #ifndef _MGSCHEMA_COMPOSITING
/* Init heap of clipping rects. */ /* Init heap of clipping rects. */
InitFreeClipRectList (&sg_FreeClipRectList, SIZE_CLIPRECTHEAP); InitFreeClipRectList (&sg_FreeClipRectList, SIZE_CLIPRECTHEAP);
@@ -259,7 +251,7 @@ BOOL mg_InitDesktop (void)
void mg_TerminateDesktop (void) void mg_TerminateDesktop (void)
{ {
/* Since 5.0.0: message queue for desktop thread was dynamically allocated */ /* Since 5.0.0: message queue for desktop thread was dynamically allocated */
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
#ifndef _MGSCHEMA_COMPOSITING #ifndef _MGSCHEMA_COMPOSITING
+1 -9
View File
@@ -102,14 +102,6 @@ BOOL mg_InitDesktop (void)
int ret; int ret;
RECT rcScr = GetScreenRect(); RECT rcScr = GetScreenRect();
#if 0 /* move to init-lite.c */
/* Since 5.0.0: allocate message queue for desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
_WRN_PRINTF ("failed to allocate message queue\n");
return FALSE;
}
#endif /* moved code */
/* /*
* Init ZOrderInfo here. * Init ZOrderInfo here.
*/ */
@@ -153,7 +145,7 @@ BOOL mg_InitDesktop (void)
void mg_TerminateDesktop (void) void mg_TerminateDesktop (void)
{ {
if (__mg_dsk_msg_queue) { if (__mg_dsk_msg_queue) {
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
} }
+2 -2
View File
@@ -145,7 +145,7 @@ void* __kernel_desktop_main (void* data)
MSG Msg; MSG Msg;
/* init message queue of desktop thread */ /* init message queue of desktop thread */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) { if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread (TRUE)) ) {
_ERR_PRINTF ("failed to allocate message queue\n"); _ERR_PRINTF ("failed to allocate message queue\n");
sem_post ((sem_t*)data); sem_post ((sem_t*)data);
return NULL; return NULL;
@@ -191,7 +191,7 @@ void* __kernel_desktop_main (void* data)
#endif #endif
} }
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
return NULL; return NULL;
} }
+39 -29
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -597,55 +597,63 @@ static void reset_window (PMAINWIN pWin, RECT* rcWin)
#endif #endif
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
#ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
/*for unix system, using read/write lock*/ static inline void lock_zi_for_change (ZORDERINFO* zi)
static inline void lock_zi_for_change (const ZORDERINFO* zi)
{ {
pthread_rwlock_wrlock(&((ZORDERINFO*)zi)->rwlock); pthread_rwlock_wrlock(&zi->rwlock);
zi->rwlock_owner = pthread_self();
} }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) static inline void unlock_zi_for_change (ZORDERINFO* zi)
{ {
pthread_rwlock_unlock(&((ZORDERINFO*)zi)->rwlock); pthread_rwlock_unlock(&zi->rwlock);
zi->rwlock_owner = 0;
} }
static inline void lock_zi_for_read (const ZORDERINFO* zi) static inline void lock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_rwlock_rdlock(&((ZORDERINFO*)zi)->rwlock); if (zi->rwlock_owner == pthread_self()) {
return;
}
pthread_rwlock_rdlock(&zi->rwlock);
} }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) static inline void unlock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_rwlock_unlock(&((ZORDERINFO*)zi)->rwlock); if (zi->rwlock_owner == pthread_self()) {
return;
}
pthread_rwlock_unlock(&zi->rwlock);
} }
#else /* __NOUNIX__ */ # else /* __ZI_USE_RWLOCK */
/*for non-unix system, using mutex*/ static inline void lock_zi_for_change (ZORDERINFO* zi)
static inline void lock_zi_for_change (const ZORDERINFO* zi)
{ {
pthread_mutex_lock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_lock(&zi->mutex);
} }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) static inline void unlock_zi_for_change (ZORDERINFO* zi)
{ {
pthread_mutex_unlock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_unlock(&zi->mutex);
} }
static inline void lock_zi_for_read (const ZORDERINFO* zi) static inline void lock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_mutex_lock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_lock(&zi->mutex);
} }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) static inline void unlock_zi_for_read (ZORDERINFO* zi)
{ {
pthread_mutex_unlock(&((ZORDERINFO*)zi)->rwlock); pthread_mutex_unlock(&zi->mutex);
} }
#endif /* __NOUNIX__ */ # endif /* notdef __ZI_USE_RWLOCK */
#elif defined(_MGRM_STANDALONE) #elif defined(_MGRM_STANDALONE)
static inline void lock_zi_for_change (const ZORDERINFO* zi) { } static inline void lock_zi_for_change (ZORDERINFO* zi) { }
static inline void unlock_zi_for_change (const ZORDERINFO* zi) { } static inline void unlock_zi_for_change (ZORDERINFO* zi) { }
static inline void lock_zi_for_read (const ZORDERINFO* zi) { } static inline void lock_zi_for_read (ZORDERINFO* zi) { }
static inline void unlock_zi_for_read (const ZORDERINFO* zi) { } static inline void unlock_zi_for_read (ZORDERINFO* zi) { }
#else /* for procs */ #else /* for procs */
/* NULL. see desktop-procs.c */ /* NULL. see desktop-procs.c */
#endif /* _MGRM_THREADS */ #endif /* _MGRM_THREADS */
@@ -3641,6 +3649,9 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL); do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
if (nodes [0].flags & ZOF_IF_REFERENCE) { if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP, SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld); MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
@@ -3680,9 +3691,6 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
update_client_window_rgn (nodes [idx_znode].cli, update_client_window_rgn (nodes [idx_znode].cli,
nodes [idx_znode].hwnd); nodes [idx_znode].hwnd);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
} }
else { else {
lock_zi_for_change (zi); lock_zi_for_change (zi);
@@ -4499,7 +4507,9 @@ int __mg_join_all_message_threads (void)
list_for_each (l, &msg_queue_list) { list_for_each (l, &msg_queue_list) {
MSGQUEUE *msg_queue = (MSGQUEUE*)l; MSGQUEUE *msg_queue = (MSGQUEUE*)l;
#ifndef NDEBUG
dump_message_queue (msg_queue, __func__); dump_message_queue (msg_queue, __func__);
#endif
pthread_cancel (msg_queue->th); pthread_cancel (msg_queue->th);
} }
+8 -8
View File
@@ -66,7 +66,7 @@ static struct FIXSTR {
BYTE bitmap[LEN_BITMAP]; BYTE bitmap[LEN_BITMAP];
int offset[NR_HEAP]; int offset[NR_HEAP];
char* heap[NR_HEAP + 1]; char* heap[NR_HEAP + 1];
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
} FixStrHeap; } FixStrHeap;
@@ -98,7 +98,7 @@ BOOL mg_InitFixStr (void)
offset += 1<<i; offset += 1<<i;
} }
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_init (&FixStrHeap.lock, NULL); pthread_mutex_init (&FixStrHeap.lock, NULL);
#endif #endif
return TRUE; return TRUE;
@@ -106,7 +106,7 @@ BOOL mg_InitFixStr (void)
void mg_TerminateFixStr (void) void mg_TerminateFixStr (void)
{ {
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_destroy (&FixStrHeap.lock); pthread_mutex_destroy (&FixStrHeap.lock);
#endif #endif
free (FixStrHeap.heap[0]); free (FixStrHeap.heap[0]);
@@ -154,7 +154,7 @@ char* GUIAPI FixStrAlloc (int len)
// .. // ..
// if i == 0; then bufflen = 512 // if i == 0; then bufflen = 512
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&FixStrHeap.lock); pthread_mutex_lock (&FixStrHeap.lock);
#endif #endif
@@ -166,7 +166,7 @@ char* GUIAPI FixStrAlloc (int len)
for(j = 0; j < 8; j++) { for(j = 0; j < 8; j++) {
if (*bitmap & (0x80 >> j)) { if (*bitmap & (0x80 >> j)) {
*bitmap &= (~(0x80 >> j)); *bitmap &= (~(0x80 >> j));
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
#if 0 #if 0
@@ -181,7 +181,7 @@ char* GUIAPI FixStrAlloc (int len)
bitmap++; bitmap++;
} }
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
return (char*)malloc (len + 1); return (char*)malloc (len + 1);
@@ -216,7 +216,7 @@ void GUIAPI FreeFixStr (char* str)
// if i == 0; then bufflen = 512 // if i == 0; then bufflen = 512
bufflen = 1 << (NR_HEAP + 1 - i); bufflen = 1 << (NR_HEAP + 1 - i);
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_lock (&FixStrHeap.lock); pthread_mutex_lock (&FixStrHeap.lock);
#endif #endif
heap = FixStrHeap.heap[i]; heap = FixStrHeap.heap[i];
@@ -236,7 +236,7 @@ void GUIAPI FreeFixStr (char* str)
bitmap = bitmap + (stroff>>3); bitmap = bitmap + (stroff>>3);
*bitmap |= (0x80 >> (stroff%8)); *bitmap |= (0x80 >> (stroff%8));
#ifdef _MGRM_THREADS #ifdef _MGHAVE_VIRTUAL_WINDOW
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
} }
+1 -1
View File
@@ -386,7 +386,7 @@ int InitGUI (int argc, const char* agr[])
/* Since 5.0.0 /* Since 5.0.0
allocate message queue for desktop thread before starting client. */ allocate message queue for desktop thread before starting client. */
if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) { if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread (TRUE)) ) {
err_message (step, "Failed to allocate message queue!"); err_message (step, "Failed to allocate message queue!");
return step; return step;
} }
+2 -2
View File
@@ -578,7 +578,7 @@ int GUIAPI InitGUI (int args, const char *agr[])
/* init message queue of main GUI thread */ /* init message queue of main GUI thread */
step++; step++;
if (!(msg_queue = mg_AllocMsgQueueForThisThread ())) { if (!(msg_queue = mg_AllocMsgQueueForThisThread (TRUE))) {
_ERR_PRINTF ("KERNEL>InitGUI: failed to allocate message queue!\n"); _ERR_PRINTF ("KERNEL>InitGUI: failed to allocate message queue!\n");
goto failure; goto failure;
} }
@@ -655,7 +655,7 @@ void GUIAPI TerminateGUI (int not_used)
miFreeArcCache (); miFreeArcCache ();
#endif #endif
mg_FreeMsgQueueForThisThread (); mg_FreeMsgQueueForThisThread (TRUE);
deleteThreadInfoKey (); deleteThreadInfoKey ();
+16 -17
View File
@@ -60,7 +60,6 @@
#include "gdi.h" #include "gdi.h"
#include "window.h" #include "window.h"
#include "blockheap.h"
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
@@ -159,7 +158,7 @@ void mg_DestroyFreeQMSGList (void)
pthread_key_t __mg_threadinfo_key; pthread_key_t __mg_threadinfo_key;
#endif #endif
MSGQUEUE* mg_AllocMsgQueueForThisThread (void) MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in)
{ {
MSGQUEUE* pMsgQueue; MSGQUEUE* pMsgQueue;
@@ -177,13 +176,14 @@ MSGQUEUE* mg_AllocMsgQueueForThisThread (void)
pthread_setspecific (__mg_threadinfo_key, pMsgQueue); pthread_setspecific (__mg_threadinfo_key, pMsgQueue);
#endif #endif
// register this new message queue if (sign_in) {
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD, SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue); MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue);
}
return pMsgQueue; return pMsgQueue;
} }
void mg_FreeMsgQueueForThisThread (void) void mg_FreeMsgQueueForThisThread (BOOL sign_off)
{ {
MSGQUEUE* pMsgQueue; MSGQUEUE* pMsgQueue;
@@ -194,6 +194,11 @@ void mg_FreeMsgQueueForThisThread (void)
_WRN_PRINTF ("there are still some windows not destroyed\n"); _WRN_PRINTF ("there are still some windows not destroyed\n");
} }
if (sign_off) {
SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD,
MSGTHREAD_SIGNOUT, (LPARAM)pMsgQueue);
}
mg_DestroyMsgQueue (pMsgQueue); mg_DestroyMsgQueue (pMsgQueue);
free (pMsgQueue); free (pMsgQueue);
@@ -823,8 +828,9 @@ checkagain:
goto got_ret; goto got_ret;
} }
} }
else else {
pMsgQueue->dwState &= ~QS_POSTMSG; pMsgQueue->dwState &= ~QS_POSTMSG;
}
} }
/* /*
@@ -1410,6 +1416,9 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
to the controls of the main window will be thrown away as well. */ to the controls of the main window will be thrown away as well. */
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd) int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
{ {
/* For a main window, we use pMainWin to check whether we
should throw away a message for controls of the main window.
Note that checkAndGetMainWindowIfControl returns NULL for non control. */
PMAINWIN pMainWin = (PMAINWIN)hWnd; PMAINWIN pMainWin = (PMAINWIN)hWnd;
PMSG pMsg; PMSG pMsg;
PQMSG pQMsg; PQMSG pQMsg;
@@ -1421,16 +1430,6 @@ int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
LOCK_MSGQ (pMsgQueue); LOCK_MSGQ (pMsgQueue);
/* for virtual window and main window, use pMainWin to check whether we
should throw away a message for controls of a main window.
checkAndGetMainWindowIfControl returns NULL for non control. */
if (pMainWin != HWND_NULL && pMainWin != HWND_INVALID &&
(pMainWin->WinType == TYPE_MAINWIN ||
pMainWin->WinType == TYPE_VIRTWIN))
pMainWin = (PMAINWIN)hWnd;
else
pMainWin = NULL;
if (pMsgQueue->pFirstNotifyMsg) { if (pMsgQueue->pFirstNotifyMsg) {
PQMSG pPrev = NULL, pNext; PQMSG pPrev = NULL, pNext;
pQMsg = pMsgQueue->pFirstNotifyMsg; pQMsg = pMsgQueue->pFirstNotifyMsg;
+20 -11
View File
@@ -67,9 +67,6 @@
#ifdef _MG_ENABLE_LICENSE #ifdef _MG_ENABLE_LICENSE
# include "../sysres/license/c_files/03_progressbar.dat.c" # include "../sysres/license/c_files/03_progressbar.dat.c"
#endif #endif
#ifndef __TARGET_UNKNOWN__
unsigned int g_license_message_offset;
#endif
#ifdef _MGRM_PROCESSES #ifdef _MGRM_PROCESSES
# include "ourhdr.h" # include "ourhdr.h"
@@ -246,11 +243,23 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_mask
#endif /* deprecated code */ #endif /* deprecated code */
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
#ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
pthread_rwlock_init(&__mg_zorder_info->rwlock, NULL); pthread_rwlock_init(&__mg_zorder_info->rwlock, NULL);
#else __mg_zorder_info->rwlock_owner = 0;
pthread_mutex_init(&__mg_zorder_info->rwlock, NULL); # else
#endif do {
int ret;
pthread_mutexattr_t my_attr;
ret = pthread_mutexattr_init(&my_attr);
assert(ret == 0);
ret = pthread_mutexattr_settype(&my_attr, PTHREAD_MUTEX_RECURSIVE);
assert(ret == 0);
pthread_mutex_init(&__mg_zorder_info->mutex, &my_attr);
ret = pthread_mutexattr_destroy(&my_attr);
assert(ret == 0);
(void)ret;
} while (0);
# endif
#endif #endif
return 0; return 0;
#endif #endif
@@ -264,11 +273,11 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
#else #else
#ifdef _MGRM_THREADS #ifdef _MGRM_THREADS
#ifndef __NOUNIX__ # ifdef __ZI_USE_RWLOCK
pthread_rwlock_destroy(&zi->rwlock); pthread_rwlock_destroy(&zi->rwlock);
#else # else
pthread_mutex_destroy(&zi->rwlock); pthread_mutex_destroy(&zi->mutex);
#endif # endif
#endif #endif
free (zi); free (zi);
__mg_zorder_info = NULL; __mg_zorder_info = NULL;
+1 -1
View File
@@ -1472,7 +1472,7 @@ void mg_slice_debug_tree_statistics (void)
su / bf, en, ex); su / bf, en, ex);
} }
else else
_MG_PRINTF("MGSlice: MemChecker: root=NULL\n"); _DBG_PRINTF("MGSlice: MemChecker: root=NULL\n");
pthread_mutex_unlock (&smc_tree_mutex); pthread_mutex_unlock (&smc_tree_mutex);
-4
View File
@@ -5,13 +5,9 @@ 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 rc4.c rc4.h \
makefile.ng makefile.msvc makefile.ng makefile.msvc
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 \ 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 \ math.c about.c license.c anon_file.c rbtree.c map.c \
error.c sockio.c error.c sockio.c
endif
SRC_FILES = $(libmisc_la_SOURCES) SRC_FILES = $(libmisc_la_SOURCES)
LIB_NAME=libmisc LIB_NAME=libmisc
+7 -339
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -1,8 +1,9 @@
AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include AM_CPPFLAGS = $(WEBP_CFLAGS)
AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
noinst_LTLIBRARIES = libmybmp.la noinst_LTLIBRARIES = libmybmp.la
SRC_FILES = mybmp.c winbmp.c gif.c jpeg.c png12.c png16.c lbm.c pcx.c tga.c SRC_FILES = mybmp.c winbmp.c gif.c jpeg.c png12.c png16.c webp.c lbm.c pcx.c tga.c
libmybmp_la_SOURCES = $(SRC_FILES) libmybmp_la_SOURCES = $(SRC_FILES)
+3 -2
View File
@@ -309,7 +309,7 @@ void* __mg_init_jpg (MG_RWops *fp, MYBITMAP* mybmp, RGB* pal)
struct my_error_mgr *jerr; struct my_error_mgr *jerr;
jpeg_init_info_t* init_info; jpeg_init_info_t* init_info;
if (!read_be16(fp,&soi_marker) || JMK_SOI != soi_marker) if (!read_be16(fp, &soi_marker) || JMK_SOI != soi_marker)
goto err; /* not JPEG image*/ goto err; /* not JPEG image*/
MGUI_RWseek (fp, 0, SEEK_SET); MGUI_RWseek (fp, 0, SEEK_SET);
@@ -353,7 +353,8 @@ void* __mg_init_jpg (MG_RWops *fp, MYBITMAP* mybmp, RGB* pal)
} }
/* Step 4: set parameters for decompression */ /* Step 4: set parameters for decompression */
cinfo->out_color_space = (mybmp->flags & MYBMP_LOAD_GRAYSCALE) ? JCS_GRAYSCALE: JCS_RGB; cinfo->out_color_space =
(mybmp->flags & MYBMP_LOAD_GRAYSCALE) ? JCS_GRAYSCALE: JCS_RGB;
cinfo->quantize_colors = FALSE; cinfo->quantize_colors = FALSE;
if (!(mybmp->flags & MYBMP_LOAD_GRAYSCALE)) { if (!(mybmp->flags & MYBMP_LOAD_GRAYSCALE)) {
+8 -1
View File
@@ -98,6 +98,9 @@ static BITMAP_TYPE_INFO bitmap_types [MAX_BITMAP_TYPES] =
#ifdef _MGIMAGE_PNG #ifdef _MGIMAGE_PNG
{ "png", __mg_init_png, __mg_load_png, __mg_cleanup_png, NULL, __mg_check_png }, { "png", __mg_init_png, __mg_load_png, __mg_cleanup_png, NULL, __mg_check_png },
#endif #endif
#ifdef _MGIMAGE_WEBP
{ "webp", __mg_init_webp, __mg_load_webp, __mg_cleanup_webp, NULL, __mg_check_webp },
#endif
}; };
/* /*
@@ -184,7 +187,8 @@ int __mg_bmp_compute_pitch(int bpp, Uint32 width, Uint32 *pitch, BOOL does_round
return bytespp; return bytespp;
} }
void* GUIAPI InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp, RGB* pal) void* GUIAPI
InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp, RGB* pal)
{ {
int type; int type;
LOAD_MYBITMAP_INFO* load_info; LOAD_MYBITMAP_INFO* load_info;
@@ -206,8 +210,11 @@ void* GUIAPI InitMyBitmapSL (MG_RWops* area, const char* ext, MYBITMAP* my_bmp,
my_bmp->frames = 1; my_bmp->frames = 1;
my_bmp->depth = GetGDCapability (HDC_SCREEN, GDCAP_BPP) << 3; my_bmp->depth = GetGDCapability (HDC_SCREEN, GDCAP_BPP) << 3;
// initialize the palette with the screen palette.
if (my_bmp->depth <= 8) if (my_bmp->depth <= 8)
GetPalette (HDC_SCREEN, 0, 256, (GAL_Color*)pal); GetPalette (HDC_SCREEN, 0, 256, (GAL_Color*)pal);
else
memset (pal, 0, sizeof(RGB) * 256); // reset the palette.
/* This is just for gray screen. If your screen is gray, /* This is just for gray screen. If your screen is gray,
* please define this macro _GRAY_SCREEN. * please define this macro _GRAY_SCREEN.
+275
View File
File diff suppressed because it is too large Load Diff
-2
View File
@@ -42,8 +42,6 @@ COMMON_SRCS = \
surface-shm.c \ surface-shm.c \
shadow-screen.h \ shadow-screen.h \
shadow-screen.c \ shadow-screen.c \
concurrent-tasks.h \
concurrent-tasks.c \
$(NULL_FILE) $(NULL_FILE)
libnewgal_la_SOURCES = $(COMMON_SRCS) libnewgal_la_SOURCES = $(COMMON_SRCS)
+26 -36
View File
@@ -77,13 +77,13 @@ static int GAL_SoftBlit(GAL_Surface *src, GAL_Rect *srcrect,
GAL_loblit RunBlit; GAL_loblit RunBlit;
/* Set up the blit information */ /* 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->y*src->pitch +
(Uint16)srcrect->x*src->format->BytesPerPixel; (Uint16)srcrect->x*src->format->BytesPerPixel;
info.s_width = srcrect->w; info.s_width = srcrect->w;
info.s_height = srcrect->h; info.s_height = srcrect->h;
info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel; 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->y*dst->pitch +
(Uint16)dstrect->x*dst->format->BytesPerPixel; (Uint16)dstrect->x*dst->format->BytesPerPixel;
info.d_width = dstrect->w; info.d_width = dstrect->w;
@@ -332,39 +332,37 @@ int GAL_CalculateBlit(GAL_Surface *surface)
int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops) int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
{ {
if (GAL_CheckPixmanFormats (src, dst)) { 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) { if ((src->flags & GAL_SRCALPHA) && src->format->alpha != GAL_ALPHA_OPAQUE) {
memset (&ctxt->alpha_bits, src->format->alpha, sizeof(uint32_t)); memset (&src->pix_alpha_bits, src->format->alpha, sizeof(uint32_t));
ctxt->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1, src->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
&ctxt->alpha_bits, 4); &src->pix_alpha_bits, 4);
if (ctxt->msk_img) if (src->msk_img)
pixman_image_set_repeat (ctxt->msk_img, PIXMAN_REPEAT_NORMAL); pixman_image_set_repeat (src->msk_img, PIXMAN_REPEAT_NORMAL);
} }
else else
ctxt->msk_img = NULL; src->msk_img = NULL;
ops &= COLOR_BLEND_FLAGS_MASK; ops &= COLOR_BLEND_FLAGS_MASK;
if (ops == COLOR_BLEND_LEGACY) { if (ops == COLOR_BLEND_LEGACY) {
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) { if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
ctxt->op = PIXMAN_OP_OVER; src->pix_op = PIXMAN_OP_OVER;
} }
else { else {
ctxt->op = PIXMAN_OP_SRC; src->pix_op = PIXMAN_OP_SRC;
} }
} }
else { else {
ctxt->op = ops; src->pix_op = ops;
} }
if (ctxt->op > PIXMAN_OP_HSL_LUMINOSITY || if (src->pix_op > PIXMAN_OP_HSL_LUMINOSITY ||
ctxt->op < PIXMAN_OP_CLEAR) { src->pix_op < PIXMAN_OP_CLEAR) {
ctxt->op = PIXMAN_OP_SRC; src->pix_op = PIXMAN_OP_SRC;
} }
/* reset transform and filter */
pixman_image_set_transform (src->pix_img, NULL);
pixman_image_set_filter (src->pix_img, PIXMAN_FILTER_NEAREST, NULL, 0);
} }
return 0; return 0;
@@ -372,14 +370,13 @@ int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst) int GAL_CleanupBlitting (GAL_Surface *src, GAL_Surface *dst)
{ {
if (src->blit_ctxt) { if (src->msk_img) {
GAL_BlittingContext* ctxt = src->blit_ctxt; pixman_image_unref (src->msk_img);
if (ctxt->msk_img) src->msk_img = NULL;
pixman_image_unref (ctxt->msk_img);
free (src->blit_ctxt);
src->blit_ctxt = NULL;
} }
pixman_image_set_clip_region32 (dst->pix_img, NULL);
return 0; return 0;
} }
@@ -390,15 +387,8 @@ static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
pixman_image_t *msk_img; pixman_image_t *msk_img;
pixman_op_t op; pixman_op_t op;
if (src->blit_ctxt) { msk_img = src->msk_img;
GAL_BlittingContext* ctxt = src->blit_ctxt; op = (pixman_op_t)src->pix_op;
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", _DBG_PRINTF ("srcrect: %d, %d, %dx%d; dstrect: %d, %d, %dx%d\n",
srcrect->x, srcrect->y, srcrect->w, srcrect->h, srcrect->x, srcrect->y, srcrect->w, srcrect->h,
@@ -411,8 +401,8 @@ static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
pixman_image_set_clip_region32 (dst_img, &clip_region); pixman_image_set_clip_region32 (dst_img, &clip_region);
#endif #endif
#if 0
// pixman_blt does not work // pixman_blt does not work
#if 0
if (pixman_image_get_format (src_img) == pixman_image_get_format (dst_img) && if (pixman_image_get_format (src_img) == pixman_image_get_format (dst_img) &&
op == PIXMAN_OP_SRC && msk_img == NULL) { op == PIXMAN_OP_SRC && msk_img == NULL) {
pixman_blt ((uint32_t *)((char*)src->pixels + src->pixels_off), pixman_blt ((uint32_t *)((char*)src->pixels + src->pixels_off),
+5 -12
View File
@@ -1524,12 +1524,12 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
} }
} else { } else {
/* Now the meat, choose the blitter we want */ /* Now the meat, choose the blitter we want */
int a_need = 0; int a_need = 0;
if(dstfmt->Amask) if (dstfmt->Amask)
a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA; a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
table = normal_blit[srcfmt->BytesPerPixel-1]; table = normal_blit[srcfmt->BytesPerPixel-1];
for ( which=0; table[which].srcR; ++which ) { for (which=0; table[which].srcR; ++which) {
if ( srcfmt->Rmask == table[which].srcR && if (srcfmt->Rmask == table[which].srcR &&
srcfmt->Gmask == table[which].srcG && srcfmt->Gmask == table[which].srcG &&
srcfmt->Bmask == table[which].srcB && srcfmt->Bmask == table[which].srcB &&
dstfmt->BytesPerPixel == table[which].dstbpp && dstfmt->BytesPerPixel == table[which].dstbpp &&
@@ -1538,7 +1538,7 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
dstfmt->Bmask == table[which].dstB && dstfmt->Bmask == table[which].dstB &&
(a_need & table[which].alpha) == a_need && (a_need & table[which].alpha) == a_need &&
(CPU_Flags()&table[which].cpu_flags) == (CPU_Flags()&table[which].cpu_flags) ==
table[which].cpu_flags ) table[which].cpu_flags)
break; break;
} }
sdata->aux_data = table[which].aux_data; sdata->aux_data = table[which].aux_data;
@@ -1547,13 +1547,6 @@ GAL_loblit GAL_CalculateBlitN(GAL_Surface *surface, int blit_index)
blitfun = BlitNtoNCopyAlpha; blitfun = BlitNtoNCopyAlpha;
} }
#ifdef DEBUG_ASM
if ( (blitfun == GAL_BlitNtoN) || (blitfun == GAL_BlitNto1) )
fprintf(stderr, "Using C blit\n");
else
fprintf(stderr, "Using optimized C blit\n");
#endif /* DEBUG_ASM */
return(blitfun); return(blitfun);
} }
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 */
+9 -2
View File
@@ -796,7 +796,7 @@ static GAL_Surface* create_surface_from_buffer (_THIS,
surface->pixels_off = 0; surface->pixels_off = 0;
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
surface->pix_img = NULL; surface->pix_img = NULL;
surface->blit_ctxt = NULL; surface->msk_img = NULL;
#endif #endif
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
surface->shared_header = NULL; surface->shared_header = NULL;
@@ -952,6 +952,11 @@ static void DRM_DeleteDevice(GAL_VideoDevice *device)
free(device); free(device);
} }
#ifdef __TARGET_PX30__
static inline char* find_driver_for_device (const char *dev_name) {
return strdup ("rockchip");
}
#else /* __TARGET_PX30__ */
static char* find_driver_for_device (const char *dev_name) static char* find_driver_for_device (const char *dev_name)
{ {
char *driver; char *driver;
@@ -996,6 +1001,7 @@ static char* find_driver_for_device (const char *dev_name)
return strdup (driver + strlen ("/")); return strdup (driver + strlen ("/"));
} }
#endif /* not defined __TARGET_PX30__ */
static DrmDriverOps* load_external_driver (DrmVideoData* vdata, static DrmDriverOps* load_external_driver (DrmVideoData* vdata,
const char* driver_name, int device_fd) const char* driver_name, int device_fd)
@@ -1095,6 +1101,7 @@ static int open_drm_device(GAL_VideoDevice *device)
_DBG_PRINTF("Try to load DRM driver: %s\n", driver_name); _DBG_PRINTF("Try to load DRM driver: %s\n", driver_name);
fd = drmOpen(driver_name, NULL); fd = drmOpen(driver_name, NULL);
if (fd < 0) { if (fd < 0) {
_ERR_PRINTF("NEWGAL>DRM: drmOpen failed\n"); _ERR_PRINTF("NEWGAL>DRM: drmOpen failed\n");
free(driver_name); free(driver_name);
@@ -3568,7 +3575,7 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
/* called by drmCreateDCFromHandle */ /* called by drmCreateDCFromHandle */
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle, 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) uint32_t width, uint32_t height, uint32_t pitch)
{ {
GAL_VideoDevice *this = (GAL_VideoDevice *)video; GAL_VideoDevice *this = (GAL_VideoDevice *)video;
+3 -1
View File
@@ -323,11 +323,13 @@ static void DUMMY_VideoQuit(_THIS)
if (mgIsServer) { if (mgIsServer) {
shm_unlink (DUMMYVID_SHAREDMEM_NAME); shm_unlink (DUMMYVID_SHAREDMEM_NAME);
} }
#else #elif !defined(_MGRM_PROCESSES)
if (this->screen->pixels != NULL) { if (this->screen->pixels != NULL) {
free (this->screen->pixels); free (this->screen->pixels);
this->screen->pixels = NULL; this->screen->pixels = NULL;
} }
#else
// do nothing (COMPOSITING_SCHEMA)
#endif /* not (defined(_MGRM_PROCESSES) && defined (_MGSCHEMA_SHAREDFB)) */ #endif /* not (defined(_MGRM_PROCESSES) && defined (_MGSCHEMA_SHAREDFB)) */
} }
File diff suppressed because it is too large Load Diff
+10 -10
View File
@@ -68,19 +68,26 @@ typedef struct vidmem_bucket {
/* Private display data */ /* Private display data */
struct GAL_PrivateVideoData { struct GAL_PrivateVideoData {
/* For compositing schema, we force to use double buffering */ /* When double buffering supported, the real surface represents the ultimate
#ifdef _MGSCHEMA_COMPOSITING * scan-out frame buffer, and the shadow screen represents the rendering
* surface. When double buffering disabled, shadow_screen is NULL.
*
* For compositing schema, we force to use double buffering.
* For threads and standalone mode, controlled by `fbcon.double_buffering`
* run-time option. Not supported for processes mode.
*/
/* start of header for shadow screen */ /* start of header for shadow screen */
int magic, version; int magic, version;
GAL_Surface *real_screen, *shadow_screen; GAL_Surface *real_screen, *shadow_screen;
RECT dirty_rc; RECT dirty_rc;
#ifdef _MGSCHEMA_COMPOSITING
/* Used to simulate the hardware cursor. */ /* Used to simulate the hardware cursor. */
GAL_Surface *cursor; GAL_Surface *cursor;
int csr_x, csr_y; int csr_x, csr_y;
int hot_x, hot_y; int hot_x, hot_y;
#endif
/* end of header for shadow screen */ /* end of header for shadow screen */
#endif /* _MGSCHEMA_COMPOSITING */
int console_fd; int console_fd;
struct fb_var_screeninfo cache_vinfo; struct fb_var_screeninfo cache_vinfo;
@@ -104,13 +111,6 @@ struct GAL_PrivateVideoData {
void (*wait_vbl)(_THIS); void (*wait_vbl)(_THIS);
void (*wait_idle)(_THIS); void (*wait_idle)(_THIS);
#if 0 /* deprecated code */
int flip_page;
char *flip_address[2];
#define flip_page (this->hidden->flip_page)
#define flip_address (this->hidden->flip_address)
#endif
}; };
/* Old variable names */ /* Old variable names */
+8
View File
@@ -76,6 +76,14 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
//memset(format, 0, sizeof(*format)); //memset(format, 0, sizeof(*format));
format->alpha = GAL_ALPHA_OPAQUE; format->alpha = GAL_ALPHA_OPAQUE;
/* Give defaults for the special case */
if (bpp == 32 && Rmask == 0 && Gmask == 0 && Bmask == 0 && Amask == 0) {
Amask = 0xFF000000;
Rmask = 0x00FF0000;
Gmask = 0x0000FF00;
Bmask = 0x000000FF;
}
/* Set up the format */ /* Set up the format */
format->BitsPerPixel = bpp; format->BitsPerPixel = bpp;
format->BytesPerPixel = (bpp+7)/8; format->BytesPerPixel = (bpp+7)/8;
+133 -248
View File
File diff suppressed because it is too large Load Diff
+30 -39
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -57,64 +57,55 @@ extern "C" {
#define _THIS GAL_VideoDevice *this #define _THIS GAL_VideoDevice *this
typedef struct _ShadowFBHeader { typedef struct _ShadowFBHeader {
unsigned int info_size; unsigned int info_size;
int width; int width;
int height; int height;
int depth; int depth;
int pitch; int pitch;
int dirty; /* true for dirty, and should reset to false after refreshing the dirty area */ int dirty; /* true for dirty, and should reset to false after refreshing the dirty area */
RECT dirty_rect; RECT dirty_rect;
int palette_changed; /* true for changed, and should reset to false after reflecting the change */ int palette_changed; /* true for changed, and should reset to false after reflecting the change */
int palette_offset; int palette_offset;
int fb_offset; int fb_offset;
Uint32 Rmask; Uint32 Rmask;
Uint32 Gmask; Uint32 Gmask;
Uint32 Bmask; Uint32 Bmask;
Uint32 Amask; Uint32 Amask;
int firstcolor; int firstcolor;
int ncolors; int ncolors;
} ShadowFBHeader; } ShadowFBHeader;
#define FLAG_REALFB_PREALLOC 0x01 #define FLAG_REALFB_PREALLOC 0x01
typedef struct _RealFBInfo { typedef struct _RealFBInfo {
DWORD flags; DWORD flags;
int height, width; int height, width;
int depth; int depth;
int pitch; int pitch;
void* fb; void* fb;
void * real_device; void * real_device;
} RealFBInfo; } RealFBInfo;
/* Private display data */ /* Private display data */
struct GAL_PrivateVideoData { struct GAL_PrivateVideoData {
RealFBInfo * realfb_info; RealFBInfo * realfb_info;
/*GAL_VideoDevice *_real_device ;
int w, h, pitch;
void *fb;
BOOL alloc_fb;
BOOL dirty;
RECT update;*/
pthread_t update_th; pthread_t update_th;
#ifdef _MGRM_PROCESSES #ifdef _MGRM_PROCESSES
int semid; int semid;
#else
pthread_mutex_t update_lock;
#endif #endif
}; };
typedef struct _ShadowFBOps { typedef struct _ShadowFBOps {
int (*init) (void); int (*init) (void);
int (*get_realfb_info) (RealFBInfo* realfb_info); int (*get_realfb_info) (RealFBInfo* realfb_info);
int (*release) (RealFBInfo* realfb_info); int (*release) (RealFBInfo* realfb_info);
int (*set_palette) (RealFBInfo* realfb_info, int firstcolor, int ncolors, void* colors); int (*set_palette) (RealFBInfo* realfb_info, int firstcolor,
void (*sleep) (void); int ncolors, void* colors);
void (*refresh) (ShadowFBHeader* shadowfb_header, RealFBInfo* realfb_info, void* update); void (*refresh) (ShadowFBHeader* shadowfb_header,
RealFBInfo* realfb_info, void* update);
} ShadowFBOps; } ShadowFBOps;
ShadowFBOps * __mg_shadow_fb_ops;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
+25 -86
View File
@@ -49,7 +49,6 @@
#include "common.h" #include "common.h"
#include "newgal.h" #include "newgal.h"
#include "blit.h" #include "blit.h"
#include "concurrent-tasks.h"
#define DEFINE_COPY_ROW(name, type) \ #define DEFINE_COPY_ROW(name, type) \
static void name(type *src, int src_w, type *dst, int dst_w) \ static void name(type *src, int src_w, type *dst, int dst_w) \
@@ -274,44 +273,38 @@ int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
double rotation; double rotation;
pixman_f_transform_t ftransform; pixman_f_transform_t ftransform;
pixman_transform_t transform; pixman_transform_t transform;
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) { if ((src->flags & GAL_SRCALPHA) && src->format->alpha != GAL_ALPHA_OPAQUE) {
memset (&ctxt->alpha_bits, src->format->alpha, sizeof(uint32_t)); memset (&src->pix_alpha_bits, src->format->alpha, sizeof(uint32_t));
ctxt->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1, src->msk_img = pixman_image_create_bits_no_clear (PIXMAN_a8, 1, 1,
&ctxt->alpha_bits, 4); &src->pix_alpha_bits, 4);
if (ctxt->msk_img) if (src->msk_img)
pixman_image_set_repeat (ctxt->msk_img, PIXMAN_REPEAT_NORMAL); pixman_image_set_repeat (src->msk_img, PIXMAN_REPEAT_NORMAL);
} }
else else
ctxt->msk_img = NULL; src->msk_img = NULL;
ctxt->filter = ops >> SCALING_FILTER_SHIFT; src->pix_filter = ops >> SCALING_FILTER_SHIFT;
if (ctxt->filter > PIXMAN_FILTER_CONVOLUTION) { if (src->pix_filter > PIXMAN_FILTER_CONVOLUTION) {
ctxt->filter = PIXMAN_FILTER_FAST; src->pix_filter = PIXMAN_FILTER_FAST;
} }
ops &= COLOR_BLEND_FLAGS_MASK; ops &= COLOR_BLEND_FLAGS_MASK;
if (ops == COLOR_BLEND_LEGACY) { if (ops == COLOR_BLEND_LEGACY) {
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) { if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
ctxt->op = PIXMAN_OP_OVER; src->pix_op = PIXMAN_OP_OVER;
} }
else { else {
ctxt->op = PIXMAN_OP_SRC; src->pix_op = PIXMAN_OP_SRC;
} }
} }
else { else {
ctxt->op = ops; src->pix_op = ops;
} }
if (ctxt->op > PIXMAN_OP_HSL_LUMINOSITY || if (src->pix_op > PIXMAN_OP_HSL_LUMINOSITY ||
ctxt->op < PIXMAN_OP_CLEAR) { src->pix_op < PIXMAN_OP_CLEAR) {
ctxt->op = PIXMAN_OP_SRC; src->pix_op = PIXMAN_OP_SRC;
} }
pixman_f_transform_init_identity (&ftransform); pixman_f_transform_init_identity (&ftransform);
@@ -351,7 +344,7 @@ int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
pixman_image_set_filter (src_img, (pixman_filter_t)filter, NULL, 0); pixman_image_set_filter (src_img, (pixman_filter_t)filter, NULL, 0);
} }
#else #else
pixman_image_set_filter (src->pix_img, (pixman_filter_t)ctxt->filter, NULL, 0); pixman_image_set_filter (src->pix_img, (pixman_filter_t)src->pix_filter, NULL, 0);
#endif #endif
} }
@@ -360,49 +353,18 @@ int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
int GAL_CleanupStretchBlit (GAL_Surface *src, GAL_Surface *dst) int GAL_CleanupStretchBlit (GAL_Surface *src, GAL_Surface *dst)
{ {
if (src->blit_ctxt) { if (src->msk_img) {
pixman_transform_t transform; pixman_image_unref (src->msk_img);
src->msk_img = NULL;
GAL_BlittingContext* ctxt = src->blit_ctxt;
if (ctxt->msk_img)
pixman_image_unref (ctxt->msk_img);
free (src->blit_ctxt);
src->blit_ctxt = NULL;
pixman_transform_init_identity (&transform);
pixman_image_set_transform (src->pix_img, &transform);
pixman_image_set_filter (src->pix_img, PIXMAN_FILTER_FAST, NULL, 0);
pixman_image_set_clip_region32 (dst->pix_img, NULL);
} }
pixman_image_set_transform (src->pix_img, NULL);
pixman_image_set_filter (src->pix_img, PIXMAN_FILTER_NEAREST, NULL, 0);
pixman_image_set_clip_region32 (dst->pix_img, NULL);
return 0; return 0;
} }
#ifdef _MGRM_PROCESSES
typedef struct _ContextStretch {
pixman_op_t op;
pixman_image_t *src_img;
pixman_image_t *msk_img;
pixman_image_t *dst_img;
GAL_Rect dst_rects [_MGNR_CONCURRENT_TASKS + 1];
} ContextStretch;
static void stretch_proc (void* context, int loop_idx)
{
ContextStretch *ctxt = context;
if (ctxt->dst_rects[loop_idx].h > 0) {
GAL_Rect* dstrect = ctxt->dst_rects + loop_idx;
pixman_image_composite32 (ctxt->op, ctxt->src_img, ctxt->msk_img, ctxt->dst_img,
dstrect->x, dstrect->y,
0, 0,
dstrect->x, dstrect->y,
dstrect->w, dstrect->h);
}
}
#endif
int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect, int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect, GAL_Surface *dst, GAL_Rect *dstrect,
const STRETCH_EXTRA_INFO* sei, DWORD ops) const STRETCH_EXTRA_INFO* sei, DWORD ops)
@@ -416,15 +378,8 @@ int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect,
return GAL_StretchBltLegacy (src, srcrect, dst, dstrect, return GAL_StretchBltLegacy (src, srcrect, dst, dstrect,
ops & COLOR_BLEND_FLAGS_MASK); ops & COLOR_BLEND_FLAGS_MASK);
if (src->blit_ctxt) { msk_img = src->msk_img;
GAL_BlittingContext* ctxt = src->blit_ctxt; op = (pixman_op_t)src->pix_op;
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; cliprect: %d,%d, %dx%d\n", _DBG_PRINTF ("srcrect: %d,%d, %dx%d; dstrect: %d,%d, %dx%d; cliprect: %d,%d, %dx%d\n",
srcrect->x, srcrect->y, srcrect->w, srcrect->h, srcrect->x, srcrect->y, srcrect->w, srcrect->h,
@@ -435,27 +390,11 @@ int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect,
dst->clip_rect.x, dst->clip_rect.y, dst->clip_rect.w, dst->clip_rect.h); 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); pixman_image_set_clip_region32 (dst_img, &clip_region);
#ifdef _MGRM_PROCESSES
// we use concurrent tasks only under MiniGUI-Processes.
{
ContextStretch ctxt;
ctxt.op = op;
ctxt.src_img = src_img;
ctxt.msk_img = msk_img;
ctxt.dst_img = dst_img;
concurrentTasks_SplitRect (ctxt.dst_rects, dstrect, _MGNR_CONCURRENT_TASKS + 1);
concurrentTasks_Do (&ctxt, stretch_proc);
}
#else
pixman_image_composite32 (op, src_img, msk_img, dst_img, pixman_image_composite32 (op, src_img, msk_img, dst_img,
dstrect->x, dstrect->y, dstrect->x, dstrect->y,
0, 0, 0, 0,
dstrect->x, dstrect->y, dstrect->x, dstrect->y,
dstrect->w, dstrect->h); dstrect->w, dstrect->h);
#endif
pixman_region32_fini (&clip_region); pixman_region32_fini (&clip_region);
return 0; return 0;
+1 -1
View File
@@ -105,7 +105,7 @@ GAL_Surface * GAL_CreateCursorSurface (GAL_VideoDevice *video,
surface->format_version = 0; surface->format_version = 0;
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
surface->pix_img = NULL; surface->pix_img = NULL;
surface->blit_ctxt = NULL; surface->msk_img = NULL;
#endif #endif
surface->shared_header = NULL; surface->shared_header = NULL;
surface->dirty_info = NULL; surface->dirty_info = NULL;
+5 -5
View File
@@ -138,7 +138,7 @@ GAL_Surface * GAL_CreateSharedRGBSurface (GAL_VideoDevice *video,
surface->format_version = 0; surface->format_version = 0;
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
surface->pix_img = NULL; surface->pix_img = NULL;
surface->blit_ctxt = NULL; surface->msk_img = NULL;
#endif #endif
surface->shared_header = NULL; surface->shared_header = NULL;
surface->dirty_info = NULL; surface->dirty_info = NULL;
@@ -278,7 +278,7 @@ error:
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
surface->pix_img = NULL; surface->pix_img = NULL;
surface->blit_ctxt = NULL; surface->msk_img = NULL;
#endif #endif
surface->shared_header = NULL; surface->shared_header = NULL;
surface->dirty_info = NULL; surface->dirty_info = NULL;
@@ -328,7 +328,7 @@ void GAL_FreeSharedSurfaceData (GAL_Surface *surface)
surface->pixels = NULL; surface->pixels = NULL;
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
surface->pix_img = NULL; surface->pix_img = NULL;
surface->blit_ctxt = NULL; surface->msk_img = NULL;
#endif #endif
surface->shared_header = NULL; surface->shared_header = NULL;
surface->dirty_info = NULL; surface->dirty_info = NULL;
@@ -424,7 +424,7 @@ GAL_Surface * GAL_AttachSharedRGBSurface (int fd, size_t map_size,
surface->format_version = 0; surface->format_version = 0;
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
surface->pix_img = NULL; surface->pix_img = NULL;
surface->blit_ctxt = NULL; surface->msk_img = NULL;
#endif #endif
GAL_SetClipRect (surface, NULL); GAL_SetClipRect (surface, NULL);
@@ -481,7 +481,7 @@ void GAL_DettachSharedSurfaceData (GAL_Surface *surface)
surface->pixels = NULL; surface->pixels = NULL;
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
surface->pix_img = NULL; surface->pix_img = NULL;
surface->blit_ctxt = NULL; surface->msk_img = NULL;
#endif #endif
surface->shared_header = NULL; surface->shared_header = NULL;
surface->dirty_info = NULL; surface->dirty_info = NULL;
+31 -45
View File
@@ -56,7 +56,6 @@
#include "pixels_c.h" #include "pixels_c.h"
#include "memops.h" #include "memops.h"
#include "leaks.h" #include "leaks.h"
#include "concurrent-tasks.h"
#ifdef _MGRM_PROCESSES #ifdef _MGRM_PROCESSES
#include <sys/mman.h> /* for munmap */ #include <sys/mman.h> /* for munmap */
@@ -145,7 +144,7 @@ GAL_Surface * GAL_CreateRGBSurface (Uint32 flags,
surface->format_version = 0; surface->format_version = 0;
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
surface->pix_img = NULL; surface->pix_img = NULL;
surface->blit_ctxt = NULL; surface->msk_img = NULL;
#endif #endif
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
surface->shared_header = NULL; surface->shared_header = NULL;
@@ -494,28 +493,6 @@ static int own_overlapped_bitblit(GAL_blit real_blit, struct GAL_Surface *src, G
} }
#endif #endif
#ifdef _MGRM_PROCESSES
typedef struct _ContextBlit {
GAL_Surface *src;
GAL_Surface *dst;
GAL_blit real_blit;
GAL_Rect src_rects [_MGNR_CONCURRENT_TASKS + 1];
GAL_Rect dst_rects [_MGNR_CONCURRENT_TASKS + 1];
} ContextBlit;
static void blit_proc (void* context, int loop_idx)
{
ContextBlit *ctxt = context;
if (ctxt->src_rects[loop_idx].h > 0) {
ctxt->real_blit (ctxt->src, ctxt->src_rects + loop_idx,
ctxt->dst, ctxt->dst_rects + loop_idx);
}
}
#endif
/* /*
* Set up a blit between two surfaces -- split into three parts: * Set up a blit between two surfaces -- split into three parts:
* The upper part, GAL_UpperBlit(), performs clipping and rectangle * The upper part, GAL_UpperBlit(), performs clipping and rectangle
@@ -561,31 +538,38 @@ int GAL_LowerBlit (GAL_Surface *src, GAL_Rect *srcrect,
} }
#endif #endif
#ifdef _MGRM_PROCESSES #ifdef MG_CONFIG_USE_OWN_OVERLAPPED_BITBLIT
// we use concurrent tasks only under MiniGUI-Processes.
{
ContextBlit ctxt;
ctxt.src = src;
ctxt.dst = dst;
ctxt.real_blit = do_blit;
concurrentTasks_SplitRect (ctxt.src_rects, srcrect, _MGNR_CONCURRENT_TASKS + 1);
concurrentTasks_SplitRect (ctxt.dst_rects, dstrect, _MGNR_CONCURRENT_TASKS + 1);
concurrentTasks_Do (&ctxt, blit_proc);
}
#else
# ifdef MG_CONFIG_USE_OWN_OVERLAPPED_BITBLIT
ret = own_overlapped_bitblit(do_blit, src, srcrect, dst, dstrect); ret = own_overlapped_bitblit(do_blit, src, srcrect, dst, dstrect);
# else #else
ret = do_blit(src, srcrect, dst, dstrect); ret = do_blit(src, srcrect, dst, dstrect);
# endif #endif
#if 0
{
static int n_sw=0, n_hw=0;
if ((src->flags & GAL_HWACCEL) == GAL_HWACCEL)
{
n_hw ++;
}
else
{
n_sw ++;
}
printf("[%06u] hw/blit=%d/%d %c size=%dX%d src=(%d %d),%p dst=(%d %d),%p\n",
times(NULL) % 1000000,
n_hw, n_hw+n_sw,
do_blit == src->map->sw_blit ? 'S':'H',
srcrect->w, srcrect->h,
srcrect->x, srcrect->y, src,
dstrect->x, dstrect->y, dst
);
}
#endif #endif
return ret; return ret;
} }
int GAL_UpperBlit (GAL_Surface *src, GAL_Rect *srcrect, int GAL_UpperBlit (GAL_Surface *src, GAL_Rect *srcrect,
GAL_Surface *dst, GAL_Rect *dstrect, DWORD op) GAL_Surface *dst, GAL_Rect *dstrect, DWORD op)
{ {
@@ -1886,13 +1870,15 @@ void GAL_FreeSurface (GAL_Surface *surface)
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
if (surface->pix_img) { if (surface->pix_img) {
_DBG_PRINTF ("There is not cleaned up blitting pixel image: %p\n", surface->pix_img);
pixman_image_unref (surface->pix_img); pixman_image_unref (surface->pix_img);
surface->pix_img = NULL; surface->pix_img = NULL;
} }
if (surface->blit_ctxt) { if (surface->msk_img) {
_WRN_PRINTF ("There is not cleaned up blitting context: %p\n", surface->blit_ctxt); _DBG_PRINTF ("There is not cleaned up blitting mask image: %p\n", surface->msk_img);
pixman_image_unref (surface->msk_img);
surface->msk_img = NULL;
} }
#endif #endif
+2 -15
View File
@@ -58,7 +58,6 @@
#include "pixels_c.h" #include "pixels_c.h"
#include "license.h" #include "license.h"
#include "debug.h" #include "debug.h"
#include "concurrent-tasks.h"
/* Available video drivers */ /* Available video drivers */
static VideoBootStrap *bootstrap[] = { static VideoBootStrap *bootstrap[] = {
@@ -174,7 +173,7 @@ BLOCKHEAP __mg_free_update_region_list;
int GAL_VideoInit(const char *driver_name, Uint32 flags); int GAL_VideoInit(const char *driver_name, Uint32 flags);
void GAL_VideoQuit(void); void GAL_VideoQuit(void);
static GAL_VideoDevice *GAL_GetVideo(const char* driver_name) GAL_VideoDevice *GAL_GetVideo(const char* driver_name)
{ {
GAL_VideoDevice *video; GAL_VideoDevice *video;
int index; int index;
@@ -289,12 +288,6 @@ int GAL_VideoInit (const char *driver_name, Uint32 flags)
video->info.vfmt = GAL_VideoSurface->format; 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); return(0);
} }
@@ -1161,12 +1154,6 @@ void GAL_VideoQuit (void)
DestroyFreeClipRectList (&__mg_free_update_region_list); DestroyFreeClipRectList (&__mg_free_update_region_list);
#endif #endif
} }
#ifdef _MGRM_PROCESSES
// we use concurrent tasks only under MiniGUI-Processes.
concurrentTasks_Term ();
#endif
return; return;
} }
@@ -1270,7 +1257,7 @@ static GAL_Surface *Slave_CreateSurface (GAL_VideoDevice *this,
surface->format_version = 0; surface->format_version = 0;
#ifdef _MGUSE_PIXMAN #ifdef _MGUSE_PIXMAN
surface->pix_img = NULL; surface->pix_img = NULL;
surface->blit_ctxt = NULL; surface->msk_img = NULL;
#endif #endif
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
surface->shared_header = NULL; surface->shared_header = NULL;
-6
View File
@@ -3,11 +3,6 @@ AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
noinst_LTLIBRARIES = libnewgdi.la noinst_LTLIBRARIES = libnewgdi.la
if MG_MINIMALGDI
SRC_FILES = gdi.c attr.c clip.c coor.c rect.c \
bitmap.c pixel.c pixel_ops.c \
region.c polygon.c
else
SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \ SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \
palette.c readbmp.c icon.c screen.c bitmap.c \ palette.c readbmp.c icon.c screen.c bitmap.c \
pixel.c line.c arc.c pixel_ops.c \ pixel.c line.c arc.c pixel_ops.c \
@@ -20,7 +15,6 @@ SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \
textruns.c \ textruns.c \
shape-glyphs-basic.c shape-glyphs-complex.c \ shape-glyphs-basic.c shape-glyphs-complex.c \
layout.c layout-utils.c layout-ellipsize.c layout.c layout-utils.c layout-ellipsize.c
endif
HDR_FILES = glyph.h drawtext.h mi.h midc.h mistruct.h miwideline.h \ HDR_FILES = glyph.h drawtext.h mi.h midc.h mistruct.h miwideline.h \
pixel_ops.h mifillarc.h mispans.h polygon.h mifpoly.h \ pixel_ops.h mifillarc.h mispans.h polygon.h mifpoly.h \
+75 -14
View File
@@ -1108,6 +1108,11 @@ void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
if (!(pddc = __mg_check_ecrgn (hddc))) if (!(pddc = __mg_check_ecrgn (hddc)))
return; return;
/* The coordinates should be in device space. */
#if 0
if (sw <= 0) sw = RECTW (psdc->DevRC);
if (sh <= 0) sh = RECTH (psdc->DevRC);
// Transfer logical to device to screen here. // Transfer logical to device to screen here.
sw += sx; sh += sy; sw += sx; sh += sy;
coor_LP2SP (psdc, &sx, &sy); coor_LP2SP (psdc, &sx, &sy);
@@ -1123,6 +1128,16 @@ void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
coor_LP2SP (pddc, &dx, &dy); coor_LP2SP (pddc, &dx, &dy);
SetRect (&dstOutput, dx, dy, dx + sw, dy + sh); SetRect (&dstOutput, dx, dy, dx + sw, dy + sh);
#else
if (sw <= 0) sw = RECTW (psdc->DevRC);
if (sh <= 0) sh = RECTH (psdc->DevRC);
coor_DP2SP (psdc, &sx, &sy);
SetRect (&srcOutput, sx, sy, sx + sw, sy + sh);
coor_DP2SP (pddc, &dx, &dy);
SetRect (&dstOutput, dx, dy, dx + sw, dy + sh);
#endif
if (pddc->surface == psdc->surface) { if (pddc->surface == psdc->surface) {
if (sx == dx && sy == dy) if (sx == dx && sy == dy)
@@ -1378,12 +1393,11 @@ void GUIAPI StretchBltLegacy (HDC hsdc, int sx, int sy, int sw, int sh,
if (!(pddc = __mg_check_ecrgn (hddc))) if (!(pddc = __mg_check_ecrgn (hddc)))
return; return;
// Transfer logical to device to screen here. /* The coordinates should be in device space. */
#if 0
sw += sx; sh += sy; sw += sx; sh += sy;
coor_LP2SP(psdc, &sx, &sy); coor_LP2SP(psdc, &sx, &sy);
coor_LP2SP(psdc, &sw, &sh); coor_LP2SP(psdc, &sw, &sh);
if (sw == sx) sw = sx + RECTW (psdc->DevRC);
if (sh == sy) sh = sy + RECTH (psdc->DevRC);
SetRect (&srcOutput, sx, sy, sw, sh); SetRect (&srcOutput, sx, sy, sw, sh);
NormalizeRect (&srcOutput); NormalizeRect (&srcOutput);
sx = srcOutput.left; sy = srcOutput.top; sx = srcOutput.left; sy = srcOutput.top;
@@ -1392,8 +1406,6 @@ void GUIAPI StretchBltLegacy (HDC hsdc, int sx, int sy, int sw, int sh,
dw += dx; dh += dy; dw += dx; dh += dy;
coor_LP2SP (pddc, &dx, &dy); coor_LP2SP (pddc, &dx, &dy);
coor_LP2SP (pddc, &dw, &dh); coor_LP2SP (pddc, &dw, &dh);
if (dw == dx) dw = dx + RECTW (pddc->DevRC);
if (dh == dy) dh = dy + RECTH (pddc->DevRC);
SetRect (&dstOutput, dx, dy, dw, dh); SetRect (&dstOutput, dx, dy, dw, dh);
NormalizeRect (&dstOutput); NormalizeRect (&dstOutput);
dx = dstOutput.left; dy = dstOutput.top; dx = dstOutput.left; dy = dstOutput.top;
@@ -1401,15 +1413,41 @@ void GUIAPI StretchBltLegacy (HDC hsdc, int sx, int sy, int sw, int sh,
if (sw <= 0 || sh <= 0 || dw <= 0 || dh <= 0) if (sw <= 0 || sh <= 0 || dw <= 0 || dh <= 0)
goto error_ret; goto error_ret;
if (sx < 0 || sx >= RECTW(psdc->DevRC) || (sx + sw) > RECTW(psdc->DevRC)) if ((sx + sw) < 0 || sx >= psdc->DevRC.right)
goto error_ret; goto error_ret;
if (sy < 0 || sy >= RECTH(psdc->DevRC) || (sy + sh) > RECTH(psdc->DevRC)) if ((sy +sh) < 0 || sy >= psdc->DevRC.bottom)
goto error_ret;
if ((dx + dw) < 0 || dx >= pddc->DevRC.right)
goto error_ret;
if ((dy + dh) <0 || dy >= pddc->DevRC.bottom)
goto error_ret;
#else
if (sx < 0) sx = 0;
if (sy < 0) sy = 0;
if (dx < 0) dx = 0;
if (dy < 0) dy = 0;
if (sx >= RECTW(psdc->DevRC))
goto error_ret;
if (sy >= RECTH(psdc->DevRC))
goto error_ret; goto error_ret;
if (dx >= RECTW(pddc->DevRC)) if (dx >= RECTW(pddc->DevRC))
goto error_ret; goto error_ret;
if (dy >= RECTH(pddc->DevRC)) if (dy >= RECTH(pddc->DevRC))
goto error_ret; goto error_ret;
if (sw <= 0 || sw > RECTW (psdc->DevRC) - sx) sw = RECTW (psdc->DevRC) - sx;
if (sh <= 0 || sh > RECTH (psdc->DevRC) - sy) sh = RECTH (psdc->DevRC) - sy;
if (dw <= 0 || dw > RECTW (pddc->DevRC) - dx) dw = RECTW (pddc->DevRC) - dx;
if (dh <= 0 || dh > RECTH (pddc->DevRC) - dy) dh = RECTH (pddc->DevRC) - dy;
coor_DP2SP (psdc, &sx, &sy);
SetRect (&srcOutput, sx, sy, sx + sw, sy + sh);
coor_DP2SP (pddc, &dx, &dy);
SetRect (&dstOutput, dx, dy, dx + dw, dy + dh);
#endif
info.pdc = pddc; info.pdc = pddc;
info.dst_x = dx; info.dst_y = dy; info.dst_x = dx; info.dst_y = dy;
info.dst_w = dw; info.dst_h = dh; info.dst_w = dw; info.dst_h = dh;
@@ -1492,12 +1530,11 @@ BOOL GUIAPI StretchBltEx (HDC hsdc, int sx, int sy, int sw, int sh,
if (!(pddc = __mg_check_ecrgn (hddc))) if (!(pddc = __mg_check_ecrgn (hddc)))
return retv; return retv;
// Transfer logical to device to screen here. /* The coordinates should be in device space. */
#if 0
sw += sx; sh += sy; sw += sx; sh += sy;
coor_LP2SP(psdc, &sx, &sy); coor_LP2SP(psdc, &sx, &sy);
coor_LP2SP(psdc, &sw, &sh); coor_LP2SP(psdc, &sw, &sh);
if (sw == sx) sw = sx + RECTW (psdc->DevRC);
if (sh == sy) sh = sy + RECTH (psdc->DevRC);
SetRect (&srcOutput, sx, sy, sw, sh); SetRect (&srcOutput, sx, sy, sw, sh);
NormalizeRect (&srcOutput); NormalizeRect (&srcOutput);
sx = srcOutput.left; sy = srcOutput.top; sx = srcOutput.left; sy = srcOutput.top;
@@ -1506,8 +1543,6 @@ BOOL GUIAPI StretchBltEx (HDC hsdc, int sx, int sy, int sw, int sh,
dw += dx; dh += dy; dw += dx; dh += dy;
coor_LP2SP (pddc, &dx, &dy); coor_LP2SP (pddc, &dx, &dy);
coor_LP2SP (pddc, &dw, &dh); coor_LP2SP (pddc, &dw, &dh);
if (dw == dx) dw = dx + RECTW (pddc->DevRC);
if (dh == dy) dh = dy + RECTH (pddc->DevRC);
SetRect (&dstOutput, dx, dy, dw, dh); SetRect (&dstOutput, dx, dy, dw, dh);
NormalizeRect (&dstOutput); NormalizeRect (&dstOutput);
dx = dstOutput.left; dy = dstOutput.top; dx = dstOutput.left; dy = dstOutput.top;
@@ -1515,15 +1550,41 @@ BOOL GUIAPI StretchBltEx (HDC hsdc, int sx, int sy, int sw, int sh,
if (sw <= 0 || sh <= 0 || dw <= 0 || dh <= 0) if (sw <= 0 || sh <= 0 || dw <= 0 || dh <= 0)
goto error_ret; goto error_ret;
if (sx < 0 || sx >= RECTW(psdc->DevRC) || (sx + sw) > RECTW(psdc->DevRC)) if ((sx + sw) < 0 || sx >= psdc->DevRC.right)
goto error_ret; goto error_ret;
if (sy < 0 || sy >= RECTH(psdc->DevRC) || (sy + sh) > RECTH(psdc->DevRC)) if ((sy +sh) < 0 || sy >= psdc->DevRC.bottom)
goto error_ret;
if ((dx + dw) < 0 || dx >= pddc->DevRC.right)
goto error_ret;
if ((dy + dh) <0 || dy >= pddc->DevRC.bottom)
goto error_ret;
#else
if (sx < 0) sx = 0;
if (sy < 0) sy = 0;
if (dx < 0) dx = 0;
if (dy < 0) dy = 0;
if (sx >= RECTW(psdc->DevRC))
goto error_ret;
if (sy >= RECTH(psdc->DevRC))
goto error_ret; goto error_ret;
if (dx >= RECTW(pddc->DevRC)) if (dx >= RECTW(pddc->DevRC))
goto error_ret; goto error_ret;
if (dy >= RECTH(pddc->DevRC)) if (dy >= RECTH(pddc->DevRC))
goto error_ret; goto error_ret;
if (sw <= 0 || sw > RECTW (psdc->DevRC) - sx) sw = RECTW (psdc->DevRC) - sx;
if (sh <= 0 || sh > RECTH (psdc->DevRC) - sy) sh = RECTH (psdc->DevRC) - sy;
if (dw <= 0 || dw > RECTW (pddc->DevRC) - dx) dw = RECTW (pddc->DevRC) - dx;
if (dh <= 0 || dh > RECTH (pddc->DevRC) - dy) dh = RECTH (pddc->DevRC) - dy;
coor_DP2SP (psdc, &sx, &sy);
SetRect (&srcOutput, sx, sy, sx + sw, sy + sh);
coor_DP2SP (pddc, &dx, &dy);
SetRect (&dstOutput, dx, dy, dx + dw, dy + dh);
#endif
retv = TRUE; retv = TRUE;
if (pddc->surface == psdc->surface) if (pddc->surface == psdc->surface)
GetBoundRect (&pddc->rc_output, &srcOutput, &dstOutput); GetBoundRect (&pddc->rc_output, &srcOutput, &dstOutput);
+12 -10
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems * and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices. * and smart IoT devices.
* *
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2022, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming * Copyright (C) 1998~2002, WEI Yongming
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -2462,7 +2462,7 @@ void GUIAPI ReleaseDC (HDC hDC)
} }
} }
static BOOL InitSubDC (HDC hdcDest, HDC hdc, int off_x, int off_y, static BOOL dc_InitSubDC (HDC hdcDest, HDC hdc, int off_x, int off_y,
int width, int height) int width, int height)
{ {
int parent_width,parent_height; int parent_width,parent_height;
@@ -2564,7 +2564,11 @@ HDC GUIAPI GetSubDC (HDC hdc, int off_x, int off_y, int width, int height)
if (pdc == NULL) if (pdc == NULL)
return HDC_INVALID; return HDC_INVALID;
if (!InitSubDC((HDC)pdc, hdc, off_x, off_y, width, height)) { InitClipRgn (&pdc->lcrgn, &__mg_FreeClipRectList);
MAKE_REGION_INFINITE(&pdc->lcrgn);
InitClipRgn (&pdc->ecrgn, &__mg_FreeClipRectList);
if (!dc_InitSubDC((HDC)pdc, hdc, off_x, off_y, width, height)) {
pdc->bInUse = FALSE; pdc->bInUse = FALSE;
return HDC_INVALID; return HDC_INVALID;
} }
@@ -2654,16 +2658,16 @@ HDC GUIAPI CreatePrivateSubDC (HDC hdc, int off_x, int off_y,
if (!(pdc = malloc(sizeof(DC)))) if (!(pdc = malloc(sizeof(DC))))
return HDC_INVALID; return HDC_INVALID;
InitClipRgn (&pdc->lcrgn, &__mg_FreeClipRectList);
MAKE_REGION_INFINITE(&pdc->lcrgn);
InitClipRgn (&pdc->ecrgn, &__mg_FreeClipRectList);
pdc->bInUse = TRUE; pdc->bInUse = TRUE;
pdc->DataType = TYPE_HDC; pdc->DataType = TYPE_HDC;
/* XXX: use the parent's type */ /* XXX: use the parent's type */
pdc->DCType = pdc_parent->DCType; pdc->DCType = pdc_parent->DCType;
if (!InitSubDC ((HDC)pdc, hdc, off_x, off_y, width, height)) { InitClipRgn (&pdc->lcrgn, &__mg_FreeClipRectList);
MAKE_REGION_INFINITE(&pdc->lcrgn);
InitClipRgn (&pdc->ecrgn, &__mg_FreeClipRectList);
if (!dc_InitSubDC ((HDC)pdc, hdc, off_x, off_y, width, height)) {
free (pdc); free (pdc);
return HDC_INVALID; return HDC_INVALID;
} }
@@ -4345,8 +4349,6 @@ static void on_surface_changed_for_control (struct _travel_context* ctxt,
RECT rc_surface, rc_minimal; RECT rc_surface, rc_minimal;
PDC pdc = dc_HDC2PDC (ctrl->privCDC); PDC pdc = dc_HDC2PDC (ctrl->privCDC);
_WRN_PRINTF ("called\n");
pdc->surface = ctxt->surface; pdc->surface = ctxt->surface;
if (pdc->surface != __gal_screen) { if (pdc->surface != __gal_screen) {
+4 -4
View File
@@ -511,11 +511,11 @@ static void shape_space(const LAYOUT* layout, const LayoutRun* lrun,
gstr->glyphs[i].is_cluster_start = 1; gstr->glyphs[i].is_cluster_start = 1;
gstr->log_clusters[i] = i; gstr->log_clusters[i] = i;
}
if (BIDI_LEVEL_IS_RTL(lrun->el) && gstr->nr_glyphs > 1) { if (BIDI_LEVEL_IS_RTL(lrun->el) && gstr->nr_glyphs > 1) {
__mg_reverse_shaped_glyphs(gstr->glyphs, gstr->nr_glyphs); __mg_reverse_shaped_glyphs(gstr->glyphs, gstr->nr_glyphs);
__mg_reverse_log_clusters(gstr->log_clusters, gstr->nr_glyphs); __mg_reverse_log_clusters(gstr->log_clusters, gstr->nr_glyphs);
}
} }
} }
+4 -3
View File
@@ -148,14 +148,15 @@ static BOOL find_color_key (GAL_PixelFormat* format, const MYBITMAP* my_bmp,
goto free_and_ret; goto free_and_ret;
color_num = 1 << my_bmp->depth; color_num = 1 << my_bmp->depth;
pixels = malloc (color_num * sizeof (Uint32)); pixels = calloc (color_num, sizeof (Uint32));
for (i = 0; i < color_num; i++) for (i = 0; i < color_num; i++) {
pixels[i] = GAL_MapRGB (format, pal[i].r, pal[i].g, pal[i].b); pixels[i] = GAL_MapRGB (format, pal[i].r, pal[i].g, pal[i].b);
}
pixel_key = pixels [my_bmp->transparent]; pixel_key = pixels [my_bmp->transparent];
for (i = 0; i < color_num; i++) { for (i = 0; i < color_num; i++) {
if (pixels[i] == pixel_key && i != my_bmp->transparent) if (pixels[i] == pixel_key && i != my_bmp->transparent)
break; break;
} }
if (i == color_num) if (i == color_num)
-1
View File
@@ -140,7 +140,6 @@ SOFTWARE.
#include "gdi.h" #include "gdi.h"
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "blockheap.h"
typedef void (*voidProcp1)(CLIPRGN *region, const CLIPRECT *r1, const CLIPRECT *r1End, typedef void (*voidProcp1)(CLIPRGN *region, const CLIPRECT *r1, const CLIPRECT *r1End,
const CLIPRECT *r2, const CLIPRECT *r2End, int top, int bottom); const CLIPRECT *r2, const CLIPRECT *r2End, int top, int bottom);
-1
View File
@@ -254,7 +254,6 @@ static BOOL shape_layout_run(SEInstance* inst,
gs->log_clusters[j] = i; gs->log_clusters[j] = i;
j++; j++;
} }
} }
gs->nr_glyphs = j; gs->nr_glyphs = j;
+3
View File
@@ -747,6 +747,8 @@ void GUIAPI UpdateTopmostLayer (const RECT* dirty_rc)
SendMessage (HWND_DESKTOP, MSG_PAINT, 0, 0); SendMessage (HWND_DESKTOP, MSG_PAINT, 0, 0);
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wzero-length-bounds"
int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type, int* cli) int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type, int* cli)
{ {
ZORDERINFO* zi; ZORDERINFO* zi;
@@ -774,6 +776,7 @@ int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type, int* cli)
return topmost; return topmost;
} }
#pragma GCC diagnostic pop
int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode, int* cli) int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode, int* cli)
{ {
-4
View File
@@ -2,9 +2,5 @@ AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
noinst_LTLIBRARIES = libstandalone.la noinst_LTLIBRARIES = libstandalone.la
if MG_MINIMALGDI
libstandalone_la_SOURCES =
else
libstandalone_la_SOURCES = standalone.c libstandalone_la_SOURCES = standalone.c
endif
+1 -5
View File
@@ -2,18 +2,14 @@ AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
SUBDIRS = bmp icon font cursor SUBDIRS = bmp icon font cursor
if MG_ENABLE_SPLASH if MG_ENABLE_SPLASH
if MG_ENABLE_SCREENSAVER if MG_ENABLE_SCREENSAVER
SUBDIRS+=license SUBDIRS+=license
endif endif
endif endif
noinst_LTLIBRARIES = libsysres.la noinst_LTLIBRARIES = libsysres.la
if MG_MINIMALGDI
libsysres_la_SOURCES = mgetc.c
else
libsysres_la_SOURCES = resource.c incoreres.c mgetc.c resmgr.c resmgr.h libsysres_la_SOURCES = resource.c incoreres.c mgetc.c resmgr.c resmgr.h
endif
SRC_FILES=$(libsysres_la_SOURCES) SRC_FILES=$(libsysres_la_SOURCES)
LIB_NAME=libsysres LIB_NAME=libsysres
+1 -1
View File
@@ -1001,7 +1001,7 @@ static inline MYBMP_WITH_PAL* new_mybmp_with_pal (void)
MYBMP_WITH_PAL* mybmp_pal; MYBMP_WITH_PAL* mybmp_pal;
mybmp_pal = NEW(MYBMP_WITH_PAL); mybmp_pal = NEW(MYBMP_WITH_PAL);
mybmp_pal->pal = malloc (sizeof (RGB) * 256); mybmp_pal->pal = calloc (256, sizeof (RGB));
return mybmp_pal; return mybmp_pal;
} }