From 3a37407982d19171f937af36efa70720253e69e3 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Sun, 14 Jul 2019 16:38:03 +0800 Subject: [PATCH] cleanup for MiniGUI-Processes --- configure.ac | 44 ++++++++++++++++++++++---------------- include/common.h | 12 ++++++----- src/kernel/desktop-procs.c | 2 -- src/newgal/video.c | 4 ++-- 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/configure.ac b/configure.ac index facca5a4..0e4b4efc 100644 --- a/configure.ac +++ b/configure.ac @@ -79,6 +79,8 @@ AC_FUNC_VPRINTF AC_CHECK_FUNCS(time mktime localtime clock_gettime strdup strcasecmp strncasecmp strerror setlocale) AC_CHECK_FUNCS(posix_memalign memalign valloc) +PKG_CHECK_MODULES(UDEV, [libudev >= 200], have_udev="yes", have_udev="no; need libudev 200+") + dnl ======================================================================== dnl User selectable options @@ -889,23 +891,27 @@ CheckFBCON() dnl Find the DRM includes CheckDRM() { - AC_ARG_ENABLE(videodri, -[ --enable-videodri include Linux DRM NEWGAL engine ], - enable_video_dri=$enableval) - if test "x$enable_video_dri" = "xyes"; then - PKG_CHECK_MODULES(DRM, [libudev >= 200, libdrm >= 2.4], video_dri="yes", - video_dri="no; Linux DRM NEWGAL engine requires libdrm 2.4+ and libudev 200+") - if test "x$video_dri" = "xyes"; then - AC_DEFINE(_MGGAL_DRI, 1, - [Define if include Linux DRM NEWGAL engine]) - VIDEO_SUBDIRS="$VIDEO_SUBDIRS dri" - VIDEO_DRIVERS="$VIDEO_DRIVERS dri/libvideo_dri.la" - DEP_LIBS="$DEP_LIBS -ldrm" - need_udev="yes" - DRM_INC_DIR="`$PKG_CONFIG --variable includedir libdrm`/drm" - AC_SUBST(DRM_INC_DIR) - else - AC_MSG_WARN([$video_dri]) + if test "x$runtime_mode" = "xprocs"; then + enable_video_dri="no; DRI engine does not support MiniGUI-Processes runtime mode currently" + else + AC_ARG_ENABLE(videodri, + [ --enable-videodri include Linux DRI NEWGAL engine ], + enable_video_dri=$enableval) + if test "x$enable_video_dri" = "xyes"; then + PKG_CHECK_MODULES(DRM, [libdrm >= 2.4], video_dri="yes", + video_dri="no; Linux DRI NEWGAL engine requires libdrm 2.4+") + if test "x$video_dri" = "xyes"; then + AC_DEFINE(_MGGAL_DRI, 1, + [Define if include Linux DRI NEWGAL engine]) + VIDEO_SUBDIRS="$VIDEO_SUBDIRS dri" + VIDEO_DRIVERS="$VIDEO_DRIVERS dri/libvideo_dri.la" + DEP_LIBS="$DEP_LIBS -ldrm" + need_udev="yes" + DRM_INC_DIR="`$PKG_CONFIG --variable includedir libdrm`/drm" + AC_SUBST(DRM_INC_DIR) + else + AC_MSG_WARN([$video_dri]) + fi fi fi } @@ -1918,8 +1924,8 @@ if test "x$build_tslib_ial_engine" = "xyes"; then fi if test "x$build_libinput_ial_engine" = "xyes"; then - PKG_CHECK_MODULES(LIBINPUT, [libudev >= 200, libinput >= 1.10.0], , - build_libinput_ial_engine="no; Libinput IAL engine requires libinput 1.13.0+ and libudev 200+") + PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.10.0], build_libinput_ial_engine="yes", + build_libinput_ial_engine="no; Libinput IAL engine requires libinput 1.10.0+") if test "x$build_libinput_ial_engine" = "xyes"; then AC_DEFINE(_MGIAL_LIBINPUT, 1, [Define if include Linux libinput IAL engine]) diff --git a/include/common.h b/include/common.h index 61b26f06..435246fd 100644 --- a/include/common.h +++ b/include/common.h @@ -1986,11 +1986,9 @@ typedef struct _GAL_Rect { /** @} end of macros_types */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HAVE_TIME +#ifdef HAVE_TIME +#include +#else typedef unsigned long time_t; struct tm { @@ -2006,6 +2004,10 @@ struct tm { }; #endif +#ifdef __cplusplus +extern "C" { +#endif + #if defined (__THREADX__) && defined (__TARGET_VFANVIL__) #include "fx_api.h" #include "tx_api.h" diff --git a/src/kernel/desktop-procs.c b/src/kernel/desktop-procs.c index df1a0676..7c538e87 100644 --- a/src/kernel/desktop-procs.c +++ b/src/kernel/desktop-procs.c @@ -3515,8 +3515,6 @@ LRESULT DesktopWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) __mg_zorder_info->active_win, message, wParam, lParam); } - - PostMessage ((HWND)active_mainwnd, message, wParam, lParam); } else if (message >= MSG_FIRSTKEYMSG && message <= MSG_LASTKEYMSG) { if (mgIsServer) { diff --git a/src/newgal/video.c b/src/newgal/video.c index c8ea2444..1183e0de 100644 --- a/src/newgal/video.c +++ b/src/newgal/video.c @@ -1349,7 +1349,7 @@ GAL_Surface *gal_SlaveVideoInit(const char* driver_name, const char* mode, int d int GAL_ResumeVideo(void) { #ifdef _MGRM_PROCESSES - if (mgIsSever) { + if (mgIsServer) { #endif if (current_video && current_video->Resume) { current_video->Resume(current_video); @@ -1382,7 +1382,7 @@ int GAL_SuspendVideo(void) #endif #ifdef _MGRM_PROCESSES - if (mgIsSever) { + if (mgIsServer) { #endif if (current_video && current_video->Suspend) { current_video->Suspend(current_video);