Compare commits

..
Author SHA1 Message Date
gengyue d68561769d modified for cross compile 2020-04-12 21:26:40 +08:00
172 changed files with 5331 additions and 9376 deletions
+1 -3
View File
@@ -4,8 +4,6 @@
*.al *.al
*.a *.a
*.so *.so
\#
am--include-marker
Makefile Makefile
Makefile.in Makefile.in
.deps/ .deps/
@@ -25,8 +23,8 @@ Makefile.in
/*config.h /*config.h
/*config.h.in /*config.h.in
/*config.h.in~ /*config.h.in~
/src/font/utils/emoji/ /src/font/utils/emoji/
/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~
+78 -174
View File
File diff suppressed because it is too large Load Diff
+78 -174
View File
File diff suppressed because it is too large Load Diff
+78 -174
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,5 +1,5 @@
MAJOR_VERSION = 5 MAJOR_VERSION = 4
MINOR_VERSION = 0 MINOR_VERSION = 1
MICRO_VERSION = 0 MICRO_VERSION = 0
EXTRAVERSION = EXTRAVERSION =
+108 -202
View File
File diff suppressed because it is too large Load Diff
+20 -264
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -1,11 +1,11 @@
Version 5.0.13 (2023/08/31) Version 5.0.0 (2019/03/31)
This is a minor enhancement and bugfix release of MiniGUI 5.0.x, the stable version. This is the second preview version of MiniGUI 5.0.0, an unstable version.
Other packages for MiniGUI resource, tools, components, and samples: Other packages for MiniGUI resource, tools, components, and samples:
- GVFB: `gvfb-1.2.5.tar.gz` - GVFB: `gvfb-1.2.4.tar.gz`
- The resource package: `minigui-res-5.0.6.tar.gz` - The resource package: `minigui-res-4.0.0.tar.gz`
- mGUtils component: `libmgutils-1.5.0.tar.gz` - mGUtils component: `libmgutils-1.5.0.tar.gz`
- mGPlus component: `libmgplus-1.5.0.tar.gz` - mGPlus component: `libmgplus-1.5.0.tar.gz`
- mGEff component: `libmgeff-1.5.0.tar.gz` - mGEff component: `libmgeff-1.5.0.tar.gz`
-44
View File
@@ -1,44 +0,0 @@
#!/bin/sh
rm config.cache config.status -f
./configure \
--disable-shared \
--enable-static \
--with-osname=freertos \
--with-targetname=external \
--with-runmode=sa \
--enable-mgslicefallback \
--disable-videopcxvfb \
--disable-videoqvfb \
--disable-videodrm \
--disable-videofbcon \
--enable-videocommlcd \
--enable-dummyial \
--disable-consoleial \
--disable-libinputial \
--enable-commial \
--disable-consoleimps2 \
--disable-mousecalibrate \
--enable-incoreres \
--disable-cursor \
--disable-clipboard \
--disable-adv2dapi \
--disable-savebitmap \
--disable-savescreen \
--disable-dblclk \
--disable-splash \
--disable-latin9support \
--disable-fullunicode \
--disable-rbfsupport \
--disable-vbfsupport \
--disable-upfsupport \
--disable-qpfsupport \
--disable-ttfsupport \
--disable-complexscripts \
--disable-ttfcache \
--disable-jpgsupport \
--disable-pngsupport \
--disable-flatlf \
--disable-textmode \
--disable-shmopen
-41
View File
@@ -1,41 +0,0 @@
#!/bin/sh
rm config.cache config.status -f
./configure \
--disable-shared \
--enable-static \
--with-osname=linux \
--with-targetname=external \
--with-runmode=sa \
--enable-mgslicefallback \
--disable-videopcxvfb \
--disable-videoqvfb \
--disable-videodrm \
--disable-videofbcon \
--enable-videocommlcd \
--enable-dummyial \
--disable-consoleial \
--disable-libinputial \
--enable-commial \
--disable-consoleimps2 \
--disable-mousecalibrate \
--enable-incoreres \
--disable-cursor \
--disable-savebitmap \
--disable-savescreen \
--disable-dblclk \
--disable-splash \
--disable-latin9support \
--disable-fullunicode \
--disable-rbfsupport \
--disable-vbfsupport \
--disable-upfsupport \
--disable-qpfsupport \
--disable-ttfsupport \
--disable-complexscripts \
--disable-ttfcache \
--disable-jpgsupport \
--disable-pngsupport \
--disable-flatlf \
--disable-textmode
-36
View File
@@ -1,36 +0,0 @@
# set your own targaet_os
TARGET_OS=freertos
##################################################
# set your compile tool #
CC=arm-linux-gnueabihf-gcc
CXX=arm-linux-gnueabihf-g++
CPP=arm-linux-gnueabihf-g++
AR=arm-linux-gnueabihf-ar
AS=arm-linux-gnueabihf-as
RANLIB=arm-linux-gnueabihf-ranlib
MAKE=/usr/bin/make
##################################################
ARFLAGS=-rc
COFLAG=-c
OBJ=o
LIBA=a
##################################################
# if you don't want to create dynamic, delete it #
LIBSO=so
SOFLAGS=-fPIC -shared -o
##################################################
##################################################
# set your compile flags and install prefix path #
PREFIX=/usr/local
CFLAGS+=-g -Wall -fPIC
LDFLAGS+=
##################################################
+170 -188
View File
File diff suppressed because it is too large Load Diff
+2 -21
View File
@@ -80,20 +80,7 @@ double_buffering=true
# The filename of the shared library for the external driver. # The filename of the shared library for the external driver.
# The equivalent environment variable: MG_GAL_DRM_DRIVER # The equivalent environment variable: MG_GAL_DRM_DRIVER
exdriver=libhidrmdrivers-0.2.so.0 exdriver=libhidrmdrivers.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 #{{ifdef _MGIAL_LIBINPUT
@@ -105,12 +92,6 @@ 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
@@ -127,7 +108,7 @@ defaultmode=800x600-16bpp
[shadow] [shadow]
real_engine=pc_xvfb real_engine=pc_xvfb
defaultmode=800x600-16bpp defaultmode=800x600-16bpp
rotate_screen=ccw rotate_screen=normal
#}} #}}
#{{ifdef _MGGAL_MLSHADOW #{{ifdef _MGGAL_MLSHADOW
-1
View File
@@ -311,7 +311,6 @@ 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__)) || \
+1
View File
@@ -237,6 +237,7 @@ MG_EXPORT void GUIAPI NotifyParentEx (HWND hwnd, LINT id, int code,
NotifyParentEx(hwnd, id, code, 0) NotifyParentEx(hwnd, id, code, 0)
/** /**
* \var typedef int (*STRCMP) (const char* s1, const char* s2, size_t n)
* \brief Type of general strncmp function. * \brief Type of general strncmp function.
* *
* The function compares the two strings \a s1 and \a s2. It returns * The function compares the two strings \a s1 and \a s2. It returns
+1
View File
@@ -698,6 +698,7 @@ extern "C" {
#define EM_SETREADONLY 0xF0CF #define EM_SETREADONLY 0xF0CF
/** /**
* \var typedef int (*ED_DRAWSEL_FUNC) (HWND hWnd, HDC hdc, int startx, int starty, const char* content, int len, int selout)
* \brief Type of the edit control callback function on drawing selected strings. * \brief Type of the edit control callback function on drawing selected strings.
* *
* \param hWnd Handle of the edit control. * \param hWnd Handle of the edit control.
+25 -24
View File
@@ -131,31 +131,7 @@
#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
@@ -173,6 +149,31 @@
#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
+7 -7
View File
@@ -298,7 +298,7 @@ typedef struct _DrmDriverOps {
ColorLogicalOp logic_op); ColorLogicalOp logic_op);
/** /**
* This operation blits pixels from a source buffer with the source alpha * This operation blits pixles from a source buffer with the source alpha
* value specified to a destination buffer. * value specified to a destination buffer.
* *
* \note If this operation is set as NULL, the driver does not support * \note If this operation is set as NULL, the driver does not support
@@ -310,7 +310,7 @@ typedef struct _DrmDriverOps {
uint8_t alpha); uint8_t alpha);
/** /**
* This operation blits pixels from a source buffer to a destination buffer, * This operation blits pixles from a source buffer to a destination buffer,
* but skipping the pixel value specified by \a color_key. * but skipping the pixel value specified by \a color_key.
* *
* \note If this operation is set as NULL, the driver does not support * \note If this operation is set as NULL, the driver does not support
@@ -322,7 +322,7 @@ typedef struct _DrmDriverOps {
uint32_t color_key); uint32_t color_key);
/** /**
* This operation blits pixels from a source buffer with the source alpha * This operation blits pixles from a source buffer with the source alpha
* value specified to a destination buffer, but skipping the pixel value * value specified to a destination buffer, but skipping the pixel value
* specified. * specified.
* *
@@ -335,7 +335,7 @@ typedef struct _DrmDriverOps {
uint8_t alpha, uint32_t color_key); uint8_t alpha, uint32_t color_key);
/** /**
* This operation blits pixels from a source buffer with the source alpha * This operation blits pixles from a source buffer with the source alpha
* value of pixels to the destination buffer, and with the specified color * value of pixels to the destination buffer, and with the specified color
* compositing/blending method (\a ColorBlendMethod). * compositing/blending method (\a ColorBlendMethod).
* *
@@ -372,12 +372,12 @@ typedef struct _DrmDriverOps {
* For example, for Intel i915/i965 GPUs, the driver name will be `i915`. * For example, for Intel i915/i965 GPUs, the driver name will be `i915`.
* \param device_fd This argument gives the file descriptor of the * \param device_fd This argument gives the file descriptor of the
* opened DRI device. * opened DRI device.
* \param version A pointer to an integer which will be used to return * \param version A pointer to an integer which will contain the
* the interface version of the DRM engine driver. * versionc of the DRM engine driver.
* *
* \return NULL or a valid pointer to DrmDriverOps. * \return NULL or a valid pointer to DrmDriverOps.
* *
* \note We use the version control since 4.0.7. It will be initialized * \note We use the version control since 4.0.7. It will be intialized
* to zero by MiniGUI before calling this function. Because an old * to zero by MiniGUI before calling this function. Because an old
* driver for MiniGUI 4.0.6 or earlier will not change the value, * driver for MiniGUI 4.0.6 or earlier will not change the value,
* MiniGUI will deny to load the old driver. * MiniGUI will deny to load the old driver.
+92 -326
View File
File diff suppressed because it is too large Load Diff
+26 -137
View File
File diff suppressed because it is too large Load Diff
+72 -141
View File
File diff suppressed because it is too large Load Diff
+43 -18
View File
@@ -1,31 +1,56 @@
COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit newgal newgdi if MG_MINIMALGDI
COMMON_SUBDIRS = misc kernel sysres include
COMMON_LADD = \ COMMON_LADD = \
libc/liblibc.la \ kernel/libkernel.la \
misc/libmisc.la \ sysres/libsysres.la \
control/libcontrol.la \ misc/libmisc.la
ex_ctrl/libexctrl.la \ else
font/libfont.la \ COMMON_SUBDIRS = libc misc main kernel sysres ial control ex_ctrl font gui mybmp include textedit
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
newgal/libnewgal.la \ endif
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) @RUNMODE_SUBDIRS@ SUBDIRS = $(COMMON_SUBDIRS) $(NEWGAL_SUBDIRS) $(LITE_SUBDIRS)
MGSOURCES = template.c template.h MGSOURCES = template.c template.h
MGLIBADD = $(COMMON_LADD) @RUNMODE_LADD@ MGLIBADD = $(COMMON_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
libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD) @DEP_LIBS@ libminigui_@MGLIB_SUFFIX@_la_LIBADD=$(MGLIBADD)
libminigui_@MGLIB_SUFFIX@_la_SOURCES=$(MGSOURCES) libminigui_@MGLIB_SUFFIX@_la_SOURCES=$(MGSOURCES)
libminigui_@MGLIB_SUFFIX@_la_LDFLAGS=$(MGLDFLAGS) libminigui_@MGLIB_SUFFIX@_la_LDFLAGS=$(MGLDFLAGS)
+27 -72
View File
@@ -154,31 +154,9 @@ int GUIAPI GetSockFD2Server (void)
#include "debug.h" #include "debug.h"
static void check_live (BOOL woken)
{
static DWORD last_ticks;
REQUEST req;
__mg_update_tick_count (NULL);
// Since 5.0.6, only send IAMLIVE if the current ticks > (last_ticks + 100)
if (woken || __mg_tick_counter > last_ticks + 100) {
last_ticks = __mg_tick_counter;
/* Tell server that I am live */
req.id = REQID_IAMLIVE;
req.data = &__mg_tick_counter;
req.len_data = sizeof (unsigned int);
ClientRequest (&req, NULL, 0);
}
}
static void process_socket_message (MSG *msg) static void process_socket_message (MSG *msg)
{ {
if (msg->message == MSG_WAKEUP_CLIENT) { if (msg->message == MSG_UPDATECLIWIN &&
check_live (TRUE);
}
else if (msg->message == MSG_UPDATECLIWIN &&
__mg_client_check_hwnd (msg->hwnd, __mg_client_id)) { __mg_client_check_hwnd (msg->hwnd, __mg_client_id)) {
__mg_update_window (msg->hwnd, __mg_update_window (msg->hwnd,
LOSWORD(msg->wParam), HISWORD(msg->wParam), LOSWORD(msg->wParam), HISWORD(msg->wParam),
@@ -388,6 +366,27 @@ sock_error:
return -1; return -1;
} }
static void check_live (void)
{
REQUEST req;
#if 0 /* deprecated code */
/* Since 5.0.0, call __mg_update_tick_count instead */
if (__mg_tick_counter != SHAREDRES_TIMER_COUNTER) {
AlertDesktopTimerEvent ();
__mg_tick_counter = SHAREDRES_TIMER_COUNTER;
}
#endif /* deprecated code */
__mg_update_tick_count (NULL);
/* Tell server that I am live */
req.id = REQID_IAMLIVE;
req.data = &__mg_tick_counter;
req.len_data = sizeof (unsigned int);
ClientRequest (&req, NULL, 0);
}
BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait) BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
{ {
static DWORD old_timer; static DWORD old_timer;
@@ -399,7 +398,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
struct timeval sel_timeout; struct timeval sel_timeout;
MSG Msg; MSG Msg;
check_live (FALSE); check_live ();
/* rset gets modified each time around */ /* rset gets modified each time around */
rset = msg_queue->rfdset; rset = msg_queue->rfdset;
@@ -434,14 +433,14 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
static unsigned int old_mouse_move_serial = 0xdeadbeef; static unsigned int old_mouse_move_serial = 0xdeadbeef;
int flag = 0, mouse_x = -1, mouse_y = -1, buttons = -1; int flag = 0, mouse_x = -1, mouse_y = -1, buttons = -1;
check_live (FALSE); check_live ();
if (wait && (__mg_tick_counter - old_timer) >= repeat_timeout) { if (wait && (__mg_tick_counter - old_timer) >= repeat_timeout) {
Msg.hwnd = HWND_DESKTOP; Msg.hwnd = HWND_DESKTOP;
Msg.message = MSG_TIMEOUT; Msg.message = MSG_TIMEOUT;
Msg.wParam = (WPARAM)__mg_tick_counter; Msg.wParam = (WPARAM)__mg_tick_counter;
Msg.lParam = 0; Msg.lParam = 0;
Msg.time = __mg_tick_counter; Msg.time = __mg_tick_counter;
// Since 5.0.0, we do not genenrate MSG_TIMEOUT message here. // Since 5.0.0, we do not genenrate MSG_TIMEOUT message any more.
// kernel_QueueMessage (msg_queue, &Msg); // kernel_QueueMessage (msg_queue, &Msg);
old_timer = __mg_tick_counter; old_timer = __mg_tick_counter;
@@ -508,7 +507,7 @@ BOOL client_IdleHandler4Client (PMSGQUEUE msg_queue, BOOL wait)
/* go through registered listen fds */ /* go through registered listen fds */
n += __mg_kernel_check_listen_fds (msg_queue, &rset, wsetptr, esetptr); n += __mg_kernel_check_listen_fds (msg_queue, &rset, wsetptr, esetptr);
check_live (FALSE); check_live ();
if (n > 0) { if (n > 0) {
old_timer = __mg_tick_counter; old_timer = __mg_tick_counter;
@@ -570,23 +569,12 @@ GHANDLE GUIAPI JoinLayer (const char* layer_name, const char* client_name,
__mg_layer = layer_handle; __mg_layer = layer_handle;
zi = (ZORDERINFO*) shmat (joined_info.zi_shmid, 0, SHM_RDONLY); zi = (ZORDERINFO*) shmat (joined_info.zo_shmid, 0, SHM_RDONLY);
if (zi == (void*)-1) { if (zi == (void*)-1) {
return INV_LAYER_HANDLE; return INV_LAYER_HANDLE;
} }
__mg_zorder_info = zi; __mg_zorder_info = zi;
if (joined_info.zi_shmid == joined_info.def_zi_shmid) {
__mg_def_zorder_info = zi;
}
else {
zi = (ZORDERINFO*) shmat (joined_info.def_zi_shmid, 0, SHM_RDONLY);
if (zi == (void*)-1) {
return INV_LAYER_HANDLE;
}
__mg_def_zorder_info = zi;
}
} }
__mg_tick_counter = SHAREDRES_TIMER_COUNTER; __mg_tick_counter = SHAREDRES_TIMER_COUNTER;
@@ -723,39 +711,6 @@ BOOL __mg_client_on_layer_changed (GHANDLE layer_handle, int zi_shmid)
__mg_layer = layer_handle; __mg_layer = layer_handle;
__mg_zorder_info = zi; __mg_zorder_info = zi;
#if 0 /* obsolete */
ZORDERNODE* nodes;
int slot;
nodes = GET_ZORDERNODE(zi);
slot = zi->first_tooltip;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
slot = zi->first_topmost;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
slot = zi->first_normal;
for (; slot > 0; slot = nodes[slot].next) {
if (nodes [slot].cli == __mg_client_id) {
PMAINWIN win = (PMAINWIN)nodes [slot].hwnd;
assert (win);
win->idx_znode = slot;
}
}
#endif /* obsolete */
return TRUE; return TRUE;
} }
+46 -56
View File
File diff suppressed because it is too large Load Diff
+14 -12
View File
@@ -299,15 +299,7 @@ static void change_status_from_pose (PCONTROL pctrl, int new_pose,
} }
} }
/* DK: When the radio or check button state changes do not erase the background, /*complete a click if the click if valid
* 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)
@@ -320,6 +312,14 @@ 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 += (int)(w - bmp->bmWidth) >> 1; x += (w - bmp->bmWidth) >> 1;
y += (int)(h - bmp->bmHeight) >> 1; y += (h - bmp->bmHeight) >> 1;
w = h = 0; w = h = 0;
if (bmp->bmWidth > RECTW(prcClient)){ if (bmp->bmWidth > RECTW(prcClient)){
@@ -847,6 +847,8 @@ 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);
@@ -1052,7 +1054,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 -7
View File
@@ -63,17 +63,21 @@
#include "ctrlmisc.h" #include "ctrlmisc.h"
#define _ID_TIMER 100 #define _ID_TIMER 100
#define _MARGIN 10
static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
static int iBorder;
switch (message) { switch (message) {
case MSG_CREATE: case MSG_CREATE:
{ {
const WINDOWINFO *info;
int timeout = (int)GetWindowAdditionalData (hWnd); int timeout = (int)GetWindowAdditionalData (hWnd);
if (timeout >= 10) if (timeout >= 10)
SetTimer (hWnd, _ID_TIMER, timeout / 10); SetTimer (hWnd, _ID_TIMER, timeout / 10);
info = GetWindowInfo (hWnd);
iBorder =
info->we_rdr->calc_we_area (hWnd, LFRDR_METRICS_BORDER, NULL);
SetWindowFont (hWnd, SetWindowFont (hWnd,
(PLOGFONT)GetWindowElementAttr(hWnd, WE_FONT_TOOLTIP)); (PLOGFONT)GetWindowElementAttr(hWnd, WE_FONT_TOOLTIP));
break; break;
@@ -98,7 +102,7 @@ static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
SetTextColor (hdc, SetTextColor (hdc,
GetWindowElementPixelEx(hWnd, hdc, WE_FGC_TOOLTIP)); GetWindowElementPixelEx(hWnd, hdc, WE_FGC_TOOLTIP));
TabbedTextOut (hdc, _MARGIN, _MARGIN, text); TabbedTextOut (hdc, iBorder, iBorder, text);
EndPaint (hWnd, hdc); EndPaint (hWnd, hdc);
return 0; return 0;
@@ -160,7 +164,6 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
CreateInfo.dwStyle = WS_VISIBLE; CreateInfo.dwStyle = WS_VISIBLE;
CreateInfo.dwExStyle = WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_USEPARENTRDR; CreateInfo.dwExStyle = WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_USEPARENTRDR;
CreateInfo.dwExStyle |= WS_EX_WINTYPE_TOOLTIP | WS_EX_TROUNDCNS | WS_EX_BROUNDCNS;
CreateInfo.spCaption = buf ? buf : text; CreateInfo.spCaption = buf ? buf : text;
CreateInfo.hMenu = 0; CreateInfo.hMenu = 0;
CreateInfo.hCursor = GetSystemCursor (IDC_ARROW); CreateInfo.hCursor = GetSystemCursor (IDC_ARROW);
@@ -168,8 +171,8 @@ HWND CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms,
CreateInfo.MainWindowProc = ToolTipWinProc; CreateInfo.MainWindowProc = ToolTipWinProc;
CreateInfo.lx = x; CreateInfo.lx = x;
CreateInfo.ty = y; CreateInfo.ty = y;
CreateInfo.rx = CreateInfo.lx + text_size.cx + _MARGIN * 2; CreateInfo.rx = CreateInfo.lx + text_size.cx;
CreateInfo.by = CreateInfo.ty + text_size.cy + _MARGIN * 2; CreateInfo.by = CreateInfo.ty + text_size.cy;
CreateInfo.iBkColor = CreateInfo.iBkColor =
GetWindowElementPixelEx (hParentWnd, HDC_SCREEN, WE_BGC_TOOLTIP); GetWindowElementPixelEx (hParentWnd, HDC_SCREEN, WE_BGC_TOOLTIP);
CreateInfo.dwAddData = (DWORD) timeout_ms; CreateInfo.dwAddData = (DWORD) timeout_ms;
@@ -215,8 +218,7 @@ void ResetToolTipWin (HWND hwnd, int x, int y, const char* text, ...)
if (y + text_size.cy > g_rcScr.bottom) if (y + text_size.cy > g_rcScr.bottom)
y = g_rcScr.bottom - text_size.cy; y = g_rcScr.bottom - text_size.cy;
MoveWindow (hwnd, x, y, MoveWindow (hwnd, x, y, text_size.cx, text_size.cy, TRUE);
text_size.cx + _MARGIN * 2, text_size.cy + _MARGIN * 2, TRUE);
ShowWindow (hwnd, SW_SHOWNORMAL); ShowWindow (hwnd, SW_SHOWNORMAL);
} }
+11 -8
View File
@@ -1678,7 +1678,7 @@ esright_input_char_refresh (HWND hWnd,
scroll_rc.right = cur_caret_x; scroll_rc.right = cur_caret_x;
ScrollWindow(hWnd, -scroll_len, 0, &scroll_rc, NULL); ScrollWindow(hWnd, -scroll_len, 0, &scroll_rc, NULL);
UpdateInvalidClient(hWnd, TRUE); UpdateWindow(hWnd, FALSE);
edtSetCaretPos (hWnd, sled); edtSetCaretPos (hWnd, sled);
sled->changed = TRUE; sled->changed = TRUE;
@@ -2143,6 +2143,9 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
else { else {
chars = 1; chars = 1;
if (charBuffer [0] == 127) // BS
charBuffer [0] = '\b';
if (dwStyle & ES_UPPERCASE) { if (dwStyle & ES_UPPERCASE) {
charBuffer [0] = toupper (charBuffer[0]); charBuffer [0] = toupper (charBuffer[0]);
} }
@@ -2151,8 +2154,12 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
} }
} }
if (chars == 1 && (charBuffer[0] == '\b' || charBuffer[0] == 0x7F)) { if (chars == 1) {
// ASCII BS or DEL if (charBuffer [0] < 0x20 && charBuffer[0] != '\b') //FIXME
return 0;
}
if (charBuffer[0] == '\b') { //backspace
int del; int del;
if (sled->editPos == 0 && sled->selStart == sled->selEnd) if (sled->editPos == 0 && sled->selStart == sled->selEnd)
@@ -2177,11 +2184,7 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
sleInsertText (hWnd, sled, NULL, del); sleInsertText (hWnd, sled, NULL, del);
} }
} }
else if (chars == 1 && charBuffer [0] < 0x20) { else{
// ignore all other ASCII control characters.
return 0;
}
else {
if (dwStyle & ES_LEFT) { if (dwStyle & ES_LEFT) {
esleft_input_char_refresh(hWnd, sled, (char*)charBuffer, chars); esleft_input_char_refresh(hWnd, sled, (char*)charBuffer, chars);
set_edit_caret_pos(hWnd, sled); set_edit_caret_pos(hWnd, sled);
+1 -1
View File
@@ -404,7 +404,7 @@ void mglist_set_itemops (MgList *mglst, PMGITEMOPS iop)
mglst->iop = *iop; mglst->iop = *iop;
} }
LRESULT DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam, int DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam,
PSCRDATA pscrdata, MgList *mglst) PSCRDATA pscrdata, MgList *mglst)
{ {
switch (message) { switch (message) {
+1 -1
View File
@@ -140,7 +140,7 @@ struct _MgList
/* ------------------------- external api -------------------------- */ /* ------------------------- external api -------------------------- */
MG_EXPORT LRESULT DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam, MG_EXPORT int DefaultItemViewProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam,
PSCRDATA pscrdata, MgList *mglst); PSCRDATA pscrdata, MgList *mglst);
MG_EXPORT SVITEM_DRAWFUNC mglist_set_itemdraw (MgList *mglst, SVITEM_DRAWFUNC draw_func); MG_EXPORT SVITEM_DRAWFUNC mglist_set_itemdraw (MgList *mglst, SVITEM_DRAWFUNC draw_func);
+2 -4
View File
@@ -1433,12 +1433,10 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
item_info->add_data = item->add_data; item_info->add_data = item->add_data;
if (item_info->which & MTB_WHICH_TEXT) if (item_info->which & MTB_WHICH_TEXT)
//strncpy (item_info->text, item->text, NTB_TEXT_LEN); strncpy (item_info->text, item->text, NTB_TEXT_LEN);
strcpy (item_info->text, item->text);
if (item_info->which & MTB_WHICH_TIP) if (item_info->which & MTB_WHICH_TIP)
//strncpy (item_info->tip, item->tip, NTB_TIP_LEN); strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
strcpy (item_info->tip, item->tip);
return NTB_OKAY; return NTB_OKAY;
} }
+1 -5
View File
@@ -172,10 +172,6 @@ BOOL scrolled_set_cont_pos (HWND hWnd, PSCRDATA pscrdata, int cont_x, int cont_y
SetScrollPos (hWnd, SB_VERT, cont_y); SetScrollPos (hWnd, SB_VERT, cont_y);
bChange = TRUE; bChange = TRUE;
} }
if (bChange)
UpdateInvalidClient(hWnd, FALSE);
return bChange; return bChange;
} }
@@ -589,7 +585,7 @@ int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h)
return 0; return 0;
} }
LRESULT DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam) int DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{ {
PSCRDATA pscrdata = NULL; PSCRDATA pscrdata = NULL;
+1 -1
View File
@@ -96,7 +96,7 @@ typedef struct _scrdata
typedef SCRDATA *PSCRDATA; typedef SCRDATA *PSCRDATA;
MG_EXPORT LRESULT DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam); MG_EXPORT int DefaultScrolledProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
MG_EXPORT int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h); MG_EXPORT int scrolled_init (HWND hWnd, PSCRDATA pscrdata, int w, int h);
MG_EXPORT void scrolled_destroy (PSCRDATA pscrdata); MG_EXPORT void scrolled_destroy (PSCRDATA pscrdata);
MG_EXPORT void scrolled_hscroll (HWND hWnd, PSCRDATA pscrdata, WPARAM wParam, LPARAM lParam); MG_EXPORT void scrolled_hscroll (HWND hWnd, PSCRDATA pscrdata, WPARAM wParam, LPARAM lParam);
+4 -9
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~2022, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2018, 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,15 +493,10 @@ LRESULT ScrollViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
break; break;
} }
case MSG_DESTROY: { case MSG_DESTROY:
/* suppress a warning about calling free() before using the pointer */ scrollview_destroy (psvdata);
PSVDATA svdata = (PSVDATA) GetWindowAdditionalData2 (hWnd); free (psvdata);
if (svdata) {
scrollview_destroy(svdata);
free (svdata);
}
break; break;
}
case MSG_GETDLGCODE: case MSG_GETDLGCODE:
return DLGC_WANTARROWS; return DLGC_WANTARROWS;
+4 -1
View File
@@ -2096,6 +2096,7 @@ static void teOnChar (HWND hWnd, PTEDATA ptedata, WPARAM wParam)
rcInv.right = ptedata->svdata.scrdata.nContWidth; rcInv.right = ptedata->svdata.scrdata.nContWidth;
rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH; rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH;
REFRESH_NODE_EX(node, &rcInv); REFRESH_NODE_EX(node, &rcInv);
// UpdateWindow(hWnd, FALSE);
newlinenr = NODE_LINENR(node); newlinenr = NODE_LINENR(node);
rcInv.left = 0; rcInv.left = 0;
@@ -2103,10 +2104,12 @@ static void teOnChar (HWND hWnd, PTEDATA ptedata, WPARAM wParam)
rcInv.top += ptedata->nLineHeight; rcInv.top += ptedata->nLineHeight;
rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH; rcInv.bottom = rcInv.top + ptedata->nLineHeight - ptedata->nLineBaseH;
REFRESH_NODE_EX(node, &rcInv); REFRESH_NODE_EX(node, &rcInv);
// UpdateWindow(hWnd, FALSE);
} }
/* houhh 20090814, UpdataWindow will invalidate all edit area, but /* houhh 20090814, UpdataWindow will invalidate all edit area, but
* erase area is not same with msg_paint area.*/ * erase area is not same with msg_paint area.*/
UpdateInvalidClient(hWnd, TRUE); UpdateWindow(hWnd, FALSE);
//SendMessage(hWnd, MSG_PAINT, 0, 0);
} }
} }
else { else {
+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~2022, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2018, 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 [0] == '\0') if (tmpdata->Caption == NULL || tmpdata->Caption [0] == '\0')
break; break;
GetTextExtent (hdc, tmpdata->Caption, -1, &size); GetTextExtent (hdc, tmpdata->Caption, -1, &size);
+4 -4
View File
@@ -80,17 +80,17 @@ static void update_viewport (gvGridViewData *view, int from, int to, int is_row)
{ {
RECT r; RECT r;
GetClientRect(view->hCtrl, &r); GetClientRect (view->hCtrl, &r);
if (is_row) { if (is_row) {
r.top = from; r.top = from;
ScrollWindow(view->hCtrl, 0, to, &r, NULL); ScrollWindow (view->hCtrl, 0, to, &r, NULL);
} }
else { else {
r.left = from; r.left = from;
ScrollWindow(view->hCtrl, to, 0, &r, NULL); ScrollWindow (view->hCtrl, to, 0, &r, NULL);
} }
UpdateInvalidClient(view->hCtrl, FALSE); UpdateWindow(view->hCtrl, FALSE);
} }
// scroll function {{{ // scroll function {{{
-2
View File
@@ -157,8 +157,6 @@ 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;
+17 -10
View File
@@ -93,15 +93,14 @@ BOOL RegisterTreeViewControl (void)
const WINDOW_ELEMENT_RENDERER * rdr = const WINDOW_ELEMENT_RENDERER * rdr =
GetDefaultWindowElementRenderer(); GetDefaultWindowElementRenderer();
if (!(icon_fold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name,
SYSICON_FOLD, szValue)))) { if (!(icon_fold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name, SYSICON_FOLD, szValue)))) {
if (!(icon_fold = LoadSystemIcon (SYSICON_FOLD, 0))) { if (!(icon_fold = LoadSystemIcon (SYSICON_FOLD, 0))) {
return FALSE; return FALSE;
} }
} }
if (!(icon_unfold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name, if (!(icon_unfold = (HICON)RetrieveRes(gui_GetIconFile(rdr->name, SYSICON_UNFOLD, szValue)))) {
SYSICON_UNFOLD, szValue)))) {
if (!(icon_unfold = LoadSystemIcon (SYSICON_UNFOLD, 0))) { if (!(icon_unfold = LoadSystemIcon (SYSICON_UNFOLD, 0))) {
DestroyIcon (icon_fold); DestroyIcon (icon_fold);
icon_fold = 0; icon_fold = 0;
@@ -181,7 +180,6 @@ static BOOL tvInitTVData (HWND hwnd, PTVDATA pData, DWORD dwStyle, PTVITEMINFO r
tvRoot->hIconFold = root_ii->hIconFold; tvRoot->hIconFold = root_ii->hIconFold;
else else
tvRoot->hIconFold = ICON_FOLD; tvRoot->hIconFold = ICON_FOLD;
if (root_ii && root_ii->hIconUnfold) if (root_ii && root_ii->hIconUnfold)
tvRoot->hIconUnfold = root_ii->hIconUnfold; tvRoot->hIconUnfold = root_ii->hIconUnfold;
else else
@@ -634,13 +632,22 @@ static void tvDrawItem (HWND hWnd, HDC hdc, PTVDATA pData, int centerX, int cent
centerX += (h>>1) + TV_BOXGAP; centerX += (h>>1) + TV_BOXGAP;
if (pData->dwStyle & TVS_WITHICON) { if (pData->dwStyle & TVS_WITHICON) {
if (p->child != NULL && (p->dwFlags & TVIF_FOLD)) { if (!(pData->dwStyle & TVS_ICONFORSELECT)
&& (!p->child || (p->dwFlags & TVIF_FOLD))) {
if ((p->hIconFold)) { if ((p->hIconFold)) {
DrawIcon (hdc, centerX, centerY - (h>>1), h, h, p->hIconFold); DrawIcon (hdc, centerX, centerY - (h>>1),
h, h, p->hIconFold);
}
} else if ((pData->dwStyle & TVS_ICONFORSELECT) && p->dwFlags & TVIF_SELECTED) {
if ((p->hIconFold)) {
DrawIcon (hdc, centerX, centerY - (h>>1),
h, h, p->hIconFold);
}
} else
if ((p->hIconUnfold)) {
DrawIcon (hdc, centerX, centerY - (h>>1),
h, h, p->hIconUnfold);
} }
} else if ((p->hIconUnfold)) {
DrawIcon (hdc, centerX, centerY - (h>>1), h, h, p->hIconUnfold);
}
centerX += h + TV_ICONGAP; centerX += h + TV_ICONGAP;
} }
-12
View File
@@ -202,17 +202,6 @@ static void destroy (GLYPHTREENODE *root)
/*** device font ops ***/ /*** device font ops ***/
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
return DEVFONTGLYPHTYPE_PRERDRBMP; return DEVFONTGLYPHTYPE_PRERDRBMP;
@@ -391,7 +380,6 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_bitmap_font_ops = { FONTOPS __mg_bitmap_font_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+15 -13
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~2023, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2018, 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
@@ -461,8 +461,9 @@ static int iso8859_6_len_first_char (const unsigned char* mstr, int len)
return 2; return 2;
else if (ignore == 2) else if (ignore == 2)
return 3; return 3;
else
return 1;
return 1;
} }
#define ISARABIC_LIG_HALF(s) ((s == 0xa5) || (s == 0xa6)) #define ISARABIC_LIG_HALF(s) ((s == 0xa5) || (s == 0xa6))
@@ -471,7 +472,6 @@ static unsigned int iso8859_6_char_type (Achar32 chv)
{ {
unsigned int ch_type = ACHAR_BASIC_UNKNOWN; unsigned int ch_type = ACHAR_BASIC_UNKNOWN;
chv = REAL_ACHAR(chv);
if (is_arabic_char_vowel (chv)) { /* is vowel */ if (is_arabic_char_vowel (chv)) { /* is vowel */
ch_type = ACHAR_BASIC_VOWEL; ch_type = ACHAR_BASIC_VOWEL;
} }
@@ -483,6 +483,7 @@ static unsigned int iso8859_6_char_type (Achar32 chv)
} }
static BidiType __mg_iso8859_6_bidi_char_type_map[] = { static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
#if 0
/*0x00~0x0f*/ /*0x00~0x0f*/
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
@@ -530,6 +531,7 @@ static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN,
#endif
/*0x80~0x8f*/ /*0x80~0x8f*/
BIDI_TYPE_ON, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_ON, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
@@ -604,9 +606,10 @@ static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
static BidiType iso8859_6_bidi_char_type (Achar32 chv) static BidiType iso8859_6_bidi_char_type (Achar32 chv)
{ {
chv = REAL_ACHAR(chv); chv = REAL_ACHAR(chv);
assert(chv < TABLESIZE(__mg_iso8859_6_bidi_char_type_map)); if (chv > 0x7F)
return (BidiType)__mg_iso8859_6_bidi_char_type_map[chv - 0x80];
return (BidiType)__mg_iso8859_6_bidi_char_type_map[chv]; else
return (BidiType)__mg_iso8859_1_bidi_char_type_map[chv];
} }
static int get_table_index(Uint8 c) static int get_table_index(Uint8 c)
@@ -793,7 +796,7 @@ static const unsigned char* iso8859_6_get_next_word (const unsigned char* mstr,
static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar, static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
int cur_len, int shape_type) int cur_len, int shape_type)
{ {
Achar32 chv = INV_ACHAR_VALUE; Achar32 chv = -1;
int ignore; int ignore;
int index; int index;
@@ -808,14 +811,15 @@ static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
} }
} }
if (chv == INV_ACHAR_VALUE || chv == 0) { if (chv == -1 || chv == 0) {
if (ISARABIC_VOWEL(*cur_mchar)){ if (ISARABIC_VOWEL(*cur_mchar)){
chv = fontset_68x_get_vowel_char(*cur_mchar); chv = fontset_68x_get_vowel_char(*cur_mchar);
} }
if (chv == 0 || chv == INV_ACHAR_VALUE) { if (chv == 0 || chv == -1) {
index = get_table_index(*cur_mchar); index = get_table_index(*cur_mchar);
if (index >=0 ) { if (index >=0)
{
switch (shape_type) { switch (shape_type) {
case ACHAR_ISOLATED: case ACHAR_ISOLATED:
chv = shape_info[index].isolated; chv = shape_info[index].isolated;
@@ -837,7 +841,7 @@ static Achar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
} }
if (chv == 0) if (chv == 0)
chv = INV_ACHAR_VALUE; chv =-1;
return chv; return chv;
} }
@@ -858,7 +862,6 @@ static const BIDICHAR_MIRROR_MAP __mg_iso8859_68x_mirror_table [] =
static BOOL iso8859_6_bidi_mirror_char (Achar32 chv, Achar32* mirrored) static BOOL iso8859_6_bidi_mirror_char (Achar32 chv, Achar32* mirrored)
{ {
chv = REAL_ACHAR(chv);
return get_mirror_char (__mg_iso8859_68x_mirror_table, return get_mirror_char (__mg_iso8859_68x_mirror_table,
TABLESIZE (__mg_iso8859_68x_mirror_table), chv, mirrored); TABLESIZE (__mg_iso8859_68x_mirror_table), chv, mirrored);
} }
@@ -868,7 +871,6 @@ static CHARSETOPS CharsetOps_iso8859_6 = {
3, 3,
FONT_CHARSET_ISO8859_6, FONT_CHARSET_ISO8859_6,
0, 0,
1,
iso8859_6_len_first_char, iso8859_6_len_first_char,
iso8859_6_get_char_value, iso8859_6_get_char_value,
iso8859_6_get_shaped_char_value, iso8859_6_get_shaped_char_value,
+2 -33
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~2023, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2018, 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
@@ -210,8 +210,6 @@ static unsigned int unicode_char_type (Achar32 chv)
mchar_type = ACHAR_BASIC_LF; mchar_type = ACHAR_BASIC_LF;
else if (break_type == UCHAR_BREAK_SPACE) else if (break_type == UCHAR_BREAK_SPACE)
mchar_type = ACHAR_BASIC_SPACE; mchar_type = ACHAR_BASIC_SPACE;
else if (basic_type == UCHAR_CATEGORY_NON_SPACING_MARK)
mchar_type = ACHAR_BASIC_VOWEL;
else if (chv != 0x00AD && ISZEROWIDTHTYPE (basic_type)) else if (chv != 0x00AD && ISZEROWIDTHTYPE (basic_type))
mchar_type = ACHAR_BASIC_ZEROWIDTH; mchar_type = ACHAR_BASIC_ZEROWIDTH;
else if ((chv >= 0x1160 && chv < 0x1200) else if ((chv >= 0x1160 && chv < 0x1200)
@@ -241,36 +239,10 @@ static const BidiType linear_enum_to_bidi_type[] = {
#undef _UNIBIDI_ADD_TYPE #undef _UNIBIDI_ADD_TYPE
}; };
/* Since 5.0.13: this function only returns BidiType which
is recognizable by the legacy BIDI algorithm. */
static BidiType unicode_bidi_char_type(Achar32 ch) static BidiType unicode_bidi_char_type(Achar32 ch)
{ {
ch = REAL_ACHAR(ch); ch = REAL_ACHAR(ch);
BidiType bt = linear_enum_to_bidi_type[UNIBIDI_GET_BIDI_TYPE(ch)]; return linear_enum_to_bidi_type[UNIBIDI_GET_BIDI_TYPE(ch)];
switch (bt) {
case BIDI_TYPE_LTR:
case BIDI_TYPE_RTL:
case BIDI_TYPE_AL:
case BIDI_TYPE_EN:
case BIDI_TYPE_AN:
case BIDI_TYPE_ET:
case BIDI_TYPE_CS:
case BIDI_TYPE_NSM:
case BIDI_TYPE_BN:
case BIDI_TYPE_BS:
case BIDI_TYPE_SS:
case BIDI_TYPE_WS:
case BIDI_TYPE_ON:
case BIDI_TYPE_SOT:
case BIDI_TYPE_EOT:
return bt;
default:
_DBG_PRINTF("Not recognizable for char (0x%04x): %u\n", ch, bt);
break;
}
return BIDI_TYPE_WS;
} }
BidiType GUIAPI UCharGetBidiType(Uchar32 uc) BidiType GUIAPI UCharGetBidiType(Uchar32 uc)
@@ -656,7 +628,6 @@ CHARSETOPS __mg_CharsetOps_utf8 = {
6, 6,
FONT_CHARSET_UTF8, FONT_CHARSET_UTF8,
0, 0,
0,
utf8_len_first_char, utf8_len_first_char,
utf8_get_char_value, utf8_get_char_value,
NULL, NULL,
@@ -883,7 +854,6 @@ CHARSETOPS __mg_CharsetOps_utf16le = {
4, 4,
FONT_CHARSET_UTF16LE, FONT_CHARSET_UTF16LE,
0, 0,
0,
utf16le_len_first_char, utf16le_len_first_char,
utf16le_get_char_value, utf16le_get_char_value,
NULL, NULL,
@@ -1110,7 +1080,6 @@ CHARSETOPS __mg_CharsetOps_utf16be = {
4, 4,
FONT_CHARSET_UTF16BE, FONT_CHARSET_UTF16BE,
0, 0,
0,
utf16be_len_first_char, utf16be_len_first_char,
utf16be_get_char_value, utf16be_get_char_value,
NULL, NULL,
+7 -30
View File
File diff suppressed because it is too large Load Diff
+13 -11
View File
@@ -1012,9 +1012,8 @@ void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
{ {
char font_name [LEN_UNIDEVFONT_NAME + 1]; char font_name [LEN_UNIDEVFONT_NAME + 1];
//memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1); memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
//strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME); strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
strcpy(font_name, (*devfont)->name);
font_DelDevFont (font_name); font_DelDevFont (font_name);
*devfont = NULL; *devfont = NULL;
@@ -1070,22 +1069,25 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
added_num ++; added_num ++;
} }
else { else {
/* [DK] Fix Bug #4801, which introduce an absolute path check error in Windows, /* [DK] Fix Bug #4801, which introduce a absolute path check error in Windows,
* first to load from sytem res path, else load it directly (relative or absolute path).*/ * first to load from sytem res path, else load it directly(relative or absolute path).*/
if (add_dev_font (font_name, font_file, TRUE)) if ((add_dev_font (font_name, font_file, TRUE)) == TRUE)
added_num++; added_num++;
else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1, else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1,
__sysres_get_system_res_path(), font_file)) && __sysres_get_system_res_path(), font_file))
add_dev_font (font_name, font_path, TRUE)) && ((add_dev_font (font_name, font_path, TRUE)) == TRUE))
added_num++; added_num++;
} }
} }
if (is_unload || added_num > 0 || added_num == font_num) { if (is_unload || added_num > 0 || added_num == font_num)
{
return TRUE; return TRUE;
} }
else
return FALSE; {
return FALSE;
}
} }
BOOL font_InitSpecificalFonts (char* etc_section) BOOL font_InitSpecificalFonts (char* etc_section)
-12
View File
@@ -255,17 +255,6 @@ compute_kernval (TTFINSTANCEINFO* ttf_inst_info)
return kernval; return kernval;
} }
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
if (logfont->style & FS_WEIGHT_BOOK) if (logfont->style & FS_WEIGHT_BOOK)
@@ -803,7 +792,6 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
} }
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_ttf_ops = { FONTOPS __mg_ttf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+1 -13
View File
@@ -197,17 +197,6 @@ print_bitmap_grey (const BYTE* buffer, int width, int rows, int pitch)
printf("*******************************************\n"); printf("*******************************************\n");
} }
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 1;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
switch (logfont->style & FS_RENDER_MASK) { switch (logfont->style & FS_RENDER_MASK) {
@@ -746,9 +735,9 @@ get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
pcache->valid_advance = 1; pcache->valid_advance = 1;
} }
} }
done:
#endif #endif
done:
FT_UNLOCK(&ft_lock); FT_UNLOCK(&ft_lock);
if (px) { if (px) {
@@ -1276,7 +1265,6 @@ void font_TermFreetypeLibrary (void)
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_ttf_ops = { FONTOPS __mg_ttf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+3 -2
View File
@@ -88,6 +88,7 @@ typedef int (* MakeHashKeyFunc)(Glyph32 gv);
typedef struct tagFTFACEINFO { typedef struct tagFTFACEINFO {
char* filepathname; char* filepathname;
FT_Face face; FT_Face face;
BOOL valid;
#ifdef _MGFONT_TTF_CACHE #ifdef _MGFONT_TTF_CACHE
int face_index; int face_index;
int cmap_index; int cmap_index;
@@ -162,13 +163,13 @@ extern void __mg_ttc_sys_deinit(void);
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size); extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
extern void __mg_ttc_refer(HCACHE hCache); extern void __mg_ttc_refer(HCACHE hCache);
#endif /* _MGFONT_TTF_CACHE */
#ifdef _MGCOMPLEX_SCRIPTS #ifdef _MGCOMPLEX_SCRIPTS
extern void __mg_init_harzbuff_funcs(void); extern void __mg_init_harzbuff_funcs(void);
extern void __mg_term_harzbuff_funcs(void); extern void __mg_term_harzbuff_funcs(void);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
+31 -26
View File
@@ -120,42 +120,47 @@ hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
return UCharDecompose(ab, a, b); return UCharDecompose(ab, a, b);
} }
/* extern hb_unicode_funcs_t *__mg_hb_unifuncs */ static hb_unicode_funcs_t *_funcs;
hb_unicode_funcs_t *__mg_hb_unifuncs; static hb_unicode_funcs_t *get_unicode_funcs(void)
{
if (_funcs)
return _funcs;
_funcs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (_funcs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (_funcs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (_funcs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (_funcs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (_funcs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (_funcs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (_funcs);
return _funcs;
}
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
void __mg_init_harzbuff_funcs(void) void __mg_init_harzbuff_funcs(void)
{ {
_DBG_PRINTF("%s: called\n", __FUNCTION__); _DBG_PRINTF("%s: called\n", __FUNCTION__);
__hb_extern_get_unicode_funcs = get_unicode_funcs;
if (__mg_hb_unifuncs)
return;
__mg_hb_unifuncs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (__mg_hb_unifuncs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (__mg_hb_unifuncs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (__mg_hb_unifuncs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (__mg_hb_unifuncs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (__mg_hb_unifuncs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (__mg_hb_unifuncs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (__mg_hb_unifuncs);
return;
} }
void __mg_term_harzbuff_funcs(void) void __mg_term_harzbuff_funcs(void)
{ {
_DBG_PRINTF("%s: called\n", __FUNCTION__); _DBG_PRINTF("%s: called\n", __FUNCTION__);
if (__mg_hb_unifuncs) { if (_funcs) {
hb_unicode_funcs_destroy(__mg_hb_unifuncs); hb_unicode_funcs_destroy(_funcs);
} }
else { else {
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n", _ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
+9 -15
View File
@@ -703,20 +703,21 @@ void __mg_legacy_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
print_hexstr(achars, len, TRUE); print_hexstr(achars, len, TRUE);
} }
#if 0
static void bidi_map_reverse (void* context, int len, int pos) static void bidi_map_reverse (void* context, int len, int pos)
{ {
ACHARMAPINFO* str = (ACHARMAPINFO*)context + pos; GLYPHMAPINFO* str = (GLYPHMAPINFO*)context + pos;
int i; int i;
for (i = 0; i < len / 2; i++) for (i = 0; i < len / 2; i++)
{ {
ACHARMAPINFO tmp = str[i]; GLYPHMAPINFO tmp = str[i];
str[i] = str[len - 1 - i]; str[i] = str[len - 1 - i];
str[len - 1 - i] = tmp; str[len - 1 - i] = tmp;
} }
} }
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops, Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel, ACHARMAPINFO* map) Achar32* achars, int len, GLYPHMAPINFO* map, int pel)
{ {
BYTE max_level = 1; BYTE max_level = 1;
TYPERUN *type_rl_list = NULL; TYPERUN *type_rl_list = NULL;
@@ -724,7 +725,6 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
int i; int i;
int run_pos; int run_pos;
int run_len; int run_len;
REORDER_CONTEXT rc;
print_hexstr(achars, len, FALSE); print_hexstr(achars, len, FALSE);
@@ -735,15 +735,14 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
run_pos = node_p->pos; run_pos = node_p->pos;
run_len = node_p->len; run_len = node_p->len;
for (i=0; i<run_len; i++) { for (i=0; i<run_len; i++)
{
(map+run_pos+i)->is_rtol = (node_p)->level & 1; (map+run_pos+i)->is_rtol = (node_p)->level & 1;
} }
} }
rc.achars = NULL; bidi_reorder_cb(map, len, &type_rl_list, max_level,
rc.extra = map; bidi_map_reverse);
rc.cb = bidi_map_reverse;
bidi_reorder(&rc, len, &type_rl_list, max_level);
/* free typerun list.*/ /* free typerun list.*/
free_typerun_list(type_rl_list); free_typerun_list(type_rl_list);
@@ -753,23 +752,18 @@ Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
return achars; return achars;
} }
#if 0
Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops, Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int* index_map, int pel) Achar32* achars, int len, int* index_map, int pel)
{ {
BYTE max_level = 1; BYTE max_level = 1;
TYPERUN *type_rl_list = NULL; TYPERUN *type_rl_list = NULL;
REORDER_CONTEXT rc;
print_hexstr(achars, len, FALSE); print_hexstr(achars, len, FALSE);
/* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */ /* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list, &max_level); bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list, &max_level);
rc.achars = achars; bidi_reorder_cb(index_map, len, &type_rl_list, max_level,
rc.extra = extra;
rc.cb = cb_reverse_extra;
bidi_reorder(index_map, len, &type_rl_list, max_level,
bidi_string_reverse); bidi_string_reverse);
/* free typerun list.*/ /* free typerun list.*/
-12
View File
@@ -66,17 +66,6 @@
#define NUF_WIDTH 8 #define NUF_WIDTH 8
#define NUF_HEIGHT 1 #define NUF_HEIGHT 1
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
return DEVFONTGLYPHTYPE_MONOBMP; return DEVFONTGLYPHTYPE_MONOBMP;
@@ -182,7 +171,6 @@ static void unload_font_data (DEVFONT* devfont, void* data)
} }
FONTOPS __mg_null_font_ops = { FONTOPS __mg_null_font_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
-12
View File
@@ -287,17 +287,6 @@ static unsigned char def_smooth_bitmap [] =
static QPF_GLYPH def_glyph = {&def_metrics, def_bitmap}; static QPF_GLYPH def_glyph = {&def_metrics, def_bitmap};
static QPF_GLYPH def_smooth_glyph = {&def_smooth_metrics, def_smooth_bitmap}; static QPF_GLYPH def_smooth_glyph = {&def_smooth_metrics, def_smooth_bitmap};
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH) if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH)
@@ -552,7 +541,6 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_qpf_ops = { FONTOPS __mg_qpf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
-12
View File
@@ -151,17 +151,6 @@ static void unload_font_data (DEVFONT* devfont, void* data)
/*************** Raw bitmap font operations *********************************/ /*************** Raw bitmap font operations *********************************/
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
return DEVFONTGLYPHTYPE_MONOBMP; return DEVFONTGLYPHTYPE_MONOBMP;
@@ -291,7 +280,6 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/ /**************************** Global data ************************************/
FONTOPS __mg_rbf_ops = { FONTOPS __mg_rbf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_ave_width, // max_width same as ave_width get_ave_width, // max_width same as ave_width
-12
View File
@@ -377,17 +377,6 @@ static int get_max_width (LOGFONT* logfont, DEVFONT* devfont)
return logfont->size; return logfont->size;
} }
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
if (logfont->style & FS_WEIGHT_BOOK) if (logfont->style & FS_WEIGHT_BOOK)
@@ -609,7 +598,6 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/ /**************************** Global data ************************************/
static FONTOPS scripteasy_font_ops = { static FONTOPS scripteasy_font_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+1 -4
View File
@@ -155,10 +155,7 @@ BOOL mg_InitSysFont (void)
goto error_load; goto error_load;
} }
/* VW 20221003: use CreateLogFontEx instead of CreateLogFont to if ((sys_fonts[i] = CreateLogFont (type, family, charset,
follow the new style convention of font name,
but the orientation is ignored for the system logfont. */
if ((sys_fonts[i] = CreateLogFontEx (type, family, charset,
style [0], style [1], style [2], style [0], style [1], style [2],
style [3], style [4], style [5], style [3], style [4], style [5],
height, 0)) == NULL) { height, 0)) == NULL) {
+3 -2
View File
@@ -377,8 +377,8 @@ static _GBType resolve_gbt(struct break_ctxt* ctxt,
uc == 0x8E2 || uc == 0xD4E || uc == 0x110BD || uc == 0x8E2 || uc == 0xD4E || uc == 0x110BD ||
(uc >= 0x111C2 && uc <= 0x111C3)) { (uc >= 0x111C2 && uc <= 0x111C3)) {
gbt = GB_Prepend; gbt = GB_Prepend;
break;
} }
break;
case UCHAR_CATEGORY_CONTROL: case UCHAR_CATEGORY_CONTROL:
case UCHAR_CATEGORY_LINE_SEPARATOR: case UCHAR_CATEGORY_LINE_SEPARATOR:
@@ -393,8 +393,8 @@ static _GBType resolve_gbt(struct break_ctxt* ctxt,
if ((uc >= 0xFFF0 && uc <= 0xFFF8) || if ((uc >= 0xFFF0 && uc <= 0xFFF8) ||
(uc >= 0xE0000 && uc <= 0xE0FFF)) { (uc >= 0xE0000 && uc <= 0xE0FFF)) {
gbt = GB_ControlCRLF; gbt = GB_ControlCRLF;
break;
} }
break;
case UCHAR_CATEGORY_OTHER_LETTER: case UCHAR_CATEGORY_OTHER_LETTER:
if (ctxt->makes_hangul_syllable) if (ctxt->makes_hangul_syllable)
@@ -434,6 +434,7 @@ static _GBType resolve_gbt(struct break_ctxt* ctxt,
gbt = GB_RI_Odd; gbt = GB_RI_Odd;
else else
gbt = GB_RI_Odd; gbt = GB_RI_Odd;
break;
} }
break; break;
-12
View File
@@ -148,17 +148,6 @@ static void unload_font_data (DEVFONT* devfont, void* data)
free (((UPFINFO*) data)); free (((UPFINFO*) data));
} }
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
Uint8* p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir; Uint8* p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir;
@@ -536,7 +525,6 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
} }
FONTOPS __mg_upf_ops = { FONTOPS __mg_upf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
-12
View File
@@ -109,17 +109,6 @@ typedef struct _FONT_PROPT {
int def_glyph; int def_glyph;
} FONT_PROPT; } FONT_PROPT;
static DWORD get_feature (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature)
{
switch (feature) {
case DEVFONT_FEATURE_MARK_BBOX:
return 0;
}
return 0;
}
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont) static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{ {
return DEVFONTGLYPHTYPE_MONOBMP; return DEVFONTGLYPHTYPE_MONOBMP;
@@ -488,7 +477,6 @@ static void unload_font_data (DEVFONT* devfont, void* data)
} }
FONTOPS __mg_vbf_ops = { FONTOPS __mg_vbf_ops = {
get_feature,
get_glyph_bmptype, get_glyph_bmptype,
get_ave_width, get_ave_width,
get_max_width, get_max_width,
+1
View File
@@ -59,6 +59,7 @@
#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;
+18 -59
View File
@@ -59,22 +59,17 @@
#include "cliprect.h" #include "cliprect.h"
#include "gal.h" #include "gal.h"
#include "internals.h" #include "internals.h"
#include "dc.h"
BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight) BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
{ {
PMAINWIN pWin; PMAINWIN pWin;
pWin = (PMAINWIN)hWnd; pWin = (PMAINWIN)hWnd;
if (!pWin->pCaretInfo) { if (!pWin->pCaretInfo) {
HDC hdc;
if (!(pWin->pCaretInfo = malloc (sizeof (CARETINFO)))) if (!(pWin->pCaretInfo = malloc (sizeof (CARETINFO))))
return FALSE; return FALSE;
/* Since 5.0.11: use client DC of the window instead of screen DC */
hdc = GetClientDC(hWnd);
pWin->pCaretInfo->pBitmap = pBitmap; pWin->pCaretInfo->pBitmap = pBitmap;
if (pBitmap) { if (pBitmap) {
nWidth = pBitmap->bmWidth; nWidth = pBitmap->bmWidth;
@@ -83,22 +78,18 @@ BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
pWin->pCaretInfo->nWidth = nWidth; pWin->pCaretInfo->nWidth = nWidth;
pWin->pCaretInfo->nHeight = nHeight; pWin->pCaretInfo->nHeight = nHeight;
pWin->pCaretInfo->caret_bmp.bmType = BMP_TYPE_NORMAL; pWin->pCaretInfo->caret_bmp.bmType = BMP_TYPE_NORMAL;
pWin->pCaretInfo->caret_bmp.bmBitsPerPixel = pWin->pCaretInfo->caret_bmp.bmBitsPerPixel = BITSPERPHYPIXEL;
GetGDCapability(hdc, GDCAP_BITSPP); pWin->pCaretInfo->caret_bmp.bmBytesPerPixel = BYTESPERPHYPIXEL;
pWin->pCaretInfo->caret_bmp.bmBytesPerPixel =
GetGDCapability(hdc, GDCAP_BPP);
pWin->pCaretInfo->caret_bmp.bmWidth = nWidth; pWin->pCaretInfo->caret_bmp.bmWidth = nWidth;
pWin->pCaretInfo->caret_bmp.bmHeight = nHeight; pWin->pCaretInfo->caret_bmp.bmHeight = nHeight;
pWin->pCaretInfo->caret_bmp.bmAlphaMask = NULL; pWin->pCaretInfo->caret_bmp.bmAlphaMask = NULL;
pWin->pCaretInfo->caret_bmp.bmAlphaPitch = 0; pWin->pCaretInfo->caret_bmp.bmAlphaPitch = 0;
pWin->pCaretInfo->nBytesNr = GAL_GetBoxSize (dc_HDC2PDC(hdc)->surface, pWin->pCaretInfo->nBytesNr = GAL_GetBoxSize (__gal_screen,
nWidth, nHeight, &pWin->pCaretInfo->caret_bmp.bmPitch); nWidth, nHeight, &pWin->pCaretInfo->caret_bmp.bmPitch);
pWin->pCaretInfo->pNormal = malloc (pWin->pCaretInfo->nBytesNr); pWin->pCaretInfo->pNormal = malloc (pWin->pCaretInfo->nBytesNr);
pWin->pCaretInfo->pXored = malloc (pWin->pCaretInfo->nBytesNr); pWin->pCaretInfo->pXored = malloc (pWin->pCaretInfo->nBytesNr);
ReleaseDC(hdc);
if (pWin->pCaretInfo->pNormal == NULL || if (pWin->pCaretInfo->pNormal == NULL ||
pWin->pCaretInfo->pXored == NULL) { pWin->pCaretInfo->pXored == NULL) {
free (pWin->pCaretInfo); free (pWin->pCaretInfo);
@@ -228,8 +219,8 @@ void GetCaretBitmaps (PCARETINFO pCaretInfo)
int i; int i;
int sx, sy; int sx, sy;
HDC hdc; HDC hdc;
Uint32 amask;
// convert to screen coordinates
sx = pCaretInfo->x; sx = pCaretInfo->x;
sy = pCaretInfo->y; sy = pCaretInfo->y;
@@ -240,68 +231,36 @@ void GetCaretBitmaps (PCARETINFO pCaretInfo)
pCaretInfo->caret_bmp.bmWidth, pCaretInfo->caret_bmp.bmWidth,
pCaretInfo->caret_bmp.bmHeight, pCaretInfo->caret_bmp.bmHeight,
&pCaretInfo->caret_bmp); &pCaretInfo->caret_bmp);
amask = GetGDCapability(hdc, GDCAP_AMASK);
ReleaseDC (hdc); ReleaseDC (hdc);
// generate XOR bitmap. // generate XOR bitmap.
if (amask == 0) { if (pCaretInfo->pBitmap) {
BYTE* normal; BYTE* normal;
BYTE* bitmap; BYTE* bitmap;
BYTE* xored; BYTE* xored;
normal = pCaretInfo->pNormal; normal = pCaretInfo->pNormal;
bitmap = pCaretInfo->pBitmap->bmBits;
xored = pCaretInfo->pXored; xored = pCaretInfo->pXored;
if (pCaretInfo->pBitmap) { for (i = 0; i < pCaretInfo->nBytesNr; i++)
bitmap = pCaretInfo->pBitmap->bmBits; xored[i] = normal[i] ^ bitmap[i];
for (i = 0; i < pCaretInfo->nBytesNr; i++)
xored[i] = normal[i] ^ bitmap[i];
}
else {
for (i = 0; i < pCaretInfo->nBytesNr; i++)
xored[i] = normal[i] ^ 0xFF;
}
} }
else { else {
// Since 5.0.11: restore the alpha component if having alpha component.
int x, y;
BYTE* normal; BYTE* normal;
BYTE* xored; BYTE* xored;
BYTE* bitmap = NULL; BYTE xor_byte;
gal_pixel pix_normal, pix_bitmap, pix_xored, bits_alpha;
for (y = 0; y < pCaretInfo->caret_bmp.bmHeight; y++) { if (BITSPERPHYPIXEL < 8)
normal = pCaretInfo->pNormal + pCaretInfo->caret_bmp.bmPitch * y; xor_byte = 0x0F;
xored = pCaretInfo->pXored + pCaretInfo->caret_bmp.bmPitch * y; else
if (pCaretInfo->pBitmap) xor_byte = 0xFF;
bitmap = pCaretInfo->pBitmap->bmBits +
pCaretInfo->caret_bmp.bmPitch * y;
for (x = 0; x < pCaretInfo->caret_bmp.bmWidth; x++) { normal = pCaretInfo->pNormal;
xored = pCaretInfo->pXored;
pix_normal = _mem_get_pixel(normal, for (i = 0; i < pCaretInfo->nBytesNr; i++)
pCaretInfo->caret_bmp.bmBytesPerPixel); xored[i] = normal[i] ^ xor_byte;
if (pCaretInfo->pBitmap) {
pix_bitmap = _mem_get_pixel(bitmap,
pCaretInfo->caret_bmp.bmBytesPerPixel);
}
else {
pix_bitmap = 0xFFFFFFFF;
}
bits_alpha = pix_normal & amask;
pix_xored = pix_normal ^ pix_bitmap;
pix_xored &= ~amask;
pix_xored |= bits_alpha;
_mem_set_pixel(xored,
pCaretInfo->caret_bmp.bmBytesPerPixel, pix_xored);
normal += pCaretInfo->caret_bmp.bmBytesPerPixel;
xored += pCaretInfo->caret_bmp.bmBytesPerPixel;
if (pCaretInfo->pBitmap)
bitmap += pCaretInfo->caret_bmp.bmBytesPerPixel;
}
}
} }
} }
+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~2022, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2018, 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[0] == '\0') if (!rdr || !rdr->name || 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,6 +71,7 @@
#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
+57 -108
View File
File diff suppressed because it is too large Load Diff
+1 -3
View File
@@ -50,7 +50,6 @@ DFB_SRCS = dfb.h dfb.c
USVFB_SRCS = usvfbinput.c usvfbinput.h USVFB_SRCS = usvfbinput.c usvfbinput.h
LIBINPUT_SRCS = linux-libinput.c linux-libinput.h LIBINPUT_SRCS = linux-libinput.c linux-libinput.h
SINGLETOUCHKEY_SRCS = singletouchkey.c singletouchkey.h
if MGIAL_CONSOLE if MGIAL_CONSOLE
native_libial_la_LIBADD = native/libnative.la native_libial_la_LIBADD = native/libnative.la
@@ -77,5 +76,4 @@ libial_la_SOURCES = $(COMMON_SRCS) $(DUMMY_SRCS) $(JZ4740_SRCS) \
$(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \ $(COMMINPUT_SRCS) $(QVFB_SRCS) $(WVFB_SRCS) \
$(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \ $(QEMU_SRCS) $(IPAQ_H3600_SRCS) $(IPAQ_H5400_SRCS) \
$(TSLIB_SRCS) $(SHANDONG_LIDE_SRCS) $(CISCO_TOUCHPAD_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)
+1 -7
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~2018, 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
@@ -133,9 +133,6 @@
#ifdef _MGIAL_LIBINPUT #ifdef _MGIAL_LIBINPUT
#include "linux-libinput.h" #include "linux-libinput.h"
#endif #endif
#ifdef _MGIAL_SINGLETOUCHKEY
#include "singletouchkey.h"
#endif
static INPUT inputs [] = static INPUT inputs [] =
{ {
@@ -215,9 +212,6 @@ static INPUT inputs [] =
#ifdef _MGIAL_LIBINPUT #ifdef _MGIAL_LIBINPUT
{"libinput", ial_InitLibInput, TermLibInput}, {"libinput", ial_InitLibInput, TermLibInput},
#endif #endif
#ifdef _MGIAL_SINGLETOUCHKEY
{"singletouchkey", ial_InitSingleTouchKey, TermSingleTouchKey},
#endif
/* ... end of general IAL engines */ /* ... end of general IAL engines */
}; };
+3 -1
View File
@@ -1243,9 +1243,11 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
break; break;
} }
#if 0
default: default:
_WRN_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type); _DBG_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
break; break;
#endif
} }
libinput_event_destroy(event); libinput_event_destroy(event);
+1
View File
@@ -65,6 +65,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <linux/vt.h> #include <linux/vt.h>
#include <linux/kd.h> #include <linux/kd.h>
#include <linux/keyboard.h>
#include "gdi.h" #include "gdi.h"
#include "window.h" #include "window.h"
+6 -12
View File
@@ -67,6 +67,8 @@
#include "gal.h" #include "gal.h"
#include "native.h" #include "native.h"
static const char* event_dev;
static int EVENT_Open(const char *); static int EVENT_Open(const char *);
static void EVENT_Close(void); static void EVENT_Close(void);
static void EVENT_GetModifierInfo(int *modifiers); static void EVENT_GetModifierInfo(int *modifiers);
@@ -83,7 +85,6 @@ KBDDEVICE kbddev_event = {
EVENT_Resume EVENT_Resume
}; };
static char* kbd_dev;
static int kbd_fd; /* file descriptor for keyboard */ static int kbd_fd; /* file descriptor for keyboard */
/* /*
@@ -143,7 +144,6 @@ static int EVENT_Open (const char *device)
if (kbd_fd < 0) if (kbd_fd < 0)
return -1; return -1;
kbd_dev = strdup (device);
return kbd_fd; return kbd_fd;
} }
@@ -153,11 +153,8 @@ static int EVENT_Open (const char *device)
*/ */
static void EVENT_Close(void) static void EVENT_Close(void)
{ {
close (kbd_fd); close(kbd_fd);
kbd_fd = -1; kbd_fd = -1;
free (kbd_dev);
kbd_dev = NULL;
} }
/* /*
@@ -206,8 +203,7 @@ static int EVENT_Read(unsigned char *buf, int *modifiers)
*/ */
static void EVENT_Suspend(void) static void EVENT_Suspend(void)
{ {
close (kbd_fd); EVENT_Close();
kbd_fd = -1;
} }
/* deactivate_keyboard: /* deactivate_keyboard:
@@ -215,12 +211,10 @@ static void EVENT_Suspend(void)
*/ */
static int EVENT_Resume(void) static int EVENT_Resume(void)
{ {
kbd_fd = open (kbd_dev, O_NONBLOCK); kbd_fd = open (event_dev, O_NONBLOCK);
if (kbd_fd < 0) { if (kbd_fd < 0) {
return -1; return -1;
} }else{
else {
return kbd_fd; return kbd_fd;
} }
} }
+1
View File
@@ -56,6 +56,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <signal.h> #include <signal.h>
#include <linux/kd.h> #include <linux/kd.h>
#include <linux/keyboard.h>
#include <errno.h> #include <errno.h>
#include "common.h" #include "common.h"
-14
View File
@@ -319,19 +319,6 @@ 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)
{ {
@@ -757,7 +744,6 @@ void TermPCXVFBInput (void)
remove("/tmp/.pcxvfb_tmp"); remove("/tmp/.pcxvfb_tmp");
} }
#endif #endif
close_rec();
#endif /* WIN32 */ #endif /* WIN32 */
} }
File diff suppressed because it is too large Load Diff
-68
View File
@@ -1,68 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.cn/exception-list
//
//////////////////////////////////////////////////////////////////////////////
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
*/
/*
** linux-libinput.h: the head file of the IAL engine based on libinput.
**
** Created by Wei YongMing, 2019/06/10
*/
#ifndef GUI_IAL_SINGLETOUCHKEY_H
#define GUI_IAL_SINGLETOUCHKEY_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
BOOL ial_InitSingleTouchKey (INPUT* input, const char* mdev, const char* mtype);
void TermSingleTouchKey (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GUI_IAL_SINGLETOUCHKEY_H */
+2 -2
View File
@@ -3,8 +3,8 @@ 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 rbtree.h \ readbmp.h icon.h blockheap.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 \
linux-tty.h debug.h map.h linux-tty.h debug.h
+3 -3
View File
@@ -112,11 +112,11 @@ void __mg_legacy_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
Uint32 __mg_legacy_bidi_str_base_dir (const CHARSETOPS* charset_ops, Uint32 __mg_legacy_bidi_str_base_dir (const CHARSETOPS* charset_ops,
Achar32* achars, int len); Achar32* achars, int len);
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel, ACHARMAPINFO* map);
#if 0 #if 0
// Deprecated // Deprecated
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, GLYPHMAPINFO* map, int pel);
Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops, Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int* index_map, int pel); Achar32* achars, int len, int* index_map, int pel);
#endif #endif
+1
View File
@@ -70,6 +70,7 @@ struct _SCALER_INFO_FILLBMP
typedef struct { typedef struct {
struct _SCALER_INFO_FILLBMP scaler_info; struct _SCALER_INFO_FILLBMP scaler_info;
GAL_Rect dst_rect; GAL_Rect dst_rect;
int old_bkmode;
BYTE* decoded_buff; BYTE* decoded_buff;
BYTE* decoded_alpha_buff; BYTE* decoded_alpha_buff;
@@ -47,35 +47,26 @@
** 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
#define GUI_BLOCKHEAP_H #define GUI_BLOCKHEAP_H
#define BDS_FREE 0x0000
#define BDS_SPECIAL 0x0001
#define BDS_USED 0x0002
#ifndef _MGUI_GDI_H /* included in include/gdi.h */ #ifndef _MGUI_GDI_H /* included in include/gdi.h */
struct _BLOCKHEAP { typedef struct tagBLOCKHEAP {
#ifdef _MGHAVE_VIRTUAL_WINDOW #ifdef _MGRM_THREADS
pthread_mutex_t lock; pthread_mutex_t lock;
#endif #endif
/* Size of one block element. */ size_t bd_size;
size_t sz_block; size_t heap_size;
/* Size of the heap in blocks. */ int free;
size_t sz_heap; void* heap;
/* The first free element in the heap. */ } BLOCKHEAP;
size_t sz_usage_bmp;
/* The number of blocks extra allocated. */
size_t nr_alloc;
/* Pointer to the pre-allocated heap. */
unsigned char* heap;
/* Pointer to the usage bitmap. */
unsigned char* usage_bmp;
};
typedef struct _BLOCKHEAP BLOCKHEAP;
typedef BLOCKHEAP* PBLOCKHEAP; typedef BLOCKHEAP* PBLOCKHEAP;
#ifdef __cplusplus #ifdef __cplusplus
+1 -4
View File
@@ -164,8 +164,7 @@ typedef struct JoinLayerInfo {
typedef struct JoinedClientInfo { typedef struct JoinedClientInfo {
GHANDLE layer; GHANDLE layer;
int cli_id; int cli_id;
int def_zi_shmid; int zo_shmid;
int zi_shmid;
} JOINEDCLIENTINFO; } JOINEDCLIENTINFO;
typedef struct LayerInfo { typedef struct LayerInfo {
@@ -223,8 +222,6 @@ typedef struct _MovedClientInfo {
#define ID_ZOOP_MASKRECT_SET 17 #define ID_ZOOP_MASKRECT_SET 17
#define ID_ZOOP_MASKRECT_FREE 18 #define ID_ZOOP_MASKRECT_FREE 18
#define ID_ZOOP_SETGESTUREFLAGS 19 /* since 5.0.6 */
#ifndef MAX_CAPTION_LEN #ifndef MAX_CAPTION_LEN
#define MAX_CAPTION_LEN 39 //40 #define MAX_CAPTION_LEN 39 //40
#endif #endif
+22 -15
View File
@@ -71,24 +71,19 @@
#define NR_DIRTY_RECTS 16 #define NR_DIRTY_RECTS 16
/* constants for layers and z-order nodes */ /* constants for layers and z-order nodes */
#define MAX_NR_LAYERS 16 #define MAX_NR_LAYERS 8
/* Since 5.0.0: the number of the fixed znodes - DONOT adjust */ /* Since 5.0.0: the number of the fixed znodes - DONOT adjust */
#define NR_FIXED_ZNODES 1 #define NR_FIXED_ZNODES 1
/* the numbers of znodes in different levels - should be mulitples of 8 */ /* the numbers of znodes in different levels - should be mulitples of 8 */
#define DEF_NR_POPUPMENUS 16 #define DEF_NR_POPUPMENUS 16
#define DEF_NR_TOOLTIPS 16 #define DEF_NR_TOOLTIPS 8
#define DEF_NR_GLOBALS 15 // reserve one slot for fixed znode #define DEF_NR_GLOBALS 15 // reserve slots for fixed znodes
#define DEF_NR_SCREENLOCKS 8 #define DEF_NR_SCREENLOCKS 8
#define DEF_NR_DOCKERS 8 #define DEF_NR_DOCKERS 8
#ifdef _MGRM_PROCESSES // per layer basis #define DEF_NR_TOPMOSTS 16
# define DEF_NR_TOPMOSTS 8 #define DEF_NR_NORMALS 128
# define DEF_NR_NORMALS 32
#else
# define DEF_NR_TOPMOSTS 16
# define DEF_NR_NORMALS 128
#endif
#define DEF_NR_LAUNCHERS 8 #define DEF_NR_LAUNCHERS 8
/* Since 5.0.0: the number of the zorder levels - DONOT adjust */ /* Since 5.0.0: the number of the zorder levels - DONOT adjust */
@@ -107,10 +102,10 @@ enum {
#define ZNIDX_DESKTOP 0 #define ZNIDX_DESKTOP 0
/* The heap size for mask rectangles */ /* The heap size for mask rectangles */
#define DEF_NR_MASKRECTS 1024 #define DEF_NR_MASKRECT 1024
#if IS_COMPOSITING_SCHEMA #if IS_COMPOSITING_SCHEMA
/* max number of shared surfaces (512) */ /* max number of shared surfaces */
# define MAX_NR_SHARED_SURF (DEF_NR_NORMALS * (MAX_NR_LAYERS >> 1)) # define MAX_NR_SHARED_SURF (DEF_NR_NORMALS * (MAX_NR_LAYERS >> 1))
#endif #endif
@@ -155,9 +150,21 @@ enum {
#endif #endif
/* constants for fix string module */ /* constants for fix string module */
#define MAX_LEN_FIXSTR 64 #if defined (__NOUNIX__) || defined (__uClinux__)
#define NR_HEAP 5 #define MAX_LEN_FIXSTR 64
#define LEN_BITMAP (1+2+4+8+16) #define NR_HEAP 5
#define LEN_BITMAP (1+2+4+8+16)
#else
#ifdef _MGRM_THREADS
#define MAX_LEN_FIXSTR 2048
#define NR_HEAP 10
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256+512)
#else
#define MAX_LEN_FIXSTR 1024
#define NR_HEAP 9
#define LEN_BITMAP (1+2+4+8+16+32+64+128+256)
#endif
#endif
/* constants for engine name and video mode */ /* constants for engine name and video mode */
#define LEN_SO_NAME 127 // name length of a shared object (library) #define LEN_SO_NAME 127 // name length of a shared object (library)
+2 -9
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) if (dc_IsGeneralDC(pdc)) __mg_lock_recalc_gcrinfo (pdc) #define LOCK_GCRINFO(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 */
@@ -167,8 +167,6 @@ struct tagDC
/* surface of this DC */ /* surface of this DC */
GAL_Surface* surface; GAL_Surface* surface;
char __first_attr[0]; // just a zero-length field for the first attribute
/* background color */ /* background color */
gal_pixel bkcolor; gal_pixel bkcolor;
@@ -181,7 +179,7 @@ struct tagDC
/* text color */ /* text color */
gal_pixel textcolor; gal_pixel textcolor;
int bkmode_set; /* the background mode set by user (5.0.12, Issue #107) */ int bkmode;
int tabstop; int tabstop;
int cExtra; /* Character extra */ int cExtra; /* Character extra */
@@ -215,8 +213,6 @@ struct tagDC
size_t dash_list_len; size_t dash_list_len;
#endif #endif
char __last_attr[0]; // just a zero-length field for the last attribute
PLOGFONT pLogFont; PLOGFONT pLogFont;
POINT CurPenPos; POINT CurPenPos;
@@ -251,7 +247,6 @@ struct tagDC
gal_pixel skip_pixel; gal_pixel skip_pixel;
gal_pixel cur_pixel; gal_pixel cur_pixel;
int step; int step;
int bkmode; /* the effective background mode */
/* ====================================================================== */ /* ====================================================================== */
CLIPRECT* cur_ban; CLIPRECT* cur_ban;
@@ -718,8 +713,6 @@ void __mg_update_secondary_dc (PMAINWIN pWin, HDC secondary_dc,
HDC __mg_get_common_rgba8888_dc (void); HDC __mg_get_common_rgba8888_dc (void);
BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch, BOOL __mg_reset_common_rgba8888_dc (int width, int height, int pitch,
void* pixels); void* pixels);
/* Since 5.0.6 */
void __mg_destroy_common_rgba8888_dc (void);
/* Since 5.0.0. /* Since 5.0.0.
helpers to update the private client DC of window and it's descendants */ helpers to update the private client DC of window and it's descendants */
+1 -12
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~2023, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2018, 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
@@ -209,9 +209,6 @@ struct _CHARSETOPS
/** Default character. */ /** Default character. */
Achar32 def_char_value; Achar32 def_char_value;
/** Whether using legacy BIDI algorithm (Since 5.0.13). */
unsigned legacy_bidi:1;
/** The method to get the length of the first character. */ /** The method to get the length of the first character. */
int (*len_first_char) (const unsigned char* mstr, int mstrlen); int (*len_first_char) (const unsigned char* mstr, int mstrlen);
@@ -266,17 +263,9 @@ struct _CHARSETOPS
#define DEVFONTGLYPHTYPE_MASK_BMPTYPE 0x0F #define DEVFONTGLYPHTYPE_MASK_BMPTYPE 0x0F
enum devfont_feature {
DEVFONT_FEATURE_MARK_BBOX = 0,
};
/** The font operation structure. */ /** The font operation structure. */
struct _FONTOPS struct _FONTOPS
{ {
/** The method to get the feature value of the font (Since 5.0.13). */
DWORD (*get_feature) (LOGFONT* logfont, DEVFONT* devfont,
enum devfont_feature feature);
/** The method to get the glyph bitmap type . */ /** The method to get the glyph bitmap type . */
DWORD (*get_glyph_bmptype) (LOGFONT* logfont, DEVFONT* devfont); DWORD (*get_glyph_bmptype) (LOGFONT* logfont, DEVFONT* devfont);
-3
View File
@@ -127,9 +127,6 @@ typedef LWEVENT* PLWEVENT;
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
extern DWORD __mg_timeout_usec;
extern DWORD __mg_repeat_usec;
// The entrance of low level event handling thread // The entrance of low level event handling thread
BOOL mg_InitLWEvent (void); BOOL mg_InitLWEvent (void);
void mg_TerminateLWEvent (void); void mg_TerminateLWEvent (void);
+42 -21
View File
@@ -84,18 +84,15 @@
#define WS_EX_MODALDISABLED 0x10000000L #define WS_EX_MODALDISABLED 0x10000000L
/* /*
* Internal extended style: * \def WS_EX_CTRLASMAINWIN
* The control can be displayed out of the main window * \brief 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: dialog box. */ /* Internal extended style. */
#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]
@@ -104,10 +101,6 @@ 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
@@ -258,7 +251,7 @@ struct _MSGQUEUE
int loop_depth; // message loop depth, for dialog boxes int loop_depth; // message loop depth, for dialog boxes
int idle_counter; // the idle connter for MSG_IDLE int idle_counter; // the idle connter for MSG_IDLE
DWORD last_ticks; // the last tick count saved; since 5.0.14 DWORD last_ticks_desktop; // the last tick count for desktop timer
/* Since 5.0.0, MiniGUI provides support for timers per message thread */ /* Since 5.0.0, MiniGUI provides support for timers per message thread */
int nr_timers; // the number of active timers int nr_timers; // the number of active timers
@@ -534,10 +527,7 @@ int __mg_free_hook_wins (int cli);
/************************* Initialization/Termination ************************/ /************************* Initialization/Termination ************************/
void __mg_init_local_sys_text (void); void __mg_init_local_sys_text (void);
/* the zorder information for the default layer */ /* the zorder information of the server */
extern ZORDERINFO* __mg_def_zorder_info;
/* the zorder information for the current layer */
extern ZORDERINFO* __mg_zorder_info; extern ZORDERINFO* __mg_zorder_info;
#ifdef _MGRM_STANDALONE #ifdef _MGRM_STANDALONE
@@ -779,8 +769,8 @@ static inline PMSGQUEUE getMsgQueue (HWND hWnd)
} }
MSGQUEUE* mg_AllocMsgQueueForThisThread (BOOL sign_in); MSGQUEUE* mg_AllocMsgQueueForThisThread (void);
void mg_FreeMsgQueueForThisThread (BOOL sign_off); void mg_FreeMsgQueueForThisThread (void);
/* 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);
@@ -911,9 +901,40 @@ static inline MSGQUEUE* getMsgQueueIfMainWindowInThisThread (PMAINWIN pMainWin)
#endif /* defined _MGHAVE_VIRTUAL_WINDOW */ #endif /* defined _MGHAVE_VIRTUAL_WINDOW */
/* Since 5.0.14, remove arg use_sys_timer */ #if 0 /* deprecated code */
BOOL mg_InitTimer (void); /* since 5.0.0, we always use QS_DESKTIMER for desktop timer */
void mg_TerminateTimer (void); /* since 5.0.0, we no longer use the timer thread */
static inline void AlertDesktopTimerEvent (void)
{
if (__mg_dsk_msg_queue) {
__mg_dsk_msg_queue->expired_timer_mask = 1;
POST_MSGQ (__mg_dsk_msg_queue);
}
}
static inline void AlertDesktopTimerEvent (void)
{
__mg_dsk_msg_queue->dwState |= QS_DESKTIMER;
#ifdef _MGHAVE_VIRTUAL_WINDOW
if (getMsgQueueForThisThread() != __mg_dsk_msg_queue)
POST_MSGQ (__mg_dsk_msg_queue);
#endif /* defined _MGHAVE_VIRTUAL_WINDOW */
}
static inline void setMsgQueueTimerFlag (PMSGQUEUE pMsgQueue, int slot)
{
pMsgQueue->expired_timer_mask |= (0x01UL << slot);
POST_MSGQ (pMsgQueue);
}
static inline void removeMsgQueueTimerFlag (PMSGQUEUE pMsgQueue, int slot)
{
pMsgQueue->expired_timer_mask &= ~(0x01UL << slot);
}
#endif /* deprecated code */
BOOL mg_InitTimer (BOOL use_sys_timer);
void mg_TerminateTimer (BOOL use_sys_timer);
/*window element renderer manager interface*/ /*window element renderer manager interface*/
extern WINDOW_ELEMENT_RENDERER * __mg_def_renderer; extern WINDOW_ELEMENT_RENDERER * __mg_def_renderer;
+111 -9
View File
@@ -54,12 +54,26 @@
# 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
}; };
@@ -71,14 +85,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 /* endif _MG_ENABLE_SPLASH or _MG_ENABLE_SCREENSAVER or _MG_ENABLE_WATERMARK*/
#ifdef _MG_ENABLE_SCREENSAVER #ifdef _MG_ENABLE_SCREENSAVER
MG_LOCAL void __mg_screensaver_create(void); MG_LOCAL void __mg_screensaver_create(void);
@@ -88,6 +102,9 @@ 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);
@@ -98,11 +115,96 @@ 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 */ /*
#define __mg_license_on_timeout() /* NULL */ * ScreenSaver & Watermark
#define LICENSE_CHECK_CUSTIMER_ID() /* NULL */ */
#define license_get_processor_id() /* NULL */ #if defined(_MG_ENABLE_SCREENSAVER) || defined(_MG_ENABLE_WATERMARK)
#define LICENSE_SET_MESSAGE_OFFSET() /* NULL */ MG_LOCAL void __mg_license_on_input(void);
#define LICENSE_MODIFY_MESSAGE(x) /* NULL */ MG_LOCAL void __mg_license_on_timeout(void);
#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 */
+11 -34
View File
@@ -120,60 +120,37 @@ int __mg_alloc_sem_for_shared_surf (void);
int __mg_free_sem_for_shared_surf (int sem_num); int __mg_free_sem_for_shared_surf (int sem_num);
#endif /* _MGSCHEMA_COMPOSITING */ #endif /* _MGSCHEMA_COMPOSITING */
size_t __mg_lookfor_unused_slot (unsigned char* bitmap, size_t len_bmp, int set); int __mg_lookfor_unused_slot (unsigned char* bitmap, int len_bmp, int set);
static inline static inline
void __mg_slot_set_use (unsigned char* bitmap, size_t index) { void __mg_slot_set_use (unsigned char* bitmap, int index) {
bitmap += index >> 3; bitmap += index >> 3;
*bitmap &= (~(0x80 >> (index % 8))); *bitmap &= (~(0x80 >> (index % 8)));
} }
static inline static inline
int __mg_slot_clear_use (unsigned char* bitmap, size_t index) { int __mg_slot_clear_use (unsigned char* bitmap, int index) {
bitmap += index >> 3;
*bitmap |= (0x80 >> (index % 8));
return 1;
}
static inline
int __mg_slot_is_used (unsigned char* bitmap, size_t index) {
bitmap += index >> 3; bitmap += index >> 3;
if (*bitmap & (0x80 >> (index % 8))) if (*bitmap & (0x80 >> (index % 8)))
return 0; return 0;
*bitmap |= (0x80 >> (index % 8));
return 1; return 1;
} }
/* get the number of idle mask rectangles */ /* get the number of idle mask rectangles */
static inline static inline
size_t __mg_get_nr_idle_slots (unsigned char* bitmap, size_t len_bmp) int __mg_get_nr_idle_slots (unsigned char* bitmap, int len_bmp)
{ {
size_t idle = 0; int idle = 0;
size_t i, j; int i, j;
for (i = 0; i < len_bmp; i++) { for (i = 0; i < len_bmp; i++) {
if (*bitmap) { for (j = 0; j < 8; j++) {
if (*bitmap == 0xFF) { if (*bitmap & (0x80 >> j))
idle += 8; idle++;
}
else {
if (*bitmap & 0xF0) {
for (j = 0; j < 4; j++) {
if (*bitmap & (0x80 >> j))
idle++;
}
}
if (*bitmap & 0x0F) {
for (j = 0; j < 4; j++) {
if (*bitmap & (0x08 >> j))
idle++;
}
}
}
} }
bitmap++; bitmap++;
} }
return idle; return idle;
} }
+36 -120
View File
File diff suppressed because it is too large Load Diff
-2
View File
@@ -73,8 +73,6 @@
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
/* union semun is defined by including <sys/sem.h> */ /* union semun is defined by including <sys/sem.h> */
#elif defined(__DARWIN__)
/* union semun is defined by including <sys/sem.h> */
#else #else
/* according to X/OPEN we have to define it ourselves */ /* according to X/OPEN we have to define it ourselves */
union semun { union semun {
-8
View File
@@ -138,14 +138,6 @@ 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)
+1 -6
View File
@@ -154,12 +154,7 @@ int __mg_get_znode_at_point (const ZORDERINFO* zi, int x, int y, HWND* hwnd);
int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info); int __mg_do_reghook_operation (int cli, const REGHOOKINFO* info);
int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam); int __mg_handle_mouse_hook (int message, WPARAM wParam, LPARAM lParam);
#ifdef _MGSCHEMA_COMPOSITING int __mg_do_change_topmost_layer (void);
int __mg_prepare_layer_for_compositing (MG_Layer* layer);
int __mg_end_up_layer_for_compositing (MG_Layer* layer);
#endif
int __mg_do_change_topmost_layer (MG_Layer* new_topmost);
MG_Layer* __mg_find_layer_by_name (const char* name); MG_Layer* __mg_find_layer_by_name (const char* name);
+1 -1
View File
@@ -74,7 +74,7 @@ typedef struct _MSGQUEUE MSGQUEUE;
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
DWORD __mg_update_tick_count (MSGQUEUE* msg_queue); void __mg_update_tick_count (void* data);
int __mg_check_expired_timers (MSGQUEUE* msg_queue, DWORD inter); int __mg_check_expired_timers (MSGQUEUE* msg_queue, DWORD inter);
void __mg_remove_timers_by_msg_queue (MSGQUEUE* msg_queue); void __mg_remove_timers_by_msg_queue (MSGQUEUE* msg_queue);
void __mg_remove_timer (MSGQUEUE* msg_queue, int slot); void __mg_remove_timer (MSGQUEUE* msg_queue, int slot);
+19 -30
View File
@@ -87,7 +87,7 @@ typedef struct _ZORDERNODE {
int nr_dirty_rcs; /* the number of dirty rects */ int nr_dirty_rcs; /* the number of dirty rects */
const RECT* dirty_rcs; /* the pointer to the dirty rectangles */ const RECT* dirty_rcs; /* the pointer to the dirty rectangles */
#else /* defined _MGSCHEMA_COMPOSITING */ #else /* defined _MGSCHEMA_COMPOSITING */
DWORD age; /* znode age */ unsigned int age; /* znode age */
RECT dirty_rc; /* dirty rectangle */ RECT dirty_rc; /* dirty rectangle */
#endif /* not defined _MGSCHEMA_COMPOSITING */ #endif /* not defined _MGSCHEMA_COMPOSITING */
@@ -133,25 +133,17 @@ typedef struct _ZORDERINFO {
int first_launcher; int first_launcher;
int active_win; int active_win;
int old_active;
int next_active;
int cli_trackmenu; int cli_trackmenu;
/* 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
# ifdef __ZI_USE_RWLOCK # ifndef __NOUNIX__
pthread_rwlock_t rwlock; pthread_rwlock_t rwlock;
pthread_t rwlock_owner;
# else # else
pthread_mutex_t mutex; pthread_mutex_t rwlock;
# endif # endif
#elif defined(_MGRM_PROCESSES) #elif defined(_MGRM_PROCESSES)
int zi_semid; int zi_semid;
@@ -164,13 +156,12 @@ typedef struct _ZORDERINFO {
typedef ZORDERINFO* PZORDERINFO; typedef ZORDERINFO* PZORDERINFO;
#define MAX_NR_SPECIAL_ZNODES(zi) \ #define MAX_NR_SPECIAL_ZNODES(zi) \
(zi->max_nr_globals + \ (zi->max_nr_tooltips + zi->max_nr_globals + \
zi->max_nr_screenlocks + zi->max_nr_dockers + \ zi->max_nr_screenlocks + zi->max_nr_dockers + \
zi->max_nr_launchers + NR_FIXED_ZNODES) zi->max_nr_launchers + NR_FIXED_ZNODES)
#define MAX_NR_GENERAL_ZNODES(zi) \ #define MAX_NR_GENERAL_ZNODES(zi) \
(zi->max_nr_tooltips + zi->max_nr_topmosts + \ (zi->max_nr_topmosts + zi->max_nr_normals)
zi->max_nr_normals)
#define MAX_NR_ZNODES(zi) \ #define MAX_NR_ZNODES(zi) \
MAX_NR_SPECIAL_ZNODES(zi) + MAX_NR_GENERAL_ZNODES(zi) MAX_NR_SPECIAL_ZNODES(zi) + MAX_NR_GENERAL_ZNODES(zi)
@@ -187,7 +178,7 @@ typedef ZORDERINFO* PZORDERINFO;
(ZORDERNODE*)((char*)((zi)+1)+ (zi)->size_usage_bmp) (ZORDERNODE*)((char*)((zi)+1)+ (zi)->size_usage_bmp)
#define GET_MASKRECT_USAGEBMP(zi) \ #define GET_MASKRECT_USAGEBMP(zi) \
((unsigned char *)((zi) + 1) + (zi)->size_usage_bmp + \ ((char *)((zi) + 1) + (zi)->size_usage_bmp + \
sizeof (ZORDERNODE) * (MAX_NR_ZNODES_WITH_PPP(zi))) sizeof (ZORDERNODE) * (MAX_NR_ZNODES_WITH_PPP(zi)))
#define GET_MASKRECT(zi) \ #define GET_MASKRECT(zi) \
@@ -196,25 +187,25 @@ typedef ZORDERINFO* PZORDERINFO;
/* round to multiple of 8 to aoivd alignment issue */ /* round to multiple of 8 to aoivd alignment issue */
#define SIZE_MASKRECT_USAGE_BMP \ #define SIZE_MASKRECT_USAGE_BMP \
ROUND_TO_MULTIPLE((DEF_NR_MASKRECTS >> 3), 8) ROUND_TO_MULTIPLE((DEF_NR_MASKRECT >> 3), 8)
#define NR_SPECIAL_ZNODES(zi) \ #define NR_SPECIAL_ZNODES(zi) \
(zi->nr_globals + \ (zi->nr_tooltips + zi->nr_globals + \
zi->nr_screenlocks + zi->nr_dockers + \ zi->nr_screenlocks + zi->nr_dockers + \
zi->nr_launchers + NR_FIXED_ZNODES) zi->nr_launchers + NR_FIXED_ZNODES)
#define NR_GENERAL_ZNODES(zi) \ #define NR_GENERAL_ZNODES(zi) \
(zi->nr_tooltips + zi->nr_topmosts + zi->nr_normals) (zi->nr_topmosts + zi->nr_normals)
#define NR_ZNODES(zi) \ #define NR_ZNODES(zi) \
NR_SPECIAL_ZNODES(zi) + NR_GENERAL_ZNODES(zi) NR_SPECIAL_ZNODES(zi) + NR_GENERAL_ZNODES(zi)
/* Since 5.0.0: more levels */ /* Since 5.0.0: more levels */
#define SIZE_USAGE_BMP_GENERAL(max_nr_t, max_nr_n) \ #define SIZE_USAGE_BMP_GENERAL(max_nr_t, max_nr_n) \
((7 + DEF_NR_TOOLTIPS + (max_nr_t) + (max_nr_n)) >> 3) ((7 + (max_nr_t) + (max_nr_n)) >> 3)
#define SIZE_USAGE_BMP_SPECIAL(max_nr_g) \ #define SIZE_USAGE_BMP_SPECIAL(max_nr_g) \
((7 + max_nr_g + \ ((7 + DEF_NR_TOOLTIPS + max_nr_g + \
DEF_NR_SCREENLOCKS + DEF_NR_DOCKERS + \ DEF_NR_SCREENLOCKS + DEF_NR_DOCKERS + \
DEF_NR_LAUNCHERS + NR_FIXED_ZNODES) >> 3) DEF_NR_LAUNCHERS + NR_FIXED_ZNODES) >> 3)
@@ -243,15 +234,15 @@ typedef ZORDERINFO* PZORDERINFO;
MG_UNLIKELY ((idx) > MAX_NR_ZNODES(zi)) MG_UNLIKELY ((idx) > MAX_NR_ZNODES(zi))
#define IS_TYPE_GENERAL(type) \ #define IS_TYPE_GENERAL(type) \
((type) == ZOF_TYPE_TOOLTIP || \ (type == ZOF_TYPE_HIGHER || \
(type) == ZOF_TYPE_HIGHER || \ type == ZOF_TYPE_NORMAL)
(type) == ZOF_TYPE_NORMAL)
#define IS_TYPE_SPECIAL(type) \ #define IS_TYPE_SPECIAL(type) \
((type) == ZOF_TYPE_GLOBAL || \ (type == ZOF_TYPE_TOOLTIP || \
(type) == ZOF_TYPE_SCREENLOCK || \ type == ZOF_TYPE_GLOBAL || \
(type) == ZOF_TYPE_DOCKER || \ type == ZOF_TYPE_SCREENLOCK || \
(type) == ZOF_TYPE_LAUNCHER) type == ZOF_TYPE_DOCKER || \
type == ZOF_TYPE_LAUNCHER)
#define ZOF_TYPE_TO_LEVEL_IDX(type) ((int)(8 - ((type) >> 28))) #define ZOF_TYPE_TO_LEVEL_IDX(type) ((int)(8 - ((type) >> 28)))
@@ -259,14 +250,12 @@ typedef ZORDERINFO* PZORDERINFO;
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_maskrc_heap); int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals);
void __kernel_free_z_order_info (ZORDERINFO* zi); void __kernel_free_z_order_info (ZORDERINFO* zi);
int __kernel_get_window_region (HWND pWin, CLIPRGN* region); int __kernel_get_window_region (HWND pWin, CLIPRGN* region);
int __kernel_get_next_znode (const ZORDERINFO* zi, int from); int __kernel_get_next_znode (const ZORDERINFO* zi, int from);
int __kernel_get_prev_znode (const ZORDERINFO* zi, int from); int __kernel_get_prev_znode (const ZORDERINFO* zi, int from);
void __mg_sync_special_nodes (ZORDERINFO* from, ZORDERINFO* to);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
+5 -1
View File
@@ -1,15 +1,19 @@
# 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
+70 -93
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+32 -91
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~2022, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 2002~2020, 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
@@ -270,9 +270,8 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
if (!ops->reset_dirty_region (ctxt, layer)) if (!ops->reset_dirty_region (ctxt, layer))
return; return;
/* travel menu znodes on the layer; /* travel menu znodes on the layer */
this will only work for topmost layer */ if (zi->nr_popupmenus > 0) {
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi); nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) { for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc); pdc = dc_HDC2PDC (nodes[i].mem_dc);
@@ -302,23 +301,21 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
} }
} }
/* check wallpaper pattern; only call for topmost layer */ /* check wallpaper pattern */
if (layer == mgTopmostLayer) { pdc = dc_HDC2PDC (HDC_SCREEN);
pdc = dc_HDC2PDC (HDC_SCREEN); if (pdc->surface->w > 0 && pdc->surface->h > 0) {
if (pdc->surface->w > 0 && pdc->surface->h > 0) { assert (pdc->surface->dirty_info);
assert (pdc->surface->dirty_info); lock_znode_surface (pdc, nodes);
lock_znode_surface (pdc, nodes); changes_in_dc = pdc->surface->dirty_info->dirty_age;
changes_in_dc = pdc->surface->dirty_info->dirty_age; if (changes_in_dc != nodes[0].changes) {
if (changes_in_dc != nodes[0].changes) { ops->merge_dirty_wpp (ctxt, layer);
ops->merge_dirty_wpp (ctxt, layer);
}
} }
} }
ops->refresh_dirty_region (ctxt, layer); ops->refresh_dirty_region (ctxt, layer);
/* unlock the znode surfaces for popup menus */ /* unlock the znode surfaces for popup menus */
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) { if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi); nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) { for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc); pdc = dc_HDC2PDC (nodes[i].mem_dc);
@@ -341,15 +338,12 @@ static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
} }
} }
/* unlock the znode surfaces for wallpaper pattern; /* unlock the znode surfaces for wallpaper patter */
only for topmost layer */ pdc = dc_HDC2PDC (HDC_SCREEN);
if (layer == mgTopmostLayer) { if (pdc->surface->w > 0 && pdc->surface->h > 0) {
pdc = dc_HDC2PDC (HDC_SCREEN); nodes[0].changes = pdc->surface->dirty_info->dirty_age;
if (pdc->surface->w > 0 && pdc->surface->h > 0) { pdc->surface->dirty_info->nr_dirty_rcs = 0;
nodes[0].changes = pdc->surface->dirty_info->dirty_age; unlock_znode_surface (pdc, nodes);
pdc->surface->dirty_info->nr_dirty_rcs = 0;
unlock_znode_surface (pdc, nodes);
}
} }
} }
@@ -377,16 +371,16 @@ void __mg_composite_dirty_znodes (void)
#endif /* optimized */ #endif /* optimized */
static void purge_all_znodes_private_data (const CompositorOps* ops, static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
CompositorCtxt* ctxt) CompositorCtxt* ctxt, MG_Layer* layer)
{ {
ZORDERINFO* zi; ZORDERINFO* zi;
ZORDERNODE* nodes; ZORDERNODE* nodes;
int i, next; int i, next;
MG_Layer* layer;
/* travel menu znodes on the topmost layer */ zi = (ZORDERINFO*)layer->zorder_info;
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
// travel popup menu znodes
if (zi->nr_popupmenus > 0) { if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi); nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) { for (i = 0; i < zi->nr_popupmenus; i++) {
@@ -397,56 +391,25 @@ static void purge_all_znodes_private_data (const CompositorOps* ops,
} }
} }
/* travel all window znodes in all layers */ // travel window znodes
layer = mgLayers; nodes = GET_ZORDERNODE(zi);
while (layer) { next = 0;
zi = (ZORDERINFO*)layer->zorder_info; while ((next = __kernel_get_next_znode (zi, next)) > 0) {
nodes = GET_ZORDERNODE(zi); if (nodes[next].priv_data && ops->purge_win_data) {
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
next = 0; nodes[next].priv_data = NULL;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].priv_data && ops->purge_win_data) {
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
nodes[next].priv_data = NULL;
}
} }
layer = layer->next;
} }
} }
static void rebuild_all_znodes_private_data (const CompositorOps* ops, static inline void purge_all_znodes_private_data (const CompositorOps* ops,
CompositorCtxt* ctxt) CompositorCtxt* ctxt)
{ {
ZORDERINFO* zi;
ZORDERNODE* nodes;
int i, next;
MG_Layer* layer; MG_Layer* layer;
/* travel menu znodes on the topmost layer */
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
if (zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
if (nodes[i].flags & ZOF_VISIBLE) {
ops->on_showing_ppp (ctxt, i);
}
}
}
/* travel all window znodes in all layers */
layer = mgLayers; layer = mgLayers;
while (layer) { while (layer) {
zi = (ZORDERINFO*)layer->zorder_info; purge_znodes_private_data_in_layer (ops, ctxt, layer);
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes[next].flags & ZOF_VISIBLE) {
ops->on_showing_win (ctxt, layer, next);
}
}
layer = layer->next; layer = layer->next;
} }
} }
@@ -570,9 +533,6 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
} }
curr_ops = ops; curr_ops = ops;
curr_ctxt = ctxt; curr_ctxt = ctxt;
/* Since 5.0.3, to rebuild the private data of visible znodes */
rebuild_all_znodes_private_data (curr_ops, curr_ctxt);
curr_ops->refresh (ctxt); curr_ops->refresh (ctxt);
} }
@@ -583,24 +543,5 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
return NULL; return NULL;
} }
const char* GUIAPI ServerGetCurrentCompositor (
const CompositorOps** ops, CompositorCtxt** ctxt)
{
int i;
const CompositorOps* the_ops;
the_ops = ServerSelectCompositor (NULL, ctxt);
if (ops) {
*ops = the_ops;
}
for (i = 0; i < MAX_NR_COMPOSITORS; i++) {
if (compositors [i].ops == the_ops)
return compositors [i].name;
}
return NULL;
}
#endif /* defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING) */ #endif /* defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING) */
+2 -2
View File
@@ -48,7 +48,7 @@ static HCURSOR load_cursor_from_file (const char* filename)
{ {
FILE* fp; FILE* fp;
WORD16 wTemp; WORD16 wTemp;
int w=0, h=0, xhot=0, yhot=0, colornum=0; int w, h, xhot, yhot, colornum;
#if 0 #if 0
DWORD32 size; DWORD32 size;
#endif #endif
@@ -152,7 +152,7 @@ static HCURSOR load_cursor_from_mem (const void* area)
const Uint8* p = (Uint8*)area; const Uint8* p = (Uint8*)area;
WORD16 wTemp; WORD16 wTemp;
int w=0, h=0, xhot=0, yhot=0, colornum=0; int w = 0, h = 0, xhot = 0, yhot = 0, colornum = 0;
#if 0 #if 0
DWORD32 size; DWORD32 size;
#endif #endif
+18 -33
View File
@@ -104,7 +104,7 @@ static PMAINWIN dskSetActiveWindow (PMAINWIN pWin)
if (pWin == pOldActive) if (pWin == pOldActive)
return pOldActive; return pOldActive;
pOldActive = (PMAINWIN) dskSetActiveZOrderNode (__mg_zorder_info, 0, pWin?pWin->idx_znode:0); pOldActive = (PMAINWIN) dskSetActiveZOrderNode (0, pWin?pWin->idx_znode:0);
#ifndef _MGRM_PROCESSES /*for MiniGUI-Threads, not for MiniGUI-StandAlone*/ #ifndef _MGRM_PROCESSES /*for MiniGUI-Threads, not for MiniGUI-StandAlone*/
if (pOldActive != (PMAINWIN)HWND_INVALID && __mg_ime_wnd) if (pOldActive != (PMAINWIN)HWND_INVALID && __mg_ime_wnd)
@@ -232,7 +232,7 @@ static int dskAddNewMainWindow (PMAINWIN pWin)
if (pWin->secondaryDC == HDC_INVALID) { if (pWin->secondaryDC == HDC_INVALID) {
/* remove the flag of WS_EX_AUTOSECONDARYDC */ /* remove the flag of WS_EX_AUTOSECONDARYDC */
pWin->dwExStyle &= ~WS_EX_AUTOSECONDARYDC; pWin->dwExStyle = pWin->dwExStyle | WS_EX_AUTOSECONDARYDC;
pWin->secondaryDC = 0; pWin->secondaryDC = 0;
} }
@@ -368,15 +368,6 @@ static BOOL dskSetMainWindowAlwaysTop (PMAINWIN pWin, BOOL fSet)
return TRUE; return TRUE;
} }
/* Since 5.0.6 */
static inline int dskSetMainWindowGestureFlags (PMAINWIN pWin, DWORD dwFlags)
{
if (dskSetZNodeGestureFlags (0, pWin->idx_znode, dwFlags))
return FALSE;
return TRUE;
}
/* Since 5.0.0 */ /* Since 5.0.0 */
static int dskSetWindowMask (HWND pWin, const WINMASKINFO* mask_info) static int dskSetWindowMask (HWND pWin, const WINMASKINFO* mask_info)
{ {
@@ -676,7 +667,7 @@ static LRESULT KeyMessageHandler (UINT message, int scancode, DWORD status)
if (next_node) { if (next_node) {
dskMove2Top (0, next_node); dskMove2Top (0, next_node);
dskSetActiveZOrderNode (__mg_zorder_info, 0, next_node); dskSetActiveZOrderNode (0, next_node);
} }
return 0; return 0;
} }
@@ -1429,17 +1420,11 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
/* Since 5.0.0 */ /* Since 5.0.0 */
case MSG_SETAUTOREPEAT: case MSG_SETAUTOREPEAT:
sg_msgAutoRepeat = *(const MSG*)lParam; sg_msgAutoRepeat = *(const MSG*)lParam;
/* start auto-repeat after 300ms */
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_timeout_usec/10000);
break; break;
/* Since 5.0.0 */ /* Since 5.0.0 */
case MSG_SETALWAYSTOP: case MSG_SETALWAYSTOP:
return dskSetMainWindowAlwaysTop (pWin, (BOOL)lParam); return dskSetMainWindowAlwaysTop(pWin, (BOOL)lParam);
/* Since 5.0.6 */
case MSG_SETGESTUREFLAGS:
return dskSetMainWindowGestureFlags (pWin, (DWORD)lParam);
/* Since 5.0.0 */ /* Since 5.0.0 */
case MSG_SETWINDOWMASK: case MSG_SETWINDOWMASK:
@@ -1745,6 +1730,11 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
FreeZOrderNode (0, pCtrl->idx_znode, NULL); FreeZOrderNode (0, pCtrl->idx_znode, NULL);
} }
if (fFound) {
pCtrl->pcci->nUseCount --;
return 0;
}
if ((HWND)pCtrl == __mg_captured_wnd) { if ((HWND)pCtrl == __mg_captured_wnd) {
/* force release the capture */ /* force release the capture */
__mg_captured_wnd = 0; __mg_captured_wnd = 0;
@@ -1759,11 +1749,6 @@ static int dskOnRemoveCtrlInstance (PCONTROL pParent, PCONTROL pCtrl)
sg_msgAutoRepeat.hwnd = 0; sg_msgAutoRepeat.hwnd = 0;
} }
if (fFound) {
pCtrl->pcci->nUseCount--;
return 0;
}
return -1; return -1;
} }
@@ -1823,7 +1808,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,
@@ -1870,17 +1855,14 @@ void GUIAPI DesktopUpdateAllWindow(void)
SendMessage(HWND_DESKTOP, MSG_PAINT, 0, 0); SendMessage(HWND_DESKTOP, MSG_PAINT, 0, 0);
} }
static void dskOnTimeout (void) static void dskOnTimer (void)
{ {
static DWORD uCounter = 0; static DWORD uCounter = 0;
static DWORD blink_counter = 0; static DWORD blink_counter = 0;
if (sg_msgAutoRepeat.hwnd != 0 && if (sg_msgAutoRepeat.hwnd != 0) {
__mg_tick_counter >= sg_msgAutoRepeat.time) {
PostMessage (sg_msgAutoRepeat.hwnd, sg_msgAutoRepeat.message, PostMessage (sg_msgAutoRepeat.hwnd, sg_msgAutoRepeat.message,
sg_msgAutoRepeat.wParam, sg_msgAutoRepeat.lParam); sg_msgAutoRepeat.wParam, sg_msgAutoRepeat.lParam);
/* next auto-repeat msg after 50ms */
sg_msgAutoRepeat.time = __mg_tick_counter + (__mg_repeat_usec/10000);
} }
if (__mg_tick_counter < (blink_counter + 10)) if (__mg_tick_counter < (blink_counter + 10))
@@ -2155,10 +2137,7 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
break; break;
#endif #endif
/* Since 5.0.6, the desktop handles caret blinking in MSG_TIMEOUT
message, and the interval for this message changes to about 0.05s. */
case MSG_TIMEOUT: case MSG_TIMEOUT:
dskOnTimeout ();
// Since 5.0.0: MSG_IDLE messages will be generated by PeekMessage. // Since 5.0.0: MSG_IDLE messages will be generated by PeekMessage.
// BroadcastMessageInThisThread (MSG_IDLE, wParam, 0); // BroadcastMessageInThisThread (MSG_IDLE, wParam, 0);
break; break;
@@ -2192,6 +2171,12 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
dsk_ops->mouse_handler(dt_context, message, wParam, lParam); dsk_ops->mouse_handler(dt_context, message, wParam, lParam);
break; break;
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMER
message, and the interval for this MSG_TIMER changes to about 0.05s. */
case MSG_TIMER:
dskOnTimer ();
break;
default: default:
break; break;
} }
+210 -517
View File
File diff suppressed because it is too large Load Diff
+10 -4
View File
@@ -74,7 +74,6 @@
#include "dc.h" #include "dc.h"
#include "misc.h" #include "misc.h"
#include "devfont.h" #include "devfont.h"
#include "event.h"
#ifndef WIN32 #ifndef WIN32
#include <sys/termios.h> #include <sys/termios.h>
@@ -103,11 +102,18 @@ 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.
*/ */
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS, ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
TRUE);
if (ret < 0) { if (ret < 0) {
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n"); _WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
return FALSE; return FALSE;
@@ -146,7 +152,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 (TRUE); mg_FreeMsgQueueForThisThread ();
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
} }
+5 -17
View File
@@ -72,7 +72,6 @@
#include "dc.h" #include "dc.h"
#include "misc.h" #include "misc.h"
#include "devfont.h" #include "devfont.h"
#include "event.h"
/******************************* global data *********************************/ /******************************* global data *********************************/
/* pointer to desktop message queue */ /* pointer to desktop message queue */
@@ -113,8 +112,7 @@ BOOL mg_InitDesktop (void)
/* /*
* Init ZOrderInfo here. * Init ZOrderInfo here.
*/ */
ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS, ret = __kernel_alloc_z_order_info (DEF_NR_TOPMOSTS, DEF_NR_NORMALS);
TRUE);
if (ret < 0) { if (ret < 0) {
_WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n"); _WRN_PRINTF ("KERNEL>Desktop: Can not initialize ZOrderInfo!\n");
return FALSE; return FALSE;
@@ -141,29 +139,19 @@ BOOL mg_InitDesktop (void)
#include "debug.h" #include "debug.h"
static IDLEHANDLER std_idle_handler;
static BOOL idle_handler_for_desktop_thread (MSGQUEUE *msg_queue, BOOL wait)
{
__mg_update_tick_count (msg_queue);
return std_idle_handler (msg_queue, wait);
}
void* __kernel_desktop_main (void* data) 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 (TRUE)) ) { if (!(__mg_dsk_msg_queue = mg_AllocMsgQueueForThisThread ()) ) {
_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;
} }
/* For bug reported in Issue #116, under threads mode, the idle handler /* for threads mode, the idle handler for desktop thread is NULL */
for the desktop thread should call __mg_update_tick_count () */ __mg_dsk_msg_queue->OnIdle = NULL;
std_idle_handler = __mg_dsk_msg_queue->OnIdle;
__mg_dsk_msg_queue->OnIdle = idle_handler_for_desktop_thread;
/* init desktop window */ /* init desktop window */
init_desktop_win (); init_desktop_win ();
@@ -202,7 +190,7 @@ void* __kernel_desktop_main (void* data)
#endif #endif
} }
mg_FreeMsgQueueForThisThread (TRUE); mg_FreeMsgQueueForThisThread ();
__mg_dsk_msg_queue = NULL; __mg_dsk_msg_queue = NULL;
return NULL; return NULL;
} }
+286 -544
View File
File diff suppressed because it is too large Load Diff
+13 -14
View File
@@ -89,9 +89,8 @@
struct timeval __mg_event_timeout; struct timeval __mg_event_timeout;
DWORD __mg_timeout_usec; static DWORD timeoutusec;
DWORD __mg_repeat_usec; static DWORD repeatusec;
static DWORD dblclicktime; static DWORD dblclicktime;
#ifndef _MGRM_THREADS #ifndef _MGRM_THREADS
@@ -122,8 +121,8 @@ static void GetTimeout (void)
char szValue [11]; char szValue [11];
int mytimeoutusec, myrepeatusec; int mytimeoutusec, myrepeatusec;
__mg_timeout_usec = DEF_USEC_TIMEOUT; timeoutusec = DEF_USEC_TIMEOUT;
__mg_repeat_usec = DEF_REPEAT_TIME; repeatusec = DEF_REPEAT_TIME;
if (GetMgEtcValue (EVENTPARA, EVENTPARA_REPEATUSEC, szValue, 10) < 0) if (GetMgEtcValue (EVENTPARA, EVENTPARA_REPEATUSEC, szValue, 10) < 0)
return; return;
@@ -134,8 +133,8 @@ static void GetTimeout (void)
mytimeoutusec = atoi(szValue); mytimeoutusec = atoi(szValue);
if (myrepeatusec >= 0 && mytimeoutusec > 0) { if (myrepeatusec >= 0 && mytimeoutusec > 0) {
__mg_timeout_usec = mytimeoutusec; timeoutusec = mytimeoutusec;
__mg_repeat_usec = myrepeatusec; repeatusec = myrepeatusec;
} }
} }
@@ -209,7 +208,7 @@ static void ResetKeyEvent(void)
IAL_SetLeds (slock | (numlock << 1) | (capslock << 2)); IAL_SetLeds (slock | (numlock << 1) | (capslock << 2));
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = __mg_timeout_usec; __mg_event_timeout.tv_usec = timeoutusec;
#ifndef _MGRM_THREADS #ifndef _MGRM_THREADS
#ifdef _MGRM_PROCESSES #ifdef _MGRM_PROCESSES
@@ -217,8 +216,8 @@ static void ResetKeyEvent(void)
SHAREDRES_SHIFTSTATUS = status; SHAREDRES_SHIFTSTATUS = status;
#endif #endif
timeout_threshold = __mg_timeout_usec / 10000; timeout_threshold = timeoutusec / 10000;
repeat_threshold = __mg_repeat_usec / 10000; repeat_threshold = repeatusec / 10000;
timeout_count = timeout_threshold; timeout_count = timeout_threshold;
#endif #endif
} }
@@ -632,7 +631,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
// set repeat time // set repeat time
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = __mg_repeat_usec; __mg_event_timeout.tv_usec = repeatusec;
// repeat last event // repeat last event
if (old_lwe.type == LWETYPE_KEY if (old_lwe.type == LWETYPE_KEY
@@ -653,7 +652,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
old_lwe.data.me.event == ME_MIDDLEDOWN))) { old_lwe.data.me.event == ME_MIDDLEDOWN))) {
// reset delay time // reset delay time
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = __mg_timeout_usec; __mg_event_timeout.tv_usec = timeoutusec;
} }
lwe->type = LWETYPE_TIMEOUT; lwe->type = LWETYPE_TIMEOUT;
@@ -881,7 +880,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
memcpy (oldkeystate, keystate, nr_keys); memcpy (oldkeystate, keystate, nr_keys);
memcpy (&old_lwe, lwe, sizeof (LWEVENT)); memcpy (&old_lwe, lwe, sizeof (LWEVENT));
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = __mg_timeout_usec; __mg_event_timeout.tv_usec = timeoutusec;
return 1; return 1;
} }
@@ -900,7 +899,7 @@ mouseret:
me->status = status; me->status = status;
memcpy (&old_lwe, lwe, sizeof (LWEVENT)); memcpy (&old_lwe, lwe, sizeof (LWEVENT));
__mg_event_timeout.tv_sec = 0; __mg_event_timeout.tv_sec = 0;
__mg_event_timeout.tv_usec = __mg_timeout_usec; __mg_event_timeout.tv_usec = timeoutusec;
return 1; return 1;
} }
#endif #endif
+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 _MGHAVE_VIRTUAL_WINDOW #ifdef _MGRM_THREADS
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 _MGHAVE_VIRTUAL_WINDOW #ifdef _MGRM_THREADS
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 _MGHAVE_VIRTUAL_WINDOW #ifdef _MGRM_THREADS
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 _MGHAVE_VIRTUAL_WINDOW #ifdef _MGRM_THREADS
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 _MGHAVE_VIRTUAL_WINDOW #ifdef _MGRM_THREADS
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 _MGHAVE_VIRTUAL_WINDOW #ifdef _MGRM_THREADS
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 _MGHAVE_VIRTUAL_WINDOW #ifdef _MGRM_THREADS
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 _MGHAVE_VIRTUAL_WINDOW #ifdef _MGRM_THREADS
pthread_mutex_unlock (&FixStrHeap.lock); pthread_mutex_unlock (&FixStrHeap.lock);
#endif #endif
} }

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