Compare commits

...
36 Commits
Author SHA1 Message Date
gengyue d97e922e12 Merge branch 'rel-5-0' of gitlab.fmsoft.cn:VincentWei/minigui into gengyue 2021-03-22 20:07:09 +08:00
gengyue 6ffdd98903 add on_showing_win and on_hiding_win for switching layer 2021-03-22 20:07:06 +08:00
Vincent Wei d894080582 fix bad Doxygen group name; 2021-03-22 16:00:50 +08:00
gengyue 044c82e2f3 add client id to parameters of calc_mainwin_pos 2021-03-22 10:02:06 +08:00
Vincent Wei 8bfc65f88f tune 2021-02-02 10:38:26 +08:00
Vincent Wei fbf02782a6 change version to 5.0.5 2021-01-04 10:34:26 +08:00
Vincent Wei 1e88954b79 adjust values of WS_XXX to avoid confilct 2021-01-04 10:34:14 +08:00
Vincent Wei 4e0cd74552 fix a bug of GetNextMainWindow 2020-12-15 17:02:16 +08:00
Vincent Wei 7530c4b5bd use non-blocking read and ignore EV_SYN 2020-11-10 20:34:47 +08:00
Vincent Wei b47d207bd2 fix a bug: misuse fdset in FD_SET and FD_ISSET 2020-11-10 19:49:21 +08:00
Vincent Wei 9ff29ccb94 do not return for EV_KEY 2020-11-10 18:52:44 +08:00
Vincent Wei 6da322ed49 cleanup 2020-11-10 18:32:16 +08:00
Vincent Wei 6e21fed525 tune 2020-11-10 18:28:30 +08:00
Vincent Wei 74747f383c use blocking reading 2020-11-10 18:12:35 +08:00
Vincent Wei bde7d74f02 break the loop for EV_KEY 2020-11-10 18:03:50 +08:00
Vincent Wei cdc818d936 use no blocking read 2020-11-10 17:53:00 +08:00
Vincent Wei 8694a342b9 tune 2020-11-10 17:49:18 +08:00
Vincent Wei dd9e59d82f cleanup 2020-11-10 17:28:03 +08:00
Vincent Wei 1b2b87d187 cleanup 2020-11-10 16:55:55 +08:00
Vincent Wei 36c1f15894 change version to 5.0.4 2020-11-10 16:21:56 +08:00
Vincent Wei c3877bad13 fix a compilation error: use #ifdef _MGSCHEMA_COMPOSITING 2020-11-10 16:10:48 +08:00
Vincent Wei a118a062ec use IAL_MOUSE_LEFTBUTTON instead of COMM_LBUTTON 2020-11-10 16:10:13 +08:00
Vincent Wei 5e34e98b28 fix a bug: save kbd_dev for suspend/resume 2020-11-10 16:02:28 +08:00
Vincent Wei 60ed1c9b3c Merge branch 'rel-5-0' of github.com:VincentWei/minigui into rel-5-0 2020-11-10 15:54:39 +08:00
Vincent Wei e148806743 Merge pull request #57 from ninexue/rel-5-0
Rel 5 0
2020-11-10 15:53:35 +08:00
xueshuming cd0dd795c8 add singletouchkey ial 2020-11-10 15:38:02 +08:00
xueshuming e6468d960c compile for aarch64-arm-gcc 7.5 2020-11-10 15:30:34 +08:00
Vincent Wei 219d72074d release notes for version 5.0.4 2020-11-10 11:17:31 +08:00
Vincent Wei 56779b033d tune comments 2020-11-10 11:12:20 +08:00
Vincent Wei 73dc293c76 new section for IAL engine singletouchkey 2020-11-10 11:06:46 +08:00
Vincent Wei abaee60a55 change version to 5.0.4; show includes for FreeType2 and HarfBuzz. 2020-10-19 10:41:16 +08:00
Vincent Wei 2b99ac28eb fix a potential bug: only increase nr_mask_rects for not empty mask rectangle 2020-10-13 08:15:57 +08:00
Vincent Wei f86fa9d483 fix bugs in ServerGetWinZNodeRegion: must check for possible empty mask rect; bad assignment of maskrect 2020-10-12 19:00:54 +08:00
Vincent Wei 529c78ef90 tune 2020-10-12 18:59:21 +08:00
Vincent Wei bc20a11744 use _ERR_PRINTF 2020-10-12 17:57:52 +08:00
Vincent Wei 6a2f28543d bugfixing: update surface of controls surface in travel_children_with_priv_cdc 2020-10-12 17:26:22 +08:00
28 changed files with 563 additions and 105 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Processes)"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v5.0.0
PROJECT_NUMBER = v5.0.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc-api-ref-minigui-procs-5.0.0
OUTPUT_DIRECTORY = doc-api-ref-minigui-procs-5.0.5
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
+2 -2
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Standalone)"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v5.0.0
PROJECT_NUMBER = v5.0.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc-api-ref-minigui-sa-5.0.0
OUTPUT_DIRECTORY = doc-api-ref-minigui-sa-5.0.5
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
+2 -2
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Threads)"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v5.0.0
PROJECT_NUMBER = v5.0.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc-api-ref-minigui-ths-5.0.0
OUTPUT_DIRECTORY = doc-api-ref-minigui-ths-5.0.5
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
+5 -5
View File
@@ -1,6 +1,6 @@
# MiniGUI
A mature and proven cross-platform GUI system for embedded and smart IoT devices.
A mature and proven cross-platform windowing system for embedded system and smart IoT devices.
## TABLE OF CONTENTS
@@ -45,7 +45,7 @@ MiniGUI aims to provide a fast, stable, full-featured, and cross-platform
windowing and GUI support system, which is especially fit for
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX,
Nucleus, pSOS, uC/OS-II, and OSE.
Nucleus, pSOS, uC/OS-II, OSE, and others.
This is the source tree of MiniGUI Core, which provides the windowing
and graphics interfaces as well as a lot of standard controls (toolkit).
@@ -108,9 +108,9 @@ for examples:
### MiniGUI and HybridOS
HybridOS is another large open source project initiated by FMSoft. It is
a totally new open source operating system designed for smart IoT devices
and cloud computing environment.
[HybridOS](https://github.com/FMSoftCN/hybridos) is another large open source project
initiated by FMSoft. It is a totally new open source operating system designed for
embedded and smart IoT devices and cloud computing environment.
In practice, MiniGUI and the software which are used to integrated with GPU
constitute the graphics stack of HybridOS.
+37
View File
@@ -1,5 +1,9 @@
# Release Notes
- [Version 5.0.5](#version-505)
+ [What's new in version 5.0.5](#whats-new-in-version-505)
- [Version 5.0.4](#version-504)
+ [What's new in version 5.0.4](#whats-new-in-version-504)
- [Version 5.0.3](#version-503)
+ [What's new in version 5.0.3](#whats-new-in-version-503)
- [Version 5.0.2](#version-502)
@@ -14,6 +18,39 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis)
## Version 5.0.5
The MiniGUI development team announces the availability of MiniGUI 5.0.5,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.5
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Adjust the constants for `WS_XXXX` macros to avoid duplicated values.
Note that the binary backward-compatibility was broken. You should
rebuild all MiniGUI applications.
## Version 5.0.4
The MiniGUI development team announces the availability of MiniGUI 5.0.4,
which is the bug fixing release of MiniGUI 5.0.x.
### What's new in version 5.0.4
In this version, we fixed some bugs and made some minor enhancements:
* BUGFIXING:
- Fix bugs in ServerGetWinZNodeRegion: must check for possible empty mask rect
and bad assignment of maskrect
- Fix a potential bug: only increase `nr_mask_rects` for not empty mask rectangle.
- Fix a bug: update surface of controls surface in `travel_children_with_priv_cdc`.
* ENHANCEMENTS:
- New IAL engine: `--enable-singletouchkeyial` to build the IAL engine for
single touch screen and key buttons.
## Version 5.0.3
The MiniGUI development team announces the availability of MiniGUI 5.0.3,
+1 -1
View File
@@ -1,4 +1,4 @@
Version 5.0.0 (2019/03/30)
Version 5.0.5 (2021/01/31)
This is the first official release of MiniGUI 5.0.x, the stable version.
+20 -6
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(libminigui, 5.0.3)
AC_INIT(libminigui, 5.0.5)
AC_CONFIG_SRCDIR(src/main/main.c)
dnl Set various version strings - taken gratefully from the SDL sources
@@ -16,9 +16,9 @@ dnl Set various version strings - taken gratefully from the SDL sources
#
MINIGUI_MAJOR_VERSION=5
MINIGUI_MINOR_VERSION=0
MINIGUI_MICRO_VERSION=3
MINIGUI_MICRO_VERSION=5
MINIGUI_INTERFACE_AGE=0
MINIGUI_BINARY_AGE=3
MINIGUI_BINARY_AGE=0
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
AC_SUBST(MINIGUI_MAJOR_VERSION)
@@ -132,6 +132,9 @@ build_console_ms3="no"
build_console_gpm="no"
build_text_mode="yes"
dnl single touch key engines
buid_singletouchkey_ial_engine="yes"
dnl the customized ial engine
build_dlcustom_ial_engine="no"
build_custom_ial_engine="no"
@@ -477,6 +480,10 @@ AC_ARG_ENABLE(libinputial,
[ --enable-libinputial build the IAL engine based on libinput <default=yes>],
build_libinput_ial_engine=$enableval)
AC_ARG_ENABLE(singletouchkey,
[ --enable-singletouchkey build the IAL engine based on single touch key <default=yes>],
buid_singletouchkey_ial_engine=$enableval)
AC_ARG_ENABLE(consoleial,
[ --enable-consoleial build the console (Linux console) IAL engine <default=yes>],
build_console_ial_engine=$enableval)
@@ -2015,6 +2022,11 @@ if test "x$build_libinput_ial_engine" = "xyes"; then
fi
fi
if test "x$buid_singletouchkey_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_SINGLETOUCHKEY, 1,
[Define if include single touch key IAL engine])
fi
if test "x$build_console_ial_engine" = "xyes"; then
AC_DEFINE(_MGIAL_CONSOLE, 1,
[Define if include console (Linux console) IAL engine])
@@ -2237,10 +2249,8 @@ if test "x$build_ttf_support" = "xyes"; then
AC_DEFINE(_MGFONT_FT2, 1,
[Define if support TrueType/OpenType fonts based on FreeType2])
with_ft2_includes=""
AC_ARG_WITH(ft2_includes,
[ --with-ft2-includes=DIR where the FreeType2 includes are],
with_ft2_includes=$withval)
[ --with-ft2-includes=DIR where the FreeType2 includes are])
if test "x$with_ft2_includes" = "x"; then
FT2_INC_DIR="-I/usr/include/freetype2"
@@ -2663,6 +2673,7 @@ AC_SUBST(MINIGUI_RUNMODE)
AM_CONDITIONAL(MGRM_PROCESSES, test "x$runtime_mode" = "xprocs")
AM_CONDITIONAL(MGRM_STANDALONE, test "x$runtime_mode" = "xsa")
AM_CONDITIONAL(MGIAL_LIBINPUT, test "x$build_libinput_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_SINGLETOUCHKEY, test "x$buid_singletouchkey_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_CONSOLE, test "x$build_console_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_NEXUS, test "x$build_nexus_ial_engine" = "xyes")
AM_CONDITIONAL(MGIAL_DLCUSTOM, test "x$build_dlcustom_ial_engine" = "xyes")
@@ -2779,6 +2790,7 @@ AC_MSG_NOTICE([
* pc_xvfb: ${enable_video_pc_xvfb}
* usvfb: ${enable_video_usvfb}
* libinput: ${build_libinput_ial_engine}
* singletouchkey: ${buid_singletouchkey_ial_engine}
* console: ${build_console_ial_engine}
* comm: ${build_comm_ial_engine}
@@ -2799,6 +2811,8 @@ AC_MSG_NOTICE([
* CPP flags: ${CPPFLAGS}
* CC flags: ${CFLAGS}
* CXX flags: ${CXXFLAGS}
* FreeType2 includes: ${FT2_INC_DIR}
* HarfBuzz includes: ${HB_INC_DIR}
* Dep. libraries: ${DEP_LIBS}
])
+13
View File
@@ -83,6 +83,19 @@ double_buffering=true
exdriver=libhidrmdrivers-0.2.so.0
#}}
#{{ifdef _MGIAL_SINGLETOUCHKEY
[singletouchkey]
# The touch device; use none to disable touch event.
touch_dev=/dev/input/event0
# The key device; use none to disable key event.
key_dev=none
# The number of keys; only valid if the key device is not `none` and can be opened.
nr_keys=2
# The maps from Linux keycode to MiniGUI scancode; only valid if `nr_keys` > 0.
keycode2scancode0=20,1
keycode2scancode1=50,2
#}}
#{{ifdef _MGIAL_LIBINPUT
[libinput]
seat=seat0
+3 -3
View File
@@ -9992,7 +9992,7 @@ typedef Uint16 BreakOppo;
* allocated by this function if it allocates the buffer.
*
* \param lang_code The language code; not used so far, reserved for future.
* \param ctr The character transformation rule; see \a char_transform_rule.
* \param ctr The character transformation rule; see \a char_transform_rules.
* \param wbr The word breaking rule; see \a word_break_rules.
* \param lbp The line breaking policy; see \a line_break_policies.
* \param ucs The Uchar32 string.
@@ -10017,7 +10017,7 @@ typedef Uint16 BreakOppo;
*
* \note Only available when support for UNICODE is enabled.
*
* \sa DrawGlyphStringEx, word_break_rules, char_transform_rule,
* \sa DrawGlyphStringEx, word_break_rules, char_transform_rules,
* line_break_policies
*/
MG_EXPORT int GUIAPI UStrGetBreaks(LanguageCode lang_code,
@@ -13035,7 +13035,7 @@ MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
*
* \note Only available when support for UNICODE is enabled.
*
* \sa DrawGlyphStringEx, white_space_rules, char_transform_rule
* \sa DrawGlyphStringEx, white_space_rules, char_transform_rules
*
* Since 4.0.0
*/
+1 -1
View File
@@ -1600,7 +1600,7 @@ typedef struct _CompositorOps {
* a main window with the extended style WS_EX_AUTOPOSITION.
*/
void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer,
DWORD zt_type, int first_for_type, CALCPOSINFO* info);
DWORD zt_type, int first_for_type, CALCPOSINFO* info, int cli);
/**
* This operation will be called when there was a layer operation.
+41 -41
View File
@@ -4280,39 +4280,62 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
*/
#define WS_DISABLED 0x04000000L
/* Main window states -- reserved for future use. */
#define WS_MINIMIZE 0x02000000L
#define WS_MAXIMIZE 0x01000000L
/**
* \def WS_VSCROLL
* \brief Creates a window with vertical scroll bar.
*/
#define WS_VSCROLL 0x02000000L
/* bits in this mask are reuse for main windows and controls;
bits have different meanings for main windows and controls.*/
#define WS_REUSE_MASK 0x00E00000L
/**
* \def WS_HSCROLL
* \brief Creates a window with horizontal scroll bar.
*/
#define WS_HSCROLL 0x01000000L
/* bits in this mask are both for main window and controls */
#define WS_BORDER_MASK 0x00F00000L
/**
* \def WS_DLGFRAME
* \brief The main window has a fixed frame, i.e. user can not
* drag the border of the window.
*/
#define WS_DLGFRAME 0x00800000L
#define WS_DLGFRAME 0x00800000L
/**
* \def WS_THICKFRAME
* \brief Creates a main window with thick frame.
*/
#define WS_THICKFRAME 0x00400000L
#define WS_THICKFRAME 0x00400000L
/**
* \def WS_THINFRAME
* \brief Creates a main window with thin frame.
*/
#define WS_THINFRAME 0x00200000L
#define WS_THINFRAME 0x00200000L
/**
* \def WS_BORDER
* \brief Creates a window with border.
*/
#define WS_BORDER 0x00100000L
/* bits in this mask are reuse for main windows and controls;
bits have different meanings for main windows and controls.*/
#define WS_MISC_MASK 0x000F0000L
/**
* \def WS_CHILD
* \brief Indicates the window is a child.
*/
#define WS_CHILD 0x00080000L
/**
* \def WS_GROUP
* \brief Indicates the control is the leader of a group.
* \note This style is valid only for controls.
*/
#define WS_GROUP 0x00800000L
#define WS_GROUP 0x00040000L
/**
* \def WS_TABSTOP
@@ -4320,7 +4343,11 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
* using Tab key.
* \note This style is valid only for controls.
*/
#define WS_TABSTOP 0x00400000L
#define WS_TABSTOP 0x00020000L
/* Main window states -- reserved for future use. */
#define WS_MINIMIZE 0x00040000L
#define WS_MAXIMIZE 0x00020000L
/**
* \def WS_ALWAYSTOP
@@ -4328,38 +4355,11 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
*
* Since 5.0.0.
*/
#define WS_ALWAYSTOP 0x00100000L
/* bits in this mask are both for main windows and controls */
#define WS_MISC_MASK 0x000F0000L
/**
* \def WS_CHILD
* \brief Indicates the window is a child.
*/
#define WS_CHILD 0x00080000L
/**
* \def WS_VSCROLL
* \brief Creates a window with vertical scroll bar.
*/
#define WS_VSCROLL 0x00040000L
/**
* \def WS_HSCROLL
* \brief Creates a window with horizontal scroll bar.
*/
#define WS_HSCROLL 0x00020000L
/**
* \def WS_BORDER
* \brief Creates a window with border.
*/
#define WS_BORDER 0x00010000L
#define WS_ALWAYSTOP 0x00010000L
/* Obsolete styles, back-compatibility definitions. */
#define WS_OVERLAPPED 0x00000000L
#define WS_ABSSCRPOS 0x00000000L
#define WS_OVERLAPPED 0x00000000L
#define WS_ABSSCRPOS 0x00000000L
#define WS_MAINWIN_ONLY_MASK (WS_CAPTIONBAR_MASK | WS_ALWAYSTOP)
#define WS_CONTROL_ONLY_MASK (WS_CTRLMASK)
+2 -2
View File
@@ -3165,8 +3165,8 @@ HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild)
HWND GUIAPI GetNextMainWindow (HWND hMainWnd)
{
MG_CHECK_RET (hMainWnd == HWND_NULL || MG_IS_NORMAL_MAIN_WINDOW (hMainWnd),
HWND_INVALID);
MG_CHECK_RET (hMainWnd != HWND_NULL &&
!MG_IS_NORMAL_MAIN_WINDOW (hMainWnd), HWND_INVALID);
return (HWND)SendMessage (HWND_DESKTOP,
MSG_GETNEXTMAINWIN, (WPARAM)hMainWnd, 0L);
+3 -1
View File
@@ -50,6 +50,7 @@ DFB_SRCS = dfb.h dfb.c
USVFB_SRCS = usvfbinput.c usvfbinput.h
LIBINPUT_SRCS = linux-libinput.c linux-libinput.h
SINGLETOUCHKEY_SRCS = singletouchkey.c singletouchkey.h
if MGIAL_CONSOLE
native_libial_la_LIBADD = native/libnative.la
@@ -76,4 +77,5 @@ libial_la_SOURCES = $(COMMON_SRCS) $(DUMMY_SRCS) $(JZ4740_SRCS) \
$(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \
$(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \
$(TSLIB_SRCS) $(SHANDONG_LIDE_SRCS) $(CISCO_TOUCHPAD_SRCS) \
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS)
$(MSTAR_SRCS) $(DFB_SRCS) $(USVFB_SRCS) $(LIBINPUT_SRCS) \
$(SINGLETOUCHKEY_SRCS)
+7 -1
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 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
@@ -133,6 +133,9 @@
#ifdef _MGIAL_LIBINPUT
#include "linux-libinput.h"
#endif
#ifdef _MGIAL_SINGLETOUCHKEY
#include "singletouchkey.h"
#endif
static INPUT inputs [] =
{
@@ -212,6 +215,9 @@ static INPUT inputs [] =
#ifdef _MGIAL_LIBINPUT
{"libinput", ial_InitLibInput, TermLibInput},
#endif
#ifdef _MGIAL_SINGLETOUCHKEY
{"singletouchkey", ial_InitSingleTouchKey, TermSingleTouchKey},
#endif
/* ... end of general IAL engines */
};
-1
View File
@@ -65,7 +65,6 @@
#include <sys/time.h>
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include "gdi.h"
#include "window.h"
+12 -6
View File
@@ -67,8 +67,6 @@
#include "gal.h"
#include "native.h"
static const char* event_dev;
static int EVENT_Open(const char *);
static void EVENT_Close(void);
static void EVENT_GetModifierInfo(int *modifiers);
@@ -85,6 +83,7 @@ KBDDEVICE kbddev_event = {
EVENT_Resume
};
static char* kbd_dev;
static int kbd_fd; /* file descriptor for keyboard */
/*
@@ -144,6 +143,7 @@ static int EVENT_Open (const char *device)
if (kbd_fd < 0)
return -1;
kbd_dev = strdup (device);
return kbd_fd;
}
@@ -153,8 +153,11 @@ static int EVENT_Open (const char *device)
*/
static void EVENT_Close(void)
{
close(kbd_fd);
close (kbd_fd);
kbd_fd = -1;
free (kbd_dev);
kbd_dev = NULL;
}
/*
@@ -203,7 +206,8 @@ static int EVENT_Read(unsigned char *buf, int *modifiers)
*/
static void EVENT_Suspend(void)
{
EVENT_Close();
close (kbd_fd);
kbd_fd = -1;
}
/* deactivate_keyboard:
@@ -211,10 +215,12 @@ static void EVENT_Suspend(void)
*/
static int EVENT_Resume(void)
{
kbd_fd = open (event_dev, O_NONBLOCK);
kbd_fd = open (kbd_dev, O_NONBLOCK);
if (kbd_fd < 0) {
return -1;
}else{
}
else {
return kbd_fd;
}
}
-1
View File
@@ -56,7 +56,6 @@
#include <sys/ioctl.h>
#include <signal.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include <errno.h>
#include "common.h"
+252
View File
@@ -0,0 +1,252 @@
//////////////////////////////////////////////////////////////////////////////
//
// 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/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include "common.h"
#ifdef _MGIAL_SINGLETOUCHKEY
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/input.h>
#include "minigui.h"
#include "misc.h"
#include "ial.h"
#include "singletouchkey.h"
#define LEN_TOUCH_DEV 127
static int sg_tp_event_fd = -1, sg_key_event_fd = -1;
static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0;
static int get_touch_data (short *x, short *y, short *button)
{
struct input_event data;
while (read (sg_tp_event_fd, &data, sizeof (data)) == sizeof (data)) {
/* do nothing for EV_SYN due to non-blocking read.
if (data.type == EV_SYN) {
if (data.code == SYN_REPORT) {
return 0;
}
else if (data.code == SYN_MT_REPORT) {
continue;
}
else {
return -1;
}
}
*/
if (data.type == EV_KEY) {
switch (data.code) {
case BTN_TOUCH:
if (data.value > 0)
*button = IAL_MOUSE_LEFTBUTTON;
else
*button = 0;
break;
default:
_WRN_PRINTF ("unknow event code for EV_KEY event: 0x%x, 0x%x\n", data.code, data.value);
return -1;
}
}
else if (data.type == EV_ABS) {
switch (data.code) {
case ABS_X:
*x = data.value;
break;
case ABS_Y:
*y = data.value;
break;
case ABS_MT_POSITION_X:
*x = data.value;
break;
case ABS_MT_POSITION_Y:
*y = data.value;
break;
case ABS_MT_TOUCH_MAJOR:
break;
case ABS_MT_WIDTH_MAJOR:
break;
case ABS_MT_TRACKING_ID:
break;
default:
_WRN_PRINTF ("unknow event code for EV_ABS event: 0x%x, 0x%x.\n", data.code, data.value);
break;
}
}
}
return 0;
}
static int mouse_update (void)
{
if (get_touch_data (&MOUSEX, &MOUSEY, &MOUSEBUTTON) == 0)
return 1;
return 0;
}
static void mouse_getxy (int *x, int* y)
{
*x = MOUSEX;
*y = MOUSEY;
}
static int mouse_getbutton (void)
{
if (MOUSEBUTTON == IAL_MOUSE_LEFTBUTTON)
return IAL_MOUSE_LEFTBUTTON;
return 0;
}
static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *except,
struct timeval *timeout)
{
fd_set rfds;
int e;
int retvalue = 0;
if (!in) {
in = &rfds;
FD_ZERO (in);
}
FD_SET (sg_tp_event_fd, in);
if (sg_tp_event_fd > maxfd)
maxfd = sg_tp_event_fd;
if (sg_key_event_fd >= 0) {
FD_SET (sg_key_event_fd, in);
if (sg_key_event_fd > maxfd)
maxfd = sg_key_event_fd;
}
e = select (maxfd + 1, in, out, except, timeout);
if (e > 0) {
if (FD_ISSET (sg_tp_event_fd, in)) {
retvalue |= IAL_MOUSEEVENT;
}
if (sg_key_event_fd >= 0 && FD_ISSET (sg_key_event_fd, in)) {
retvalue |= IAL_KEYEVENT;
}
}
else if (e < 0) {
retvalue = -1;
}
else {
retvalue = 0;
}
return retvalue;
}
BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype)
{
char touch_dev[LEN_TOUCH_DEV + 1];
if (GetMgEtcValue ("singletouchkey", "touch_dev", touch_dev, LEN_TOUCH_DEV) < 0) {
strcpy (touch_dev, "none");
}
if (strcmp (touch_dev, "none") == 0) {
_WRN_PRINTF ("no touch_dev defined.\n");
return FALSE;
}
sg_tp_event_fd = open (touch_dev, O_RDONLY | O_NONBLOCK);
if (sg_tp_event_fd < 0) {
_WRN_PRINTF ("failed when opening touch event device: %s\n", touch_dev);
return FALSE;
}
input->update_mouse = mouse_update;
input->get_mouse_xy = mouse_getxy;
input->set_mouse_xy = NULL;
input->get_mouse_button = mouse_getbutton;
input->set_mouse_range = NULL;
input->suspend_mouse= NULL;
input->resume_mouse = NULL;
input->update_keyboard = NULL;
input->get_keyboard_state = NULL;
input->suspend_keyboard = NULL;
input->resume_keyboard = NULL;
input->set_leds = NULL;
input->wait_event = wait_event;
return TRUE;
}
void TermSingleTouchKey (void)
{
if (sg_tp_event_fd >= 0)
close (sg_tp_event_fd);
if (sg_key_event_fd >= 0)
close (sg_key_event_fd);
}
#endif /* _MGIAL_SINGLETOUCHKEY */
+68
View File
@@ -0,0 +1,68 @@
///////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.cn/exception-list
//
//////////////////////////////////////////////////////////////////////////////
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
*/
/*
** linux-libinput.h: the head file of the IAL engine based on libinput.
**
** Created by Wei YongMing, 2019/06/10
*/
#ifndef GUI_IAL_SINGLETOUCHKEY_H
#define GUI_IAL_SINGLETOUCHKEY_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype);
void TermSingleTouchKey (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GUI_IAL_SINGLETOUCHKEY_H */
+2 -1
View File
@@ -532,7 +532,7 @@ static void rebuild_wins_region (CompositorCtxt* ctxt)
}
static void calc_mainwin_pos (CompositorCtxt* ctxt, MG_Layer* layer,
DWORD zt_type, int first_for_type, CALCPOSINFO* info)
DWORD zt_type, int first_for_type, CALCPOSINFO* info, int cli)
{
/* give a default size first */
if (IsRectEmpty (&info->rc)) {
@@ -902,6 +902,7 @@ static void on_changed_rgn (CompositorCtxt* ctxt, MG_Layer* layer,
assert (znode_hdr);
if (!(znode_hdr->flags & ZNIF_VISIBLE)) {
_DBG_PRINTF("not a visible window\n");
return;
}
+2 -2
View File
@@ -48,7 +48,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
{
FILE* fp;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
int w=0, h=0, xhot=0, yhot=0, colornum=0;
#if 0
DWORD32 size;
#endif
@@ -152,7 +152,7 @@ static HCURSOR load_cursor_from_mem (const void* area)
const Uint8* p = (Uint8*)area;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
int w=0, h=0, xhot=0, yhot=0, colornum=0;
#if 0
DWORD32 size;
#endif
+24 -16
View File
@@ -1356,6 +1356,10 @@ intptr_t __mg_do_zorder_maskrect_operation (int cli,
get_layer_from_client (cli), info->idx_znode, &rc_org_bound);
#endif
}
else {
_ERR_PRINTF("KERNEL: failed in __mg_do_zorder_maskrect_operation\n");
}
return ret;
}
@@ -4536,7 +4540,7 @@ BOOL GUIAPI ServerGetWinZNodeRegion (MG_Layer* layer, int idx_znode,
DWORD rgn_ops, CLIPRGN* dst_rgn)
{
RECT rc;
MASKRECT *maskrect;
MASKRECT *firstmaskrect = NULL, *maskrect;
ZORDERNODE* nodes;
ZORDERINFO* zi;
int idx, nr_mask_rects;
@@ -4568,33 +4572,37 @@ BOOL GUIAPI ServerGetWinZNodeRegion (MG_Layer* layer, int idx_znode,
nr_mask_rects = 0;
nodes = GET_ZORDERNODE(zi);
maskrect = GET_MASKRECT(zi);
firstmaskrect = GET_MASKRECT(zi);
idx = nodes [idx_znode].idx_mask_rect;
while (idx) {
maskrect = firstmaskrect + idx;
rc.left = maskrect->left;
rc.top = maskrect->top;
rc.right = maskrect->left;
rc.right = maskrect->right;
rc.bottom = maskrect->bottom;
if (rgn_ops & RGN_OP_FLAG_ABS) {
OffsetRect (&rc, nodes[idx_znode].rc.left, nodes[idx_znode].rc.top);
}
if (!IsRectEmpty (&rc)) {
if (rgn_ops & RGN_OP_FLAG_ABS) {
OffsetRect (&rc, nodes[idx_znode].rc.left, nodes[idx_znode].rc.top);
}
if ((rgn_ops & RGN_OP_MASK) == RGN_OP_EXCLUDE) {
if (!SubtractClipRect (dst_rgn, &rc)) {
nr_mask_rects = -1;
goto __mg_err_ret;
if ((rgn_ops & RGN_OP_MASK) == RGN_OP_EXCLUDE) {
if (!SubtractClipRect (dst_rgn, &rc)) {
nr_mask_rects = -1;
goto __mg_err_ret;
}
}
}
else {
if (!AddClipRect (dst_rgn, &rc)) {
nr_mask_rects = -1;
goto __mg_err_ret;
else {
if (!AddClipRect (dst_rgn, &rc)) {
nr_mask_rects = -1;
goto __mg_err_ret;
}
}
nr_mask_rects ++;
}
idx = maskrect->next;
nr_mask_rects ++;
}
if (nr_mask_rects == 0) {
+8 -6
View File
@@ -2578,6 +2578,8 @@ static DWORD get_znode_flags_from_style (PMAINWIN pWin)
return zt_type;
}
/* TODO: this function should be optimized to avoid allocating space for
invalid (empty) mask rectangles */
static int AllocZOrderMaskRect (int cli, int idx_znode,
int flags, const RECT4MASK *rc, const int nr_rc)
{
@@ -2599,24 +2601,24 @@ static int AllocZOrderMaskRect (int cli, int idx_znode,
/*get mask rect number*/
idx = nodes[idx_znode].idx_mask_rect;
while(idx) {
while (idx) {
old_num++;
idx = ((MASKRECT *)(firstmaskrect+idx))->next;
idx = ((MASKRECT *)(firstmaskrect + idx))->next;
}
if (nr_rc > old_num) {
/* check the number of mask rect if enough */
int idle =
__mg_get_nr_idle_slots((unsigned char*)GET_MASKRECT_USAGEBMP(zi),
__mg_get_nr_idle_slots ((unsigned char*)GET_MASKRECT_USAGEBMP(zi),
zi->size_maskrect_usage_bmp);
if (idle < nr_rc-old_num) {
if (idle < nr_rc - old_num) {
unlock_zi_for_change (zi);
return -1;
}
/*add new space to Znode*/
idx = nodes[idx_znode].idx_mask_rect;
for(i = 0; i < nr_rc-old_num; i++) {
for (i = 0; i < nr_rc - old_num; i++) {
free_slot = __mg_lookfor_unused_slot (
(unsigned char*)GET_MASKRECT_USAGEBMP(zi),
zi->size_maskrect_usage_bmp, 1);
@@ -4408,7 +4410,7 @@ static int dskCalculateDefaultPosition (int cli, CALCPOSINFO* info)
#ifdef _MGSCHEMA_COMPOSITING /* not defined _MGSCHEMA_COMPOSITING */
DO_COMPSOR_OP_ARGS (calc_mainwin_pos,
__mg_get_layer_from_zi(zi), zt_type, first, info);
__mg_get_layer_from_zi(zi), zt_type, first, info, cli);
#else /* defined _MGSCHEMA_COMPOSITING */
/* give a default size first */
if (IsRectEmpty (&info->rc)) {
+2
View File
@@ -69,6 +69,8 @@
#include <linux/memfd.h>
#include <stdlib.h>
#else
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#endif
-1
View File
@@ -59,7 +59,6 @@
#include <linux/version.h>
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include "common.h"
#include "minigui.h"
+3
View File
@@ -4413,6 +4413,9 @@ static void travel_children_with_priv_cdc (struct _travel_context* ctxt)
child = (PCONTROL)(ctxt->parent->children);
while (child) {
#ifdef _MGSCHEMA_COMPOSITING
child->surf = ctxt->surface;
#endif
if (child->privCDC) {
ctxt->cb (ctxt, child);
+48
View File
@@ -635,6 +635,30 @@ BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer)
if (mgTopmostLayer && mgTopmostLayer->cli_head)
IsPaint = 1;
// add by gengyue for swtich layer <<<<<<<<
int cur_clientId = 0;
int idx_topmost = ServerGetTopmostZNodeOfType(mgTopmostLayer, ZOF_TYPE_NORMAL, &cur_clientId);
int znode_index = 0;
if(idx_topmost > 0)
{
// get the number of app in normal level
znode_index = ServerGetNextZNode(mgTopmostLayer, 0, &cur_clientId);
while(znode_index > 0)
{
ZNODEINFO znodeinfo;
if(ServerGetZNodeInfo(NULL, znode_index, &znodeinfo))
{
if((znodeinfo.type & ZOF_TYPE_MASK) == ZOF_TYPE_NORMAL) // it the main window in normal level
{
DO_COMPSOR_OP_ARGS (on_hiding_win, mgTopmostLayer, znode_index);
}
}
znode_index = ServerGetNextZNode(mgTopmostLayer, znode_index, &cur_clientId);
}
}
// >>>>>>>>> add by gengyue for swtich layer
mgTopmostLayer = layer;
CHANGE_TOPMOST_LAYER (layer);
@@ -649,6 +673,30 @@ BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer)
client = client->next;
}
// add by gengyue for swtich layer <<<<<<<<
cur_clientId = 0;
idx_topmost = ServerGetTopmostZNodeOfType(mgTopmostLayer, ZOF_TYPE_NORMAL, &cur_clientId);
znode_index = 0;
if(idx_topmost > 0)
{
// get the number of app in normal level
znode_index = ServerGetNextZNode(mgTopmostLayer, 0, &cur_clientId);
while(znode_index > 0)
{
ZNODEINFO znodeinfo;
if(ServerGetZNodeInfo(NULL, znode_index, &znodeinfo))
{
if((znodeinfo.type & ZOF_TYPE_MASK) == ZOF_TYPE_NORMAL) // it the main window in normal level
{
DO_COMPSOR_OP_ARGS (on_showing_win, mgTopmostLayer, znode_index);
}
}
znode_index = ServerGetNextZNode(mgTopmostLayer, znode_index, &cur_clientId);
}
}
// >>>>>>>>> add by gengyue for swtich layer
/* Notify that a new topmost layer have been set. */
if (OnChangeLayer)
OnChangeLayer (LCO_TOPMOST_CHANGED, mgTopmostLayer, NULL);
+3 -4
View File
@@ -570,9 +570,8 @@ static int sigma8654_client_get_surface(int cli, int clifd, void* buff, size_t l
REQ_SIGMA8654_GETSURFACE *request;
REP_SIGMA8654_GETSURFACE reply;
if (Sigma8654_ServerOnGetSurface(request, &reply) < 0)
{
fprintf(stderr, "Nexus_ServerOnGetSurface() failed\n");
if (Sigma8654_ServerOnGetSurface(request, &reply) < 0) {
_ERR_PRINTF ("Nexus_ServerOnGetSurface() failed\n");
return -1;
}
return ServerSendReply (clifd, &reply, sizeof (reply));
@@ -590,7 +589,7 @@ static int nexus_client_get_surface(int cli, int clifd, void* buff, size_t len)
if (Nexus_ServerOnGetSurface(request, &reply) < 0)
{
fprintf(stderr, "Nexus_ServerOnGetSurface() failed\n");
_ERR_PRINTF ("Nexus_ServerOnGetSurface() failed\n");
return -1;
}
return ServerSendReply (clifd, &reply, sizeof (reply));