mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-24 00:54:18 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79c9e16ddb | ||
|
|
bb62e1ff45 | ||
|
|
95ac2ecfce | ||
|
|
7baf414d73 | ||
|
|
70255521f8 | ||
|
|
3dce463697 | ||
|
|
43f126635c | ||
|
|
c31c970e88 | ||
|
|
8dcb3349c7 | ||
|
|
b03bc62fef | ||
|
|
a8b46e9e9c | ||
|
|
4541934bd5 | ||
|
|
fa2382c0de | ||
|
|
5944085555 | ||
|
|
97f4215330 | ||
|
|
1d81705437 | ||
|
|
2f48b9df05 | ||
|
|
5541ad971d | ||
|
|
8d4ced06d6 | ||
|
|
07ba1c50b9 | ||
|
|
2f97ddc0a2 | ||
|
|
988d1ca680 | ||
|
|
fec1ccef76 | ||
|
|
884cd66dfa | ||
|
|
f41180d025 | ||
|
|
bebe28b95c | ||
|
|
358c940763 | ||
|
|
b3d6c70a45 | ||
|
|
5fc1c1101e | ||
|
|
f336b8401b | ||
|
|
78a0a8addf | ||
|
|
be5f46f92d | ||
|
|
07592ad802 | ||
|
|
1764c47131 | ||
|
|
f83c92d91b | ||
|
|
bf85472935 | ||
|
|
ff6856ec1f | ||
|
|
a4d532f85e |
+2
-1
@@ -4,6 +4,8 @@
|
||||
*.al
|
||||
*.a
|
||||
*.so
|
||||
\#
|
||||
am--include-marker
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps/
|
||||
@@ -23,7 +25,6 @@ Makefile.in
|
||||
/*config.h
|
||||
/*config.h.in
|
||||
/*config.h.in~
|
||||
|
||||
/src/font/utils/emoji/
|
||||
/src/font/utils/ucd/
|
||||
/src/sysres/font_list
|
||||
|
||||
+45
-1
@@ -1,5 +1,9 @@
|
||||
# Release Notes
|
||||
|
||||
- [Version 5.0.3](#version-503)
|
||||
+ [What's new in version 5.0.3](#whats-new-in-version-503)
|
||||
- [Version 5.0.2](#version-502)
|
||||
+ [What's new in version 5.0.2](#whats-new-in-version-502)
|
||||
- [Version 5.0.0](#version-500)
|
||||
+ [What's new in version 5.0.0](#whats-new-in-version-500)
|
||||
+ [Compositing schema](#compositing-schema)
|
||||
@@ -10,6 +14,46 @@
|
||||
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
||||
+ [Deprecated APIs](#deprecated-apis)
|
||||
|
||||
## Version 5.0.3
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 5.0.3,
|
||||
which is the bug fixing release of MiniGUI 5.0.x.
|
||||
|
||||
### What's new in version 5.0.3
|
||||
|
||||
In this version, we fixed some bugs and made some minor enhancements:
|
||||
|
||||
* BUGFIXING:
|
||||
- Always check expired timers even got `EINTR`.
|
||||
- Add static modifier to `refresh_dirty_region` method of the fallback compositor.
|
||||
- Fix a bug in `RegisterListenFD`.
|
||||
- Fix a bug in `allocate_more_fd_slots`.
|
||||
* TUNING:
|
||||
- Rebuild the private data for all visible z-nodes after selected a new compositor.
|
||||
* ENHANCEMENTS:
|
||||
- New configuration option: `--enable-mgslicefallback` to build a fallback
|
||||
implementation of mgslice.
|
||||
- New API: `ServerGetTopmostZNodeOfType`.
|
||||
- Merge some code by @ehello (<https://github.com/ehello>) for FreeRTOS.
|
||||
|
||||
## Version 5.0.2
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 5.0.2,
|
||||
which is the bug fixing release of MiniGUI 5.0.x.
|
||||
|
||||
### What's new in version 5.0.2
|
||||
|
||||
In this version, we tuned some code for GCC 9 and fixed some bugs:
|
||||
|
||||
* BUGFIXING:
|
||||
- Initialize `cfg_res_path` in function `__sysres_get_system_res_path()`.
|
||||
- Always return TRUE in `subtract_rgn_by_node()`.
|
||||
* ADJUSTMENTS:
|
||||
- Use upstream Harfbuzz for glyph shaping of complex scripts instead
|
||||
of the modified version.
|
||||
* TUNING:
|
||||
- Tune some code to depress compilation warnings.
|
||||
|
||||
## Version 5.0.0
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 5.0.0,
|
||||
@@ -63,7 +107,7 @@ exciting features for MiniGUI:
|
||||
* ADJUSTMENTS:
|
||||
- `g_rcScr` now is defined a macro calling function `GetScreenRect()`.
|
||||
- `mgIsServer` now is define a macro calling function `IsServer()`.
|
||||
* TUNNING
|
||||
* TUNING
|
||||
- Tune the `drm` (DRM) engine to support MiniGUI-Processes runtime mode
|
||||
and compositing schema.
|
||||
- Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema.
|
||||
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/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
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/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
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
# 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+=
|
||||
##################################################
|
||||
|
||||
+7
-6
@@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT(libminigui, 5.0.0)
|
||||
AC_INIT(libminigui, 5.0.3)
|
||||
AC_CONFIG_SRCDIR(src/main/main.c)
|
||||
|
||||
dnl Set various version strings - taken gratefully from the SDL sources
|
||||
@@ -16,9 +16,9 @@ dnl Set various version strings - taken gratefully from the SDL sources
|
||||
#
|
||||
MINIGUI_MAJOR_VERSION=5
|
||||
MINIGUI_MINOR_VERSION=0
|
||||
MINIGUI_MICRO_VERSION=0
|
||||
MINIGUI_MICRO_VERSION=3
|
||||
MINIGUI_INTERFACE_AGE=0
|
||||
MINIGUI_BINARY_AGE=0
|
||||
MINIGUI_BINARY_AGE=3
|
||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||
|
||||
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
||||
@@ -77,7 +77,7 @@ AC_FUNC_MEMCMP
|
||||
AC_FUNC_MMAP
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(time mktime localtime clock_gettime strdup strcasecmp strncasecmp strerror setlocale)
|
||||
AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create poll select)
|
||||
AC_CHECK_FUNCS(posix_memalign memalign valloc memfd_create access poll select)
|
||||
|
||||
PKG_CHECK_MODULES(UDEV, [libudev >= 200], have_udev="yes", have_udev="no; need libudev 200+")
|
||||
|
||||
@@ -1621,6 +1621,7 @@ case "$with_osname" in
|
||||
*)
|
||||
with_osname="linux"
|
||||
osname="Linux"
|
||||
use_shmopen="yes"
|
||||
AC_DEFINE(__LINUX__, 1,
|
||||
[Define if compile for Linux])
|
||||
;;
|
||||
@@ -2143,7 +2144,7 @@ if test "x$build_ttf_support" = "xyes"; then
|
||||
if test "x$build_complex_scripts" = "xyes"; then
|
||||
dnl Check for HarfBuzz library
|
||||
AC_CHECK_LIB(harfbuzz, hb_version,
|
||||
DEP_LIBS="$DEP_LIBS -lharfbuzzex -lfreetype",
|
||||
DEP_LIBS="$DEP_LIBS -lharfbuzz -lfreetype",
|
||||
build_complex_scripts="no; support for complex scripts requires libharfbuzz")
|
||||
else
|
||||
DEP_LIBS="$DEP_LIBS -lfreetype",
|
||||
@@ -2223,7 +2224,7 @@ if test "x$build_complex_scripts" = "xyes"; then
|
||||
[ --with-hb-includes=DIR where the HarfBuzz includes are])
|
||||
|
||||
if test "x$with_hb_includes" = "x"; then
|
||||
HB_INC_DIR="-I/usr/local/include/harfbuzz"
|
||||
HB_INC_DIR="-I/usr/include/harfbuzz"
|
||||
else
|
||||
HB_INC_DIR="-I$with_hb_includes"
|
||||
fi
|
||||
|
||||
+50
-16
@@ -101,9 +101,9 @@ extern "C" {
|
||||
#define ZOF_TYPE_NORMAL 0x30000000
|
||||
#define ZOF_TYPE_HIGHER 0x40000000
|
||||
#define ZOF_TYPE_DOCKER 0x50000000 // Since 5.0.0
|
||||
#define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0;
|
||||
#define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0
|
||||
#define ZOF_TYPE_GLOBAL 0x70000000
|
||||
#define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0; fixed and only one.
|
||||
#define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0
|
||||
#define ZOF_TYPE_POPUPMENU 0x90000000
|
||||
|
||||
#define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER
|
||||
@@ -669,21 +669,22 @@ typedef void (* ON_NEW_DEL_CLIENT) (int op, int cli);
|
||||
typedef void (* ON_CHANGE_LAYER) (int op, MG_Layer* layer,
|
||||
MG_Client* client);
|
||||
|
||||
#define ZNOP_ALLOCATE 1
|
||||
#define ZNOP_FREE 2
|
||||
#define ZNOP_MOVE2TOP 3
|
||||
#define ZNOP_SHOW 4
|
||||
#define ZNOP_HIDE 5
|
||||
#define ZNOP_MOVEWIN 6
|
||||
#define ZNOP_SETACTIVE 7
|
||||
#define ZNOP_ALLOCATE 1
|
||||
#define ZNOP_FREE 2
|
||||
#define ZNOP_MOVE2TOP 3
|
||||
#define ZNOP_SHOW 4
|
||||
#define ZNOP_HIDE 5
|
||||
#define ZNOP_MOVEWIN 6
|
||||
#define ZNOP_SETACTIVE 7
|
||||
|
||||
#define ZNOP_ENABLEWINDOW 11
|
||||
#define ZNOP_DISABLEWINDOW 12
|
||||
#define ZNOP_STARTDRAG 13
|
||||
#define ZNOP_CANCELDRAG 14
|
||||
#define ZNOP_CHANGECAPTION 15
|
||||
#define ZNOP_REGIONCHANGED 16
|
||||
#define ZNOP_COMPOSITINGCHANGED 17
|
||||
#define ZNOP_ENABLEWINDOW 11
|
||||
#define ZNOP_DISABLEWINDOW 12
|
||||
#define ZNOP_STARTDRAG 13
|
||||
#define ZNOP_CANCELDRAG 14
|
||||
#define ZNOP_CHANGECAPTION 15
|
||||
#define ZNOP_REGIONCHANGED 16
|
||||
#define ZNOP_COMPOSITINGCHANGED 17
|
||||
#define ZNOP_ICONCHANGED 18 /* reserved for future */
|
||||
|
||||
/**
|
||||
* \var typedef void (* ON_ZNODE_OPERATION) (int op, int cli, int idx_znode)
|
||||
@@ -889,6 +890,39 @@ MG_EXPORT BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer);
|
||||
*/
|
||||
MG_EXPORT BOOL GUIAPI ServerDeleteLayer (MG_Layer* layer);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type,
|
||||
* int* cli)
|
||||
* \brief Get the topmost z-node in the specified layer for the specific
|
||||
* window type from the server.
|
||||
*
|
||||
* This function gets the topmost z-node of the type specified by
|
||||
* \a type in the specified layer \a layer from the server.
|
||||
*
|
||||
* \param layer The pointer to the layer, NULL for the current topmost layer.
|
||||
* \param type The window type, can be one of the following values:
|
||||
* - ZOF_TYPE_TOOLTIP
|
||||
* - ZOF_TYPE_GLOBAL
|
||||
* - ZOF_TYPE_SCREENLOCK
|
||||
* - ZOF_TYPE_DOCKER
|
||||
* - ZOF_TYPE_HIGHER
|
||||
* - ZOF_TYPE_NORMAL
|
||||
* - ZOF_TYPE_LAUNCHER
|
||||
* \param cli The client identifier of the topmost z-node will be returned
|
||||
* through this pointer. NULL is okay.
|
||||
*
|
||||
* \return The index of the topmost z-node of the specified type.
|
||||
* Zero when there is no z-node in the level; < 0 when error.
|
||||
*
|
||||
* \note Server-only function. Note that this function will not return
|
||||
* the z-node of the desktop, and the desktop always has the z-node index
|
||||
* of zero.
|
||||
*
|
||||
* \sa ServerGetZNodeInfo
|
||||
*/
|
||||
MG_EXPORT int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type,
|
||||
int* cli);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode,
|
||||
* int* cli)
|
||||
|
||||
@@ -1433,10 +1433,12 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||
item_info->add_data = item->add_data;
|
||||
|
||||
if (item_info->which & MTB_WHICH_TEXT)
|
||||
strncpy (item_info->text, item->text, NTB_TEXT_LEN);
|
||||
//strncpy (item_info->text, item->text, NTB_TEXT_LEN);
|
||||
strcpy (item_info->text, item->text);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
+11
-13
@@ -1012,8 +1012,9 @@ void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
|
||||
{
|
||||
char font_name [LEN_UNIDEVFONT_NAME + 1];
|
||||
|
||||
memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
|
||||
strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
|
||||
//memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
|
||||
//strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
|
||||
strcpy(font_name, (*devfont)->name);
|
||||
|
||||
font_DelDevFont (font_name);
|
||||
*devfont = NULL;
|
||||
@@ -1069,25 +1070,22 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
|
||||
added_num ++;
|
||||
}
|
||||
else {
|
||||
/* [DK] Fix Bug #4801, which introduce a absolute path check error in Windows,
|
||||
* first to load from sytem res path, else load it directly(relative or absolute path).*/
|
||||
if ((add_dev_font (font_name, font_file, TRUE)) == TRUE)
|
||||
/* [DK] Fix Bug #4801, which introduce an absolute path check error in Windows,
|
||||
* first to load from sytem res path, else load it directly (relative or absolute path).*/
|
||||
if (add_dev_font (font_name, font_file, TRUE))
|
||||
added_num++;
|
||||
else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1,
|
||||
__sysres_get_system_res_path(), font_file))
|
||||
&& ((add_dev_font (font_name, font_path, TRUE)) == TRUE))
|
||||
__sysres_get_system_res_path(), font_file)) &&
|
||||
add_dev_font (font_name, font_path, TRUE))
|
||||
added_num++;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_unload || added_num > 0 || added_num == font_num)
|
||||
{
|
||||
if (is_unload || added_num > 0 || added_num == font_num) {
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL font_InitSpecificalFonts (char* etc_section)
|
||||
|
||||
@@ -120,47 +120,42 @@ hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
|
||||
return UCharDecompose(ab, a, b);
|
||||
}
|
||||
|
||||
static hb_unicode_funcs_t *_funcs;
|
||||
static hb_unicode_funcs_t *get_unicode_funcs(void)
|
||||
{
|
||||
if (_funcs)
|
||||
return _funcs;
|
||||
|
||||
_funcs = hb_unicode_funcs_create (NULL);
|
||||
|
||||
hb_unicode_funcs_set_combining_class_func (_funcs,
|
||||
hb_minigui_unicode_combining_class, NULL, NULL);
|
||||
hb_unicode_funcs_set_general_category_func (_funcs,
|
||||
hb_minigui_unicode_general_category, NULL, NULL);
|
||||
hb_unicode_funcs_set_mirroring_func (_funcs,
|
||||
hb_minigui_unicode_mirroring, NULL, NULL);
|
||||
hb_unicode_funcs_set_script_func (_funcs,
|
||||
hb_minigui_unicode_script, NULL, NULL);
|
||||
hb_unicode_funcs_set_compose_func (_funcs,
|
||||
hb_minigui_unicode_compose, NULL, NULL);
|
||||
hb_unicode_funcs_set_decompose_func (_funcs,
|
||||
hb_minigui_unicode_decompose, NULL, NULL);
|
||||
|
||||
hb_unicode_funcs_make_immutable (_funcs);
|
||||
|
||||
return _funcs;
|
||||
}
|
||||
|
||||
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
|
||||
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
|
||||
/* extern hb_unicode_funcs_t *__mg_hb_unifuncs */
|
||||
hb_unicode_funcs_t *__mg_hb_unifuncs;
|
||||
|
||||
void __mg_init_harzbuff_funcs(void)
|
||||
{
|
||||
_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)
|
||||
{
|
||||
_DBG_PRINTF("%s: called\n", __FUNCTION__);
|
||||
|
||||
if (_funcs) {
|
||||
hb_unicode_funcs_destroy(_funcs);
|
||||
if (__mg_hb_unifuncs) {
|
||||
hb_unicode_funcs_destroy(__mg_hb_unifuncs);
|
||||
}
|
||||
else {
|
||||
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
|
||||
|
||||
@@ -1243,11 +1243,9 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
default:
|
||||
_DBG_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
|
||||
_WRN_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
libinput_event_destroy(event);
|
||||
|
||||
@@ -711,7 +711,7 @@ static BOOL merge_dirty_wpp (CompositorCtxt* ctxt, MG_Layer* layer)
|
||||
return rc;
|
||||
}
|
||||
|
||||
BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
|
||||
static BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
|
||||
{
|
||||
/* the fallback compositor only manages znodes on the topmost layer. */
|
||||
if (layer != mgTopmostLayer || IsEmptyClipRgn (&ctxt->dirty_rgn))
|
||||
|
||||
@@ -377,16 +377,16 @@ void __mg_composite_dirty_znodes (void)
|
||||
|
||||
#endif /* optimized */
|
||||
|
||||
static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
|
||||
CompositorCtxt* ctxt, MG_Layer* layer)
|
||||
static void purge_all_znodes_private_data (const CompositorOps* ops,
|
||||
CompositorCtxt* ctxt)
|
||||
{
|
||||
ZORDERINFO* zi;
|
||||
ZORDERNODE* nodes;
|
||||
int i, next;
|
||||
MG_Layer* layer;
|
||||
|
||||
zi = (ZORDERINFO*)layer->zorder_info;
|
||||
|
||||
// travel popup menu znodes
|
||||
/* 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++) {
|
||||
@@ -397,25 +397,56 @@ static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
|
||||
}
|
||||
}
|
||||
|
||||
// travel window znodes
|
||||
nodes = GET_ZORDERNODE(zi);
|
||||
next = 0;
|
||||
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
|
||||
if (nodes[next].priv_data && ops->purge_win_data) {
|
||||
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
|
||||
nodes[next].priv_data = NULL;
|
||||
/* travel all window znodes in all layers */
|
||||
layer = mgLayers;
|
||||
while (layer) {
|
||||
zi = (ZORDERINFO*)layer->zorder_info;
|
||||
nodes = GET_ZORDERNODE(zi);
|
||||
|
||||
next = 0;
|
||||
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
|
||||
if (nodes[next].priv_data && ops->purge_win_data) {
|
||||
ops->purge_win_data (ctxt, layer, next, nodes[next].priv_data);
|
||||
nodes[next].priv_data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
layer = layer->next;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void purge_all_znodes_private_data (const CompositorOps* ops,
|
||||
static void rebuild_all_znodes_private_data (const CompositorOps* ops,
|
||||
CompositorCtxt* ctxt)
|
||||
{
|
||||
ZORDERINFO* zi;
|
||||
ZORDERNODE* nodes;
|
||||
int i, next;
|
||||
MG_Layer* layer;
|
||||
|
||||
/* travel menu znodes on the topmost layer */
|
||||
zi = (ZORDERINFO*)mgTopmostLayer->zorder_info;
|
||||
if (zi->nr_popupmenus > 0) {
|
||||
nodes = GET_MENUNODE(zi);
|
||||
for (i = 0; i < zi->nr_popupmenus; i++) {
|
||||
if (nodes[i].flags & ZOF_VISIBLE) {
|
||||
ops->on_showing_ppp (ctxt, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* travel all window znodes in all layers */
|
||||
layer = mgLayers;
|
||||
while (layer) {
|
||||
purge_znodes_private_data_in_layer (ops, ctxt, layer);
|
||||
zi = (ZORDERINFO*)layer->zorder_info;
|
||||
nodes = GET_ZORDERNODE(zi);
|
||||
|
||||
next = 0;
|
||||
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
|
||||
if (nodes[next].flags & ZOF_VISIBLE) {
|
||||
ops->on_showing_win (ctxt, layer, next);
|
||||
}
|
||||
}
|
||||
|
||||
layer = layer->next;
|
||||
}
|
||||
}
|
||||
@@ -539,6 +570,9 @@ const CompositorOps* GUIAPI ServerSelectCompositor (const char* name,
|
||||
}
|
||||
curr_ops = ops;
|
||||
curr_ctxt = ctxt;
|
||||
|
||||
/* Since 5.0.3, to rebuild the private data of visible znodes */
|
||||
rebuild_all_znodes_private_data (curr_ops, curr_ctxt);
|
||||
curr_ops->refresh (ctxt);
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ static BOOL subtract_rgn_by_node (PCLIPRGN region, const ZORDERINFO* zi,
|
||||
else
|
||||
SubtractClipRect(region, &(node->rc));
|
||||
|
||||
return !IsEmptyClipRgn(region);
|
||||
return TRUE; // !IsEmptyClipRgn(region); We must return TRUE for this callback.
|
||||
}
|
||||
|
||||
#else /* not defined _MGSCHEMA_COMPOSITING */
|
||||
@@ -505,8 +505,13 @@ static BOOL _cb_update_znode (void* context,
|
||||
{
|
||||
const RECT* rc = (RECT*)context;
|
||||
|
||||
_DBG_PRINTF ("Checking window (%s), visibility: %s, referred: %s\n", znode->caption,
|
||||
(znode->flags & ZOF_VISIBLE)? "TRUE" : "FALSE",
|
||||
(znode->flags & ZOF_IF_REFERENCE)? "TRUE" : "FALSE");
|
||||
|
||||
if (znode->flags & ZOF_VISIBLE &&
|
||||
znode->flags & ZOF_IF_REFERENCE) {
|
||||
_DBG_PRINTF ("Widnow (%s) will be updated\n", znode->caption);
|
||||
update_client_window (znode, rc);
|
||||
znode->flags &= ~ZOF_IF_REFERENCE;
|
||||
return TRUE;
|
||||
|
||||
@@ -478,8 +478,10 @@ int InitGUI (int argc, const char* agr[])
|
||||
/* Since 5.0.0
|
||||
* Copy the video engine information to the shared resource segement
|
||||
*/
|
||||
strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
|
||||
strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
|
||||
//strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
|
||||
strcpy (SHAREDRES_VIDEO_ENGINE, engine);
|
||||
//strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
|
||||
strcpy (SHAREDRES_VIDEO_MODE, mode);
|
||||
#if 0 /* deprecated code */
|
||||
// these fileds will be initialized by DRM engine.
|
||||
if (GetMgEtcValue (engine, "device",
|
||||
|
||||
@@ -140,6 +140,8 @@ static BOOL allocate_more_fd_slots (MSGQUEUE* msg_queue)
|
||||
msg_queue->fd_slots[i] = NULL;
|
||||
}
|
||||
msg_queue->nr_fd_slots += MAX_NR_LISTEN_FD;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -213,8 +215,11 @@ BOOL GUIAPI RegisterListenFD (int fd, int type, HWND hwnd, void* context)
|
||||
}
|
||||
}
|
||||
|
||||
if (ok && msg_queue->maxfd < fd) {
|
||||
msg_queue->maxfd = fd;
|
||||
if (ok) {
|
||||
if (msg_queue->maxfd < fd) {
|
||||
msg_queue->maxfd = fd;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ libkernel_la_SOURCES = timer.c \
|
||||
desktop-ths.c desktop-sa.c desktop-procs.c \
|
||||
cursor.c cursor-procs.c cursor-sa.c \
|
||||
sharedres.c \
|
||||
message.c event.c \
|
||||
message.c event.c listenfd.c \
|
||||
blockheap.c fixstr.c slotset.c zorder.c
|
||||
endif
|
||||
|
||||
|
||||
+1
-1
@@ -362,7 +362,7 @@ static void mg_slice_init_nomessage (void)
|
||||
sys_page_size = system_info.dwPageSize;
|
||||
}
|
||||
#else
|
||||
sys_page_size = sysconf (_SC_PAGESIZE); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
|
||||
sys_page_size = getpagesize(); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
|
||||
#endif
|
||||
mem_assert (sys_page_size >= 2 * LARGEALIGNMENT);
|
||||
mem_assert ((sys_page_size & (sys_page_size - 1)) == 0);
|
||||
|
||||
@@ -13,6 +13,7 @@ MINIGUILIB=libminigui-$(MINIGUI_VER)
|
||||
# specific defines
|
||||
|
||||
COMM_LDADD= \
|
||||
standalone/libstandalone.$(LIBA) \
|
||||
libc/liblibc.$(LIBA) \
|
||||
misc/libmisc.$(LIBA) \
|
||||
control/libcontrol.$(LIBA) \
|
||||
|
||||
@@ -5,15 +5,12 @@ EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||
math.c about.c error.c sockio.c rc4.c rc4.h \
|
||||
makefile.ng makefile.msvc
|
||||
|
||||
LITE_SRCS=error.c sockio.c
|
||||
|
||||
|
||||
if MG_MINIMALGDI
|
||||
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
|
||||
else
|
||||
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||
math.c about.c license.c anon_file.c rbtree.c map.c \
|
||||
$(LITE_SRCS)
|
||||
error.c sockio.c
|
||||
endif
|
||||
|
||||
SRC_FILES = $(libmisc_la_SOURCES)
|
||||
|
||||
@@ -4,18 +4,15 @@ INCLUDES = -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/include
|
||||
noinst_LTLIBRARIES = libmisc.la
|
||||
|
||||
EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||
math.c about.c error.c sockio.c listenfd.c rc4.c rc4.h \
|
||||
makefile.ng makefile.msvc
|
||||
|
||||
LITE_SRCS=error.c sockio.c listenfd.c
|
||||
|
||||
math.c about.c error.c sockio.c rc4.c rc4.h \
|
||||
makefile.ng makefile.msvc
|
||||
|
||||
ifdef MG_MINIMALGDI
|
||||
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
|
||||
else
|
||||
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
|
||||
math.c about.c license.c \
|
||||
$(LITE_SRCS)
|
||||
math.c about.c license.c anon_file.c rbtree.c map.c \
|
||||
error.c sockio.c
|
||||
endif
|
||||
|
||||
SRC_FILES = $(libmisc_la_SOURCES)
|
||||
|
||||
+11
-2
@@ -1433,7 +1433,9 @@ char * strtrimall( char *src)
|
||||
return src;
|
||||
}
|
||||
|
||||
strcpy (src, src + nIndex1);
|
||||
// VW: use memmove instead of strcpy to avoid overlapping
|
||||
// strcpy (src, src + nIndex1);
|
||||
memmove (src, src + nIndex1, nLen - nIndex1 + 1);
|
||||
|
||||
nLen = strlen (src);
|
||||
nIndex1 = nLen - 1;
|
||||
@@ -1468,11 +1470,18 @@ int __mg_path_joint (char* dst, int dst_size,
|
||||
if (__mg_is_abs_path(abs_path) && (!__mg_is_abs_path(sub_path))) {
|
||||
if (dst_size >= strlen(abs_path) + strlen(sub_path)
|
||||
+ 2/* size of split '/' and terminator '\0' */) {
|
||||
sprintf(dst, "%s/%s", abs_path, sub_path);
|
||||
strcpy (dst, abs_path);
|
||||
strcat (dst, "/");
|
||||
strcat (dst, sub_path);
|
||||
//sprintf(dst, "%s/%s", abs_path, sub_path);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
_WRN_PRINTF ("The buffer space for the full path is too short: %d\n", dst_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -414,6 +414,7 @@ unsigned int __mg_os_get_random_seed (void)
|
||||
unsigned int rt_tick_get(void);
|
||||
return rt_tick_get();
|
||||
#elif defined (__FREERTOS__)
|
||||
return 0; // just return zero for now.
|
||||
#else
|
||||
/*other os use time, for example: linux, OSE, etc.*/
|
||||
return time (NULL);
|
||||
@@ -451,7 +452,8 @@ void __mg_os_time_delay (int ms)
|
||||
extern int rt_thread_mdelay(int ms);
|
||||
rt_thread_mdelay(ms);
|
||||
#elif defined (__FREERTOS__)
|
||||
#error "Please implement __mg_os_time_delay for your OS"
|
||||
extern void vTaskDelay(int xTicksToDelay);
|
||||
vTaskDelay(ms);
|
||||
#else
|
||||
#error "Please implement __mg_os_time_delay for your OS"
|
||||
#endif
|
||||
|
||||
@@ -75,6 +75,9 @@
|
||||
#include <hb.h>
|
||||
#include <hb-ft.h>
|
||||
|
||||
/* __mg_hb_unifuncs is implemented in src/font/harzbuff-minigui-funcs.c */
|
||||
extern hb_unicode_funcs_t *__mg_hb_unifuncs;
|
||||
|
||||
// define _CACHED_HB_FONT if you want use the cached HB fonts
|
||||
#define _CACHED_HB_FONT 1
|
||||
|
||||
@@ -216,6 +219,14 @@ static BOOL shape_layout_run(SEInstance* inst,
|
||||
if (hb_buf == NULL)
|
||||
goto error;
|
||||
|
||||
/* use our own unicode functions */
|
||||
if (__mg_hb_unifuncs) {
|
||||
hb_buffer_set_unicode_funcs(hb_buf, __mg_hb_unifuncs);
|
||||
}
|
||||
else {
|
||||
_DBG_PRINTF("Unicode functions for HarfBuzz does not initialized\n");
|
||||
}
|
||||
|
||||
hb_buffer_set_content_type(hb_buf, HB_BUFFER_CONTENT_TYPE_UNICODE);
|
||||
for (i = 0; i < run->len; i++) {
|
||||
hb_buffer_add(hb_buf, run->ucs[i], i);
|
||||
|
||||
+30
-1
@@ -409,7 +409,7 @@ int __mg_init_layers ()
|
||||
return -1;
|
||||
|
||||
/* mark the first semphore is used; it is reserved for wallpaper pattern */
|
||||
assert (__mg_alloc_mutual_sem (_ssm_shared_surf, NULL) == 0);
|
||||
__mg_alloc_mutual_sem (_ssm_shared_surf, NULL);
|
||||
|
||||
on_exit (__mg_delete_sem_set_manager, _ssm_shared_surf);
|
||||
#endif
|
||||
@@ -742,6 +742,34 @@ void GUIAPI UpdateTopmostLayer (const RECT* dirty_rc)
|
||||
SendMessage (HWND_DESKTOP, MSG_PAINT, 0, 0);
|
||||
}
|
||||
|
||||
int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type, int* cli)
|
||||
{
|
||||
ZORDERINFO* zi;
|
||||
int topmost;
|
||||
|
||||
if (layer == NULL)
|
||||
layer = mgTopmostLayer;
|
||||
else if (!__mg_is_valid_layer (layer))
|
||||
return -1;
|
||||
|
||||
if (type < ZOF_TYPE_LAUNCHER || type > ZOF_TYPE_TOOLTIP)
|
||||
return -1;
|
||||
|
||||
zi = (ZORDERINFO*)layer->zorder_info;
|
||||
topmost = zi->first_in_levels [(ZOF_TYPE_TOOLTIP - type) >> 28];
|
||||
if (topmost <= 0) {
|
||||
return 0;
|
||||
}
|
||||
else if (cli) {
|
||||
ZORDERNODE* nodes;
|
||||
|
||||
nodes = GET_ZORDERNODE(zi);
|
||||
*cli = nodes [topmost].cli;
|
||||
}
|
||||
|
||||
return topmost;
|
||||
}
|
||||
|
||||
int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode, int* cli)
|
||||
{
|
||||
ZORDERINFO* zi;
|
||||
@@ -870,6 +898,7 @@ const ZNODEHEADER* GUIAPI ServerGetWinZNodeHeader (MG_Layer* layer,
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
if (lock && (pdc = dc_HDC2PDC (hdr->mem_dc))) {
|
||||
assert (pdc->surface->dirty_info);
|
||||
|
||||
if (hdr->lock_count == 0) {
|
||||
if (pdc->surface->shared_header) {
|
||||
// XXX: consider timeout.
|
||||
|
||||
@@ -812,10 +812,10 @@ static int get_shared_surface (int cli, int clifd, void* buff, size_t len)
|
||||
|
||||
static int authenticate_client (int cli, int clifd, void* buff, size_t len)
|
||||
{
|
||||
uint32_t magic;
|
||||
int auth_result = 1;
|
||||
|
||||
#ifdef _MGGAL_DRM
|
||||
uint32_t magic;
|
||||
extern int __drm_auth_client(int, uint32_t);
|
||||
magic = *(uint32_t*)buff;
|
||||
auth_result = __drm_auth_client (cli, magic);
|
||||
|
||||
+9
-1
@@ -403,8 +403,16 @@ BOOL server_IdleHandler4Server (PMSGQUEUE msg_queue, BOOL wait)
|
||||
|
||||
/* It is time to check event again. */
|
||||
if (errno == EINTR) {
|
||||
if (wait)
|
||||
if (wait) {
|
||||
ParseEvent (msg_queue, 0);
|
||||
|
||||
/* Since 5.0.3: Always check timers */
|
||||
nevts += __mg_check_expired_timers (msg_queue,
|
||||
SHAREDRES_TIMER_COUNTER - msg_queue->old_tick_count);
|
||||
msg_queue->old_tick_count = SHAREDRES_TIMER_COUNTER;
|
||||
return (nevts > 0);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
abs_top_srcdir=../..
|
||||
|
||||
INCLUDES = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
||||
|
||||
noinst_LTLIBRARIES = libstandalone.la
|
||||
|
||||
|
||||
libstandalone_la_SOURCES = standalone.c
|
||||
|
||||
|
||||
SRC_FILES = $(libstandalone_la_SOURCES)
|
||||
LIB_NAME=libstandalone
|
||||
|
||||
|
||||
|
||||
include ../../rules.make
|
||||
+3
-3
@@ -70,10 +70,10 @@ static char* _system_keys[]={
|
||||
};
|
||||
static char* _system_values[]={
|
||||
// GAL engine and default options
|
||||
"pc_xvfb",
|
||||
"800x600-16bpp",
|
||||
"commlcd",
|
||||
"160x80-16bpp",
|
||||
// IAL engine
|
||||
"pc_xvfb",
|
||||
"comm",
|
||||
"/dev/input/mice",
|
||||
"IMPS2"
|
||||
};
|
||||
|
||||
+55
-40
@@ -397,29 +397,10 @@ static void free_val_bitmap (void *val)
|
||||
map_t* __mg_sys_bmp_map;
|
||||
BOOL mg_InitResManager(int hash_table_size)
|
||||
{
|
||||
char szpath[MAX_PATH+1];
|
||||
char* p = NULL;
|
||||
pwd_res_path = strdup("./");
|
||||
|
||||
//initialize paths
|
||||
#if !defined(__NOUNIX__) || defined(WIN32)
|
||||
if ((p = getenv ("MG_RES_PATH"))) {
|
||||
int len = strlen(p);
|
||||
if (p[len-1] == '/')
|
||||
sprintf(szpath, "%s", p);
|
||||
else
|
||||
sprintf(szpath, "%s/", p);
|
||||
cfg_res_path = strdup(szpath);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
//step 2: get from MiniGUI.cfg
|
||||
if (GetMgEtcValue("resinfo", "respath",
|
||||
szpath, sizeof(szpath)-1) == ETC_OK) {
|
||||
cfg_res_path = strdup(szpath);
|
||||
}
|
||||
}
|
||||
// initialize paths
|
||||
if (pwd_res_path == NULL)
|
||||
pwd_res_path = strdup ("./");
|
||||
__sysres_get_system_res_path();
|
||||
|
||||
//initialize hash table
|
||||
init_hash_table (&hash_table, hash_table_size);
|
||||
@@ -475,6 +456,31 @@ void TerminateResManager()
|
||||
|
||||
const char* __sysres_get_system_res_path()
|
||||
{
|
||||
char szpath [MAX_PATH+1];
|
||||
char* p = NULL;
|
||||
|
||||
if (cfg_res_path)
|
||||
return cfg_res_path;
|
||||
|
||||
#if !defined(__NOUNIX__) || defined(WIN32)
|
||||
if ((p = getenv ("MG_RES_PATH"))) {
|
||||
int len = strlen (p);
|
||||
if (p[len-1] == '/')
|
||||
sprintf (szpath, "%s", p);
|
||||
else
|
||||
sprintf (szpath, "%s/", p);
|
||||
cfg_res_path = strdup (szpath);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// get from MiniGUI.cfg
|
||||
if (GetMgEtcValue ("resinfo", "respath",
|
||||
szpath, sizeof (szpath)-1) == ETC_OK) {
|
||||
cfg_res_path = strdup (szpath);
|
||||
}
|
||||
}
|
||||
|
||||
return cfg_res_path;
|
||||
}
|
||||
|
||||
@@ -496,7 +502,7 @@ int SetResPath(const char* path)
|
||||
//test path is valid directory
|
||||
#if !defined(__NOUNIX__) && !defined(WIN32)
|
||||
struct stat buf;
|
||||
if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
|
||||
if (stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
|
||||
# ifdef _DEBUG
|
||||
ERR_RETV (RES_RET_INVALID_PARAM, RES_RET_INVALID_PARAM, "param path (%s) is not a valid directory", path);
|
||||
# else
|
||||
@@ -505,7 +511,7 @@ int SetResPath(const char* path)
|
||||
}
|
||||
#endif
|
||||
|
||||
if(usr_res_path != NULL)
|
||||
if (usr_res_path != NULL)
|
||||
DELETE(usr_res_path);
|
||||
|
||||
usr_res_path = STR_DUP(path);
|
||||
@@ -611,39 +617,39 @@ int UnregisterResType(int type)
|
||||
return RES_RET_OK;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ACCESS
|
||||
static char* get_res_file(const char* res_name, char* filename)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (res_name == NULL || filename == NULL)
|
||||
return NULL;
|
||||
|
||||
//test it is a full path or not
|
||||
for(i=0; res_name[i] && res_name[i] == '/'; i++);
|
||||
if(i>0) //is full path
|
||||
{
|
||||
for (i = 0; res_name[i] && res_name[i] == '/'; i++);
|
||||
|
||||
if (i > 0) { // full path
|
||||
#ifndef __NOUNIX__
|
||||
struct stat buf;
|
||||
if(stat(res_name, &buf) == 0
|
||||
&& !S_ISDIR(buf.st_mode)
|
||||
&& (buf.st_mode&S_IRUSR))
|
||||
if(stat (res_name, &buf) == 0
|
||||
&& !S_ISDIR(buf.st_mode)
|
||||
&& (buf.st_mode&S_IRUSR))
|
||||
#endif
|
||||
{
|
||||
return (char*)res_name;
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0; res_paths[i]; i++)
|
||||
{
|
||||
for (i = 0; res_paths[i]; i++) {
|
||||
#ifndef __NOUNIX__
|
||||
struct stat buf;
|
||||
sprintf(filename,"%s/%s", res_paths[i], res_name);
|
||||
if(stat(filename, &buf) == 0 && !S_ISDIR(buf.st_mode) && (buf.st_mode&S_IRUSR))
|
||||
|
||||
sprintf (filename,"%s/%s", res_paths[i], res_name);
|
||||
if (stat (filename, &buf) == 0 &&
|
||||
!S_ISDIR (buf.st_mode) && (buf.st_mode & S_IRUSR))
|
||||
#else
|
||||
sprintf(filename,"%s/%s", res_paths[i], res_name);
|
||||
#ifndef __VXWORKS__
|
||||
//in vxworks, don't support _access method.
|
||||
if (_access(filename, 04) != -1)
|
||||
#endif
|
||||
sprintf (filename,"%s/%s", res_paths[i], res_name);
|
||||
if (access (filename, 04) != -1)
|
||||
#endif
|
||||
{
|
||||
return filename;
|
||||
@@ -653,6 +659,15 @@ static char* get_res_file(const char* res_name, char* filename)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static char* get_res_file(const char* res_name, char* filename)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* !HAVE_ACCESS */
|
||||
|
||||
static void* get_res_data (RES_ENTRY *entry, RES_TYPE_OPS *ops, DWORD usr_param)
|
||||
{
|
||||
if (entry == NULL && ops == NULL)
|
||||
|
||||
Reference in New Issue
Block a user