This commit is contained in:
Vincent Wei
2019-03-31 15:38:39 +08:00
parent f8e9dea491
commit 3f53804f62
9 changed files with 49 additions and 48 deletions
+5 -5
View File
@@ -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);
+5 -5
View File
@@ -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
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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
View File
@@ -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;
+4 -5
View File
@@ -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);
+29 -27
View File
@@ -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;
}
+2 -2
View File
@@ -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,