mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-23 08:33:55 +08:00
modified for rtems
This commit is contained in:
+12
-2
@@ -1404,12 +1404,18 @@ case "$with_libsuffix" in
|
||||
esac
|
||||
|
||||
AC_ARG_WITH(osname,
|
||||
[ --with-osname=linux/uclinux/ecos/ucos2/swlinux/vxworks/win32/darwin/threadx/cygwin/nucleus/ose/psos])
|
||||
[ --with-osname=linux/uclinux/ecos/ucos2/swlinux/vxworks/win32/darwin/threadx/cygwin/nucleus/ose/psos/rtems])
|
||||
|
||||
dnl configure.in file is used only for the following OSes: linux/uclinux/swlinux/ecos/darwin/cygwin
|
||||
dnl for other OSes, you should use makefile.ng or else.
|
||||
|
||||
case "$with_osname" in
|
||||
rtems)
|
||||
AC_DEFINE(__RTEMS__, 1,
|
||||
[Define if compile for rtems])
|
||||
AC_DEFINE(__NOUNIX__, 1,
|
||||
[Define if compile for non-UNIX like OS])
|
||||
;;
|
||||
uclinux)
|
||||
AC_DEFINE(__uClinux__, 1,
|
||||
[Define if compile for uClinux])
|
||||
@@ -1510,7 +1516,7 @@ dnl esac
|
||||
|
||||
AC_ARG_WITH(targetname,
|
||||
[ --with-targetname=unknown/customer/fmsoft/mstudio/stb810/vfanvil/vxi386/qvfb/fbcon/mx21/monaco/c33l05/bfin/vxppc/
|
||||
S3C6410/S3C2440/S3C2410/hi3560a Define the target board name])
|
||||
S3C6410/S3C2440/S3C2410/hi3560a/movidius Define the target board name])
|
||||
|
||||
case "$with_targetname" in
|
||||
fmsoft)
|
||||
@@ -1565,6 +1571,10 @@ case "$with_targetname" in
|
||||
hi3560a)
|
||||
CFLAGS="$CFLAGS -D_WITH_TARGET_HI3560A"
|
||||
;;
|
||||
movidius)
|
||||
AC_DEFINE(__TARGET_MOVIDIUS__, 1,
|
||||
[Define for Intel ma2150])
|
||||
;;
|
||||
*)
|
||||
with_targetname="unknown"
|
||||
CFLAGS="$CFLAGS -D_WITH_TARGET_NONE"
|
||||
|
||||
+1
-1
@@ -1701,7 +1701,7 @@ typedef struct _GAL_Rect {
|
||||
#endif
|
||||
|
||||
/* Commonly used definitions */
|
||||
#if !defined(__NOUNIX__) || defined (__ECOS__)
|
||||
#if !defined(__NOUNIX__) || defined (__ECOS__) || defined (__RTEMS__)
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
|
||||
+14
-6
@@ -2734,8 +2734,9 @@ MG_EXPORT HCURSOR GUIAPI GetCurrentCursor (void);
|
||||
#define LoadCursorFromFile(filename) (do_nothing(), 0)
|
||||
#define CreateCursor(x, y, w, h, ANDbs, XORbs, cr) (do_nothing(), 0)
|
||||
#define DestroyCursor(hcsr) (do_nothing(), 0)
|
||||
#define GetSystemCursor(csrid) (do_nothing(), 0)
|
||||
// #define GetSystemCursor(csrid) (do_nothing(), 0)
|
||||
#define GetCurrentCursor() (do_nothing(), 0)
|
||||
static inline HCURSOR GetSystemCursor(int csrid) { return (HCURSOR) 0;}
|
||||
#endif /* _MGHAVE_CURSOR */
|
||||
|
||||
#define MAX_SYSCURSORINDEX 22
|
||||
@@ -2909,10 +2910,16 @@ MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
|
||||
MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void);
|
||||
|
||||
#else
|
||||
#define SetCursorEx(hcsr, set_def) (do_nothing(), 0)
|
||||
#define SetCursor(hcsr) (do_nothing(), 0)
|
||||
#define SetDefaultCursor(hcsr) (do_nothing(), 0)
|
||||
#define GetDefaultCursor() (do_nothing(), 0)
|
||||
// #define SetCursorEx(hcsr, set_def) (do_nothing(), (HCURSOR)0)
|
||||
// #define SetCursor(hcsr) (do_nothing(), (HCURSOR)0)
|
||||
// #define SetDefaultCursor(hcsr) (do_nothing(), (HCURSOR)0)
|
||||
// #define GetDefaultCursor() (do_nothing(), (HCURSOR)0)
|
||||
|
||||
static inline HCURSOR SetCursorEx(HCURSOR hcsr, BOOL set_def) { return (HCURSOR) 0;}
|
||||
static inline HCURSOR SetCursor(HCURSOR hcsr) { return (HCURSOR) 0;}
|
||||
static inline HCURSOR SetDefaultCursor(HCURSOR hcsr) { return (HCURSOR) 0;}
|
||||
static inline HCURSOR GetDefaultCursor(void) { return (HCURSOR) 0;}
|
||||
|
||||
#endif /* _MGHAVE_CURSOR */
|
||||
|
||||
#ifdef _MGHAVE_CURSOR
|
||||
@@ -2933,7 +2940,8 @@ MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void);
|
||||
*/
|
||||
MG_EXPORT int GUIAPI ShowCursor (BOOL fShow);
|
||||
#else
|
||||
#define ShowCursor(fShow) (do_nothing(), 0)
|
||||
// #define ShowCursor(fShow) (do_nothing(), (HCURSOR)0)
|
||||
static inline int ShowCursor(BOOL fShow) {return 0;}
|
||||
#endif /* _MGHAVE_CURSOR */
|
||||
|
||||
/** @} end of cursor_fns */
|
||||
|
||||
@@ -1893,7 +1893,9 @@ sledit_insert_text (HWND hWnd, PSLEDITDATA sled, const char* newtext, int len)
|
||||
return -1;
|
||||
|
||||
if (dwStyle & ES_READONLY)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
tempstr = (char*) malloc(realen+1);
|
||||
|
||||
|
||||
@@ -1266,7 +1266,9 @@ static void ShowCurItemHintText (HWND hWnd, NTBCTRLDATA *ntb_data , NTBITEM * pi
|
||||
return;
|
||||
|
||||
if (pitem->tip[0] == '\0')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
x = pitem->rc_item.right;
|
||||
y = pitem->rc_item.bottom;
|
||||
|
||||
@@ -294,7 +294,7 @@ static void start_str_output (LOGFONT* logfont, DEVFONT* devfont)
|
||||
/* call this function before getting the bitmap/pixmap of the char
|
||||
* to get the bbox of the char */
|
||||
static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value,
|
||||
Glyph32 glyph_value,
|
||||
int* px, int* py, int* pwidth, int* pheight)
|
||||
{
|
||||
TT_UShort uni_char;
|
||||
@@ -440,7 +440,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
/* call this function to get the bitmap/pixmap of the char */
|
||||
static const void*
|
||||
char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, BOOL is_grey)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, BOOL is_grey)
|
||||
{
|
||||
TT_Raster_Map Raster;
|
||||
TT_Error error;
|
||||
@@ -538,14 +538,14 @@ char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
if (scale) *scale = 1;
|
||||
return char_bitmap_pixmap (logfont, devfont, glyph_value, sz, pitch, FALSE);
|
||||
}
|
||||
|
||||
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
if (scale) *scale = 1;
|
||||
return char_bitmap_pixmap (logfont, devfont, glyph_value, sz, pitch, TRUE);
|
||||
@@ -554,7 +554,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
/* call this function after getting the bitmap/pixmap of the char
|
||||
* to get the advance of the char */
|
||||
static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* px, int* py)
|
||||
Glyph32 glyph_value, int* px, int* py)
|
||||
{
|
||||
TT_Pos vec_x, vec_y;
|
||||
TTFINSTANCEINFO* ttf_inst_info = TTF_INST_INFO_P (devfont);
|
||||
|
||||
@@ -324,7 +324,7 @@ load_or_search_glyph (FTINSTANCEINFO* ft_inst_info, FT_Face* face,
|
||||
* to get the bbox of the char */
|
||||
static int
|
||||
get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value,
|
||||
Glyph32 glyph_value,
|
||||
int* px, int* py, int* pwidth, int* pheight)
|
||||
{
|
||||
|
||||
@@ -479,7 +479,7 @@ press_bitmap (void* buffer, int width, int rows, int pitch)
|
||||
/* call this function to get the bitmap/pixmap of the char */
|
||||
static const void*
|
||||
char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, BOOL is_grey)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, BOOL is_grey)
|
||||
{
|
||||
FT_BitmapGlyph glyph_bitmap;
|
||||
FT_Bitmap* source;
|
||||
@@ -616,14 +616,14 @@ char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
|
||||
static const void*
|
||||
get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
if (scale) *scale = 1;
|
||||
return char_bitmap_pixmap (logfont, devfont, glyph_value, sz, pitch, FALSE);
|
||||
}
|
||||
static const void*
|
||||
get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch,
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch,
|
||||
unsigned short* scale)
|
||||
{
|
||||
if (scale) *scale = 1;
|
||||
@@ -648,7 +648,7 @@ start_str_output (LOGFONT* logfont, DEVFONT* devfont)
|
||||
* to get the advance of the char */
|
||||
static int
|
||||
get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* px, int* py)
|
||||
Glyph32 glyph_value, int* px, int* py)
|
||||
{
|
||||
FT_Fixed advance;
|
||||
FTINSTANCEINFO* ft_inst_info = FT_INST_INFO_P (devfont);
|
||||
|
||||
+1
-1
@@ -329,7 +329,7 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
unsigned int uc16;
|
||||
QPF_GLYPH* glyph;
|
||||
|
||||
@@ -208,7 +208,7 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
int bitmap_size;
|
||||
Glyph32 glyph_tmp = glyph_value;
|
||||
|
||||
@@ -466,7 +466,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
seunichar16 wc;
|
||||
SeLogFont selogfont;
|
||||
|
||||
+1
-1
@@ -279,7 +279,7 @@ print_bitmap(char* bits, int width, int height, int pitch)
|
||||
#endif
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
unsigned int uc16;
|
||||
UPFGLYPH* glyph;
|
||||
|
||||
@@ -237,10 +237,9 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
int offset;
|
||||
Glyph32 eff_value = glyph_value;
|
||||
Glyph32 first_value;
|
||||
Glyph32 last_value;
|
||||
VBFINFO* vbf_info = VARFONT_INFO_P (devfont);
|
||||
@@ -249,13 +248,13 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
last_value = vbf_info->last_glyph;
|
||||
|
||||
if (glyph_value < first_value || glyph_value > last_value)
|
||||
eff_value = vbf_info->def_glyph;
|
||||
glyph_value = vbf_info->def_glyph;
|
||||
|
||||
if (vbf_info->bits_offset == NULL)
|
||||
offset = (((size_t)vbf_info->max_width + 7) >> 3) * vbf_info->height
|
||||
* (eff_value - first_value);
|
||||
* (glyph_value - first_value);
|
||||
else {
|
||||
offset = vbf_info->bits_offset [eff_value - vbf_info->first_glyph];
|
||||
offset = vbf_info->bits_offset [glyph_value - vbf_info->first_glyph];
|
||||
#if MGUI_BYTEORDER == MGUI_BIG_ENDIAN
|
||||
if (vbf_info->font_size)
|
||||
offset = ArchSwap16 (offset);
|
||||
|
||||
+1
-1
@@ -4025,7 +4025,7 @@ int PopupMenuTrackProc (PTRACKMENUINFO ptmi,
|
||||
break;
|
||||
|
||||
case MSG_SHOWMENU:
|
||||
if (GetCurrentCursor() != GetSystemCursor(IDC_ARROW))
|
||||
if ((HCURSOR)GetCurrentCursor() != GetSystemCursor(IDC_ARROW))
|
||||
SetCursor(GetSystemCursor(IDC_ARROW));
|
||||
return mnuShowPopupMenu (ptmi);
|
||||
break;
|
||||
|
||||
+29
-27
@@ -1,39 +1,39 @@
|
||||
/*
|
||||
* 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/en/about/licensing-policy/>.
|
||||
*/
|
||||
/*
|
||||
** dummy.c: The dummy IAL engine.
|
||||
**
|
||||
**
|
||||
** Created by Wei Yongming, 2001/09/13
|
||||
*/
|
||||
|
||||
@@ -53,9 +53,9 @@ static int mouse_x, mouse_y, mouse_button;
|
||||
|
||||
typedef struct tagPOS
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
short b;
|
||||
short x;
|
||||
short y;
|
||||
short b;
|
||||
} POS;
|
||||
|
||||
/************************ Low Level Input Operations **********************/
|
||||
@@ -64,28 +64,28 @@ typedef struct tagPOS
|
||||
*/
|
||||
static int mouse_update(void)
|
||||
{
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void mouse_getxy (int* x, int* y)
|
||||
{
|
||||
*x = mouse_x;
|
||||
*x = mouse_x;
|
||||
*y = mouse_y;
|
||||
}
|
||||
|
||||
static int mouse_getbutton(void)
|
||||
{
|
||||
return mouse_button;
|
||||
return mouse_button;
|
||||
}
|
||||
|
||||
static int keyboard_update(void)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char * keyboard_get_state (void)
|
||||
{
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *except,
|
||||
@@ -93,23 +93,25 @@ static int wait_event (int which, int maxfd, fd_set *in, fd_set *out, fd_set *ex
|
||||
{
|
||||
#ifdef _MGRM_THREADS
|
||||
__mg_os_time_delay (300);
|
||||
timeout->tv_sec = 0;
|
||||
timeout->tv_usec = 0;
|
||||
#else
|
||||
fd_set rfds;
|
||||
int e;
|
||||
fd_set rfds;
|
||||
int e;
|
||||
|
||||
if (!in) {
|
||||
in = &rfds;
|
||||
mg_fd_zero (in);
|
||||
}
|
||||
|
||||
e = mg_select (maxfd + 1, in, out, except, timeout) ;
|
||||
e = mg_select (maxfd + 1, in, out, except, timeout) ;
|
||||
|
||||
if (e < 0) {
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL InitDummyInput (INPUT* input, const char* mdev, const char* mtype)
|
||||
@@ -125,9 +127,9 @@ BOOL InitDummyInput (INPUT* input, const char* mdev, const char* mtype)
|
||||
input->set_leds = NULL;
|
||||
|
||||
input->wait_event = wait_event;
|
||||
mouse_x = 0;
|
||||
mouse_y = 0;
|
||||
mouse_button= 0;
|
||||
mouse_x = 0;
|
||||
mouse_y = 0;
|
||||
mouse_button= 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <linux/input.h>
|
||||
//#include <linux/input.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
#ifdef _MGIAL_NET
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/poll.h>
|
||||
//#include <sys/poll.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <linux/kd.h>
|
||||
//#include <linux/kd.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
@@ -216,7 +216,7 @@ BOOL InitNetInput (INPUT* input, const char* mdev, const char* mtype)
|
||||
}
|
||||
printf ("Please start the PC side of the client process.\n");
|
||||
|
||||
temp_sock_descriptor = accept (sock_descriptor, (struct sockaddr *)&pin, &address_size);
|
||||
temp_sock_descriptor = accept (sock_descriptor, (struct sockaddr *)&pin, (socklen_t *)&address_size); // gengyue
|
||||
if (temp_sock_descriptor == -1)
|
||||
{
|
||||
perror ("call to accept");
|
||||
|
||||
@@ -225,11 +225,11 @@ struct _FONTOPS
|
||||
|
||||
/** The method to get mono-bitmap function. */
|
||||
const void* (*get_glyph_monobitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale);
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale);
|
||||
|
||||
/** The method to get grey bitmap, pitch and scale function */
|
||||
const void* (*get_glyph_greybitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 galph_value, SIZE* sz, int* pitch, unsigned short* scale);
|
||||
Glyph32 galph_value, SIZE* sz, int* pitch, unsigned short* scale);
|
||||
|
||||
/** The method to get the pre-rendered bitmap of one glyph. */
|
||||
int (*get_glyph_prbitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
|
||||
+5
-4
@@ -125,18 +125,18 @@ static OS_TIMER_ID __mg_os_timer = 0;
|
||||
#else /* __AOS__ */
|
||||
static void* TimerEntry (void* data)
|
||||
{
|
||||
sem_post ((sem_t*)data);
|
||||
sem_post ((sem_t*)data);
|
||||
|
||||
#ifdef _MG_USE_BETTER_TIMER
|
||||
g_timer_started = times(NULL);
|
||||
g_last_tick = 0;
|
||||
#endif /* _MG_USE_BETTER_TIMER */
|
||||
|
||||
while (__mg_quiting_stage > _MG_QUITING_STAGE_TIMER) {
|
||||
while (__mg_quiting_stage > _MG_QUITING_STAGE_TIMER)
|
||||
{
|
||||
__mg_os_time_delay (10);
|
||||
__mg_timer_action (NULL);
|
||||
}
|
||||
|
||||
/* printf("quit from TimerEntry()\n"); */
|
||||
return NULL;
|
||||
}
|
||||
@@ -155,8 +155,9 @@ int __mg_timer_init (void)
|
||||
OS_AUTO_ACTIVATE | OS_AUTO_LOAD);
|
||||
#else /* NOT __AOS__ */
|
||||
{
|
||||
sem_t wait;
|
||||
sem_t wait;
|
||||
sem_init (&wait, 0, 0);
|
||||
|
||||
pthread_create (&__mg_timer, NULL, TimerEntry, &wait);
|
||||
sem_wait (&wait);
|
||||
sem_destroy (&wait);
|
||||
|
||||
+1
-1
@@ -413,7 +413,7 @@ void __mg_os_time_delay (int ms)
|
||||
OSTimeDly (OS_TICKS_PER_SEC * ms / 1000);
|
||||
#elif defined (__VXWORKS__)
|
||||
taskDelay (sysClkRateGet() * ms / 1000);
|
||||
#elif defined (__PSOS__) || defined (__ECOS__)
|
||||
#elif defined (__PSOS__) || defined (__ECOS__) || defined (__RTEMS__)
|
||||
struct timespec ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = ms * 1000000;
|
||||
|
||||
@@ -539,7 +539,9 @@ ReadImage(MG_RWops* src, MYBITMAP* bmp, int len, int height,
|
||||
else {
|
||||
/* emit line at here */
|
||||
if (bmp->flags &= MYBMP_LOAD_ALLOCATE_ONE)
|
||||
{
|
||||
(*cb)(context, bmp, ypos);
|
||||
}
|
||||
++ypos;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,9 +242,9 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
|
||||
Bmask = 0x001F;
|
||||
break;
|
||||
case COMMLCD_TRUE_RGB565:
|
||||
Rmask = 0xF800;
|
||||
Gmask = 0x07E0;
|
||||
Bmask = 0x001F;
|
||||
Rmask = 0x07E0;
|
||||
Gmask = 0x001F;
|
||||
Bmask = 0xF800;
|
||||
break;
|
||||
case COMMLCD_TRUE_RGB888:
|
||||
case COMMLCD_TRUE_RGB0888:
|
||||
@@ -264,6 +264,13 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
|
||||
Gmask = 0x0000FF00;
|
||||
Bmask = 0x000000FF;
|
||||
break;
|
||||
case COMMLCD_TRUE_AGBR8888:
|
||||
printf("=========================================================================== i am here, type is %d\n", li.type);
|
||||
Amask = 0xFF000000;
|
||||
Rmask = 0x0000FF00;
|
||||
Gmask = 0x000000FF;
|
||||
Bmask = 0x00FF0000;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Allocate the new pixel format for the screen */
|
||||
|
||||
@@ -64,6 +64,7 @@ struct GAL_PrivateVideoData {
|
||||
#define COMMLCD_TRUE_RGB0888 5
|
||||
#define COMMLCD_TRUE_ARGB1555 6
|
||||
#define COMMLCD_TRUE_ARGB8888 7
|
||||
#define COMMLCD_TRUE_AGBR8888 8
|
||||
|
||||
struct commlcd_info {
|
||||
short height; // vertical resolution of the screen
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
#ifdef _MGGAL_COMMLCD
|
||||
|
||||
#if defined (__VXWORKS__) || defined (__TARGET_UNKNOWN__)
|
||||
#if defined (__VXWORKS__) || defined (__TARGET_UNKNOWN__) || defined(__RTEMS__)
|
||||
|
||||
#include "minigui.h"
|
||||
#include "newgal.h"
|
||||
|
||||
+2
-2
@@ -219,7 +219,6 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
|
||||
format->Amask = Amask;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Calculate some standard bitmasks, if necessary
|
||||
* Note: This could conflict with an alpha mask, if given.
|
||||
*/
|
||||
@@ -247,7 +246,8 @@ GAL_PixelFormat *GAL_ReallocFormat(GAL_Surface *surface, int bpp,
|
||||
GAL_FreeFormat(surface->format);
|
||||
GAL_FormatChanged(surface);
|
||||
}
|
||||
surface->format = GAL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
|
||||
|
||||
surface->format = GAL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
|
||||
return surface->format;
|
||||
}
|
||||
|
||||
|
||||
@@ -997,7 +997,9 @@ static int _PutBoxAlphaChannelEx (GAL_Surface* dst, BYTE* dstrow, BYTE* srcrow,
|
||||
|
||||
|
||||
if (bpp == 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(box->bmType & BMP_TYPE_ALPHA_MASK)) {
|
||||
while ( h-- ) {
|
||||
@@ -1074,7 +1076,9 @@ static int _PutBoxAlpha (GAL_Surface* dst, BYTE* dstrow, BYTE* srcrow, Uint32 w,
|
||||
|
||||
|
||||
if (bpp == 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(box->bmType & BMP_TYPE_ALPHA_MASK)) {
|
||||
if (dstfmt->Amask == 0xff000000 && dstfmt->BitsPerPixel == 32)
|
||||
@@ -1233,7 +1237,9 @@ static int _PutBoxKeyAlphaChannelEx (GAL_Surface* dst, BYTE* dstrow, BYTE* srcro
|
||||
|
||||
|
||||
if (bpp == 1)
|
||||
return -1;
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(box->bmType & BMP_TYPE_ALPHA_MASK)) {
|
||||
while ( h-- ) {
|
||||
|
||||
@@ -668,6 +668,7 @@ GAL_Surface *GAL_DisplayFormatAlpha(GAL_Surface *surface)
|
||||
optimised alpha format is written, add the converter here */
|
||||
break;
|
||||
}
|
||||
printf("============================================================================================== in GAL_DisplayFormatAlpha\n");
|
||||
format = GAL_AllocFormat(32, rmask, gmask, bmask, amask);
|
||||
flags = GAL_PublicSurface->flags & GAL_HWSURFACE;
|
||||
flags |= surface->flags & (GAL_SRCALPHA | GAL_RLEACCELOK);
|
||||
@@ -1071,6 +1072,7 @@ static GAL_Surface *Slave_CreateSurface (GAL_VideoDevice *this,
|
||||
if (Amask){
|
||||
surface->flags |= GAL_SRCPIXELALPHA;
|
||||
}
|
||||
printf("============================================================================================== in Slave_CreateSurface\n");
|
||||
surface->format = GAL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask);
|
||||
|
||||
if ( surface->format == NULL ) {
|
||||
|
||||
+5
-3
@@ -58,10 +58,12 @@ static char* _system_keys[]={
|
||||
};
|
||||
static char* _system_values[]={
|
||||
// GAL engine and default options
|
||||
"pc_xvfb",
|
||||
"800x600-16bpp",
|
||||
// "dummy",
|
||||
"commlcd",
|
||||
"800x480-32bpp",
|
||||
// IAL engine
|
||||
"pc_xvfb",
|
||||
"dummy",
|
||||
// "comm",
|
||||
"/dev/input/mice",
|
||||
"IMPS2"
|
||||
};
|
||||
|
||||
+10
-2
@@ -44,7 +44,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if !defined(__NOUNIX__) && !defined(WIN32)
|
||||
#if !defined(__NOUNIX__) && !defined(WIN32) && !defined(__RTEMS__)
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -364,7 +364,9 @@ static void delete_entry_data(RES_ENTRY* entry)
|
||||
BOOL InitializeResManager(int hash_table_size)
|
||||
{
|
||||
char szpath[MAX_PATH+1];
|
||||
#if !defined(__NOUNIX__) || defined(WIN32) || !defined(__RTEMS__)
|
||||
char* p = NULL;
|
||||
#endif
|
||||
pwd_res_path = strdup("./");
|
||||
|
||||
//initialize paths
|
||||
@@ -634,10 +636,16 @@ int UnregisterResType(int type)
|
||||
|
||||
static char* get_res_file(const char* res_name, char* filename)
|
||||
{
|
||||
#ifndef __RTEMS__
|
||||
int i;
|
||||
#endif
|
||||
if (res_name == NULL || filename == NULL)
|
||||
return NULL;
|
||||
|
||||
#ifdef __RTEMS__
|
||||
return NULL;
|
||||
#else
|
||||
|
||||
//test it is a full path or not
|
||||
for(i=0; res_name[i] && res_name[i] == '/'; i++);
|
||||
if(i>0) //is full path
|
||||
@@ -670,7 +678,7 @@ static char* get_res_file(const char* res_name, char* filename)
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -270,11 +270,15 @@ int ncsParseConstructParams(va_list args, const char* signature, ...)
|
||||
return 0;
|
||||
*/
|
||||
if (_va_check (args) == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
argc = va_arg(args, int);
|
||||
if(argc <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
va_start(params, signature);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user