mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-23 16:43:58 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d287f72e3 | ||
|
|
bbac3b1796 | ||
|
|
e25fbb39d0 | ||
|
|
1b42c853ba | ||
|
|
a932bc798e | ||
|
|
713fd0ccb8 | ||
|
|
1a63b30d32 | ||
|
|
7ba6246dd1 | ||
|
|
190b2fea97 | ||
|
|
f2c2c28e62 | ||
|
|
837f2987fd | ||
|
|
7de60f2b94 | ||
|
|
018340f42e | ||
|
|
d4b226d2a5 | ||
|
|
699a68a9ac | ||
|
|
5a6705d8bc | ||
|
|
e7cc2f1e35 | ||
|
|
03b1dd9042 | ||
|
|
7651fbda35 | ||
|
|
6927a22507 | ||
|
|
c640565f3b | ||
|
|
c720b2a9ca | ||
|
|
8b24b1243b | ||
|
|
d8b2895527 | ||
|
|
2a4ead5e0f | ||
|
|
6f15548dc4 | ||
|
|
ef9048c582 | ||
|
|
da15a1dbd5 | ||
|
|
32aad95e7b | ||
|
|
57bdcd4754 | ||
|
|
b95538a415 | ||
|
|
fa7c84b2b5 | ||
|
|
bc77048488 | ||
|
|
2f21b22a49 | ||
|
|
ec91986854 | ||
|
|
e7b03037be | ||
|
|
9ff822c7fd | ||
|
|
239924c63e | ||
|
|
2f85645e9d | ||
|
|
9a6b208a85 |
+2
-2
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Processes)"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = v4.0.4
|
||||
PROJECT_NUMBER = v4.0.7
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -58,7 +58,7 @@ PROJECT_LOGO =
|
||||
# entered, it will be relative to the location where doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-procs-4.0.4
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-procs-4.0.7
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||
# directories (in 2 levels) under the output directory of each output format and
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Standalone)"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = v4.0.4
|
||||
PROJECT_NUMBER = v4.0.7
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -58,7 +58,7 @@ PROJECT_LOGO =
|
||||
# entered, it will be relative to the location where doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-sa-4.0.4
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-sa-4.0.7
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||
# directories (in 2 levels) under the output directory of each output format and
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Threads)"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = v4.0.4
|
||||
PROJECT_NUMBER = v4.0.7
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -58,7 +58,7 @@ PROJECT_LOGO =
|
||||
# entered, it will be relative to the location where doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-ths-4.0.4
|
||||
OUTPUT_DIRECTORY = doc-api-ref-minigui-ths-4.0.7
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||
# directories (in 2 levels) under the output directory of each output format and
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
MAJOR_VERSION = 3
|
||||
MAJOR_VERSION = 4
|
||||
MINOR_VERSION = 0
|
||||
MICRO_VERSION = 13
|
||||
MICRO_VERSION = 4
|
||||
EXTRAVERSION =
|
||||
|
||||
MINIGUI_RELEASE=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)$(EXTRAVERSION)
|
||||
|
||||
+117
-387
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1,8 +1,8 @@
|
||||
Version 4.0.4 (2019/12/24)
|
||||
Version 4.0.7 (2020/03/30)
|
||||
|
||||
This release needs the following packages:
|
||||
|
||||
- The resource package: `minigui-res-4.0.0.tar.gz`
|
||||
- The sample package: `mg-samples-4.0.1.tar.gz`
|
||||
- The test cases package: `mg-tests-4.0.4.tar.gz`
|
||||
- The test cases package: `mg-tests-4.0.7.tar.gz`
|
||||
|
||||
|
||||
+25
-29
@@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT(libminigui, 4.0.4)
|
||||
AC_INIT(libminigui, 4.0.7)
|
||||
AC_CONFIG_SRCDIR(src/main/main.c)
|
||||
|
||||
dnl Set various version strings - taken gratefully from the SDL sources
|
||||
@@ -16,7 +16,7 @@ dnl Set various version strings - taken gratefully from the SDL sources
|
||||
#
|
||||
MINIGUI_MAJOR_VERSION=4
|
||||
MINIGUI_MINOR_VERSION=0
|
||||
MINIGUI_MICRO_VERSION=4
|
||||
MINIGUI_MICRO_VERSION=7
|
||||
MINIGUI_INTERFACE_AGE=0
|
||||
MINIGUI_BINARY_AGE=0
|
||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||
@@ -120,13 +120,13 @@ build_net_ial_engine="no"
|
||||
|
||||
dnl common IAL engines
|
||||
build_libinput_ial_engine="yes"
|
||||
build_console_ial_engine="no"
|
||||
build_console_ial_engine="yes"
|
||||
build_console_ps2="no"
|
||||
build_console_imps2="no"
|
||||
build_console_imps2="yes"
|
||||
build_console_ms="no"
|
||||
build_console_ms3="no"
|
||||
build_console_gpm="no"
|
||||
build_text_mode="no"
|
||||
build_text_mode="yes"
|
||||
|
||||
dnl the customized ial engine
|
||||
build_dlcustom_ial_engine="no"
|
||||
@@ -265,7 +265,7 @@ enable_video_dfb_st7167="no"
|
||||
enable_video_stgfb="no"
|
||||
|
||||
enable_video_drm="yes"
|
||||
enable_video_fbcon="no"
|
||||
enable_video_fbcon="yes"
|
||||
enable_video_commlcd="no"
|
||||
enable_video_shadow="no"
|
||||
enable_video_mlshadow="no"
|
||||
@@ -470,7 +470,7 @@ AC_ARG_ENABLE(libinputial,
|
||||
build_libinput_ial_engine=$enableval)
|
||||
|
||||
AC_ARG_ENABLE(consoleial,
|
||||
[ --enable-consoleial build the console (Linux console) IAL engine <default=no>],
|
||||
[ --enable-consoleial build the console (Linux console) IAL engine <default=yes>],
|
||||
build_console_ial_engine=$enableval)
|
||||
|
||||
AC_ARG_ENABLE(consoleps2,
|
||||
@@ -478,7 +478,7 @@ AC_ARG_ENABLE(consoleps2,
|
||||
build_console_ps2=$enableval)
|
||||
|
||||
AC_ARG_ENABLE(consoleimps2,
|
||||
[ --enable-consoleimps2 build the console engine subdriver for IntelligentMouse (IMPS/2) mouse <default=no>],
|
||||
[ --enable-consoleimps2 build the console engine subdriver for IntelligentMouse (IMPS/2) mouse <default=yes>],
|
||||
build_console_imps2=$enableval)
|
||||
|
||||
AC_ARG_ENABLE(consolems,
|
||||
@@ -494,7 +494,7 @@ AC_ARG_ENABLE(consolegpm,
|
||||
build_console_gpm=$enableval)
|
||||
|
||||
AC_ARG_ENABLE(textmode,
|
||||
[ --enable-textmode Linux system have console (text mode) on FrameBuffer <default=no>],
|
||||
[ --enable-textmode Linux system have console (text mode) on FrameBuffer <default=yes>],
|
||||
build_text_mode=$enableval)
|
||||
|
||||
AC_ARG_ENABLE(rbfsupport,
|
||||
@@ -885,26 +885,22 @@ CheckFBCON()
|
||||
dnl Find the DRM includes
|
||||
CheckDRM()
|
||||
{
|
||||
if test "x$runtime_mode" = "xprocs"; then
|
||||
enable_video_drm="no; DRI engine does not support MiniGUI-Processes runtime mode currently"
|
||||
else
|
||||
AC_ARG_ENABLE(videodrm,
|
||||
[ --enable-videodrm include Linux DRI NEWGAL engine <default=yes>],
|
||||
enable_video_drm=$enableval)
|
||||
if test "x$enable_video_drm" = "xyes"; then
|
||||
PKG_CHECK_MODULES(DRM, [libdrm >= 2.4], video_drm="yes",
|
||||
video_drm="no; Linux DRI NEWGAL engine requires libdrm 2.4+")
|
||||
if test "x$video_drm" = "xyes"; then
|
||||
AC_DEFINE(_MGGAL_DRM, 1,
|
||||
[Define if include Linux DRI NEWGAL engine])
|
||||
VIDEO_SUBDIRS="$VIDEO_SUBDIRS drm"
|
||||
VIDEO_DRIVERS="$VIDEO_DRIVERS drm/libvideo_drm.la"
|
||||
DEP_LIBS="$DEP_LIBS -ldrm -ldl"
|
||||
DRM_INC_DIR="`$PKG_CONFIG --variable includedir libdrm`/libdrm"
|
||||
AC_SUBST(DRM_INC_DIR)
|
||||
else
|
||||
AC_MSG_WARN([$video_drm])
|
||||
fi
|
||||
AC_ARG_ENABLE(videodrm,
|
||||
[ --enable-videodrm include Linux DRI NEWGAL engine <default=yes>],
|
||||
enable_video_drm=$enableval)
|
||||
if test "x$enable_video_drm" = "xyes"; then
|
||||
PKG_CHECK_MODULES(DRM, [libdrm >= 2.4], video_drm="yes",
|
||||
video_drm="no; Linux DRI NEWGAL engine requires libdrm 2.4+")
|
||||
if test "x$video_drm" = "xyes"; then
|
||||
AC_DEFINE(_MGGAL_DRM, 1,
|
||||
[Define if include Linux DRI NEWGAL engine])
|
||||
VIDEO_SUBDIRS="$VIDEO_SUBDIRS drm"
|
||||
VIDEO_DRIVERS="$VIDEO_DRIVERS drm/libvideo_drm.la"
|
||||
DEP_LIBS="$DEP_LIBS -ldrm -ldl"
|
||||
DRM_INC_DIR="`$PKG_CONFIG --variable includedir libdrm`/libdrm"
|
||||
AC_SUBST(DRM_INC_DIR)
|
||||
else
|
||||
AC_MSG_WARN([$video_drm])
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ dpi=96
|
||||
|
||||
# The filename of the shared library for the external driver.
|
||||
# The equivalent environment variable: MG_GAL_DRM_DRIVER
|
||||
exdriver=libhidrmdrivers.so.0
|
||||
exdriver=libhidrmdrivers-0.2.so.0
|
||||
#}}
|
||||
|
||||
#{{ifdef _MGIAL_LIBINPUT
|
||||
|
||||
@@ -234,6 +234,9 @@ typedef struct tagINPUT {
|
||||
// New wait event method for getting extra input events; since 4.0.0
|
||||
int (*wait_event_ex) (int maxfd, fd_set *in, fd_set *out,
|
||||
fd_set *except, struct timeval *timeout, EXTRA_INPUT_EVENT* extra);
|
||||
|
||||
/* BUGFIXING (VM 2020-03-12): merged from 5.0.0 */
|
||||
char* mdev;
|
||||
} INPUT;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+313
-84
File diff suppressed because it is too large
Load Diff
+49
-16
@@ -13734,14 +13734,18 @@ MG_EXPORT int drmGetDeviceFD (GHANDLE video);
|
||||
* THe struct type defines the DRM surface information.
|
||||
*/
|
||||
typedef struct _DrmSurfaceInfo {
|
||||
/** The prime fd of the buffer object. */
|
||||
int prime_fd;
|
||||
/** The global name of the buffer object. */
|
||||
uint32_t name;
|
||||
/** The local handle of the buffer object. */
|
||||
uint32_t handle;
|
||||
/** The buffer identifier. */
|
||||
uint32_t id;
|
||||
/** The prime fd of the buffer object. If it was no exported as a global
|
||||
buffer object, it has the value -1. */
|
||||
int prime_fd;
|
||||
/** The global name of the buffer object. It has the value 0 when it was
|
||||
not expored as global buffer object. */
|
||||
uint32_t name;
|
||||
/** The frame buffer identifier. If the buffer was not added as
|
||||
a frame buffer to the system, it has the value 0. */
|
||||
uint32_t fb_id;
|
||||
|
||||
/** The width of the surface. */
|
||||
uint32_t width;
|
||||
/** The height of the surface. */
|
||||
@@ -13751,7 +13755,9 @@ typedef struct _DrmSurfaceInfo {
|
||||
/** The DRM pixel format. */
|
||||
uint32_t drm_format;
|
||||
/** Size in bytes of the buffer object. */
|
||||
unsigned long size;
|
||||
size_t size;
|
||||
/** The offset from the buffer start to the real pixel data. */
|
||||
off_t offset;
|
||||
} DrmSurfaceInfo;
|
||||
|
||||
/**
|
||||
@@ -13773,15 +13779,24 @@ MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info);
|
||||
* \param video The video handle.
|
||||
* \param name The name handle of the DRM surface.
|
||||
* \param drm_format The DRM pixel format.
|
||||
* \param offset The offset from the buffer start to the real pixel data.
|
||||
* \param width The width of the DRM surface.
|
||||
* \param height The height of the DRM surface.
|
||||
* \param pitch The pitch (row stride) of the DRM surface.
|
||||
*
|
||||
* \return The handle to the memory DC for success, HDC_INVALID for failure.
|
||||
*/
|
||||
MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
|
||||
uint32_t name, uint32_t drm_format,
|
||||
unsigned int width, unsigned int height, uint32_t pitch);
|
||||
MG_EXPORT HDC drmCreateDCFromNameEx (GHANDLE video,
|
||||
uint32_t name, uint32_t drm_format, off_t offset,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
static inline HDC drmCreateDCFromName (GHANDLE video,
|
||||
uint32_t name, uint32_t drm_format,
|
||||
uint32_t width, uint32_t height, uint32_t pitch)
|
||||
{
|
||||
return drmCreateDCFromNameEx (video,
|
||||
name, drm_format, 0, width, height, pitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function creates a memory DC with a DRM surface which is created by
|
||||
@@ -13791,15 +13806,24 @@ MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
|
||||
* \param prime_fd The PRIME file descriptor.
|
||||
* \param size The size of the DRM surface in bytes.
|
||||
* \param drm_format The DRM pixel format.
|
||||
* \param offset The offset from the buffer start to the real pixel data.
|
||||
* \param width The width of the DRM surface.
|
||||
* \param height The height of the DRM surface.
|
||||
* \param pitch The pitch (row stride) of the DRM surface.
|
||||
*
|
||||
* \return The handle to the memory DC for success, HDC_INVALID for failure.
|
||||
*/
|
||||
MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
||||
int prime_fd, unsigned long size, uint32_t drm_format,
|
||||
unsigned int width, unsigned int height, uint32_t pitch);
|
||||
MG_EXPORT HDC drmCreateDCFromPrimeFdEx (GHANDLE video,
|
||||
int prime_fd, size_t size, uint32_t drm_format, off_t offset,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
static inline HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
||||
int prime_fd, size_t size, uint32_t drm_format,
|
||||
uint32_t width, uint32_t height, uint32_t pitch)
|
||||
{
|
||||
return drmCreateDCFromPrimeFdEx (video,
|
||||
prime_fd, size, drm_format, 0, width, height, pitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function creates a memory DC with a DRM surface which is created by
|
||||
@@ -13809,15 +13833,24 @@ MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
||||
* \param handle The handle of the DRM surface.
|
||||
* \param size The size of the DRM surface in bytes.
|
||||
* \param drm_format The DRM pixel format.
|
||||
* \param offset The offset from the buffer start to the real pixel data.
|
||||
* \param width The width of the DRM surface.
|
||||
* \param height The height of the DRM surface.
|
||||
* \param pitch The pitch (row stride) of the DRM surface.
|
||||
*
|
||||
* \return The handle to the memory DC for success, HDC_INVALID for failure.
|
||||
*/
|
||||
MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video,
|
||||
uint32_t handle, unsigned long size, uint32_t drm_format,
|
||||
unsigned int width, unsigned int height, uint32_t pitch);
|
||||
MG_EXPORT HDC drmCreateDCFromHandleEx (GHANDLE video,
|
||||
uint32_t handle, size_t size, uint32_t drm_format, off_t offset,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
static inline HDC drmCreateDCFromHandle (GHANDLE video,
|
||||
uint32_t handle, size_t size, uint32_t drm_format,
|
||||
uint32_t width, uint32_t height, uint32_t pitch)
|
||||
{
|
||||
return drmCreateDCFromHandleEx (video,
|
||||
handle, size, drm_format, 0, width, height, pitch);
|
||||
}
|
||||
|
||||
/** @} end of gdi_drm_fns */
|
||||
|
||||
|
||||
+6
-9
@@ -175,15 +175,12 @@ int GUIAPI ClientRequestEx (const REQUEST* request, const void* ex_data, int ex_
|
||||
if (mgIsServer)
|
||||
return -1;
|
||||
|
||||
#ifdef _MGGAL_MLSHADOW
|
||||
if ((request->id != REQID_MLSHADOW_CLIREQ)
|
||||
&& (__mg_client_id == 0 && request->id != REQID_JOINLAYER)) {
|
||||
#elif defined(_MGGAL_NEXUS)
|
||||
if ((request->id != REQID_NEXUS_CLIENT_GET_SURFACE)
|
||||
&& (__mg_client_id == 0 && request->id != REQID_JOINLAYER)) {
|
||||
#else
|
||||
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER) {
|
||||
#endif
|
||||
if (__mg_client_id == 0 &&
|
||||
request->id != REQID_AUTHCLIENT &&
|
||||
request->id != REQID_GETSHAREDSURFACE &&
|
||||
request->id != REQID_NEXUS_CLIENT_GET_SURFACE &&
|
||||
request->id != REQID_MLSHADOW_CLIREQ &&
|
||||
request->id != REQID_JOINLAYER) {
|
||||
fprintf (stderr, "CLIENT: please call JoinLayer first.\n");
|
||||
exit (255);
|
||||
return -1;
|
||||
|
||||
+2
-1
@@ -2147,7 +2147,8 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (wParam == '\b') { //backspace
|
||||
/* BUGFIXING (VM 2020-03-12): merged from 5.0.0 */
|
||||
if (charBuffer [0] == '\b') { //backspace
|
||||
int del;
|
||||
|
||||
if (sled->editPos == 0 && sled->selStart == sled->selEnd)
|
||||
|
||||
@@ -3824,6 +3824,9 @@ HWND GUIAPI CreateMainWindowEx (PMAINWINCREATE pCreateInfo,
|
||||
return (HWND)pWin;
|
||||
|
||||
err:
|
||||
/* BUGFIXING (VM 2020-03-12): merged from 5.0.0 */
|
||||
ThrowAwayMessages ((HWND)pWin);
|
||||
|
||||
#ifdef _MGRM_THREADS
|
||||
if (pWin->pMessages && pWin->pHosting == NULL) {
|
||||
mg_FreeMsgQueueThisThread ();
|
||||
|
||||
+9
-5
@@ -133,8 +133,7 @@
|
||||
#include "linux-libinput.h"
|
||||
#endif
|
||||
|
||||
#define LEN_ENGINE_NAME 16
|
||||
#define LEN_MTYPE_NAME 16
|
||||
#define LEN_MTYPE_NAME 23
|
||||
|
||||
static INPUT inputs [] =
|
||||
{
|
||||
@@ -291,7 +290,8 @@ int mg_InitIAL (void)
|
||||
return ERR_NO_MATCH;
|
||||
}
|
||||
|
||||
//strcpy (__mg_cur_input->mdev, mdev);
|
||||
/* BUGFIXING (VM 2020-03-12): merged from 5.0.0 */
|
||||
__mg_cur_input->mdev = strdup (mdev);
|
||||
|
||||
if (!IAL_InitInput (__mg_cur_input, mdev, mtype)) {
|
||||
_ERR_PRINTF ("IAL: Failed to initialize the IAL engine: %s.\n", __mg_cur_input->id);
|
||||
@@ -306,8 +306,12 @@ int mg_InitIAL (void)
|
||||
|
||||
void mg_TerminateIAL (void)
|
||||
{
|
||||
if (__mg_cur_input && __mg_cur_input->term_input) {
|
||||
IAL_TermInput ();
|
||||
if (__mg_cur_input) {
|
||||
if (__mg_cur_input->mdev)
|
||||
free (__mg_cur_input->mdev);
|
||||
|
||||
if (__mg_cur_input->term_input)
|
||||
IAL_TermInput ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+21
-10
@@ -75,32 +75,43 @@
|
||||
|
||||
#define REQID_HWSURFACE 0x0013
|
||||
|
||||
#ifdef _MGHAVE_CLIPBOARD
|
||||
#define REQID_CLIPBOARD 0x0014
|
||||
#endif
|
||||
|
||||
#ifdef _MGGAL_MLSHADOW
|
||||
#define REQID_MLSHADOW_CLIREQ 0x0015
|
||||
#endif
|
||||
|
||||
#define REQID_ZORDERMASKRECTOP 0x0016
|
||||
|
||||
#ifdef _MGGAL_NEXUS
|
||||
#define REQID_NEXUS_CLIENT_GET_SURFACE 0x0017
|
||||
#endif
|
||||
#ifdef _MGGAL_SIGMA8654
|
||||
#define REQID_SIGMA8654_CLIENT_GET_SURFACE 0x0018
|
||||
#endif
|
||||
|
||||
#define REQID_GETIMEPOS 0x0019
|
||||
#define REQID_SETIMEPOS 0x001A
|
||||
|
||||
#define REQID_COPYCURSOR 0x001B
|
||||
#define REQID_COPYCURSOR 0x001B
|
||||
|
||||
// Since 4.0.7: Authenticate client
|
||||
#define REQID_AUTHCLIENT 0x001C
|
||||
|
||||
// Since 4.0.7: Get shared surface
|
||||
#define REQID_GETSHAREDSURFACE 0x001D
|
||||
// for sharedfb schema
|
||||
#define SYSSF_REAL_SCREEN "syssf-real-screen"
|
||||
|
||||
/*
|
||||
* XXX: To fellows who need to add a new REQID, please make sure your new ID _less_ than MAX_SYS_REQID (defined in /include/minigui.h).
|
||||
* XXX: To fellows who need to add a new REQID, please make sure your
|
||||
* new ID _less_ than MAX_SYS_REQID (defined in /include/minigui.h).
|
||||
*/
|
||||
|
||||
/* Since 4.0.7 */
|
||||
typedef struct _SharedSurfInfo {
|
||||
uint32_t flags; // the flags of the surface
|
||||
uint32_t width, height;
|
||||
uint32_t pitch;
|
||||
uint32_t name; // when use flink name
|
||||
uint32_t drm_format; // DRM pixel format
|
||||
size_t size; // whole size of the surface
|
||||
off_t offset; // offset of pixel data
|
||||
} SHAREDSURFINFO;
|
||||
|
||||
typedef struct JoinLayerInfo
|
||||
{
|
||||
|
||||
@@ -639,14 +639,14 @@ AlertDesktopTimerEvent (void)
|
||||
static inline void
|
||||
SetMsgQueueTimerFlag (PMSGQUEUE pMsgQueue, int slot)
|
||||
{
|
||||
pMsgQueue->TimerMask |= (0x01 << slot);
|
||||
pMsgQueue->TimerMask |= (0x01UL << slot);
|
||||
POST_MSGQ (pMsgQueue);
|
||||
}
|
||||
|
||||
static inline void
|
||||
RemoveMsgQueueTimerFlag (PMSGQUEUE pMsgQueue, int slot)
|
||||
{
|
||||
pMsgQueue->TimerMask &= ~(0x01 << slot);
|
||||
pMsgQueue->TimerMask &= ~(0x01UL << slot);
|
||||
}
|
||||
|
||||
BOOL mg_InitTimer (void);
|
||||
|
||||
+32
-1
@@ -57,6 +57,14 @@
|
||||
|
||||
#include "gdi.h"
|
||||
|
||||
#define LEN_SO_NAME 127 // name length of a shared object (library)
|
||||
#define LEN_DEVICE_NAME 127
|
||||
#define LEN_EXDRIVER_NAME LEN_SO_NAME
|
||||
#define LEN_ENGINE_NAME 23
|
||||
#define LEN_VIDEO_MODE 31
|
||||
#define LEN_MTYPE_NAME 23
|
||||
#define LEN_FOURCC_FORMAT 7
|
||||
|
||||
#define DISABLE_THREADS
|
||||
#define GAL_mutex int
|
||||
|
||||
@@ -757,7 +765,7 @@ extern GAL_Surface* __gal_screen;
|
||||
#define GAL_BMask(surface) (surface->format->Bmask)
|
||||
#define GAL_AMask(surface) (surface->format->Amask)
|
||||
|
||||
extern int mg_InitGAL (void);
|
||||
extern int mg_InitGAL (char* engine, char* mode);
|
||||
|
||||
/* Since 4.0.0; suspend/resume video device, for switching virtual terminals */
|
||||
extern int GAL_SuspendVideo(void);
|
||||
@@ -778,6 +786,29 @@ extern BYTE* gal_PutPixelKeyAlpha (GAL_Surface* dst,
|
||||
|
||||
#define mg_TerminateGAL GAL_VideoQuit
|
||||
|
||||
#ifdef _MGRM_PROCESSES
|
||||
/* Since 4.0.7: copy video information to the shared resource segment */
|
||||
BOOL GAL_CopyVideoInfoToSharedRes (void);
|
||||
#endif /* _MGRM_PROCESSES */
|
||||
|
||||
#ifdef _MGGAL_DRM
|
||||
/* functions implemented in DRM engine. */
|
||||
BOOL __drm_get_surface_info (GAL_Surface *surface, DrmSurfaceInfo* info);
|
||||
int __drm_auth_client (int, uint32_t);
|
||||
|
||||
GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
|
||||
uint32_t name, uint32_t drm_format, uint32_t pixels_off,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video,
|
||||
uint32_t handle, size_t size, uint32_t drm_format, uint32_t pixels_off,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
|
||||
int prime_fd, size_t size, uint32_t drm_format, uint32_t pixels_off,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
#endif /* defined _MGGAL_DRM */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
+65
-10
@@ -11,35 +11,35 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* 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~2018, 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/>.
|
||||
*/
|
||||
@@ -70,10 +70,48 @@ enum {
|
||||
_NR_SEM
|
||||
};
|
||||
|
||||
// key base for System V IPC
|
||||
#define IPC_KEY_BASE 0x464D4700
|
||||
|
||||
inline static key_t get_shm_key_for_system (void)
|
||||
{
|
||||
return (key_t)(IPC_KEY_BASE + 0x01);
|
||||
}
|
||||
|
||||
inline static key_t get_sem_key_for_system (void)
|
||||
{
|
||||
return (key_t)(IPC_KEY_BASE + 0x02);
|
||||
}
|
||||
|
||||
inline static key_t get_sem_key_for_layers (void)
|
||||
{
|
||||
return (key_t)(IPC_KEY_BASE + 0x03);
|
||||
}
|
||||
|
||||
/* constants for engine name and video mode */
|
||||
#define LEN_SO_NAME 127 // name length of a shared object (library)
|
||||
#define LEN_DEVICE_NAME 127
|
||||
#define LEN_EXDRIVER_NAME LEN_SO_NAME
|
||||
#define LEN_ENGINE_NAME 23
|
||||
#define LEN_VIDEO_MODE 31
|
||||
#define LEN_MTYPE_NAME 23
|
||||
#define LEN_FOURCC_FORMAT 7
|
||||
|
||||
typedef struct tagG_RES {
|
||||
int semid;
|
||||
int shmid;
|
||||
|
||||
/* information of NEWGAL engine; since 4.0.7 */
|
||||
char video_engine [LEN_ENGINE_NAME + 1];
|
||||
char video_mode [LEN_VIDEO_MODE + 1];
|
||||
char video_device [LEN_DEVICE_NAME + 1];
|
||||
int video_dpi, video_hres, video_vres, video_depth;
|
||||
Uint32 video_rmask, video_gmask, video_bmask, video_amask;
|
||||
#ifdef _MGGAL_DRM
|
||||
char video_exdriver [LEN_EXDRIVER_NAME + 1];
|
||||
Uint32 video_drm_format;
|
||||
#endif
|
||||
|
||||
int nr_layers;
|
||||
int semid_layer;
|
||||
|
||||
@@ -95,7 +133,7 @@ typedef struct tagG_RES {
|
||||
int mousebutton;
|
||||
int shiftstatus;
|
||||
Uint8 kbd_state [MGUI_NR_KEYS + 1];
|
||||
|
||||
|
||||
#ifdef _MGHAVE_CURSOR
|
||||
int cursorx, cursory;
|
||||
int oldboxleft, oldboxtop;
|
||||
@@ -132,6 +170,23 @@ typedef struct tagG_RES {
|
||||
} G_RES;
|
||||
typedef G_RES* PG_RES;
|
||||
|
||||
#define SHAREDRES_VIDEO_ENGINE (((PG_RES)mgSharedRes)->video_engine)
|
||||
#define SHAREDRES_VIDEO_MODE (((PG_RES)mgSharedRes)->video_mode)
|
||||
#define SHAREDRES_VIDEO_DEVICE (((PG_RES)mgSharedRes)->video_device)
|
||||
#define SHAREDRES_VIDEO_DPI (((PG_RES)mgSharedRes)->video_dpi)
|
||||
#define SHAREDRES_VIDEO_HRES (((PG_RES)mgSharedRes)->video_hres)
|
||||
#define SHAREDRES_VIDEO_VRES (((PG_RES)mgSharedRes)->video_vres)
|
||||
#define SHAREDRES_VIDEO_DEPTH (((PG_RES)mgSharedRes)->video_depth)
|
||||
#define SHAREDRES_VIDEO_RMASK (((PG_RES)mgSharedRes)->video_rmask)
|
||||
#define SHAREDRES_VIDEO_GMASK (((PG_RES)mgSharedRes)->video_gmask)
|
||||
#define SHAREDRES_VIDEO_BMASK (((PG_RES)mgSharedRes)->video_bmask)
|
||||
#define SHAREDRES_VIDEO_AMASK (((PG_RES)mgSharedRes)->video_amask)
|
||||
|
||||
#ifdef _MGGAL_DRM
|
||||
#define SHAREDRES_VIDEO_EXDRIVER (((PG_RES)mgSharedRes)->video_exdriver)
|
||||
#define SHAREDRES_VIDEO_DRM_FORMAT (((PG_RES)mgSharedRes)->video_drm_format)
|
||||
#endif
|
||||
|
||||
#define SHAREDRES_TIMER_COUNTER (((PG_RES)mgSharedRes)->timer_counter)
|
||||
#define SHAREDRES_TICK_ON_LOCKSEM (((PG_RES)mgSharedRes)->tick_on_locksem)
|
||||
#define SHAREDRES_TIMEOUT (((PG_RES)mgSharedRes)->timeout)
|
||||
|
||||
@@ -189,7 +189,8 @@ static HCURSOR load_cursor_from_mem (const void* area)
|
||||
p += sizeof (DWORD32);
|
||||
imagew = MGUI_ReadLE32Mem (&p);
|
||||
imageh = MGUI_ReadLE32Mem (&p);
|
||||
if (imagew > 32 || imageh > 32) {
|
||||
/* BUGFIXING (VM 2020-03-12): merged from 5.0.0 */
|
||||
if (imagew != CURSORWIDTH || imageh != (CURSORHEIGHT*2)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
@@ -370,9 +370,7 @@ HCURSOR GUIAPI GetDefaultCursor (void)
|
||||
return def_cursor;
|
||||
}
|
||||
|
||||
static BITMAP csr_bmp = {
|
||||
BMP_TYPE_NORMAL, 0, 0, 0, 0, CURSORWIDTH, CURSORHEIGHT
|
||||
};
|
||||
static BITMAP csr_bmp;
|
||||
|
||||
BOOL mg_InitCursor (void)
|
||||
{
|
||||
@@ -392,10 +390,14 @@ BOOL mg_InitCursor (void)
|
||||
CSR_OLDBOXTOP = -100;
|
||||
}
|
||||
|
||||
/* always initialize fields by explicitly assignments */
|
||||
csr_bmp.bmType = BMP_TYPE_NORMAL;
|
||||
csr_bmp.bmBitsPerPixel = __gal_screen->format->BitsPerPixel;
|
||||
csr_bmp.bmBytesPerPixel = __gal_screen->format->BytesPerPixel;
|
||||
csr_bmp.bmWidth = CURSORWIDTH;
|
||||
csr_bmp.bmHeight = CURSORHEIGHT;
|
||||
csr_bmp.bmPitch = __gal_screen->format->BytesPerPixel * CURSORWIDTH;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,9 +108,7 @@ HCURSOR GUIAPI LoadCursorFromMem (const void* area)
|
||||
return load_cursor_from_mem (area);
|
||||
}
|
||||
|
||||
static BITMAP csr_bmp = {
|
||||
BMP_TYPE_NORMAL, 0, 0, 0, 0, CURSORWIDTH, CURSORHEIGHT
|
||||
};
|
||||
static BITMAP csr_bmp;
|
||||
|
||||
/* Only called from InitCursor and client code. */
|
||||
HCURSOR GUIAPI CreateCursor(int xhotspot, int yhotspot, int w, int h,
|
||||
@@ -242,6 +240,10 @@ BOOL mg_InitCursor(void)
|
||||
|
||||
csrimgsize = GAL_GetBoxSize (__gal_screen, CURSORWIDTH, CURSORHEIGHT, &csrimgpitch);
|
||||
|
||||
/* always initialize fields by explicitly assignments */
|
||||
csr_bmp.bmType = BMP_TYPE_NORMAL;
|
||||
csr_bmp.bmWidth = CURSORWIDTH;
|
||||
csr_bmp.bmHeight = CURSORHEIGHT;
|
||||
csr_bmp.bmBitsPerPixel = __gal_screen->format->BitsPerPixel;
|
||||
csr_bmp.bmBytesPerPixel = __gal_screen->format->BytesPerPixel;
|
||||
csr_bmp.bmPitch = csrimgpitch;
|
||||
|
||||
+3
-6
@@ -139,9 +139,7 @@ HCURSOR GUIAPI LoadCursorFromMem (const void* area)
|
||||
return load_cursor_from_mem (area);
|
||||
}
|
||||
|
||||
static BITMAP csr_bmp = {
|
||||
BMP_TYPE_NORMAL, 0, 0, 0, 0, CURSORWIDTH, CURSORHEIGHT
|
||||
};
|
||||
static BITMAP csr_bmp;
|
||||
|
||||
/* Only called from InitCursor and client code. */
|
||||
HCURSOR GUIAPI CreateCursor(int xhotspot, int yhotspot, int w, int h,
|
||||
@@ -279,11 +277,10 @@ BOOL realInitCursor(void)
|
||||
&csrimgpitch);
|
||||
|
||||
csr_bmp.bmType = BMP_TYPE_NORMAL;
|
||||
csr_bmp.bmWidth = CURSORWIDTH;
|
||||
csr_bmp.bmHeight = CURSORHEIGHT;
|
||||
|
||||
csr_bmp.bmBitsPerPixel = __gal_screen->format->BitsPerPixel;
|
||||
csr_bmp.bmBytesPerPixel = __gal_screen->format->BytesPerPixel;
|
||||
csr_bmp.bmWidth = CURSORWIDTH;
|
||||
csr_bmp.bmHeight = CURSORHEIGHT;
|
||||
csr_bmp.bmPitch = csrimgpitch;
|
||||
|
||||
if( !(savedbits = malloc(csrimgsize)) )
|
||||
|
||||
@@ -97,7 +97,7 @@ GHANDLE __mg_layer;
|
||||
/* always be zero for clients. */
|
||||
BOOL __mg_switch_away;
|
||||
|
||||
void lock_zi_for_read (const ZORDERINFO* zi)
|
||||
static void lock_zi_for_read (const ZORDERINFO* zi)
|
||||
{
|
||||
struct sembuf sb;
|
||||
|
||||
@@ -116,7 +116,7 @@ again:
|
||||
|
||||
}
|
||||
|
||||
void unlock_zi_for_read (const ZORDERINFO* zi)
|
||||
static void unlock_zi_for_read (const ZORDERINFO* zi)
|
||||
{
|
||||
struct sembuf sb;
|
||||
|
||||
@@ -134,7 +134,7 @@ again:
|
||||
}
|
||||
}
|
||||
|
||||
void lock_zi_for_change (const ZORDERINFO* zi)
|
||||
static void lock_zi_for_change (const ZORDERINFO* zi)
|
||||
{
|
||||
int clients = 0;
|
||||
struct sembuf sb;
|
||||
@@ -157,7 +157,7 @@ again:
|
||||
}
|
||||
}
|
||||
|
||||
void unlock_zi_for_change (const ZORDERINFO* zi)
|
||||
static void unlock_zi_for_change (const ZORDERINFO* zi)
|
||||
{
|
||||
int clients = 0;
|
||||
struct sembuf sb;
|
||||
@@ -176,7 +176,7 @@ again:
|
||||
}
|
||||
}
|
||||
|
||||
inline void* get_zi_from_client(int cli)
|
||||
static inline void* get_zi_from_client(int cli)
|
||||
{
|
||||
return (((cli>0)?mgClients[cli].layer:mgTopmostLayer)->zorder_info);
|
||||
}
|
||||
|
||||
+236
-236
File diff suppressed because it is too large
Load Diff
+18
-6
@@ -55,6 +55,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define _DEBUG
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifndef __NOUNIX__
|
||||
@@ -252,7 +254,7 @@ static void treat_longpress (PKEYEVENT ke, DWORD interval)
|
||||
ke->event = KE_KEYLONGPRESS;
|
||||
}
|
||||
else
|
||||
ke->event = 0;
|
||||
ke->event = KE_KEYDOWN;
|
||||
}
|
||||
else if (interval >= __mg_key_alwayspress_time) {
|
||||
if (flag2) {
|
||||
@@ -261,7 +263,7 @@ static void treat_longpress (PKEYEVENT ke, DWORD interval)
|
||||
ke->event = KE_KEYALWAYSPRESS;
|
||||
}
|
||||
else if (__mg_timer_counter - starttime < __mg_interval_time) {
|
||||
ke->event = 0;
|
||||
ke->event = KE_KEYDOWN;
|
||||
}
|
||||
else {
|
||||
starttime = __mg_timer_counter;
|
||||
@@ -278,7 +280,7 @@ static void treat_longpress (PKEYEVENT ke, DWORD interval)
|
||||
ke->event = KE_KEYALWAYSPRESS;
|
||||
}
|
||||
else if (__mg_timer_counter - starttime < __mg_interval_time) {
|
||||
ke->event = 0;
|
||||
ke->event = KE_KEYDOWN;
|
||||
}
|
||||
else {
|
||||
starttime = __mg_timer_counter;
|
||||
@@ -291,7 +293,7 @@ static void treat_longpress (PKEYEVENT ke, DWORD interval)
|
||||
ke->event = KE_KEYLONGPRESS;
|
||||
}
|
||||
else
|
||||
ke->event = 0;
|
||||
ke->event = KE_KEYDOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -456,6 +458,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
||||
#endif
|
||||
ke->event = KE_KEYUP;
|
||||
ke->scancode = i;
|
||||
olddownkey = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -465,8 +468,12 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
||||
ke->scancode = olddownkey;
|
||||
interval = __mg_timer_counter - ke_time;
|
||||
treat_longpress (ke, interval);
|
||||
if (ke->event == 0)
|
||||
if (ke->event == 0) {
|
||||
return 0;
|
||||
}
|
||||
else if (ke->event == KE_KEYDOWN) {
|
||||
status |= KS_REPEATED;
|
||||
}
|
||||
}
|
||||
|
||||
make = (ke->event == KE_KEYDOWN)?1:0;
|
||||
@@ -756,6 +763,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
||||
if(oldkeystate[i] && !keystate[i]) {
|
||||
ke->event = KE_KEYUP;
|
||||
ke->scancode = i;
|
||||
olddownkey = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -765,8 +773,12 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
|
||||
ke->scancode = olddownkey;
|
||||
interval = __mg_timer_counter - ke_time;
|
||||
treat_longpress (ke, interval);
|
||||
if (ke->event == 0)
|
||||
if (ke->event == 0) {
|
||||
return 0;
|
||||
}
|
||||
else if (ke->event == KE_KEYDOWN) {
|
||||
status |= KS_REPEATED;
|
||||
}
|
||||
}
|
||||
|
||||
make = (ke->event == KE_KEYDOWN) ? 1 : 0;
|
||||
|
||||
+22
-2
@@ -108,6 +108,8 @@ void kernel_ShowCursorForGDI(BOOL fShow, void* pdc)
|
||||
|
||||
int InitGUI (int argc, const char* agr[])
|
||||
{
|
||||
char engine [LEN_ENGINE_NAME + 1];
|
||||
char mode [LEN_VIDEO_MODE + 1];
|
||||
int step = 1;
|
||||
|
||||
__mg_quiting_stage = _MG_QUITING_STAGE_RUNNING;
|
||||
@@ -135,7 +137,7 @@ int InitGUI (int argc, const char* agr[])
|
||||
step++;
|
||||
|
||||
/* Init GAL engine. */
|
||||
switch (mg_InitGAL ()) {
|
||||
switch (mg_InitGAL (engine, mode)) {
|
||||
case ERR_CONFIG_FILE:
|
||||
err_message (step, "Reading configuration failure!");
|
||||
return step;
|
||||
@@ -302,6 +304,8 @@ static BOOL InstallSEGVHandler (void)
|
||||
|
||||
int InitGUI (int argc, const char* agr[])
|
||||
{
|
||||
char engine [LEN_ENGINE_NAME + 1];
|
||||
char mode [LEN_VIDEO_MODE + 1];
|
||||
int step = 1;
|
||||
|
||||
__mg_quiting_stage = _MG_QUITING_STAGE_RUNNING;
|
||||
@@ -379,7 +383,7 @@ int InitGUI (int argc, const char* agr[])
|
||||
#endif
|
||||
|
||||
/* Init GAL engine. */
|
||||
switch (mg_InitGAL ()) {
|
||||
switch (mg_InitGAL (engine, mode)) {
|
||||
case ERR_CONFIG_FILE:
|
||||
err_message (step, "Reading configuration failure!");
|
||||
return step;
|
||||
@@ -444,6 +448,22 @@ int InitGUI (int argc, const char* agr[])
|
||||
}
|
||||
atexit (kernel_UnloadSharedResource);
|
||||
SHAREDRES_TERMIOS = savedtermio;
|
||||
|
||||
/* Since 4.0.7
|
||||
* 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);
|
||||
SHAREDRES_VIDEO_DPI = __gal_screen->dpi;
|
||||
SHAREDRES_VIDEO_HRES = __gal_screen->w;
|
||||
SHAREDRES_VIDEO_VRES = __gal_screen->h;
|
||||
SHAREDRES_VIDEO_DEPTH = __gal_screen->format->BitsPerPixel;
|
||||
SHAREDRES_VIDEO_RMASK = __gal_screen->format->Rmask;
|
||||
SHAREDRES_VIDEO_GMASK = __gal_screen->format->Gmask;
|
||||
SHAREDRES_VIDEO_BMASK = __gal_screen->format->Bmask;
|
||||
SHAREDRES_VIDEO_AMASK = __gal_screen->format->Amask;
|
||||
|
||||
GAL_CopyVideoInfoToSharedRes();
|
||||
}
|
||||
|
||||
step++;
|
||||
|
||||
+3
-1
@@ -419,6 +419,8 @@ static BOOL InstallSEGVHandler (void)
|
||||
|
||||
int GUIAPI InitGUI (int args, const char *agr[])
|
||||
{
|
||||
char engine [LEN_ENGINE_NAME + 1];
|
||||
char mode [LEN_VIDEO_MODE + 1];
|
||||
int step = 0;
|
||||
|
||||
__mg_quiting_stage = _MG_QUITING_STAGE_RUNNING;
|
||||
@@ -464,7 +466,7 @@ int GUIAPI InitGUI (int args, const char *agr[])
|
||||
}
|
||||
|
||||
step++;
|
||||
switch (mg_InitGAL ()) {
|
||||
switch (mg_InitGAL (engine, mode)) {
|
||||
case ERR_CONFIG_FILE:
|
||||
fprintf (stderr,
|
||||
"KERNEL>InitGUI: Reading configuration failure!\n");
|
||||
|
||||
+76
-50
@@ -11,41 +11,41 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* 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~2018, 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/>.
|
||||
*/
|
||||
/*
|
||||
** sharedres.c: Load and init shared resource.
|
||||
**
|
||||
**
|
||||
** Create date: 2000/12/22
|
||||
*/
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
#define SEM_PARAM 0666
|
||||
|
||||
// define to use mmap instead of shared memory.
|
||||
#undef _USE_MMAP
|
||||
#undef _USE_MMAP
|
||||
// #define _USE_MMAP 1
|
||||
|
||||
#ifdef _MGHAVE_CURSOR
|
||||
@@ -125,7 +125,7 @@ static BOOL LoadCursorRes (void)
|
||||
mgSizeRes += __mg_csrimgsize;
|
||||
((PG_RES)mgSharedRes)->csroffset = mgSizeRes;
|
||||
|
||||
// pointer to begin of cursor struct,
|
||||
// pointer to begin of cursor struct,
|
||||
// and reserve a space for handles for system cursors.
|
||||
temp = (char*)mgSharedRes + mgSizeRes + sizeof (PCURSOR) * number;
|
||||
|
||||
@@ -133,12 +133,12 @@ static BOOL LoadCursorRes (void)
|
||||
if ( !(tempcsr = sysres_load_system_cursor (i)) )
|
||||
goto error;
|
||||
|
||||
memcpy (temp, tempcsr, sizeof(CURSOR));
|
||||
memcpy (temp, tempcsr, sizeof(CURSOR));
|
||||
temp += sizeof(CURSOR);
|
||||
memcpy (temp, tempcsr->AndBits, __mg_csrimgsize);
|
||||
temp += __mg_csrimgsize;
|
||||
temp += __mg_csrimgsize;
|
||||
memcpy (temp, tempcsr->XorBits, __mg_csrimgsize);
|
||||
temp += __mg_csrimgsize;
|
||||
temp += __mg_csrimgsize;
|
||||
free (tempcsr->AndBits);
|
||||
free (tempcsr->XorBits);
|
||||
free (tempcsr);
|
||||
@@ -153,23 +153,46 @@ error:
|
||||
|
||||
#endif /* _MGHAVE_CURSOR */
|
||||
|
||||
inline static key_t get_shm_key (void)
|
||||
{
|
||||
return (key_t)(IPC_KEY_BASE + 0x01);
|
||||
}
|
||||
|
||||
inline static key_t get_sem_key (void)
|
||||
{
|
||||
return (key_t)(IPC_KEY_BASE + 0x02);
|
||||
}
|
||||
|
||||
BOOL kernel_IsOnlyMe (void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if ((fd = open (LOCKFILE, O_RDONLY)) == -1)
|
||||
if ((fd = open (LOCKFILE, O_RDONLY)) == -1) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (flock (fd, LOCK_EX | LOCK_NB) == 0) {
|
||||
// It is time to remove the old SysV IPC objects.
|
||||
key_t sem_key = get_sem_key_for_system ();
|
||||
|
||||
// remove system semaphore set.
|
||||
int semid = semget (sem_key, 0, SEM_PARAM);
|
||||
if (semid >= 0) {
|
||||
union semun ignored;
|
||||
if (semctl (semid, 0, IPC_RMID, ignored) < 0) {
|
||||
goto failed;
|
||||
}
|
||||
_WRN_PRINTF("The old semaphore set for system (0x%06x) dicarded\n",
|
||||
semid);
|
||||
}
|
||||
|
||||
// remove system semaphore set.
|
||||
sem_key = get_sem_key_for_layers ();
|
||||
semid = semget (sem_key, 0, SEM_PARAM);
|
||||
if (semid >= 0) {
|
||||
union semun ignored;
|
||||
if (semctl (semid, 0, IPC_RMID, ignored) < 0) {
|
||||
goto failed;
|
||||
}
|
||||
_WRN_PRINTF("The old semaphore set for layers (0x%06x) dicarded\n",
|
||||
semid);
|
||||
}
|
||||
|
||||
close (fd);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
failed:
|
||||
close (fd);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -186,6 +209,8 @@ error:
|
||||
perror("remove semaphore");
|
||||
}
|
||||
|
||||
static int lockfd;
|
||||
|
||||
void *kernel_LoadSharedResource (void)
|
||||
{
|
||||
key_t sem_key;
|
||||
@@ -193,7 +218,7 @@ void *kernel_LoadSharedResource (void)
|
||||
key_t shm_key;
|
||||
void *memptr;
|
||||
#endif
|
||||
int lockfd, semid;
|
||||
int semid;
|
||||
#ifndef _USE_MMAP
|
||||
int shmid;
|
||||
#endif
|
||||
@@ -205,30 +230,30 @@ void *kernel_LoadSharedResource (void)
|
||||
|
||||
#ifdef _MGHAVE_CURSOR
|
||||
if (!LoadCursorRes()) {
|
||||
perror ("InitCursor");
|
||||
perror ("InitCursor");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _USE_MMAP
|
||||
if ((shm_key = get_shm_key ()) == -1) {
|
||||
if ((shm_key = get_shm_key_for_system ()) == -1) {
|
||||
goto error;
|
||||
}
|
||||
shmid = shmget (shm_key, mgSizeRes, SHM_PARAM | IPC_CREAT | IPC_EXCL);
|
||||
if (shmid == -1) {
|
||||
shmid = shmget (shm_key, mgSizeRes, SHM_PARAM | IPC_CREAT | IPC_EXCL);
|
||||
if (shmid == -1) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
// Attach to the share memory.
|
||||
// Attach to the share memory.
|
||||
memptr = shmat (shmid, 0, 0);
|
||||
if (memptr == (char*)-1)
|
||||
if (memptr == (char*)-1)
|
||||
goto error;
|
||||
else {
|
||||
memcpy (memptr, mgSharedRes, mgSizeRes);
|
||||
free (mgSharedRes);
|
||||
}
|
||||
|
||||
if (shmctl (shmid, IPC_RMID, NULL) < 0)
|
||||
if (shmctl (shmid, IPC_RMID, NULL) < 0)
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
@@ -252,19 +277,19 @@ void *kernel_LoadSharedResource (void)
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
if (flock (lockfd, LOCK_EX | LOCK_NB) == -1)
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
close (lockfd);
|
||||
if (flock (lockfd, LOCK_EX) == -1)
|
||||
goto error;
|
||||
|
||||
// close lockfd will release the exclusive lock
|
||||
// close (lockfd);
|
||||
|
||||
// Obtain the semophore syncing drawing.
|
||||
if ((sem_key = get_sem_key ()) == -1) {
|
||||
if ((sem_key = get_sem_key_for_system ()) == -1) {
|
||||
goto error;
|
||||
}
|
||||
semid = semget (sem_key, _NR_SEM, SEM_PARAM | IPC_CREAT | IPC_EXCL);
|
||||
if (semid == -1) {
|
||||
semid = semget (sem_key, _NR_SEM, SEM_PARAM | IPC_CREAT | IPC_EXCL);
|
||||
if (semid == -1) {
|
||||
goto error;
|
||||
}
|
||||
atexit (__mg_delete_sharedres_sem);
|
||||
@@ -291,15 +316,16 @@ void *kernel_LoadSharedResource (void)
|
||||
#endif
|
||||
SHAREDRES_SEMID = semid;
|
||||
|
||||
return mgSharedRes;
|
||||
return mgSharedRes;
|
||||
|
||||
error:
|
||||
perror ("KERNEL>LoadSharedResource");
|
||||
perror ("KERNEL>LoadSharedResource");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void kernel_UnloadSharedResource (void)
|
||||
{
|
||||
close (lockfd);
|
||||
unlink (LOCKFILE);
|
||||
}
|
||||
|
||||
@@ -324,12 +350,12 @@ void* kernel_AttachSharedResource (void)
|
||||
|
||||
memptr = shmat (shmid, 0, SHM_RDONLY);
|
||||
#endif
|
||||
if (memptr == (char*)-1)
|
||||
if (memptr == (char*)-1)
|
||||
goto error;
|
||||
return memptr;
|
||||
|
||||
error:
|
||||
perror ("AttachSharedResource");
|
||||
perror ("AttachSharedResource");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -337,10 +363,10 @@ void kernel_UnattachSharedResource (void)
|
||||
{
|
||||
#ifdef _USE_MMAP
|
||||
if (munmap(mgSharedRes, mgSizeRes))
|
||||
perror("detaches shared resource");
|
||||
perror("detaches shared resource");
|
||||
#else
|
||||
if (shmdt (mgSharedRes) < 0)
|
||||
perror("detaches shared resource");
|
||||
perror("detaches shared resource");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+1498
-1080
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2019, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 2019 ~ 2020, Beijing FMSoft Technologies Co., Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -55,13 +55,18 @@
|
||||
|
||||
/* Private display data */
|
||||
|
||||
#define LEN_DEVICE_NAME 31
|
||||
|
||||
typedef struct drm_mode_info DrmModeInfo;
|
||||
|
||||
typedef struct GAL_PrivateVideoData {
|
||||
char dev_name[LEN_DEVICE_NAME + 1];
|
||||
char* dev_name;
|
||||
char* ex_driver;
|
||||
GAL_Surface* real_screen;
|
||||
int dev_fd;
|
||||
/* capabilities */
|
||||
uint32_t scanout_buff_id;
|
||||
/* the global names of real screen and shadow screen */
|
||||
uint32_t real_name;
|
||||
uint32_t cap_dumb:1;
|
||||
|
||||
void* exdrv_handle;
|
||||
DrmDriverOps* driver_ops;
|
||||
@@ -70,23 +75,8 @@ typedef struct GAL_PrivateVideoData {
|
||||
DrmModeInfo* mode_list;
|
||||
GAL_Rect** modes;
|
||||
|
||||
int bpp;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t pitch;
|
||||
uint32_t size;
|
||||
|
||||
uint32_t scanout_buff_id;
|
||||
uint8_t* scanout_fb;
|
||||
|
||||
DrmModeInfo* saved_info;
|
||||
drmModeCrtc* saved_crtc;
|
||||
|
||||
/* only valid when using DUMB frame buffer */
|
||||
uint32_t handle;
|
||||
|
||||
/* only valid when using DRM driver */
|
||||
uint32_t console_buff_id;
|
||||
} DrmVideoData;
|
||||
|
||||
#endif /* _NEWGAL_DRIVIDEO_H */
|
||||
|
||||
@@ -707,7 +707,8 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
|
||||
}
|
||||
|
||||
#ifdef _MGHAVE_PCIACCESS
|
||||
if (pci_accel_driver) /* Init accelerated hardware via pciaccess */
|
||||
/* BUGFIXING (VM 2020-03-12): merged from 5.0.0 */
|
||||
if (pci_accel_driver > 0) /* Init accelerated hardware via pciaccess */
|
||||
FB_InitPCIAccelDriver (this, current);
|
||||
#endif
|
||||
|
||||
@@ -1196,7 +1197,8 @@ static void FB_VideoQuit(_THIS)
|
||||
}
|
||||
|
||||
#ifdef _MGHAVE_PCIACCESS
|
||||
if (pci_accel_driver) {
|
||||
/* BUGFIXING (VM 2020-03-12): merged from 5.0.0 */
|
||||
if (pci_accel_driver > 0) {
|
||||
FB_CleanupPCIAccelDriver (this);
|
||||
pci_accel_driver = 0;
|
||||
}
|
||||
|
||||
@@ -74,16 +74,6 @@ struct GAL_PrivateVideoData {
|
||||
int saved_cmaplen;
|
||||
__u16 *saved_cmap;
|
||||
|
||||
#if 0
|
||||
int current_vt;
|
||||
int saved_vt;
|
||||
int keyboard_fd;
|
||||
int saved_kbd_mode;
|
||||
struct termios saved_kbd_termios;
|
||||
|
||||
int mouse_fd;
|
||||
#endif
|
||||
|
||||
#ifdef _MGHAVE_PCIACCESS
|
||||
int pci_accel_driver;
|
||||
#endif
|
||||
|
||||
+77
-28
@@ -61,11 +61,13 @@
|
||||
#include "misc.h"
|
||||
#include "license.h"
|
||||
|
||||
#ifdef _MGRM_PROCESSES
|
||||
#include "sharedres.h"
|
||||
#endif
|
||||
|
||||
GAL_Surface* __gal_screen;
|
||||
|
||||
#define LEN_ENGINE_NAME 10
|
||||
#define LEN_MODE 20
|
||||
#define LEN_MODE LEN_VIDEO_MODE
|
||||
|
||||
BOOL GAL_ParseVideoMode (const char* mode, int* w, int* h, int* depth)
|
||||
{
|
||||
@@ -87,20 +89,11 @@ BOOL GAL_ParseVideoMode (const char* mode, int* w, int* h, int* depth)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int mg_InitGAL (void)
|
||||
static void get_engine_from_etc (char* engine)
|
||||
{
|
||||
int i;
|
||||
int w, h, depth;
|
||||
char engine [LEN_ENGINE_NAME + 1];
|
||||
char mode [LEN_MODE + 1];
|
||||
|
||||
#if defined (WIN32) || !defined(__NOUNIX__)
|
||||
char* env_value;
|
||||
#endif
|
||||
char* env_value;
|
||||
|
||||
LICENSE_CHECK_CUSTIMER_ID ();
|
||||
|
||||
#ifndef __NOUNIX__
|
||||
if ((env_value = getenv ("MG_GAL_ENGINE"))) {
|
||||
strncpy (engine, env_value, LEN_ENGINE_NAME);
|
||||
engine [LEN_ENGINE_NAME] = '\0';
|
||||
@@ -109,7 +102,7 @@ int mg_InitGAL (void)
|
||||
#endif
|
||||
#ifndef _MG_MINIMALGDI
|
||||
if (GetMgEtcValue ("system", "gal_engine", engine, LEN_ENGINE_NAME) < 0) {
|
||||
return ERR_CONFIG_FILE;
|
||||
engine [0] = '\0';
|
||||
}
|
||||
#else /* _MG_MINIMALGDI */
|
||||
# ifdef _MGGAL_PCXVFB
|
||||
@@ -118,23 +111,75 @@ int mg_InitGAL (void)
|
||||
strcpy(engine, "dummy");
|
||||
# endif
|
||||
#endif /* _MG_MINIMALGDI */
|
||||
|
||||
}
|
||||
|
||||
static void get_mode_from_etc (const char* engine, char* mode)
|
||||
{
|
||||
#if defined (WIN32) || !defined(__NOUNIX__)
|
||||
char* env_value;
|
||||
|
||||
if ((env_value = getenv ("MG_DEFAULTMODE"))) {
|
||||
strncpy (mode, env_value, LEN_VIDEO_MODE);
|
||||
mode [LEN_VIDEO_MODE] = '\0';
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (GetMgEtcValue (engine, "defaultmode", mode, LEN_VIDEO_MODE) < 0)
|
||||
if (GetMgEtcValue ("system", "defaultmode", mode, LEN_VIDEO_MODE) < 0)
|
||||
mode [0] = '\0';
|
||||
}
|
||||
|
||||
static int get_dpi_from_etc (const char* engine)
|
||||
{
|
||||
int dpi;
|
||||
|
||||
if (GetMgEtcIntValue (engine, "dpi", &dpi) < 0)
|
||||
dpi = GDCAP_DPI_DEFAULT;
|
||||
else if (dpi < GDCAP_DPI_MINIMAL)
|
||||
dpi = GDCAP_DPI_MINIMAL;
|
||||
|
||||
return dpi;
|
||||
}
|
||||
|
||||
int mg_InitGAL (char* engine, char* mode)
|
||||
{
|
||||
int i;
|
||||
int w, h, depth;
|
||||
|
||||
#ifdef _MGRM_PROCESSES
|
||||
if (mgIsServer) {
|
||||
get_engine_from_etc (engine);
|
||||
}
|
||||
else {
|
||||
strncpy (engine, SHAREDRES_VIDEO_ENGINE, LEN_ENGINE_NAME);
|
||||
engine [LEN_ENGINE_NAME] = '\0';
|
||||
|
||||
strncpy (mode, SHAREDRES_VIDEO_MODE, LEN_VIDEO_MODE);
|
||||
mode [LEN_VIDEO_MODE] = '\0';
|
||||
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
need_set_mode = FALSE;
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
get_engine_from_etc (engine);
|
||||
#endif /* _MGRM_PROCESSES */
|
||||
|
||||
if (engine[0] == 0) {
|
||||
return ERR_CONFIG_FILE;
|
||||
}
|
||||
|
||||
if (GAL_VideoInit (engine, 0)) {
|
||||
GAL_VideoQuit ();
|
||||
fprintf (stderr, "NEWGAL: Does not find matched engine: %s.\n", engine);
|
||||
return ERR_NO_MATCH;
|
||||
}
|
||||
|
||||
#if defined (WIN32) || !defined(__NOUNIX__)
|
||||
if ((env_value = getenv ("MG_DEFAULTMODE"))) {
|
||||
strncpy (mode, env_value, LEN_MODE);
|
||||
mode [LEN_MODE] = '\0';
|
||||
get_mode_from_etc (engine, mode);
|
||||
|
||||
if (mode[0] == 0) {
|
||||
return ERR_CONFIG_FILE;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (GetMgEtcValue (engine, "defaultmode", mode, LEN_MODE) < 0)
|
||||
if (GetMgEtcValue ("system", "defaultmode", mode, LEN_MODE) < 0)
|
||||
return ERR_CONFIG_FILE;
|
||||
|
||||
if (!GAL_ParseVideoMode (mode, &w, &h, &depth)) {
|
||||
GAL_VideoQuit ();
|
||||
@@ -159,10 +204,14 @@ int mg_InitGAL (void)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (GetMgEtcIntValue (engine, "dpi", &__gal_screen->dpi) < 0)
|
||||
__gal_screen->dpi = GDCAP_DPI_DEFAULT;
|
||||
else if (__gal_screen->dpi < GDCAP_DPI_MINIMAL)
|
||||
__gal_screen->dpi = GDCAP_DPI_MINIMAL;
|
||||
#ifdef _MGRM_PROCESSES
|
||||
if (mgIsServer)
|
||||
__gal_screen->dpi = get_dpi_from_etc (engine);
|
||||
else
|
||||
__gal_screen->dpi = SHAREDRES_VIDEO_DPI;
|
||||
#else /* defined _MGRM_PROCESSES */
|
||||
__gal_screen->dpi = get_dpi_from_etc (engine);
|
||||
#endif /* not defined _MGRM_PROCESSES */
|
||||
|
||||
for (i = 0; i < 17; i++) {
|
||||
SysPixelIndex [i] = GAL_MapRGB (__gal_screen->format,
|
||||
|
||||
@@ -160,6 +160,12 @@ GAL_Surface * GAL_CreateRGBSurface (Uint32 flags,
|
||||
surface->flags &= ~GAL_HWSURFACE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* set a static buff to pixels for empty surface */
|
||||
static char buff[8];
|
||||
surface->flags |= GAL_PREALLOC;
|
||||
surface->pixels = buff;
|
||||
}
|
||||
|
||||
/* Allocate an empty mapping */
|
||||
surface->map = GAL_AllocBlitMap();
|
||||
|
||||
@@ -102,10 +102,10 @@ struct GAL_VideoDevice {
|
||||
GAL_Surface *(*SetVideoMode)(_THIS, GAL_Surface *current,
|
||||
int width, int height, int bpp, Uint32 flags);
|
||||
|
||||
#if 0
|
||||
/* Toggle the fullscreen mode */
|
||||
int (*ToggleFullScreen)(_THIS, int on);
|
||||
|
||||
#if 0
|
||||
/* This is called after the video mode has been set, to get the
|
||||
initial mouse state. It should queue events as necessary to
|
||||
properly represent the current mouse focus and position.
|
||||
@@ -141,6 +141,8 @@ struct GAL_VideoDevice {
|
||||
GAL_VideoInfo info;
|
||||
|
||||
#ifndef _MGRM_THREADS
|
||||
/* Copy video information to shared resource segment */
|
||||
void (*CopyVideoInfoToSharedRes)(_THIS);
|
||||
/* Request a surface in video memory */
|
||||
void (*RequestHWSurface)(_THIS, const REQ_HWSURFACE* request, REP_HWSURFACE* reply);
|
||||
#endif
|
||||
|
||||
@@ -1406,3 +1406,15 @@ int GAL_SuspendVideo(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _MGRM_PROCESSES
|
||||
BOOL GAL_CopyVideoInfoToSharedRes (void)
|
||||
{
|
||||
if (__mg_current_video && __mg_current_video->CopyVideoInfoToSharedRes) {
|
||||
__mg_current_video->CopyVideoInfoToSharedRes(__mg_current_video);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* _MGRM_PROCESSES */
|
||||
|
||||
|
||||
+35
-52
@@ -175,7 +175,7 @@ static BOOL RestrictControlECRGNEx (RECT* minimal,
|
||||
rc.bottom = (maskrect + idx)->bottom + pCtrl->top + off_y;
|
||||
AddClipRect (ergn, &rc);
|
||||
idx = (maskrect + idx)->next;
|
||||
}while (idx != 0);
|
||||
} while (idx != 0);
|
||||
|
||||
IntersectClipRect (ergn, minimal);
|
||||
}
|
||||
@@ -467,7 +467,6 @@ BOOL dc_GenerateECRgn(PDC pdc, BOOL fForce)
|
||||
PCLIPRECT pcr;
|
||||
PCONTROL pCtrl;
|
||||
RECT minimal;
|
||||
CLIPRGN ergn;
|
||||
|
||||
/* is global clip region is empty? */
|
||||
if ((!fForce) && (!dc_IsVisible (pdc)))
|
||||
@@ -522,6 +521,7 @@ BOOL dc_GenerateECRgn(PDC pdc, BOOL fForce)
|
||||
pCtrl = gui_Control (pdc->hwnd);
|
||||
|
||||
if (pCtrl && !(pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN)) {
|
||||
CLIPRGN ergn;
|
||||
InitClipRgn (&ergn, &__mg_FreeClipRectList);
|
||||
if (RestrictControlECRGNEx (&minimal, pCtrl, &ergn)) {
|
||||
ClipRgnIntersect (&pdc->ecrgn, &pdc->ecrgn, &ergn);
|
||||
@@ -530,6 +530,7 @@ BOOL dc_GenerateECRgn(PDC pdc, BOOL fForce)
|
||||
else {
|
||||
EmptyClipRgn (&pdc->ecrgn);
|
||||
}
|
||||
EmptyClipRgn (&ergn);
|
||||
}
|
||||
else {
|
||||
IntersectClipRect (&pdc->ecrgn, &minimal);
|
||||
@@ -1728,7 +1729,6 @@ static CB_COMP_SETPIXEL draw_pixel_ops [NR_ROPS][NR_PIXEL_LEN] =
|
||||
static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient)
|
||||
{
|
||||
PCONTROL pCtrl;
|
||||
CLIPRGN ergn;
|
||||
|
||||
pdc->hwnd = hWnd;
|
||||
|
||||
@@ -1793,8 +1793,8 @@ static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient)
|
||||
|
||||
pCtrl = gui_Control (pdc->hwnd);
|
||||
|
||||
if (pCtrl && !(pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN))
|
||||
{
|
||||
if (pCtrl && !(pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN)) {
|
||||
CLIPRGN ergn;
|
||||
InitClipRgn (&ergn, &__mg_FreeClipRectList);
|
||||
|
||||
if (RestrictControlECRGNEx (&minimal, pCtrl, &ergn)) {
|
||||
@@ -1804,6 +1804,8 @@ static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient)
|
||||
else {
|
||||
EmptyClipRgn (&pdc->ecrgn);
|
||||
}
|
||||
|
||||
EmptyClipRgn (&ergn);
|
||||
}
|
||||
else {
|
||||
IntersectClipRect (&pdc->ecrgn, &minimal);
|
||||
@@ -2107,7 +2109,6 @@ void GUIAPI ReleaseDC (HDC hDC)
|
||||
if (pWin && pWin->privCDC == hDC) {
|
||||
RECT minimal;
|
||||
PCONTROL pCtrl;
|
||||
CLIPRGN ergn;
|
||||
|
||||
/* for private DC, we reset the clip region info. */
|
||||
/* houhh 20090113, for private dc with secondaryDC, pGCRInfo is NULL. */
|
||||
@@ -2127,6 +2128,7 @@ void GUIAPI ReleaseDC (HDC hDC)
|
||||
|
||||
pCtrl = gui_Control (pdc->hwnd);
|
||||
if (pCtrl && !(pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN)) {
|
||||
CLIPRGN ergn;
|
||||
InitClipRgn (&ergn, &__mg_FreeClipRectList);
|
||||
if (RestrictControlECRGNEx (&minimal, pCtrl, &ergn)) {
|
||||
ClipRgnIntersect (&pdc->ecrgn, &pdc->ecrgn, &ergn);
|
||||
@@ -2135,6 +2137,7 @@ void GUIAPI ReleaseDC (HDC hDC)
|
||||
else {
|
||||
EmptyClipRgn (&pdc->ecrgn);
|
||||
}
|
||||
EmptyClipRgn (&ergn);
|
||||
}
|
||||
else {
|
||||
IntersectClipRect (&pdc->ecrgn, &minimal);
|
||||
@@ -2574,7 +2577,6 @@ BOOL dc_GenerateMemDCECRgn(PDC pdc, BOOL fForce)
|
||||
{
|
||||
PCONTROL pCtrl;
|
||||
RECT minimal;
|
||||
CLIPRGN ergn;
|
||||
PCLIPRECT pcr;
|
||||
|
||||
/* is global clip region is empty? */
|
||||
@@ -2610,6 +2612,7 @@ BOOL dc_GenerateMemDCECRgn(PDC pdc, BOOL fForce)
|
||||
/* restrict control's effective region. */
|
||||
pCtrl = gui_Control (pdc->hwnd);
|
||||
if (pCtrl && !(pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN)) {
|
||||
CLIPRGN ergn;
|
||||
InitClipRgn (&ergn, &__mg_FreeClipRectList);
|
||||
|
||||
if (RestrictControlMemDCECRGNEx (&minimal, pCtrl, &ergn)) {
|
||||
@@ -2619,6 +2622,7 @@ BOOL dc_GenerateMemDCECRgn(PDC pdc, BOOL fForce)
|
||||
else {
|
||||
EmptyClipRgn (&pdc->ecrgn);
|
||||
}
|
||||
EmptyClipRgn (&ergn);
|
||||
}
|
||||
else {
|
||||
IntersectClipRect (&pdc->ecrgn, &minimal);
|
||||
@@ -2642,7 +2646,6 @@ HDC GetSecondarySubDC (HDC secondary_dc, HWND hwnd_child, BOOL client)
|
||||
int off_x, off_y;
|
||||
PCONTROL pCtrl;
|
||||
RECT minimal;
|
||||
CLIPRGN ergn;
|
||||
|
||||
pdc_parent = dc_HDC2PDC (secondary_dc);
|
||||
|
||||
@@ -2716,6 +2719,7 @@ HDC GetSecondarySubDC (HDC secondary_dc, HWND hwnd_child, BOOL client)
|
||||
pCtrl = gui_Control (pdc->hwnd);
|
||||
|
||||
if (pCtrl && !(pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN)) {
|
||||
CLIPRGN ergn;
|
||||
InitClipRgn (&ergn, &__mg_FreeClipRectList);
|
||||
|
||||
if (RestrictControlMemDCECRGNEx (&minimal, pCtrl, &ergn)) {
|
||||
@@ -2725,6 +2729,7 @@ HDC GetSecondarySubDC (HDC secondary_dc, HWND hwnd_child, BOOL client)
|
||||
else {
|
||||
EmptyClipRgn (&pdc->ecrgn);
|
||||
}
|
||||
EmptyClipRgn (&ergn);
|
||||
}
|
||||
else {
|
||||
IntersectClipRect (&pdc->ecrgn, &minimal);
|
||||
@@ -3754,10 +3759,7 @@ MG_EXPORT GHANDLE GetVideoHandle (HDC hdc)
|
||||
|
||||
#ifdef _MGGAL_DRM
|
||||
|
||||
/* implemented in DRI engine. */
|
||||
BOOL __drm_get_surface_info (GAL_Surface *surface, DrmSurfaceInfo* info);
|
||||
|
||||
MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info)
|
||||
BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info)
|
||||
{
|
||||
PDC pdc = dc_HDC2PDC (hdc);
|
||||
if (pdc->surface->video != (GHANDLE)video)
|
||||
@@ -3766,14 +3768,8 @@ MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info)
|
||||
return __drm_get_surface_info(pdc->surface, info);
|
||||
}
|
||||
|
||||
/* implemented in DRI engine. */
|
||||
GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
|
||||
uint32_t name, uint32_t drm_format,
|
||||
unsigned int width, unsigned int height, uint32_t pitch);
|
||||
|
||||
MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
|
||||
uint32_t name, uint32_t drm_format,
|
||||
unsigned int width, unsigned int height, uint32_t pitch)
|
||||
HDC drmCreateDCFromNameEx (GHANDLE video, uint32_t name, uint32_t drm_format,
|
||||
off_t offset, uint32_t width, uint32_t height, uint32_t pitch)
|
||||
{
|
||||
PDC pmem_dc = NULL;
|
||||
GAL_Surface* surface;
|
||||
@@ -3783,7 +3779,7 @@ MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
|
||||
|
||||
LOCK (&__mg_gdilock);
|
||||
surface = __drm_create_surface_from_name (video, name,
|
||||
drm_format, width, height, pitch);
|
||||
drm_format, offset, width, height, pitch);
|
||||
UNLOCK (&__mg_gdilock);
|
||||
|
||||
if (!surface) {
|
||||
@@ -3797,16 +3793,14 @@ MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
|
||||
|
||||
pmem_dc->DataType = TYPE_HDC;
|
||||
pmem_dc->DCType = TYPE_MEMDC;
|
||||
pmem_dc->inuse = TRUE;
|
||||
pmem_dc->inuse = TRUE;
|
||||
pmem_dc->surface = surface;
|
||||
|
||||
dc_InitDC (pmem_dc, HWND_DESKTOP, FALSE);
|
||||
dc_InitDC (pmem_dc, HWND_NULL, FALSE);
|
||||
|
||||
InitClipRgn (&pmem_dc->lcrgn, &__mg_FreeClipRectList);
|
||||
MAKE_REGION_INFINITE(&pmem_dc->lcrgn);
|
||||
InitClipRgn (&pmem_dc->ecrgn, &__mg_FreeClipRectList);
|
||||
pmem_dc->pGCRInfo = NULL;
|
||||
pmem_dc->oldage = 0;
|
||||
|
||||
pmem_dc->DevRC.left = 0;
|
||||
pmem_dc->DevRC.top = 0;
|
||||
@@ -3819,14 +3813,9 @@ MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
|
||||
return (HDC)pmem_dc;
|
||||
}
|
||||
|
||||
/* implemented in DRI engine. */
|
||||
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video,
|
||||
uint32_t handle, unsigned long size, uint32_t drm_format,
|
||||
unsigned int width, unsigned int height, uint32_t pitch);
|
||||
|
||||
MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video,
|
||||
uint32_t handle, unsigned long size, uint32_t drm_format,
|
||||
unsigned int width, unsigned int height, uint32_t pitch)
|
||||
HDC drmCreateDCFromHandleEx (GHANDLE video, uint32_t handle, size_t size,
|
||||
uint32_t drm_format, off_t offset,
|
||||
uint32_t width, uint32_t height, uint32_t pitch)
|
||||
{
|
||||
PDC pmem_dc = NULL;
|
||||
GAL_Surface* surface;
|
||||
@@ -3836,7 +3825,7 @@ MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video,
|
||||
|
||||
LOCK (&__mg_gdilock);
|
||||
surface = __drm_create_surface_from_handle (video, handle, size,
|
||||
drm_format, width, height, pitch);
|
||||
drm_format, offset, width, height, pitch);
|
||||
UNLOCK (&__mg_gdilock);
|
||||
|
||||
if (!surface) {
|
||||
@@ -3850,16 +3839,14 @@ MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video,
|
||||
|
||||
pmem_dc->DataType = TYPE_HDC;
|
||||
pmem_dc->DCType = TYPE_MEMDC;
|
||||
pmem_dc->inuse = TRUE;
|
||||
pmem_dc->inuse = TRUE;
|
||||
pmem_dc->surface = surface;
|
||||
|
||||
dc_InitDC (pmem_dc, HWND_DESKTOP, FALSE);
|
||||
dc_InitDC (pmem_dc, HWND_NULL, FALSE);
|
||||
|
||||
InitClipRgn (&pmem_dc->lcrgn, &__mg_FreeClipRectList);
|
||||
MAKE_REGION_INFINITE(&pmem_dc->lcrgn);
|
||||
InitClipRgn (&pmem_dc->ecrgn, &__mg_FreeClipRectList);
|
||||
pmem_dc->pGCRInfo = NULL;
|
||||
pmem_dc->oldage = 0;
|
||||
|
||||
pmem_dc->DevRC.left = 0;
|
||||
pmem_dc->DevRC.top = 0;
|
||||
@@ -3872,14 +3859,9 @@ MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video,
|
||||
return (HDC)pmem_dc;
|
||||
}
|
||||
|
||||
/* implemented in DRI engine. */
|
||||
GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
|
||||
int prime_fd, unsigned long size, uint32_t drm_format,
|
||||
unsigned int width, unsigned int height, uint32_t pitch);
|
||||
|
||||
MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
||||
int prime_fd, unsigned long size, uint32_t drm_format,
|
||||
unsigned int width, unsigned int height, uint32_t pitch)
|
||||
HDC drmCreateDCFromPrimeFdEx (GHANDLE video, int prime_fd, size_t size,
|
||||
uint32_t drm_format, off_t offset,
|
||||
uint32_t width, uint32_t height, uint32_t pitch)
|
||||
{
|
||||
PDC pmem_dc = NULL;
|
||||
GAL_Surface* surface;
|
||||
@@ -3887,9 +3869,12 @@ MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
||||
if (!(pmem_dc = malloc (sizeof(DC))))
|
||||
return HDC_INVALID;
|
||||
|
||||
if (size == 0) {
|
||||
}
|
||||
|
||||
LOCK (&__mg_gdilock);
|
||||
surface =__drm_create_surface_from_prime_fd (video, prime_fd, size,
|
||||
drm_format, width, height, pitch);
|
||||
drm_format, offset, width, height, pitch);
|
||||
UNLOCK (&__mg_gdilock);
|
||||
|
||||
if (!surface) {
|
||||
@@ -3903,16 +3888,14 @@ MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
||||
|
||||
pmem_dc->DataType = TYPE_HDC;
|
||||
pmem_dc->DCType = TYPE_MEMDC;
|
||||
pmem_dc->inuse = TRUE;
|
||||
pmem_dc->inuse = TRUE;
|
||||
pmem_dc->surface = surface;
|
||||
|
||||
dc_InitDC (pmem_dc, HWND_DESKTOP, FALSE);
|
||||
dc_InitDC (pmem_dc, HWND_NULL, FALSE);
|
||||
|
||||
InitClipRgn (&pmem_dc->lcrgn, &__mg_FreeClipRectList);
|
||||
MAKE_REGION_INFINITE(&pmem_dc->lcrgn);
|
||||
InitClipRgn (&pmem_dc->ecrgn, &__mg_FreeClipRectList);
|
||||
pmem_dc->pGCRInfo = NULL;
|
||||
pmem_dc->oldage = 0;
|
||||
|
||||
pmem_dc->DevRC.left = 0;
|
||||
pmem_dc->DevRC.top = 0;
|
||||
@@ -3925,4 +3908,4 @@ MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
|
||||
return (HDC)pmem_dc;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* _MGGAL_DRM */
|
||||
|
||||
+29
-34
@@ -11,41 +11,41 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* 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~2018, 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/>.
|
||||
*/
|
||||
/*
|
||||
** layer.c: maintain the layers in server.
|
||||
**
|
||||
**
|
||||
** Current maintainer: Wei Yongming.
|
||||
**
|
||||
** Create date: 2005/08/14
|
||||
@@ -83,7 +83,7 @@ ON_CHANGE_LAYER OnChangeLayer = NULL;
|
||||
static int sg_nr_layers = 0;
|
||||
static unsigned char sem_usage [(MAX_NR_LAYERS + 7)/8];
|
||||
|
||||
static BOOL do_alloc_layer (MG_Layer* layer, const char* name,
|
||||
static BOOL do_alloc_layer (MG_Layer* layer, const char* name,
|
||||
int nr_topmosts, int nr_normals)
|
||||
{
|
||||
ZORDERINFO* zi;
|
||||
@@ -97,10 +97,10 @@ static BOOL do_alloc_layer (MG_Layer* layer, const char* name,
|
||||
|
||||
/* Attach to the share memory. */
|
||||
zi = shmat (layer->zorder_shmid, 0, 0);
|
||||
if (zi == (void*)-1)
|
||||
if (zi == (void*)-1)
|
||||
return FALSE;
|
||||
|
||||
if (shmctl (layer->zorder_shmid, IPC_RMID, NULL) < 0)
|
||||
if (shmctl (layer->zorder_shmid, IPC_RMID, NULL) < 0)
|
||||
return FALSE;
|
||||
|
||||
strcpy (layer->name, name);
|
||||
@@ -148,7 +148,7 @@ static BOOL do_alloc_layer (MG_Layer* layer, const char* name,
|
||||
memset (maskrect_usage_bmp, 0xFF, zi->size_maskrect_usage_bmp);
|
||||
|
||||
/* init z-order node for desktop */
|
||||
znodes = (ZORDERNODE*) ((char*)(zi + 1) + zi->size_usage_bmp +
|
||||
znodes = (ZORDERNODE*) ((char*)(zi + 1) + zi->size_usage_bmp +
|
||||
sizeof (ZORDERNODE) * DEF_NR_POPUPMENUS);
|
||||
|
||||
znodes [0].flags = ZOF_TYPE_DESKTOP | ZOF_VISIBLE;
|
||||
@@ -239,11 +239,6 @@ BOOL __mg_is_valid_layer (MG_Layer* layer)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
inline static key_t get_sem_key (void)
|
||||
{
|
||||
return (key_t)(IPC_KEY_BASE + 0x03);
|
||||
}
|
||||
|
||||
void __mg_delete_zi_sem (void)
|
||||
{
|
||||
union semun ignored;
|
||||
@@ -268,11 +263,11 @@ int __mg_init_layers ()
|
||||
|
||||
memset (sem_usage, 0xFF, sizeof (sem_usage));
|
||||
|
||||
if ((sem_key = get_sem_key ()) == -1) {
|
||||
if ((sem_key = get_sem_key_for_layers ()) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
semid = semget (sem_key, MAX_NR_LAYERS, SEM_PARAM | IPC_CREAT | IPC_EXCL);
|
||||
semid = semget (sem_key, MAX_NR_LAYERS, SEM_PARAM | IPC_CREAT | IPC_EXCL);
|
||||
if (semid == -1)
|
||||
return -1;
|
||||
atexit (__mg_delete_zi_sem);
|
||||
@@ -280,7 +275,7 @@ int __mg_init_layers ()
|
||||
SHAREDRES_SEMID_LAYER = semid;
|
||||
|
||||
/* allocate the first layer for the default layer. */
|
||||
if (!do_alloc_layer (mgLayers, NAME_DEF_LAYER,
|
||||
if (!do_alloc_layer (mgLayers, NAME_DEF_LAYER,
|
||||
SHAREDRES_DEF_NR_TOPMOSTS, SHAREDRES_DEF_NR_NORMALS)) {
|
||||
|
||||
free (mgLayers);
|
||||
@@ -349,18 +344,18 @@ static MG_Layer* alloc_layer (const char* layer_name,
|
||||
|
||||
mgTopmostLayer = new_layer;
|
||||
|
||||
_WRN_PRINTF ("SERVER: alloc_layer, mgTopmostLayer->zi = %p\n",
|
||||
_WRN_PRINTF ("SERVER: alloc_layer, mgTopmostLayer->zi = %p\n",
|
||||
mgTopmostLayer->zorder_info);
|
||||
|
||||
/* Topmost layer changed */
|
||||
CHANGE_TOPMOST_LAYER(mgTopmostLayer);
|
||||
|
||||
__mg_do_change_topmost_layer ();
|
||||
_WRN_PRINTF ("SERVER: alloc_layer, mgTopmostLayer->zi = %p\n",
|
||||
_WRN_PRINTF ("SERVER: alloc_layer, mgTopmostLayer->zi = %p\n",
|
||||
mgTopmostLayer->zorder_info);
|
||||
|
||||
/* Notify that a new topmost layer have been set. */
|
||||
if (OnChangeLayer)
|
||||
if (OnChangeLayer)
|
||||
OnChangeLayer (LCO_TOPMOST_CHANGED, mgTopmostLayer, NULL);
|
||||
|
||||
PostMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0, 0);
|
||||
@@ -421,7 +416,7 @@ void __mg_get_layer_info (int cli, const char* layer_name, LAYERINFO* info)
|
||||
}
|
||||
}
|
||||
|
||||
static void do_client_join_layer (int cli,
|
||||
static void do_client_join_layer (int cli,
|
||||
const JOINLAYERINFO* info, JOINEDCLIENTINFO* joined_info)
|
||||
{
|
||||
MG_Layer* layer = (MG_Layer*)(joined_info->layer);
|
||||
@@ -433,11 +428,11 @@ static void do_client_join_layer (int cli,
|
||||
return;
|
||||
}
|
||||
|
||||
_WRN_PRINTF ("SERVER: Join a client (%s) to layer %s\n",
|
||||
_WRN_PRINTF ("SERVER: Join a client (%s) to layer %s\n",
|
||||
info->client_name, layer->name);
|
||||
|
||||
strcpy (new_client->name, info->client_name);
|
||||
|
||||
|
||||
new_client->layer = layer;
|
||||
|
||||
/* Notify that a new client joined to this layer. */
|
||||
@@ -455,13 +450,13 @@ static void do_client_join_layer (int cli,
|
||||
}
|
||||
|
||||
/* Join a client to a layer, the server side of JoinLayer */
|
||||
void __mg_client_join_layer (int cli,
|
||||
void __mg_client_join_layer (int cli,
|
||||
const JOINLAYERINFO* info, JOINEDCLIENTINFO* joined_info)
|
||||
{
|
||||
MG_Layer* layer;
|
||||
|
||||
if ((layer = __mg_find_layer_by_name (info->layer_name)) == NULL) {
|
||||
layer = alloc_layer (info->layer_name,
|
||||
layer = alloc_layer (info->layer_name,
|
||||
(info->max_nr_topmosts <= 0)?SHAREDRES_DEF_NR_TOPMOSTS:
|
||||
info->max_nr_topmosts,
|
||||
(info->max_nr_normals<= 0)?SHAREDRES_DEF_NR_NORMALS:
|
||||
@@ -512,7 +507,7 @@ BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
MG_Layer* GUIAPI ServerCreateLayer (const char* layer_name,
|
||||
MG_Layer* GUIAPI ServerCreateLayer (const char* layer_name,
|
||||
int max_nr_topmosts, int max_nr_normals)
|
||||
{
|
||||
MG_Layer* new_layer;
|
||||
@@ -604,7 +599,7 @@ int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode, int* cli)
|
||||
return -1;
|
||||
|
||||
zi = (ZORDERINFO*)layer->zorder_info;
|
||||
if (idx_znode > zi->max_nr_globals
|
||||
if (idx_znode > zi->max_nr_globals
|
||||
+ zi->max_nr_topmosts + zi->max_nr_normals) {
|
||||
return -1;
|
||||
}
|
||||
@@ -680,7 +675,7 @@ BOOL GUIAPI ServerGetZNodeInfo (MG_Layer* layer, int idx_znode,
|
||||
return FALSE;
|
||||
|
||||
zi = (ZORDERINFO*)layer->zorder_info;
|
||||
if (idx_znode > zi->max_nr_globals
|
||||
if (idx_znode > zi->max_nr_globals
|
||||
+ zi->max_nr_topmosts + zi->max_nr_normals) {
|
||||
return FALSE;
|
||||
}
|
||||
@@ -713,7 +708,7 @@ BOOL GUIAPI ServerDoZNodeOperation (MG_Layer* layer,
|
||||
return FALSE;
|
||||
|
||||
zi = (ZORDERINFO*)layer->zorder_info;
|
||||
if (idx_znode > zi->max_nr_globals
|
||||
if (idx_znode > zi->max_nr_globals
|
||||
+ zi->max_nr_topmosts + zi->max_nr_normals) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -601,6 +601,34 @@ static int req_hw_surface (int cli, int clifd, void* buff, size_t len)
|
||||
extern int clipboard_op (int cli, int clifd, void* buff, size_t len);
|
||||
#endif
|
||||
|
||||
static int authenticate_client (int cli, int clifd, void* buff, size_t len)
|
||||
{
|
||||
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);
|
||||
#endif
|
||||
|
||||
return ServerSendReply (clifd, &auth_result, sizeof (int));
|
||||
}
|
||||
|
||||
/* get the rendering surface */
|
||||
static int get_shared_surface (int cli, int clifd, void* buff, size_t len)
|
||||
{
|
||||
SHAREDSURFINFO info = { 0, 0 };
|
||||
|
||||
#ifdef _MGGAL_DRM
|
||||
const char* name = buff;
|
||||
extern int __drm_get_shared_screen_surface (const char*, SHAREDSURFINFO*);
|
||||
__drm_get_shared_screen_surface (name, &info);
|
||||
#endif
|
||||
|
||||
return ServerSendReply (clifd, &info, sizeof (SHAREDSURFINFO));
|
||||
}
|
||||
|
||||
static REQ_HANDLER handlers [MAX_REQID] =
|
||||
{
|
||||
load_cursor,
|
||||
@@ -646,6 +674,8 @@ static REQ_HANDLER handlers [MAX_REQID] =
|
||||
get_ime_targetinfo,
|
||||
set_ime_targetinfo,
|
||||
copy_cursor,
|
||||
authenticate_client,
|
||||
get_shared_surface,
|
||||
};
|
||||
|
||||
BOOL GUIAPI RegisterRequestHandler (int req_id, REQ_HANDLER your_handler)
|
||||
|
||||
+12
-3
@@ -166,21 +166,30 @@ static void ParseEvent (PMSGQUEUE msg_que, int event)
|
||||
case ME_LEFTDOWN:
|
||||
Msg.message = MSG_LBUTTONDOWN;
|
||||
break;
|
||||
case ME_RIGHTDOWN:
|
||||
Msg.message = MSG_RBUTTONDOWN;
|
||||
break;
|
||||
case ME_LEFTUP:
|
||||
Msg.message = MSG_LBUTTONUP;
|
||||
break;
|
||||
case ME_LEFTDBLCLICK:
|
||||
Msg.message = MSG_LBUTTONDBLCLK;
|
||||
break;
|
||||
case ME_RIGHTDOWN:
|
||||
Msg.message = MSG_RBUTTONDOWN;
|
||||
break;
|
||||
case ME_RIGHTUP:
|
||||
Msg.message = MSG_RBUTTONUP;
|
||||
break;
|
||||
case ME_RIGHTDBLCLICK:
|
||||
Msg.message = MSG_RBUTTONDBLCLK;
|
||||
break;
|
||||
case ME_MIDDLEDOWN:
|
||||
Msg.message = MSG_MBUTTONDOWN;
|
||||
break;
|
||||
case ME_MIDDLEUP:
|
||||
Msg.message = MSG_MBUTTONUP;
|
||||
break;
|
||||
case ME_MIDDLEDBLCLICK:
|
||||
Msg.message = MSG_MBUTTONDBLCLK;
|
||||
break;
|
||||
}
|
||||
|
||||
if (__mg_do_drag_drop_window (Msg.message, me->x, me->y)) {
|
||||
|
||||
@@ -162,6 +162,15 @@ static void ParseEvent (PMSGQUEUE msg_que, int event)
|
||||
case ME_RIGHTDBLCLICK:
|
||||
Msg.message = MSG_RBUTTONDBLCLK;
|
||||
break;
|
||||
case ME_MIDDLEDOWN:
|
||||
Msg.message = MSG_MBUTTONDOWN;
|
||||
break;
|
||||
case ME_MIDDLEUP:
|
||||
Msg.message = MSG_MBUTTONUP;
|
||||
break;
|
||||
case ME_MIDDLEDBLCLICK:
|
||||
Msg.message = MSG_MBUTTONDBLCLK;
|
||||
break;
|
||||
}
|
||||
|
||||
Msg.lParam = MAKELONG (me->x, me->y);
|
||||
|
||||
@@ -74,7 +74,7 @@ const int __mg_cursors_offset [] = {
|
||||
766*11 + 326*9 + 518*2,
|
||||
};
|
||||
|
||||
const const unsigned char __mg_cursors_data[] = {
|
||||
const unsigned char __mg_cursors_data[] = {
|
||||
#ifdef __TARGET_FMSOFT__
|
||||
0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x20, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x02,
|
||||
|
||||
@@ -85,9 +85,9 @@
|
||||
BOOL sysres_init_inner_resource()
|
||||
{
|
||||
#ifdef _MGINCORE_RES
|
||||
AddInnerRes(__mgir_bmp_inner_res, TABLESIZE(__mgir_bmp_inner_res), FALSE);
|
||||
AddInnerRes(__mgir_icon_inner_res, TABLESIZE(__mgir_icon_inner_res),FALSE);
|
||||
AddInnerRes(__mgir_font_inner_res, TABLESIZE(__mgir_font_inner_res),FALSE);
|
||||
AddInnerRes((INNER_RES*)__mgir_bmp_inner_res, TABLESIZE(__mgir_bmp_inner_res), FALSE);
|
||||
AddInnerRes((INNER_RES*)__mgir_icon_inner_res, TABLESIZE(__mgir_icon_inner_res),FALSE);
|
||||
AddInnerRes((INNER_RES*)__mgir_font_inner_res, TABLESIZE(__mgir_font_inner_res),FALSE);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user