mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-28 16:17:09 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56fd0a1050 | ||
|
|
fbba2ebd1a | ||
|
|
33b3ad0bd3 | ||
|
|
9bee00cf9f | ||
|
|
aedcffacf7 | ||
|
|
c91eeddd2c | ||
|
|
2ac54f9ee6 | ||
|
|
20f160074f | ||
|
|
437769c1a4 | ||
|
|
69eebf37e3 | ||
|
|
4ea6912024 | ||
|
|
6b2039c151 | ||
|
|
d7eed07222 | ||
|
|
6f033d8e93 | ||
|
|
193f5e58b1 | ||
|
|
75dabce7af | ||
|
|
2149a6aa5e | ||
|
|
bf8a9fee5c | ||
|
|
8556f15e36 | ||
|
|
57215b9e59 | ||
|
|
6201664035 | ||
|
|
7303f40b2e | ||
|
|
42b10aed6a | ||
|
|
d9dc070698 | ||
|
|
ee5a1f86a7 | ||
|
|
d335e008ad | ||
|
|
268695a94b | ||
|
|
1d211ed855 | ||
|
|
a7eaab6d38 | ||
|
|
7d671c8318 | ||
|
|
76f4bf3661 | ||
|
|
4f51baac32 | ||
|
|
4fa002216e | ||
|
|
6dc8696c08 | ||
|
|
06c497d671 | ||
|
|
79267be62c | ||
|
|
9475ff227f | ||
|
|
f562661146 | ||
|
|
eca15c447d | ||
|
|
736a532b1a | ||
|
|
5a0fc2e74f | ||
|
|
12106c036c | ||
|
|
debd8a3fdd | ||
|
|
ac6d4019d5 | ||
|
|
61dd46f965 | ||
|
|
3f53804f62 | ||
|
|
f8e9dea491 | ||
|
|
8943cc75ec | ||
|
|
ebf765f4ad | ||
|
|
3b61f25bb5 | ||
|
|
ea20032dae | ||
|
|
9245091b87 |
@@ -22,4 +22,5 @@ Makefile.in
|
|||||||
/*.pc
|
/*.pc
|
||||||
/*config.h
|
/*config.h
|
||||||
/*config.h.in
|
/*config.h.in
|
||||||
|
/*config.h.in~
|
||||||
|
|
||||||
|
|||||||
+30
-10
@@ -1,5 +1,22 @@
|
|||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
|
## Version 3.2.3
|
||||||
|
|
||||||
|
The MiniGUI development team announces the availability of MiniGUI 3.2.3.
|
||||||
|
All users of MiniGUI are recommended strongly to use this version.
|
||||||
|
Please report any bugs and incompatibilities in
|
||||||
|
|
||||||
|
<https://github.com/VincentWei/minigui>
|
||||||
|
|
||||||
|
* ENHANCEMENTS:
|
||||||
|
- Support for RTEMS operating system.
|
||||||
|
* BUGFIXES:
|
||||||
|
- Fixed errors in makefile.ng files.
|
||||||
|
* CLEANUP:
|
||||||
|
- `README.md` for correct markdown tags.
|
||||||
|
|
||||||
|
### What's new in this version
|
||||||
|
|
||||||
## Version 3.2.2
|
## Version 3.2.2
|
||||||
|
|
||||||
The MiniGUI development team announces the availability of MiniGUI 3.2.2.
|
The MiniGUI development team announces the availability of MiniGUI 3.2.2.
|
||||||
@@ -11,34 +28,38 @@ Please report any bugs and incompatibilities in
|
|||||||
### What's new in this version
|
### What's new in this version
|
||||||
|
|
||||||
* ENHANCEMENTS:
|
* ENHANCEMENTS:
|
||||||
1. Add a new key `dpi` for NEWGAL engine to define the DPI of the screen.
|
|
||||||
If it is absent, use 96 as the default DPI.
|
|
||||||
1. Add an item for `GetGDCapability` to return DPI of the DC.
|
|
||||||
1. New API `InitSlaveScreenEx` to specify the DPI of slave screen.
|
|
||||||
Define `InitSlaveScreen` as an inline function calling `InitSlaveScreenEx`.
|
|
||||||
1. New API: `SyncUpdateDC`. You can use this function to synchronize
|
1. New API: `SyncUpdateDC`. You can use this function to synchronize
|
||||||
the update rectangles of a surface to screen, if the surface
|
the update rectangles of a surface to screen, if the surface
|
||||||
represents the shadow frame buffer of the screen.
|
represents the shadow frame buffer of the screen.
|
||||||
* configure option: `--enable-syncupdate`
|
* configure option: `--enable-syncupdate`
|
||||||
* macro: `_MGUSE_SYNC_UPDATE`
|
* macro: `_MGUSE_SYNC_UPDATE`
|
||||||
1. New API: `UpdateInvalidClient`. You can use this function to update
|
1. New API `UpdateInvalidClient`. You can use this function to update
|
||||||
the invalid client region of a window instantly.
|
the invalid client region of a window instantly.
|
||||||
|
1. New API `LoadDevFontFromIncoreData`. You can use this function to load
|
||||||
|
a device font from incore data.
|
||||||
1. Use different colors for the output of `_DBG_PRINTF` and `_ERR_PRINTF`.
|
1. Use different colors for the output of `_DBG_PRINTF` and `_ERR_PRINTF`.
|
||||||
1. Add `__mg_save_jpg` function for storing MYBITMAP as JPEG file (10km).
|
1. Add `__mg_save_jpg` function for storing MYBITMAP as JPEG file (10km).
|
||||||
1. Modified logic for checking JPEG format (10km).
|
1. Modified logic for checking JPEG format (10km).
|
||||||
1. Support BIDI for UNICODE charsets and cleanup the implementation.
|
1. Support BIDI for UNICODE charsets and cleanup the implementation.
|
||||||
* New API: `GetGlyphBIDIType` to get the glyph type in BIDI.
|
* New API: `GetGlyphBIDIType` to get the glyph type in BIDI.
|
||||||
* New DC attribute: BIDI flag.
|
* New DC attribute: BIDI flag.
|
||||||
|
1. Add a new key `dpi` for NEWGAL engine to define the DPI of the screen.
|
||||||
|
If it is absent, use 96 as the default DPI.
|
||||||
|
1. Add an item for `GetGDCapability` to return DPI of the DC.
|
||||||
|
1. New API `InitSlaveScreenEx` to specify the DPI of slave screen.
|
||||||
|
Define `InitSlaveScreen` as an inline function calling `InitSlaveScreenEx`.
|
||||||
1. Enhance commlcd engint to support more pixel type and synchronously update.
|
1. Enhance commlcd engint to support more pixel type and synchronously update.
|
||||||
1. New USVFB IAL engine and NEWGAL engine for web display server.
|
1. New USVFB IAL engine and NEWGAL engine for web display server.
|
||||||
1. New type: `QDWORD` for a quauter of DWORD. This type is 16-bit long on
|
1. New type: `QDWORD` for a quauter of DWORD. This type is 16-bit long on
|
||||||
64-bit architecture, and 8-bit long on 32-bit.
|
64-bit architecture, and 8-bit long on 32-bit.
|
||||||
1. New macros for QDWORD:
|
1. New macros for QDWORD:
|
||||||
* `MAKEDWORD`: Make a DWROD from four QDWORDs.
|
* `MAKEDWORD`: Make a DWROD from four QDWORDs.
|
||||||
* `FIRST_QDWORD`: get the first (LSB) QDWORD from a DWORD.
|
* `FIRST_QDWORD`: get the first (LSB) QDWORD from a DWORD.
|
||||||
* `SECOND_QDWORD`: get the second (LSB) QDWORD from a DWORD.
|
* `SECOND_QDWORD`: get the second (LSB) QDWORD from a DWORD.
|
||||||
* `THIRD_QDWORD`: get the third (LSB) QDWORD from a DWORD.
|
* `THIRD_QDWORD`: get the third (LSB) QDWORD from a DWORD.
|
||||||
* `FOURTH_QDWORD`: get the fourth (LSB) QDWORD from a DWORD.
|
* `FOURTH_QDWORD`: get the fourth (LSB) QDWORD from a DWORD.
|
||||||
|
1. New header for CommLCD NEWGAL engine and COMM IAL engine:
|
||||||
|
`<minigui/exstubs.h>`.
|
||||||
|
|
||||||
* BUGFIXING:
|
* BUGFIXING:
|
||||||
1. handle `PNG_COLOR_TYPE_GRAY_ALPHA` color type of PNG files.
|
1. handle `PNG_COLOR_TYPE_GRAY_ALPHA` color type of PNG files.
|
||||||
@@ -48,9 +69,8 @@ Please report any bugs and incompatibilities in
|
|||||||
1. Skip null pixels for SUBPIXEL glyphs. This bug will always show background
|
1. Skip null pixels for SUBPIXEL glyphs. This bug will always show background
|
||||||
pixels of one SUBPIXEL glyph.
|
pixels of one SUBPIXEL glyph.
|
||||||
1. Fix the bug of wrong bounding box handling for SUBPIXEL rendering of glyph.
|
1. Fix the bug of wrong bounding box handling for SUBPIXEL rendering of glyph.
|
||||||
|
1. Tune cache implementation of FreeType2 font engine.
|
||||||
* TUNNING:
|
* Enable cache for rotated LOGFONT.
|
||||||
1. Tune GLYPHINFO structure and GetGlyphInfo to return BIDI glyph type.
|
|
||||||
|
|
||||||
## Version 3.2.0
|
## Version 3.2.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Version 3.2.0 (2018/02/10)
|
Version 3.2.3 (2019/10/31)
|
||||||
|
|
||||||
This release needs the following resource packages:
|
This release needs the following resource packages:
|
||||||
|
|
||||||
@@ -6,4 +6,4 @@ This release needs the following resource packages:
|
|||||||
|
|
||||||
The latest samples package is:
|
The latest samples package is:
|
||||||
|
|
||||||
* mg-samples-3.2.0.tar.gz
|
* mg-samples-3.2.2.tar.gz
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
./configure \
|
./configure \
|
||||||
|
--with-runmode=ths \
|
||||||
--disable-dblclk \
|
--disable-dblclk \
|
||||||
--disable-cursor \
|
--disable-cursor \
|
||||||
--disable-mousecalibrate \
|
--disable-mousecalibrate \
|
||||||
|
|||||||
Executable
+44
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
RTEMS_DIR=/home/projects/movidius/m8_gui/tools/18.11.4/linux64/sparc-myriad-rtems-6.3.0
|
||||||
|
|
||||||
|
#RTEMS_GLOBAL_CFLAGS="-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -finit-priority"
|
||||||
|
|
||||||
|
rm -f config.cache config.status
|
||||||
|
|
||||||
|
CC=${RTEMS_DIR}/bin/sparc-myriad-rtems-gcc \
|
||||||
|
CFLAGS="-I${RTEMS_DIR}/sparc-myriad-rtems/include -I${RTEMS_DIR}/pnglib/include -I${RTEMS_DIR}/zlib/include" \
|
||||||
|
LDFLAGS="-L${RTEMS_DIR}/lib/gcc/sparc-myriad-rtems/6.3.0 -L${RTEMS_DIR}/pnglib/lib -L${RTEMS_DIR}/zlib/lib" \
|
||||||
|
./configure --prefix=/home/projects/movidius/m8_gui/tools/18.11.4/linux64/sparc-myriad-rtems-6.3.0/minigui \
|
||||||
|
--build=i686-linux \
|
||||||
|
--host=sparc-myriad-rtems \
|
||||||
|
--target=sparc-myriad-rtems \
|
||||||
|
--with-osname=rtems \
|
||||||
|
--with-runmode=ths \
|
||||||
|
--enable-miniguientry \
|
||||||
|
--enable-incoreres \
|
||||||
|
--disable-cursor \
|
||||||
|
--disable-videofbcon \
|
||||||
|
--disable-qvfbial \
|
||||||
|
--disable-vbfsupport \
|
||||||
|
--disable-qpfsupport \
|
||||||
|
--disable-latin9support \
|
||||||
|
--enable-gbksupport \
|
||||||
|
--disable-big5support \
|
||||||
|
--enable-unicodesupport \
|
||||||
|
--disable-savebitmap \
|
||||||
|
--disable-jpgsupport \
|
||||||
|
--disable-pngsupport \
|
||||||
|
--disable-aboutdlg \
|
||||||
|
--enable-adv2dapi \
|
||||||
|
--enable-videodummy \
|
||||||
|
--disable-consoleial \
|
||||||
|
--disable-videopcxvfb \
|
||||||
|
--with-targetname=external \
|
||||||
|
--enable-pngsupport \
|
||||||
|
--disable-develmode \
|
||||||
|
--disable-detaildebug \
|
||||||
|
--disable-tracemsg \
|
||||||
|
--enable-videocommlcd \
|
||||||
|
--enable-commial \
|
||||||
|
--disable-splash
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# rules for pc-linux
|
||||||
|
|
||||||
|
# set your own targaet_os
|
||||||
|
TARGET_OS=linux
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# set your compile tool #
|
||||||
|
CC=gcc
|
||||||
|
CXX=g++
|
||||||
|
CPP=g++
|
||||||
|
AR=ar
|
||||||
|
AS=as
|
||||||
|
RANLIB=ranlib
|
||||||
|
MAKE=/usr/bin/make
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
ARFLAGS=-rc
|
||||||
|
COFLAG=-c
|
||||||
|
|
||||||
|
OBJ=o
|
||||||
|
LIBA=a
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# if you don't want to create dynamic, delete it #
|
||||||
|
LIBSO=so
|
||||||
|
SOFLAGS=-fPIC -shared -o
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# set your compile flags and install prefix path #
|
||||||
|
PREFIX=/usr/local
|
||||||
|
CFLAGS+=-g -Wall -fPIC `pkg-config --cflags freetype2`
|
||||||
|
LDFLAGS+=
|
||||||
|
##################################################
|
||||||
|
|
||||||
+32
-29
@@ -1,6 +1,6 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ(2.60)
|
||||||
AC_INIT(libminigui, 3.2.2)
|
AC_INIT(libminigui, 3.2.3)
|
||||||
AC_CONFIG_SRCDIR(src/main/main.c)
|
AC_CONFIG_SRCDIR(src/main/main.c)
|
||||||
|
|
||||||
dnl Set various version strings - taken gratefully from the SDL sources
|
dnl Set various version strings - taken gratefully from the SDL sources
|
||||||
@@ -16,9 +16,9 @@ dnl Set various version strings - taken gratefully from the SDL sources
|
|||||||
#
|
#
|
||||||
MINIGUI_MAJOR_VERSION=3
|
MINIGUI_MAJOR_VERSION=3
|
||||||
MINIGUI_MINOR_VERSION=2
|
MINIGUI_MINOR_VERSION=2
|
||||||
MINIGUI_MICRO_VERSION=2
|
MINIGUI_MICRO_VERSION=3
|
||||||
MINIGUI_INTERFACE_AGE=0
|
MINIGUI_INTERFACE_AGE=0
|
||||||
MINIGUI_BINARY_AGE=1
|
MINIGUI_BINARY_AGE=3
|
||||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||||
|
|
||||||
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
||||||
@@ -62,7 +62,7 @@ dnl ========================================================================
|
|||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_CHECK_HEADERS(sys/types.h sys/time.h termio.h unistd.h math.h locale.h)
|
AC_CHECK_HEADERS(limits.h math.h locale.h unistd.h termio.h sys/types.h sys/time.h)
|
||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
@@ -76,7 +76,7 @@ AC_FUNC_ALLOCA
|
|||||||
AC_FUNC_MEMCMP
|
AC_FUNC_MEMCMP
|
||||||
AC_FUNC_MMAP
|
AC_FUNC_MMAP
|
||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
AC_CHECK_FUNCS(time mktime localtime strdup strcasecmp strncasecmp strerror setlocale getpt)
|
AC_CHECK_FUNCS(time mktime localtime strdup strcasecmp strncasecmp strerror setlocale)
|
||||||
|
|
||||||
dnl ========================================================================
|
dnl ========================================================================
|
||||||
dnl User selectable options
|
dnl User selectable options
|
||||||
@@ -89,8 +89,6 @@ message_string="no"
|
|||||||
|
|
||||||
runtime_mode="procs"
|
runtime_mode="procs"
|
||||||
|
|
||||||
stand_alone="no"
|
|
||||||
|
|
||||||
incore_res="no"
|
incore_res="no"
|
||||||
use_miniguientry="no"
|
use_miniguientry="no"
|
||||||
fixed_math="yes"
|
fixed_math="yes"
|
||||||
@@ -304,10 +302,6 @@ AC_ARG_WITH(runmode,
|
|||||||
[ --with-runmode=procs/ths/sa the MiniGUI runtime mode <default=procs>],
|
[ --with-runmode=procs/ths/sa the MiniGUI runtime mode <default=procs>],
|
||||||
runtime_mode=$withval)
|
runtime_mode=$withval)
|
||||||
|
|
||||||
AC_ARG_ENABLE(standalone,
|
|
||||||
[ --enable-standalone build MiniGUI-Standalone version <default=no>],
|
|
||||||
stand_alone=$enableval)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(incoreres,
|
AC_ARG_ENABLE(incoreres,
|
||||||
[ --enable-incoreres use incore resource instead file IO to initialize MiniGUI <default=no>],
|
[ --enable-incoreres use incore resource instead file IO to initialize MiniGUI <default=no>],
|
||||||
incore_res=$enableval)
|
incore_res=$enableval)
|
||||||
@@ -389,7 +383,7 @@ AC_ARG_ENABLE(netial,
|
|||||||
build_net_ial_engine=$enableval)
|
build_net_ial_engine=$enableval)
|
||||||
|
|
||||||
AC_ARG_ENABLE(cisco_touchpad_ial,
|
AC_ARG_ENABLE(cisco_touchpad_ial,
|
||||||
[ --enable-cisco_touchpad_ial build the IAL engine for Cisco Touchpad <default=no>],
|
[ --enable-cisco_touchpad_ial build the IAL engine for Cisco Touchpad <default=no>],
|
||||||
build_cisco_touchpad_ial_engine=$enableval)
|
build_cisco_touchpad_ial_engine=$enableval)
|
||||||
|
|
||||||
AC_ARG_ENABLE(mstar_ial,
|
AC_ARG_ENABLE(mstar_ial,
|
||||||
@@ -732,9 +726,8 @@ AC_ARG_ENABLE(ctrlbidisledit,
|
|||||||
[ --enable-ctrlbidisledit include Single-Line BIDI EDIT control <default=no>],
|
[ --enable-ctrlbidisledit include Single-Line BIDI EDIT control <default=no>],
|
||||||
build_ctrl_bidisledit=$enableval)
|
build_ctrl_bidisledit=$enableval)
|
||||||
|
|
||||||
dnl enable new textedit
|
AC_ARG_ENABLE(ctrlnewtextedit,
|
||||||
AC_ARG_ENABLE(newtextedit,
|
[ --disable-ctrlnewtextedit include the new implementation of TEXTEDIT control <default=yes>],
|
||||||
[ --enable-ctrlnewtextedit include the new implementation of TEXTEDIT control <default=yes>],
|
|
||||||
build_ctrl_textedit_new=$enableval)
|
build_ctrl_textedit_new=$enableval)
|
||||||
|
|
||||||
AC_ARG_ENABLE(ctrllistbox,
|
AC_ARG_ENABLE(ctrllistbox,
|
||||||
@@ -892,21 +885,21 @@ CheckXVFB()
|
|||||||
[ --enable-videortosxvfb include RTOS Virtual FrameBuffer NEWGAL engine <default=no>. Please disable pcxvfb to enable rtosxvfb],
|
[ --enable-videortosxvfb include RTOS Virtual FrameBuffer NEWGAL engine <default=no>. Please disable pcxvfb to enable rtosxvfb],
|
||||||
enable_video_rtos_xvfb=$enableval)
|
enable_video_rtos_xvfb=$enableval)
|
||||||
|
|
||||||
if test "x$enable_video_pc_xvfb" = "xyes"; then
|
if test "x$enable_video_pc_xvfb" = "xyes"; then
|
||||||
dnl CheckPCXVFB
|
dnl CheckPCXVFB
|
||||||
AC_DEFINE(_MGGAL_PCXVFB, 1,
|
AC_DEFINE(_MGGAL_PCXVFB, 1,
|
||||||
[Define if include PC Virtual FrameBuffer NEWGAL engine])
|
[Define if include PC Virtual FrameBuffer NEWGAL engine])
|
||||||
VIDEO_SUBDIRS="$VIDEO_SUBDIRS pcxvfb"
|
VIDEO_SUBDIRS="$VIDEO_SUBDIRS pcxvfb"
|
||||||
VIDEO_DRIVERS="$VIDEO_DRIVERS pcxvfb/libvideo_pcxvfb.la"
|
VIDEO_DRIVERS="$VIDEO_DRIVERS pcxvfb/libvideo_pcxvfb.la"
|
||||||
else
|
else
|
||||||
if test "x$enable_video_rtos_xvfb" = "xyes"; then
|
if test "x$enable_video_rtos_xvfb" = "xyes"; then
|
||||||
dnl CheckRTOSXVFB
|
dnl CheckRTOSXVFB
|
||||||
AC_DEFINE(_MGGAL_RTOSXVFB, 1,
|
AC_DEFINE(_MGGAL_RTOSXVFB, 1,
|
||||||
[Define if include RTOS Virtual FrameBuffer NEWGAL engine])
|
[Define if include RTOS Virtual FrameBuffer NEWGAL engine])
|
||||||
VIDEO_SUBDIRS="$VIDEO_SUBDIRS rtos_xvfb"
|
VIDEO_SUBDIRS="$VIDEO_SUBDIRS rtos_xvfb"
|
||||||
VIDEO_DRIVERS="$VIDEO_DRIVERS rtos_xvfb/libvideo_rtos_xvfb.la"
|
VIDEO_DRIVERS="$VIDEO_DRIVERS rtos_xvfb/libvideo_rtos_xvfb.la"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1404,12 +1397,18 @@ case "$with_libsuffix" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
AC_ARG_WITH(osname,
|
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 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.
|
dnl for other OSes, you should use makefile.ng or else.
|
||||||
|
|
||||||
case "$with_osname" in
|
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)
|
uclinux)
|
||||||
AC_DEFINE(__uClinux__, 1,
|
AC_DEFINE(__uClinux__, 1,
|
||||||
[Define if compile for uClinux])
|
[Define if compile for uClinux])
|
||||||
@@ -1513,13 +1512,17 @@ AC_ARG_WITH(targetname,
|
|||||||
S3C6410/S3C2440/S3C2410/hi3560a Define the target board name])
|
S3C6410/S3C2440/S3C2410/hi3560a Define the target board name])
|
||||||
|
|
||||||
case "$with_targetname" in
|
case "$with_targetname" in
|
||||||
|
external)
|
||||||
|
AC_DEFINE(__TARGET_EXTERNAL__, 1,
|
||||||
|
[Define for targets which use GAL and/or IAL engines and define the interfaces externally])
|
||||||
|
;;
|
||||||
fmsoft)
|
fmsoft)
|
||||||
AC_DEFINE(__TARGET_FMSOFT__, 1,
|
AC_DEFINE(__TARGET_FMSOFT__, 1,
|
||||||
[Define for FMSoft internal use])
|
[Define for FMSoft internal use])
|
||||||
;;
|
;;
|
||||||
mstudio)
|
mstudio)
|
||||||
AC_DEFINE(__TARGET_MSTUDIO__, 1,
|
AC_DEFINE(__TARGET_MSTUDIO__, 1,
|
||||||
[Define for FMSoft miniStudio])
|
[Define for FMSoft miniStudio])
|
||||||
;;
|
;;
|
||||||
stb810)
|
stb810)
|
||||||
AC_DEFINE(__TARGET_STB810__, 1,
|
AC_DEFINE(__TARGET_STB810__, 1,
|
||||||
@@ -1547,11 +1550,11 @@ case "$with_targetname" in
|
|||||||
;;
|
;;
|
||||||
bfin)
|
bfin)
|
||||||
AC_DEFINE(__TARGET_BLACKFIN__, 1,
|
AC_DEFINE(__TARGET_BLACKFIN__, 1,
|
||||||
[Define for Blackfin run uClinux])
|
[Define for Blackfin run uClinux])
|
||||||
;;
|
;;
|
||||||
c33l05)
|
c33l05)
|
||||||
AC_DEFINE(__TARGET_C33L05__, 1,
|
AC_DEFINE(__TARGET_C33L05__, 1,
|
||||||
[Define for EPSON C33L05 (axLinux)])
|
[Define for EPSON C33L05 (axLinux)])
|
||||||
;;
|
;;
|
||||||
S3C6410)
|
S3C6410)
|
||||||
CFLAGS="$CFLAGS -D_WITH_TARGET_S3C6410"
|
CFLAGS="$CFLAGS -D_WITH_TARGET_S3C6410"
|
||||||
@@ -2430,8 +2433,8 @@ fi
|
|||||||
if test "x$build_ctrl_textedit_new" = "xyes"; then
|
if test "x$build_ctrl_textedit_new" = "xyes"; then
|
||||||
AC_DEFINE(_MGCTRL_TEXTEDIT, 1,
|
AC_DEFINE(_MGCTRL_TEXTEDIT, 1,
|
||||||
[Define if include TEXTEDIT control])
|
[Define if include TEXTEDIT control])
|
||||||
AC_DEFINE(_MGCTRL_TEXTEDIT_USE_NEW_IMPL, 1,
|
AC_DEFINE(_MGCTRL_TEXTEDIT_USE_NEW_IMPL, 1,
|
||||||
[Define if use new implementation of TEXTEDIT control])
|
[Define if use new implementation of TEXTEDIT control])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$build_splash" = "xyes"; then
|
if test "x$build_splash" = "xyes"; then
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ COMM_HDRS = \
|
|||||||
common.h endianrw.h fixedmath.h \
|
common.h endianrw.h fixedmath.h \
|
||||||
minigui.h gdi.h window.h control.h \
|
minigui.h gdi.h window.h control.h \
|
||||||
own_malloc.h own_stdio.h \
|
own_malloc.h own_stdio.h \
|
||||||
xvfb.h customial.h \
|
xvfb.h customial.h exstubs.h \
|
||||||
dti.c
|
dti.c
|
||||||
|
|
||||||
UCOSII_HDRS=ucos2_pthread.h ucos2_semaphore.h
|
UCOSII_HDRS=ucos2_pthread.h ucos2_semaphore.h
|
||||||
|
|||||||
+1
-1
@@ -1701,7 +1701,7 @@ typedef struct _GAL_Rect {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Commonly used definitions */
|
/* Commonly used definitions */
|
||||||
#if !defined(__NOUNIX__) || defined (__ECOS__)
|
#ifdef HAVE_LIMITS_H
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -871,7 +871,7 @@ typedef LVNM_ITEMRUP *PLVNM_ITEMRUP;
|
|||||||
*/
|
*/
|
||||||
#define LVM_GETITEMSTATE 0xF128
|
#define LVM_GETITEMSTATE 0xF128
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* \def LVM_GETSELECTEDCOLUMN
|
* \def LVM_GETSELECTEDCOLUMN
|
||||||
* \brief Retrieves the index of the currently selected column of a listview.
|
* \brief Retrieves the index of the currently selected column of a listview.
|
||||||
*
|
*
|
||||||
|
|||||||
+13
-13
@@ -51,11 +51,6 @@
|
|||||||
#ifndef GUI_IAL_CUSTOM_H
|
#ifndef GUI_IAL_CUSTOM_H
|
||||||
#define GUI_IAL_CUSTOM_H
|
#define GUI_IAL_CUSTOM_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
|
|
||||||
#define IAL_MOUSE_LEFTBUTTON 1
|
#define IAL_MOUSE_LEFTBUTTON 1
|
||||||
#define IAL_MOUSE_RIGHTBUTTON 2
|
#define IAL_MOUSE_RIGHTBUTTON 2
|
||||||
#define IAL_MOUSE_MIDDLEBUTTON 4
|
#define IAL_MOUSE_MIDDLEBUTTON 4
|
||||||
@@ -67,12 +62,12 @@ extern "C" {
|
|||||||
#define IAL_MOUSEEVENT 1
|
#define IAL_MOUSEEVENT 1
|
||||||
#define IAL_KEYEVENT 2
|
#define IAL_KEYEVENT 2
|
||||||
|
|
||||||
typedef struct tagINPUT
|
typedef struct tagINPUT {
|
||||||
{
|
|
||||||
char* id;
|
char* id;
|
||||||
|
|
||||||
// Initialization and termination
|
// Initialization and termination
|
||||||
BOOL (*init_input) (struct tagINPUT *input, const char* mdev, const char* mtype);
|
BOOL (*init_input) (struct tagINPUT *input, const char* mdev,
|
||||||
|
const char* mtype);
|
||||||
void (*term_input) (void);
|
void (*term_input) (void);
|
||||||
|
|
||||||
// Mouse operations
|
// Mouse operations
|
||||||
@@ -96,17 +91,22 @@ typedef struct tagINPUT
|
|||||||
fd_set *except, struct timeval *timeout);
|
fd_set *except, struct timeval *timeout);
|
||||||
|
|
||||||
char mdev [MAX_PATH + 1];
|
char mdev [MAX_PATH + 1];
|
||||||
}INPUT;
|
} INPUT;
|
||||||
|
|
||||||
#ifdef _MGIAL_CUSTOM
|
#ifdef _MGIAL_CUSTOM
|
||||||
extern BOOL InitCustomInput (INPUT* input, const char* mdev, const char* mtype);
|
|
||||||
extern void TermCustomInput (void);
|
#ifdef __cplusplus
|
||||||
#endif
|
extern "C" {
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
BOOL InitCustomInput (INPUT* input, const char* mdev, const char* mtype);
|
||||||
|
void TermCustomInput (void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#endif /* _MGIAL_CUSTOM */
|
||||||
|
|
||||||
#endif /* GUI_IAL_CUSTOM_H */
|
#endif /* GUI_IAL_CUSTOM_H */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
/**
|
||||||
|
* \file exstubs.h
|
||||||
|
* \author Wei Yongming <vincent@minigui.org>
|
||||||
|
* \date 2019/04/07
|
||||||
|
*
|
||||||
|
* \brief This file is the header for NEWGAL/IAL engines which should be
|
||||||
|
* implemented by an external module.
|
||||||
|
*
|
||||||
|
\verbatim
|
||||||
|
|
||||||
|
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) 2007~2018, 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
|
||||||
|
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/>.
|
||||||
|
|
||||||
|
\endverbatim
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
|
||||||
|
* pSOS, ThreadX, NuCleus, OSE, and Win32.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GUI_EXSTUBS_H
|
||||||
|
#define GUI_EXSTUBS_H
|
||||||
|
|
||||||
|
/* The pixel format defined by depth */
|
||||||
|
#define COMMLCD_PSEUDO_RGB332 1
|
||||||
|
#define COMMLCD_TRUE_RGB555 2
|
||||||
|
#define COMMLCD_TRUE_RGB565 3
|
||||||
|
#define COMMLCD_TRUE_RGB888 4
|
||||||
|
#define COMMLCD_TRUE_RGB0888 5
|
||||||
|
#define COMMLCD_TRUE_ARGB1555 6
|
||||||
|
#define COMMLCD_TRUE_ARGB8888 7
|
||||||
|
#define COMMLCD_TRUE_ABRG8888 8
|
||||||
|
|
||||||
|
#define COMMLCD_UPDATE_NONE 0
|
||||||
|
#define COMMLCD_UPDATE_SYNC 1
|
||||||
|
#define COMMLCD_UPDATE_ASYNC 2
|
||||||
|
|
||||||
|
struct commlcd_info {
|
||||||
|
int height; // vertical resolution of the screen
|
||||||
|
int width; // horinzontal resolution of the screen
|
||||||
|
int pitch; // Length of one scan line in bytes
|
||||||
|
int bpp; // Depth (bits-per-pixel)
|
||||||
|
int type; // Pixel type
|
||||||
|
int update_method; // Update method: none, asynchronously, or synchronously.
|
||||||
|
Uint8* fb; // Frame buffer
|
||||||
|
};
|
||||||
|
|
||||||
|
#define COMM_MOUSEINPUT 0x01
|
||||||
|
#define COMM_KBINPUT 0x02
|
||||||
|
|
||||||
|
#define COMM_MOUSELBUTTON 0x01
|
||||||
|
#define COMM_MOUSERBUTTON 0x04
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
/* external stubs for COMMLCD NEWGAL engine */
|
||||||
|
#ifdef _MGGAL_COMMLCD
|
||||||
|
|
||||||
|
int __commlcd_drv_init (void);
|
||||||
|
int __commlcd_drv_getinfo (struct commlcd_info *li,
|
||||||
|
int width, int height, int depth);
|
||||||
|
int __commlcd_drv_release (void);
|
||||||
|
int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
|
||||||
|
int __commlcd_drv_update (const RECT* rc_dirty);
|
||||||
|
|
||||||
|
#endif /* _MGGAL_COMMLCD */
|
||||||
|
|
||||||
|
#ifdef _MGIAL_COMM
|
||||||
|
|
||||||
|
int __comminput_init (void);
|
||||||
|
int __comminput_ts_getdata (short *x, short *y, short *button);
|
||||||
|
int __comminput_kb_getdata (short *key, short *status);
|
||||||
|
int __comminput_wait_for_input (struct timeval *timeout);
|
||||||
|
void __comminput_deinit (void);
|
||||||
|
|
||||||
|
#endif /* _MGIAL_COMM */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#endif /* GUI_EXSTUBS_H */
|
||||||
|
|
||||||
+22
-17
@@ -2769,7 +2769,7 @@ MG_EXPORT void GUIAPI RGB2Pixels (HDC hdc, const RGB* rgbs,
|
|||||||
*/
|
*/
|
||||||
static inline gal_pixel RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b)
|
static inline gal_pixel RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b)
|
||||||
{
|
{
|
||||||
RGB rgb = {r, g, b, 0};
|
RGB rgb = {r, g, b, 0xFF};
|
||||||
gal_pixel pixel;
|
gal_pixel pixel;
|
||||||
|
|
||||||
RGB2Pixels (hdc, &rgb, &pixel, 1);
|
RGB2Pixels (hdc, &rgb, &pixel, 1);
|
||||||
@@ -6258,7 +6258,6 @@ MG_EXPORT BOOL GUIAPI ft2SetLcdFilter (LOGFONT* logfont, mg_FT_LcdFilter filter)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MGFONT_QPF) || defined(_MGFONT_FT2) || defined(_MGFONT_TTF) || defined(_MGFONT_UPF)
|
|
||||||
/**
|
/**
|
||||||
* \fn DEVFONT* GUIAPI LoadDevFontFromFile (const char* devfont_name, \
|
* \fn DEVFONT* GUIAPI LoadDevFontFromFile (const char* devfont_name, \
|
||||||
* const char* file_name)
|
* const char* file_name)
|
||||||
@@ -6278,6 +6277,23 @@ MG_EXPORT BOOL GUIAPI ft2SetLcdFilter (LOGFONT* logfont, mg_FT_LcdFilter filter)
|
|||||||
MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name,
|
MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name,
|
||||||
const char *file_name);
|
const char *file_name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \fn DEVFONT* GUIAPI LoadDevFontFromIncoreData (const char* devfont_name, \
|
||||||
|
* const void* data)
|
||||||
|
* \brief Load device font from incore data.
|
||||||
|
*
|
||||||
|
* This function can be used to load device font from incore data.
|
||||||
|
*
|
||||||
|
* \param devfont_name The device font name.
|
||||||
|
* \param data The pointer to the incore font data.
|
||||||
|
*
|
||||||
|
* \return the pointer to the new device font on success, NULL on error.
|
||||||
|
*
|
||||||
|
* \sa GetNextDevFont, DestroyDynamicDevFont
|
||||||
|
*/
|
||||||
|
MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromIncoreData (const char *devfont_name,
|
||||||
|
const void *data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont)
|
* \fn void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont)
|
||||||
* \brief Destroy device font loaded dynamically from font file.
|
* \brief Destroy device font loaded dynamically from font file.
|
||||||
@@ -6288,7 +6304,6 @@ MG_EXPORT DEVFONT* GUIAPI LoadDevFontFromFile (const char *devfont_name,
|
|||||||
* \sa LoadDevFontFromFile
|
* \sa LoadDevFontFromFile
|
||||||
*/
|
*/
|
||||||
MG_EXPORT void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont);
|
MG_EXPORT void GUIAPI DestroyDynamicDevFont (DEVFONT **devfont);
|
||||||
#endif
|
|
||||||
|
|
||||||
/** @} end of font_fns */
|
/** @} end of font_fns */
|
||||||
|
|
||||||
@@ -8003,7 +8018,7 @@ MG_EXPORT HDC GUIAPI InitSlaveScreenEx (const char* name, const char* mode, int
|
|||||||
*
|
*
|
||||||
* \return Valid handle on success, HDC_INVALID on failure.
|
* \return Valid handle on success, HDC_INVALID on failure.
|
||||||
*/
|
*/
|
||||||
inline HDC InitSlaveScreen (const char* name, const char* mode)
|
static inline HDC InitSlaveScreen (const char* name, const char* mode)
|
||||||
{
|
{
|
||||||
return InitSlaveScreenEx(name, mode, GDCAP_DPI_DEFAULT);
|
return InitSlaveScreenEx(name, mode, GDCAP_DPI_DEFAULT);
|
||||||
}
|
}
|
||||||
@@ -8760,10 +8775,8 @@ MG_EXPORT int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
|
|||||||
MG_EXPORT int GUIAPI DrawGlyphString (HDC hdc, int x, int y, Glyph32* glyph_string,
|
MG_EXPORT int GUIAPI DrawGlyphString (HDC hdc, int x, int y, Glyph32* glyph_string,
|
||||||
int len, int* adv_x, int* adv_y);
|
int len, int* adv_x, int* adv_y);
|
||||||
|
|
||||||
#define GLYPH_INFO_TYPE 0x01
|
#define GLYPH_INFO_METRICS 0x01
|
||||||
#define GLYPH_INFO_BIDI_TYPE 0x02
|
#define GLYPH_INFO_BMP 0x02
|
||||||
#define GLYPH_INFO_METRICS 0x04
|
|
||||||
#define GLYPH_INFO_BMP 0x10
|
|
||||||
|
|
||||||
/*the type of glyph bitmap*/
|
/*the type of glyph bitmap*/
|
||||||
#define GLYPHBMP_TYPE_MONO 0x00
|
#define GLYPHBMP_TYPE_MONO 0x00
|
||||||
@@ -8780,18 +8793,10 @@ typedef struct _GLYPHINFO
|
|||||||
/**
|
/**
|
||||||
* The mask indicates if you want to get glyph type info, metrics,
|
* The mask indicates if you want to get glyph type info, metrics,
|
||||||
* or bitmap infomation you want. Or'ed with the following values:
|
* or bitmap infomation you want. Or'ed with the following values:
|
||||||
* - GLYPH_INFO_TYPE
|
|
||||||
* - GLYPH_INFO_BIDI_TYPE
|
|
||||||
* - GLYPH_INFO_METRICS
|
* - GLYPH_INFO_METRICS
|
||||||
* - GLYPH_INFO_BMP
|
* - GLYPH_INFO_BMP
|
||||||
*/
|
*/
|
||||||
unsigned char mask;
|
Uint32 mask;
|
||||||
|
|
||||||
/** The basic glyph type */
|
|
||||||
unsigned int glyph_type;
|
|
||||||
|
|
||||||
/** The BIDI glyph type */
|
|
||||||
unsigned int bidi_glyph_type;
|
|
||||||
|
|
||||||
/** The height of the glyph */
|
/** The height of the glyph */
|
||||||
int height;
|
int height;
|
||||||
|
|||||||
+78
-55
@@ -2565,10 +2565,6 @@ MG_EXPORT void GUIAPI FreeFixStr (char* str);
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _MGHAVE_CURSOR
|
|
||||||
static inline void do_nothing (void) { return; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _MGHAVE_CURSOR
|
#ifdef _MGHAVE_CURSOR
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2730,12 +2726,34 @@ MG_EXPORT HCURSOR GUIAPI GetSystemCursor (int csrid);
|
|||||||
* \return Handle to the current system cursor, zero means no current cursor.
|
* \return Handle to the current system cursor, zero means no current cursor.
|
||||||
*/
|
*/
|
||||||
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor (void);
|
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor (void);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define LoadCursorFromFile(filename) (do_nothing(), 0)
|
|
||||||
#define CreateCursor(x, y, w, h, ANDbs, XORbs, cr) (do_nothing(), 0)
|
static inline HCURSOR LoadCursorFromFile(const char* filename) {
|
||||||
#define DestroyCursor(hcsr) (do_nothing(), 0)
|
return (HCURSOR)0;
|
||||||
#define GetSystemCursor(csrid) (do_nothing(), 0)
|
}
|
||||||
#define GetCurrentCursor() (do_nothing(), 0)
|
|
||||||
|
static inline HCURSOR CreateCursor(int xhotspot, int yhotspot, int w, int h,
|
||||||
|
const BYTE* pANDBits, const BYTE* pXORBits, int colornum) {
|
||||||
|
return (HCURSOR)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline HCURSOR GUIAPI CopyCursor (HCURSOR hcsr) {
|
||||||
|
return (HCURSOR)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline BOOL DestroyCursor (HCURSOR hcsr) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline HCURSOR GetSystemCursor (int csrid) {
|
||||||
|
return (HCURSOR)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline HCURSOR GUIAPI GetCurrentCursor (void) {
|
||||||
|
return (HCURSOR)0;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* _MGHAVE_CURSOR */
|
#endif /* _MGHAVE_CURSOR */
|
||||||
|
|
||||||
#define MAX_SYSCURSORINDEX 22
|
#define MAX_SYSCURSORINDEX 22
|
||||||
@@ -2843,6 +2861,7 @@ MG_EXPORT void GUIAPI GetCursorPos (POINT* ppt);
|
|||||||
MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
|
MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
|
||||||
|
|
||||||
#ifdef _MGHAVE_CURSOR
|
#ifdef _MGHAVE_CURSOR
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def)
|
* \fn HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def)
|
||||||
* \brief Changes the current cursor.
|
* \brief Changes the current cursor.
|
||||||
@@ -2861,40 +2880,7 @@ MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
|
|||||||
*
|
*
|
||||||
* \sa SetCursor, SetDefaultCursor, GetDefaultCursor
|
* \sa SetCursor, SetDefaultCursor, GetDefaultCursor
|
||||||
*/
|
*/
|
||||||
MG_EXPORT HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def);
|
MG_EXPORT HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def);
|
||||||
|
|
||||||
/**
|
|
||||||
* \def SetCursor(hcsr)
|
|
||||||
* \brief Changes the current cursor.
|
|
||||||
*
|
|
||||||
* This function changes the current cursor to be \a hcsr.
|
|
||||||
*
|
|
||||||
* \param hcsr The expected cursor handle.
|
|
||||||
* \return The old cursor handle.
|
|
||||||
*
|
|
||||||
* \note This function defined as a macro calling \a SetCursorEx with
|
|
||||||
* passing \a set_def as FALSE.
|
|
||||||
*
|
|
||||||
* \sa SetCursorEx, SetDefaultCursor
|
|
||||||
*/
|
|
||||||
#define SetCursor(hcsr) SetCursorEx (hcsr, FALSE)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \def SetDefaultCursor(hcsr)
|
|
||||||
* \brief Changes the current cursor, and set it as the default cursor.
|
|
||||||
*
|
|
||||||
* This function changes the current cursor to be \a hcsr, and set it as
|
|
||||||
* the default cursor.
|
|
||||||
*
|
|
||||||
* \param hcsr The expected cursor handle.
|
|
||||||
* \return The old cursor handle.
|
|
||||||
*
|
|
||||||
* \note This function defined as a macro calling \a SetCursorEx with
|
|
||||||
* passing \a set_def as TRUE.
|
|
||||||
*
|
|
||||||
* \sa SetCursorEx, SetCursor
|
|
||||||
*/
|
|
||||||
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn HCURSOR GUIAPI GetDefaultCursor (void)
|
* \fn HCURSOR GUIAPI GetDefaultCursor (void)
|
||||||
@@ -2908,15 +2894,6 @@ MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
|
|||||||
*/
|
*/
|
||||||
MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void);
|
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)
|
|
||||||
#endif /* _MGHAVE_CURSOR */
|
|
||||||
|
|
||||||
#ifdef _MGHAVE_CURSOR
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn int GUIAPI ShowCursor (BOOL fShow)
|
* \fn int GUIAPI ShowCursor (BOOL fShow)
|
||||||
* \brief Shows or hides cursor.
|
* \brief Shows or hides cursor.
|
||||||
@@ -2932,9 +2909,55 @@ MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void);
|
|||||||
* \return Cursor showing count value.
|
* \return Cursor showing count value.
|
||||||
*/
|
*/
|
||||||
MG_EXPORT int GUIAPI ShowCursor (BOOL fShow);
|
MG_EXPORT int GUIAPI ShowCursor (BOOL fShow);
|
||||||
#else
|
|
||||||
#define ShowCursor(fShow) (do_nothing(), 0)
|
#else /* _MGHAVE_CURSOR */
|
||||||
#endif /* _MGHAVE_CURSOR */
|
|
||||||
|
static inline HCURSOR SetCursorEx(HCURSOR hcsr, BOOL set_def) {
|
||||||
|
return (HCURSOR)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline HCURSOR GetDefaultCursor(void) {
|
||||||
|
return (HCURSOR)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int GUIAPI ShowCursor (BOOL fShow) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* !_MGHAVE_CURSOR */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \def SetCursor(hcsr)
|
||||||
|
* \brief Changes the current cursor.
|
||||||
|
*
|
||||||
|
* This function changes the current cursor to be \a hcsr.
|
||||||
|
*
|
||||||
|
* \param hcsr The expected cursor handle.
|
||||||
|
* \return The old cursor handle.
|
||||||
|
*
|
||||||
|
* \note This function defined as a macro calling \a SetCursorEx with
|
||||||
|
* passing \a set_def as FALSE.
|
||||||
|
*
|
||||||
|
* \sa SetCursorEx, SetDefaultCursor
|
||||||
|
*/
|
||||||
|
#define SetCursor(hcsr) SetCursorEx (hcsr, FALSE)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \def SetDefaultCursor(hcsr)
|
||||||
|
* \brief Changes the current cursor, and set it as the default cursor.
|
||||||
|
*
|
||||||
|
* This function changes the current cursor to be \a hcsr, and set it as
|
||||||
|
* the default cursor.
|
||||||
|
*
|
||||||
|
* \param hcsr The expected cursor handle.
|
||||||
|
* \return The old cursor handle.
|
||||||
|
*
|
||||||
|
* \note This function defined as a macro calling \a SetCursorEx with
|
||||||
|
* passing \a set_def as TRUE.
|
||||||
|
*
|
||||||
|
* \sa SetCursorEx, SetCursor
|
||||||
|
*/
|
||||||
|
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE)
|
||||||
|
|
||||||
/** @} end of cursor_fns */
|
/** @} end of cursor_fns */
|
||||||
|
|
||||||
|
|||||||
+4
-5
@@ -4584,17 +4584,16 @@ typedef unsigned long RES_KEY;
|
|||||||
/* define the incore res type */
|
/* define the incore res type */
|
||||||
typedef struct _INNER_RES {
|
typedef struct _INNER_RES {
|
||||||
RES_KEY key;
|
RES_KEY key;
|
||||||
Uint8* data;
|
const Uint8* data;
|
||||||
int data_len;
|
int data_len;
|
||||||
|
|
||||||
/* special param recognized by the TYPE_OPS
|
/* The special param recognized by the TYPE_OPS normally it is NULL.
|
||||||
* normal is null.
|
* If data is the data is a mem of raw png, jpeg, bmp
|
||||||
* is the data is a mem of raw png, jpeg, bmp
|
|
||||||
* and so on, it should be the extention name
|
* and so on, it should be the extention name
|
||||||
* of the filename. eg.
|
* of the filename. eg.
|
||||||
* INNER_RES res[]= { ... { ..., ... ,.., "png" } .. };
|
* INNER_RES res[]= { ... { ..., ... ,.., "png" } .. };
|
||||||
* */
|
* */
|
||||||
void* additional;
|
const void* additional;
|
||||||
} INNER_RES;
|
} INNER_RES;
|
||||||
|
|
||||||
/* the type of resource */
|
/* the type of resource */
|
||||||
|
|||||||
+2
-13
@@ -14,7 +14,6 @@ include $(abs_top_srcdir)/$(TARGET_RULES)
|
|||||||
# Flags that can be set on the nmake command line:
|
# Flags that can be set on the nmake command line:
|
||||||
# DEBUG=1 for compiling a debugging version
|
# DEBUG=1 for compiling a debugging version
|
||||||
# PREFIX=Some/Directory Base directory for installation
|
# PREFIX=Some/Directory Base directory for installation
|
||||||
# CONFIGH=YourConfigHeader for defining the mgconfig.h file to use
|
|
||||||
|
|
||||||
ifndef DEBUG
|
ifndef DEBUG
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
@@ -37,8 +36,6 @@ docdir = $(datadir)/doc/minigui
|
|||||||
|
|
||||||
# The directory where the include files will be installed
|
# The directory where the include files will be installed
|
||||||
libminiguiincludedir = $(includedir)/minigui
|
libminiguiincludedir = $(includedir)/minigui
|
||||||
libmgextincludedir = $(includedir)/minigui
|
|
||||||
|
|
||||||
|
|
||||||
# Programs used by "make":
|
# Programs used by "make":
|
||||||
CP = cp
|
CP = cp
|
||||||
@@ -93,14 +90,6 @@ TIFF_LIBS = $(TIFF_NOLZW_LIBS)
|
|||||||
ZLIB_CFLAGS = -I $(ZLIB)
|
ZLIB_CFLAGS = -I $(ZLIB)
|
||||||
ZLIB_LIBS = $(ZLIB)/zlib.lib
|
ZLIB_LIBS = $(ZLIB)/zlib.lib
|
||||||
|
|
||||||
ifdef COMPILE_MGEXTLIB
|
|
||||||
MGEXT_CFLAGS = -D__MGEXT_LIB__
|
|
||||||
else
|
|
||||||
MGEXT_CFLAGS =
|
|
||||||
endif
|
|
||||||
|
|
||||||
MG_PRE_DEFINES = -D__MINIGUI_LIB__ $(MGEXT_CFLAGS)
|
|
||||||
|
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
|
||||||
ifdef LOCAL_INC
|
ifdef LOCAL_INC
|
||||||
@@ -119,10 +108,10 @@ endif
|
|||||||
|
|
||||||
DEPLIBINC = -I$(DEPLIBDIR)/include
|
DEPLIBINC = -I$(DEPLIBDIR)/include
|
||||||
|
|
||||||
CFLAGS += $(OPTIMIZE) $(DEBUGINFO) $(DEPLIBINC) $(INCLUDES) $(DEFINES) $(DEPCFLAGS) $(MG_PRE_DEFINES) -c
|
CFLAGS += $(OPTIMIZE) $(DEBUGINFO) $(DEPLIBINC) $(DEFINES) $(DEPCFLAGS) -c
|
||||||
|
|
||||||
DEFS += -D__MINIGUI_LIB__ -D_REENTRANT
|
DEFS += -D__MINIGUI_LIB__ -D_REENTRANT
|
||||||
CFLAGS += -I$(abs_top_srcdir) $(INCLUDES) $(DEFS) $(INCS)
|
CFLAGS += -I$(abs_top_srcdir) -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/include $(INCLUDES) $(DEFS) $(INCS)
|
||||||
|
|
||||||
%.$(OBJ): %.c
|
%.$(OBJ): %.c
|
||||||
$(CC) $(CFLAGS) $(COFLAG) $<
|
$(CC) $(CFLAGS) $(COFLAG) $<
|
||||||
|
|||||||
+6
-6
@@ -1853,8 +1853,8 @@ static int sledit_reset_text (HWND hWnd, PSLEDITDATA sled, char* str)
|
|||||||
check_valid_passwd (buffer);
|
check_valid_passwd (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//we must retain the status of this control, it include is ETS_FOCUS state, that
|
//we must retain the status of this control, it include is ETS_FOCUS state, that
|
||||||
//tell this control whether the caret is need
|
//tell this control whether the caret is need
|
||||||
//sled->status = 0;
|
//sled->status = 0;
|
||||||
sled->selStart = 0;
|
sled->selStart = 0;
|
||||||
sled->selEnd = 0;
|
sled->selEnd = 0;
|
||||||
@@ -1895,7 +1895,7 @@ sledit_insert_text (HWND hWnd, PSLEDITDATA sled, const char* newtext, int len)
|
|||||||
if (dwStyle & ES_READONLY)
|
if (dwStyle & ES_READONLY)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
tempstr = (char*) malloc(realen+1);
|
tempstr = (char*) malloc(realen+1);
|
||||||
|
|
||||||
for (i = 0; i < len && newtext[i] != '\0'; i ++)
|
for (i = 0; i < len && newtext[i] != '\0'; i ++)
|
||||||
{
|
{
|
||||||
@@ -1912,7 +1912,7 @@ sledit_insert_text (HWND hWnd, PSLEDITDATA sled, const char* newtext, int len)
|
|||||||
|
|
||||||
sleInsertText (hWnd, sled, (char* )newbuffer, len);
|
sleInsertText (hWnd, sled, (char* )newbuffer, len);
|
||||||
|
|
||||||
free(tempstr);
|
free(tempstr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2161,14 +2161,14 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (dwStyle & ES_LEFT) {
|
if (dwStyle & ES_LEFT) {
|
||||||
esleft_input_char_refresh(hWnd, sled, (char*)charBuffer, chars);
|
esleft_input_char_refresh(hWnd, sled, (char*)charBuffer, chars);
|
||||||
set_edit_caret_pos(hWnd, sled);
|
set_edit_caret_pos(hWnd, sled);
|
||||||
|
|
||||||
sled->changed = TRUE;
|
sled->changed = TRUE;
|
||||||
NotifyParent (hWnd, GetDlgCtrlID(hWnd), EN_CHANGE);
|
NotifyParent (hWnd, GetDlgCtrlID(hWnd), EN_CHANGE);
|
||||||
}
|
}
|
||||||
else if (dwStyle & ES_RIGHT) {
|
else if (dwStyle & ES_RIGHT) {
|
||||||
esright_input_char_refresh(hWnd, sled, (char*)charBuffer, chars);
|
esright_input_char_refresh(hWnd, sled, (char*)charBuffer, chars);
|
||||||
}
|
}
|
||||||
else if (dwStyle & ES_CENTER) {
|
else if (dwStyle & ES_CENTER) {
|
||||||
sleInsertText (hWnd, sled, (char* )charBuffer, chars);
|
sleInsertText (hWnd, sled, (char* )charBuffer, chars);
|
||||||
|
|||||||
+18
-18
@@ -1260,17 +1260,17 @@ static int bar_add_item (HWND hwnd, PNTBCTRLDATA ntb_data, NTBITEMINFO* item_inf
|
|||||||
|
|
||||||
static void ShowCurItemHintText (HWND hWnd, NTBCTRLDATA *ntb_data , NTBITEM * pitem)
|
static void ShowCurItemHintText (HWND hWnd, NTBCTRLDATA *ntb_data , NTBITEM * pitem)
|
||||||
{
|
{
|
||||||
int x,y;
|
int x,y;
|
||||||
|
|
||||||
if(!pitem)
|
if(!pitem)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (pitem->tip[0] == '\0')
|
if (pitem->tip[0] == '\0')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
x = pitem->rc_item.right;
|
x = pitem->rc_item.right;
|
||||||
y = pitem->rc_item.bottom;
|
y = pitem->rc_item.bottom;
|
||||||
ClientToScreen (hWnd, &x, &y);
|
ClientToScreen (hWnd, &x, &y);
|
||||||
|
|
||||||
if (!IsWindow(ntb_data->hToolTip)) {
|
if (!IsWindow(ntb_data->hToolTip)) {
|
||||||
ntb_data->hToolTip = CreateToolTipWin (hWnd, x, y, 1000, pitem->tip);
|
ntb_data->hToolTip = CreateToolTipWin (hWnd, x, y, 1000, pitem->tip);
|
||||||
@@ -1326,11 +1326,11 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||||||
case MSG_DESTROY: {
|
case MSG_DESTROY: {
|
||||||
NTBITEM *item, *tmp;
|
NTBITEM *item, *tmp;
|
||||||
|
|
||||||
if (ntb_data->hToolTip)
|
if (ntb_data->hToolTip)
|
||||||
{
|
{
|
||||||
DestroyToolTipWin(ntb_data->hToolTip);
|
DestroyToolTipWin(ntb_data->hToolTip);
|
||||||
ntb_data->hToolTip = 0;
|
ntb_data->hToolTip = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
item = ntb_data->head;
|
item = ntb_data->head;
|
||||||
while (item) {
|
while (item) {
|
||||||
@@ -1559,12 +1559,12 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||||||
if (!wParam && ntb_data->sel_item) {
|
if (!wParam && ntb_data->sel_item) {
|
||||||
InvalidateRect (hwnd, &ntb_data->sel_item->rc_item, TRUE);
|
InvalidateRect (hwnd, &ntb_data->sel_item->rc_item, TRUE);
|
||||||
ntb_data->sel_item = NULL;
|
ntb_data->sel_item = NULL;
|
||||||
ShowWindow(ntb_data->hToolTip, SW_HIDE);
|
ShowWindow(ntb_data->hToolTip, SW_HIDE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowWindow(ntb_data->hToolTip, SW_HIDE);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
ShowWindow(ntb_data->hToolTip, SW_HIDE);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1584,12 +1584,12 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||||||
}
|
}
|
||||||
ntb_data->sel_item = item;
|
ntb_data->sel_item = item;
|
||||||
InvalidateRect (hwnd, &ntb_data->sel_item->rc_item, TRUE);
|
InvalidateRect (hwnd, &ntb_data->sel_item->rc_item, TRUE);
|
||||||
ShowCurItemHintText(hwnd, ntb_data, item);
|
ShowCurItemHintText(hwnd, ntb_data, item);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (ntb_data->sel_item) {
|
if (ntb_data->sel_item) {
|
||||||
ShowWindow(ntb_data->hToolTip, SW_HIDE);
|
ShowWindow(ntb_data->hToolTip, SW_HIDE);
|
||||||
InvalidateRect (hwnd, &ntb_data->sel_item->rc_item, TRUE);
|
InvalidateRect (hwnd, &ntb_data->sel_item->rc_item, TRUE);
|
||||||
ntb_data->sel_item = NULL;
|
ntb_data->sel_item = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
abs_top_srcdir=../..
|
abs_top_srcdir=../..
|
||||||
|
LOCAL_INC=-I$(abs_top_srcdir)/src/control/
|
||||||
|
|
||||||
include Makefile.am
|
include Makefile.am
|
||||||
include ../../rules.make
|
include ../../rules.make
|
||||||
|
|||||||
+62
-15
@@ -334,14 +334,14 @@ void font_DelSBDevFont (DEVFONT* dev_font)
|
|||||||
tmp = sb_dev_font_head;
|
tmp = sb_dev_font_head;
|
||||||
while (tmp != NULL) {
|
while (tmp != NULL) {
|
||||||
if (tmp == dev_font) {
|
if (tmp == dev_font) {
|
||||||
if (prev != NULL)
|
if (prev != NULL)
|
||||||
prev->next = tmp->next;
|
prev->next = tmp->next;
|
||||||
else
|
else
|
||||||
sb_dev_font_head = tmp->next;
|
sb_dev_font_head = tmp->next;
|
||||||
|
|
||||||
nr_sb_dev_fonts --;
|
nr_sb_dev_fonts --;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = tmp;
|
prev = tmp;
|
||||||
@@ -370,7 +370,7 @@ void font_DelMBDevFont (DEVFONT* dev_font)
|
|||||||
|
|
||||||
nr_mb_dev_fonts --;
|
nr_mb_dev_fonts --;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
prev = tmp;
|
prev = tmp;
|
||||||
tmp = prev->next;
|
tmp = prev->next;
|
||||||
@@ -380,7 +380,31 @@ void font_DelMBDevFont (DEVFONT* dev_font)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filename)
|
static DEVFONT* find_devfont(const char* font_name, BOOL is_mbc_list)
|
||||||
|
{
|
||||||
|
DEVFONT* head;
|
||||||
|
DEVFONT* cur;
|
||||||
|
|
||||||
|
if (is_mbc_list) {
|
||||||
|
head = mb_dev_font_head;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
head = sb_dev_font_head;
|
||||||
|
}
|
||||||
|
|
||||||
|
cur = head;
|
||||||
|
while (cur) {
|
||||||
|
if (strcasecmp (cur->name, font_name) == 0) {
|
||||||
|
return cur;
|
||||||
|
}
|
||||||
|
|
||||||
|
cur = cur->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DEVFONT* make_devfont (const char* font_name, const void* data, BOOL is_filename)
|
||||||
{
|
{
|
||||||
FONTOPS_INFO* fontops_info = __mg_fontops_infos;
|
FONTOPS_INFO* fontops_info = __mg_fontops_infos;
|
||||||
DEVFONT* devfont;
|
DEVFONT* devfont;
|
||||||
@@ -411,6 +435,12 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (find_devfont(font_name, (charset_ops->bytes_maxlen_char > 1))) {
|
||||||
|
_MG_PRINTF ("FONT>DevFont: Duplicated devfont name (%s)",
|
||||||
|
font_name);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
devfont = calloc (1, sizeof (DEVFONT));
|
devfont = calloc (1, sizeof (DEVFONT));
|
||||||
|
|
||||||
devfont->font_ops = fontops_info->fontops;
|
devfont->font_ops = fontops_info->fontops;
|
||||||
@@ -429,7 +459,7 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
|
|||||||
devfont->need_unload = TRUE;
|
devfont->need_unload = TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
devfont->data = data;
|
devfont->data = (void*)data;
|
||||||
devfont->need_unload = FALSE;
|
devfont->need_unload = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,7 +592,7 @@ static UPFINFO* incore_upfonts [] = {
|
|||||||
&__mgif_upf_times_12x10,
|
&__mgif_upf_times_12x10,
|
||||||
&__mgif_upf_times_17x14,
|
&__mgif_upf_times_17x14,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NR_UPFONTS (sizeof (incore_upfonts) / sizeof (UPFINFO*))
|
#define NR_UPFONTS (sizeof (incore_upfonts) / sizeof (UPFINFO*))
|
||||||
@@ -738,10 +768,22 @@ static void font_DelDevFont (const char* font_name)
|
|||||||
del_devfont_from_list(font_name, FALSE);
|
del_devfont_from_list(font_name, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVFONT* GUIAPI LoadDevFontFromFile
|
DEVFONT* GUIAPI LoadDevFontFromIncoreData(const char *devfont_name,
|
||||||
(const char *devfont_name, const char *file_name)
|
const void *data)
|
||||||
{
|
{
|
||||||
DEVFONT* devfont = make_devfont (devfont_name, (char*)file_name, TRUE);
|
DEVFONT* devfont = make_devfont (devfont_name, data, FALSE);
|
||||||
|
if (devfont == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
ADD_DEVFONT_TO_LINKLIST (devfont);
|
||||||
|
add_relating_devfonts_to_list (devfont);
|
||||||
|
return devfont;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEVFONT* GUIAPI LoadDevFontFromFile(const char *devfont_name,
|
||||||
|
const char *file_name)
|
||||||
|
{
|
||||||
|
DEVFONT* devfont = make_devfont (devfont_name, file_name, TRUE);
|
||||||
if (devfont == NULL)
|
if (devfont == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@@ -752,7 +794,12 @@ DEVFONT* GUIAPI LoadDevFontFromFile
|
|||||||
|
|
||||||
void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
|
void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
|
||||||
{
|
{
|
||||||
font_DelDevFont ((*devfont)->name);
|
char font_name [LEN_UNIDEVFONT_NAME + 1];
|
||||||
|
|
||||||
|
memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
|
||||||
|
strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
|
||||||
|
|
||||||
|
font_DelDevFont (font_name);
|
||||||
*devfont = NULL;
|
*devfont = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -763,13 +810,13 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
|
|||||||
char font_name [LEN_UNIDEVFONT_NAME + 1];
|
char font_name [LEN_UNIDEVFONT_NAME + 1];
|
||||||
char font_file [MAX_PATH+1];
|
char font_file [MAX_PATH+1];
|
||||||
char font_path [MAX_PATH+1];
|
char font_path [MAX_PATH+1];
|
||||||
char *font_file_name = NULL;
|
char *font_file_name = NULL;
|
||||||
MEM_RES* memres = NULL;
|
MEM_RES* memres = NULL;
|
||||||
|
|
||||||
char key[12];
|
char key[32];
|
||||||
int added_num = 0;
|
int added_num = 0;
|
||||||
|
|
||||||
font_file_name = font_file;
|
font_file_name = font_file;
|
||||||
|
|
||||||
/*get font number in minigui etc*/
|
/*get font number in minigui etc*/
|
||||||
if (GetMgEtcIntValue (etc_section, "font_number", &font_num) < 0 ) {
|
if (GetMgEtcIntValue (etc_section, "font_number", &font_num) < 0 ) {
|
||||||
|
|||||||
+24
-32
@@ -91,10 +91,10 @@ typedef struct _HashDirectory
|
|||||||
typedef struct cache
|
typedef struct cache
|
||||||
{
|
{
|
||||||
/* Information about font */
|
/* Information about font */
|
||||||
char family[LEN_FONT_NAME + 1];
|
char df_name[LEN_UNIDEVFONT_NAME + 1];
|
||||||
char charset[LEN_FONT_NAME + 1];
|
int style;
|
||||||
DWORD style;
|
|
||||||
int fontsize;
|
int fontsize;
|
||||||
|
int rotation;
|
||||||
|
|
||||||
int refers;
|
int refers;
|
||||||
int blkSize;
|
int blkSize;
|
||||||
@@ -384,7 +384,7 @@ AppendBlk(cache_t *cache, MemBlk *blk, int key)
|
|||||||
*size : if found the data, how long is the data(return val)
|
*size : if found the data, how long is the data(return val)
|
||||||
reutrn = pointer to the data */
|
reutrn = pointer to the data */
|
||||||
TTFCACHEINFO *
|
TTFCACHEINFO *
|
||||||
__mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
|
__mg_ttc_search(HCACHE hCache, UChar32 unicode, int *size)
|
||||||
{
|
{
|
||||||
int key;
|
int key;
|
||||||
CacheQueueNode *ca;
|
CacheQueueNode *ca;
|
||||||
@@ -402,7 +402,8 @@ __mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
|
|||||||
|
|
||||||
for ( ; blk != &(ca->cache.hashDir[key].hashHead);
|
for ( ; blk != &(ca->cache.hashDir[key].hashHead);
|
||||||
blk = blk->hashNext) {
|
blk = blk->hashNext) {
|
||||||
if (*(unsigned short *)(blk->data) == unicode) {
|
TTFCACHEINFO * tci = (TTFCACHEINFO *)blk->data;
|
||||||
|
if (tci->unicode == unicode) {
|
||||||
/* If found the blk, we should pick off it
|
/* If found the blk, we should pick off it
|
||||||
and link it at the end of LRU-q */
|
and link it at the end of LRU-q */
|
||||||
*size = blk->len;
|
*size = blk->len;
|
||||||
@@ -412,9 +413,10 @@ __mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
|
|||||||
blk->lruPrev = ca->cache.lruQueueDummyHead.lruPrev;
|
blk->lruPrev = ca->cache.lruQueueDummyHead.lruPrev;
|
||||||
(ca->cache.lruQueueDummyHead.lruPrev)->lruNext = blk;
|
(ca->cache.lruQueueDummyHead.lruPrev)->lruNext = blk;
|
||||||
ca->cache.lruQueueDummyHead.lruPrev = blk;
|
ca->cache.lruQueueDummyHead.lruPrev = blk;
|
||||||
return blk->data;
|
return tci;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,7 +439,7 @@ __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
|
|||||||
if (ca->cache.blkSize < size) {
|
if (ca->cache.blkSize < size) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
key = ca->cache.makeHashKeyFunc(*(unsigned short *)data);
|
key = ca->cache.makeHashKeyFunc(data->unicode);
|
||||||
|
|
||||||
/* pick off a block from lru queue */
|
/* pick off a block from lru queue */
|
||||||
if ((blk = PickOffBlk(&ca->cache)) == NULL) {
|
if ((blk = PickOffBlk(&ca->cache)) == NULL) {
|
||||||
@@ -464,11 +466,11 @@ __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
|
|||||||
ndir : how many hash entries in the cache
|
ndir : how many hash entries in the cache
|
||||||
makeHashKey : the function which make the hash key */
|
makeHashKey : the function which make the hash key */
|
||||||
HCACHE
|
HCACHE
|
||||||
__mg_ttc_create(char *family, char *charset, DWORD style, int size,
|
__mg_ttc_create(const char *df_name, int style, int size, int rotation,
|
||||||
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey)
|
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey)
|
||||||
{
|
{
|
||||||
CacheQueueNode *temp;
|
CacheQueueNode *temp;
|
||||||
if (family == NULL || charset == NULL || makeHashKey == NULL) {
|
if (df_name == NULL || makeHashKey == NULL) {
|
||||||
return (HCACHE)(0);
|
return (HCACHE)(0);
|
||||||
}
|
}
|
||||||
if (nblk <= 0 || blksize <= 0 || size <= 0 || ndir <= 0) {
|
if (nblk <= 0 || blksize <= 0 || size <= 0 || ndir <= 0) {
|
||||||
@@ -482,10 +484,11 @@ __mg_ttc_create(char *family, char *charset, DWORD style, int size,
|
|||||||
return (HCACHE)(0);
|
return (HCACHE)(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(temp->cache.family, family, LEN_FONT_NAME);
|
memset(temp->cache.df_name, 0, LEN_UNIDEVFONT_NAME + 1);
|
||||||
strncpy(temp->cache.charset, charset, LEN_FONT_NAME);
|
strncpy(temp->cache.df_name, df_name, LEN_UNIDEVFONT_NAME);
|
||||||
temp->cache.style = style;
|
temp->cache.style = style;
|
||||||
temp->cache.fontsize = size;
|
temp->cache.fontsize = size;
|
||||||
|
temp->cache.rotation = rotation;
|
||||||
temp->cache.blkSize = blksize;
|
temp->cache.blkSize = blksize;
|
||||||
temp->cache.nBlk = nblk;
|
temp->cache.nBlk = nblk;
|
||||||
temp->cache.nDir = ndir;
|
temp->cache.nDir = ndir;
|
||||||
@@ -576,7 +579,7 @@ __mg_ttc_sys_deinit(void)
|
|||||||
|
|
||||||
|
|
||||||
HCACHE
|
HCACHE
|
||||||
__mg_ttc_is_exist(char *family, char *charset, DWORD style, int size)
|
__mg_ttc_is_exist(const char *df_name, int style, int size, int rotation)
|
||||||
{
|
{
|
||||||
CacheQueueNode *p;
|
CacheQueueNode *p;
|
||||||
|
|
||||||
@@ -587,22 +590,11 @@ __mg_ttc_is_exist(char *family, char *charset, DWORD style, int size)
|
|||||||
/* If can not match font name*/
|
/* If can not match font name*/
|
||||||
p = __mg_globalCache.queueDummyHead.nextCache;
|
p = __mg_globalCache.queueDummyHead.nextCache;
|
||||||
while (p != &__mg_globalCache.queueDummyHead) {
|
while (p != &__mg_globalCache.queueDummyHead) {
|
||||||
if (strncmp(p->cache.family, family, LEN_FONT_NAME) == 0) {
|
if (strncmp(p->cache.df_name, df_name, LEN_UNIDEVFONT_NAME) == 0 &&
|
||||||
if (strncmp(p->cache.charset, charset, LEN_FONT_NAME) == 0) {
|
p->cache.style == style &&
|
||||||
if (p->cache.fontsize == size) {
|
p->cache.fontsize == size &&
|
||||||
int s = style & 0x000000FF;
|
p->cache.rotation == rotation) {
|
||||||
if ((s == FS_WEIGHT_BOOK || s == FS_WEIGHT_DEMIBOLD || s == FS_WEIGHT_SUBPIXEL) &&
|
return (HCACHE) p;
|
||||||
(p->cache.style == FS_WEIGHT_BOOK || p->cache.style == FS_WEIGHT_DEMIBOLD ||
|
|
||||||
p->cache.style == FS_WEIGHT_SUBPIXEL)) {
|
|
||||||
return (HCACHE) p;
|
|
||||||
}
|
|
||||||
if ((s != FS_WEIGHT_BOOK && s != FS_WEIGHT_DEMIBOLD && s != FS_WEIGHT_SUBPIXEL) &&
|
|
||||||
(p->cache.style != FS_WEIGHT_BOOK && p->cache.style != FS_WEIGHT_DEMIBOLD &&
|
|
||||||
p->cache.style != FS_WEIGHT_SUBPIXEL)) {
|
|
||||||
return (HCACHE) p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
p = p->nextCache;
|
p = p->nextCache;
|
||||||
}
|
}
|
||||||
@@ -664,10 +656,10 @@ void __mg_ttc_dump(cache_t *cache)
|
|||||||
MemBlk *ptr;
|
MemBlk *ptr;
|
||||||
#if 0
|
#if 0
|
||||||
DP(("&cache = %p\n", cache));
|
DP(("&cache = %p\n", cache));
|
||||||
DP(("cache.family = %s\n", cache->family));
|
DP(("cache.df_name = %s\n", cache->df_name));
|
||||||
DP(("cache.charset = %s\n", cache->charset));
|
|
||||||
DP(("cache.style = %d\n", cache->style));
|
DP(("cache.style = %d\n", cache->style));
|
||||||
DP(("cache.fontsize = %d\n", cache->fontsize));
|
DP(("cache.fontsize = %d\n", cache->fontsize));
|
||||||
|
DP(("cache.rotation = %d\n", cache->rotation));
|
||||||
DP(("cache.blkSize = %d\n", cache->blkSize));
|
DP(("cache.blkSize = %d\n", cache->blkSize));
|
||||||
DP(("cache.refers = %d\n", cache->refers));
|
DP(("cache.refers = %d\n", cache->refers));
|
||||||
DP(("cache.nBlk = %d\n", cache->nBlk));
|
DP(("cache.nBlk = %d\n", cache->nBlk));
|
||||||
@@ -692,7 +684,7 @@ void __mg_ttc_dump(cache_t *cache)
|
|||||||
printf("hash[%d]:", i);
|
printf("hash[%d]:", i);
|
||||||
p = (cache->hashDir)[i].hashHead.hashNext;
|
p = (cache->hashDir)[i].hashHead.hashNext;
|
||||||
while(p != &(cache->hashDir[i].hashHead)) {
|
while(p != &(cache->hashDir[i].hashHead)) {
|
||||||
printf("-->%d(%d)", *(unsigned short *)(p->data), p->len);
|
printf("-->%d(%d)", *(UChar32 *)(p->data), p->len);
|
||||||
p = p->hashNext;
|
p = p->hashNext;
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -703,7 +695,7 @@ void __mg_ttc_dump(cache_t *cache)
|
|||||||
ptr = cache->lruQueueDummyHead.lruNext;
|
ptr = cache->lruQueueDummyHead.lruNext;
|
||||||
for ( ; ptr != &cache->lruQueueDummyHead; ptr = ptr->lruNext) {
|
for ( ; ptr != &cache->lruQueueDummyHead; ptr = ptr->lruNext) {
|
||||||
DP(("-->%p(len:%d, data:%d)",
|
DP(("-->%p(len:%d, data:%d)",
|
||||||
ptr, ptr->len, *(unsigned short *)(ptr->data)));
|
ptr, ptr->len, *(UCha32 *)(ptr->data)));
|
||||||
}
|
}
|
||||||
//printf("\n");
|
//printf("\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ static void start_str_output (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
/* call this function before getting the bitmap/pixmap of the char
|
/* call this function before getting the bitmap/pixmap of the char
|
||||||
* to get the bbox of the char */
|
* to get the bbox of the char */
|
||||||
static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
const Glyph32 glyph_value,
|
Glyph32 glyph_value,
|
||||||
int* px, int* py, int* pwidth, int* pheight)
|
int* px, int* py, int* pwidth, int* pheight)
|
||||||
{
|
{
|
||||||
TT_UShort uni_char;
|
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 */
|
/* call this function to get the bitmap/pixmap of the char */
|
||||||
static const void*
|
static const void*
|
||||||
char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
const Glyph32 glyph_value, int* pitch, BOOL is_grey)
|
Glyph32 glyph_value, SIZE* sz, int* pitch, BOOL is_grey)
|
||||||
{
|
{
|
||||||
TT_Raster_Map Raster;
|
TT_Raster_Map Raster;
|
||||||
TT_Error error;
|
TT_Error error;
|
||||||
@@ -538,23 +538,23 @@ char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_monobitmap (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, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
if (scale) *scale = 1;
|
if (scale) *scale = 1;
|
||||||
return char_bitmap_pixmap (logfont, devfont, glyph_value, pitch, FALSE);
|
return char_bitmap_pixmap (logfont, devfont, glyph_value, sz, pitch, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
if (scale) *scale = 1;
|
if (scale) *scale = 1;
|
||||||
return char_bitmap_pixmap (logfont, devfont, glyph_value, pitch, TRUE);
|
return char_bitmap_pixmap (logfont, devfont, glyph_value, sz, pitch, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* call this function after getting the bitmap/pixmap of the char
|
/* call this function after getting the bitmap/pixmap of the char
|
||||||
* to get the advance of the char */
|
* to get the advance of the char */
|
||||||
static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
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;
|
TT_Pos vec_x, vec_y;
|
||||||
TTFINSTANCEINFO* ttf_inst_info = TTF_INST_INFO_P (devfont);
|
TTFINSTANCEINFO* ttf_inst_info = TTF_INST_INFO_P (devfont);
|
||||||
|
|||||||
+66
-42
File diff suppressed because it is too large
Load Diff
+12
-11
@@ -63,13 +63,12 @@ extern "C" {
|
|||||||
|
|
||||||
#ifdef _MGFONT_TTF_CACHE
|
#ifdef _MGFONT_TTF_CACHE
|
||||||
typedef unsigned long HCACHE;
|
typedef unsigned long HCACHE;
|
||||||
typedef int (* MakeHashKeyFunc)(unsigned short unicode);
|
typedef int (* MakeHashKeyFunc)(UChar32 unicode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct tagFTFACEINFO {
|
typedef struct tagFTFACEINFO {
|
||||||
#ifdef _MGFONT_TTF_CACHE
|
#ifdef _MGFONT_TTF_CACHE
|
||||||
/*should be MAX_PATH*/
|
char* filepathname;
|
||||||
char filepathname[256];
|
|
||||||
int face_index;
|
int face_index;
|
||||||
int cmap_index;
|
int cmap_index;
|
||||||
#else
|
#else
|
||||||
@@ -114,26 +113,28 @@ typedef struct tagFTINSTANCEINFO {
|
|||||||
#define _TTF_HASH_NDIR 37
|
#define _TTF_HASH_NDIR 37
|
||||||
|
|
||||||
typedef struct tagTTFCACHEINFO {
|
typedef struct tagTTFCACHEINFO {
|
||||||
unsigned short unicode;
|
UChar32 unicode;
|
||||||
short glyph_code;
|
FT_UInt glyph_code;
|
||||||
FT_Vector advance;
|
FT_Vector advance;
|
||||||
FT_BBox bbox;
|
FT_BBox bbox;
|
||||||
FT_Vector delta;
|
FT_Vector delta;
|
||||||
int flag;
|
int flag;
|
||||||
int pitch;
|
int pitch;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
void *bitmap;
|
void *bitmap;
|
||||||
} TTFCACHEINFO, *PTTFCACHEINFO;
|
} TTFCACHEINFO, *PTTFCACHEINFO;
|
||||||
|
|
||||||
extern HCACHE __mg_ttc_create(char *family, char *charset, DWORD style, int size,
|
extern HCACHE __mg_ttc_create(const char *df_name,
|
||||||
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey);
|
int style, int size, int rotation,
|
||||||
|
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey);
|
||||||
|
extern HCACHE __mg_ttc_is_exist(const char *df_name,
|
||||||
|
int style, int size, int rotation);
|
||||||
extern int __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size);
|
extern int __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size);
|
||||||
extern void __mg_ttc_release(HCACHE hCache);
|
extern void __mg_ttc_release(HCACHE hCache);
|
||||||
extern int __mg_ttc_sys_init(int maxCache, int cacheSize);
|
extern int __mg_ttc_sys_init(int maxCache, int cacheSize);
|
||||||
extern void __mg_ttc_sys_deinit(void);
|
extern void __mg_ttc_sys_deinit(void);
|
||||||
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache,
|
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, UChar32 unicode, int *size);
|
||||||
unsigned short unicode, int *size);
|
|
||||||
extern HCACHE __mg_ttc_is_exist(char *family, char *charset,
|
|
||||||
DWORD style, int size);
|
|
||||||
extern void __mg_ttc_refer(HCACHE hCache);
|
extern void __mg_ttc_refer(HCACHE hCache);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
abs_top_srcdir=../../../
|
abs_top_srcdir=../../..
|
||||||
|
LOCAL_INC=-I$(abs_top_srcdir)/src/font/
|
||||||
|
|
||||||
include Makefile.am
|
include Makefile.am
|
||||||
include ../../../rules.make
|
include ../../../rules.make
|
||||||
|
|||||||
+5
-1
@@ -259,10 +259,14 @@ PLOGFONT GUIAPI CreateLogFontIndirect (LOGFONT *logfont)
|
|||||||
|
|
||||||
if (!logfont) return NULL;
|
if (!logfont) return NULL;
|
||||||
|
|
||||||
if ((font = malloc (sizeof (LOGFONT))) == NULL)
|
// VincentWei: make sure the logfont has the key for resource manager.
|
||||||
|
//if ((font = malloc (sizeof (LOGFONT))) == NULL)
|
||||||
|
if ((font = (PLOGFONT)malloc (sizeof (FONT_RES))) == NULL)
|
||||||
return INV_LOGFONT;
|
return INV_LOGFONT;
|
||||||
|
|
||||||
|
// VincentWei: make sure the logfont has an invalid key for resource manager.
|
||||||
memcpy (font, logfont, sizeof(LOGFONT));
|
memcpy (font, logfont, sizeof(LOGFONT));
|
||||||
|
((FONT_RES *)font)->key = -1;
|
||||||
|
|
||||||
sbc_devfont = logfont->sbc_devfont;
|
sbc_devfont = logfont->sbc_devfont;
|
||||||
if (sbc_devfont->font_ops->new_instance)
|
if (sbc_devfont->font_ops->new_instance)
|
||||||
|
|||||||
+3
-3
@@ -329,7 +329,7 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_monobitmap (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, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
unsigned int uc16;
|
unsigned int uc16;
|
||||||
QPF_GLYPH* glyph;
|
QPF_GLYPH* glyph;
|
||||||
@@ -345,7 +345,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
||||||
unsigned char ascii_ch = uc16;
|
unsigned char ascii_ch = uc16;
|
||||||
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
|
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
|
||||||
logfont->sbc_devfont, ascii_ch, pitch, scale);
|
logfont->sbc_devfont, ascii_ch, sz, pitch, scale);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
glyph = &def_glyph;
|
glyph = &def_glyph;
|
||||||
@@ -365,7 +365,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
unsigned int uc16;
|
unsigned int uc16;
|
||||||
QPF_GLYPH* glyph;
|
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,
|
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
int bitmap_size;
|
int bitmap_size;
|
||||||
Glyph32 glyph_tmp = glyph_value;
|
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,
|
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;
|
seunichar16 wc;
|
||||||
SeLogFont selogfont;
|
SeLogFont selogfont;
|
||||||
|
|||||||
+1
-1
@@ -101,7 +101,7 @@ BOOL mg_InitSysFont (void)
|
|||||||
memset (sys_fonts, 0, nr_fonts * sizeof (PLOGFONT));
|
memset (sys_fonts, 0, nr_fonts * sizeof (PLOGFONT));
|
||||||
|
|
||||||
for (i = 0; i < nr_fonts; i++) {
|
for (i = 0; i < nr_fonts; i++) {
|
||||||
char key [11];
|
char key [32];
|
||||||
char type [LEN_FONT_NAME + 1];
|
char type [LEN_FONT_NAME + 1];
|
||||||
char family [LEN_FONT_NAME + 1];
|
char family [LEN_FONT_NAME + 1];
|
||||||
char style [LEN_FONT_NAME + 1];
|
char style [LEN_FONT_NAME + 1];
|
||||||
|
|||||||
+3
-3
@@ -279,7 +279,7 @@ print_bitmap(char* bits, int width, int height, int pitch)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const void* get_glyph_monobitmap (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, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
unsigned int uc16;
|
unsigned int uc16;
|
||||||
UPFGLYPH* glyph;
|
UPFGLYPH* glyph;
|
||||||
@@ -300,7 +300,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
||||||
unsigned char ascii_ch = uc16;
|
unsigned char ascii_ch = uc16;
|
||||||
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
|
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
|
||||||
logfont->sbc_devfont, ascii_ch, pitch, scale);
|
logfont->sbc_devfont, ascii_ch, sz, pitch, scale);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
glyph = &def_glyph;
|
glyph = &def_glyph;
|
||||||
@@ -326,7 +326,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
unsigned int uc16;
|
unsigned int uc16;
|
||||||
UPFGLYPH* glyph;
|
UPFGLYPH* glyph;
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ static int get_ch_width (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
if (vbf_info->bits_offset == NULL)
|
if (vbf_info->bits_offset == NULL)
|
||||||
return vbf_info->max_width * scale;
|
return vbf_info->max_width * scale;
|
||||||
|
|
||||||
|
if (glyph_value < vbf_info->first_glyph || glyph_value > vbf_info->last_glyph)
|
||||||
|
glyph_value = vbf_info->def_glyph;
|
||||||
|
|
||||||
return vbf_info->advance_x [glyph_value - vbf_info->first_glyph] * scale;
|
return vbf_info->advance_x [glyph_value - vbf_info->first_glyph] * scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,10 +237,9 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const void* get_glyph_monobitmap (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, SIZE* sz, int* pitch, unsigned short* scale)
|
||||||
{
|
{
|
||||||
int offset;
|
int offset;
|
||||||
Glyph32 eff_value = glyph_value;
|
|
||||||
Glyph32 first_value;
|
Glyph32 first_value;
|
||||||
Glyph32 last_value;
|
Glyph32 last_value;
|
||||||
VBFINFO* vbf_info = VARFONT_INFO_P (devfont);
|
VBFINFO* vbf_info = VARFONT_INFO_P (devfont);
|
||||||
@@ -246,13 +248,13 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
|||||||
last_value = vbf_info->last_glyph;
|
last_value = vbf_info->last_glyph;
|
||||||
|
|
||||||
if (glyph_value < first_value || glyph_value > last_value)
|
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)
|
if (vbf_info->bits_offset == NULL)
|
||||||
offset = (((size_t)vbf_info->max_width + 7) >> 3) * vbf_info->height
|
offset = (((size_t)vbf_info->max_width + 7) >> 3) * vbf_info->height
|
||||||
* (eff_value - first_value);
|
* (glyph_value - first_value);
|
||||||
else {
|
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 MGUI_BYTEORDER == MGUI_BIG_ENDIAN
|
||||||
if (vbf_info->font_size)
|
if (vbf_info->font_size)
|
||||||
offset = ArchSwap16 (offset);
|
offset = ArchSwap16 (offset);
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ BOOL GUIAPI SetWindowElementRenderer (HWND hWnd, const char* werdr_name,
|
|||||||
pwnd = MG_GET_WINDOW_PTR(hWnd);
|
pwnd = MG_GET_WINDOW_PTR(hWnd);
|
||||||
|
|
||||||
if (NULL == pwnd ||
|
if (NULL == pwnd ||
|
||||||
((NULL == werdr_name || '\0' == werdr_name) && NULL == we_attrs))
|
((NULL == werdr_name || '\0' == *werdr_name) && NULL == we_attrs))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1078,7 +1078,7 @@ int GUIAPI SetMenuItemInfo (HMENU hmnu, LINT item,
|
|||||||
case MFT_MARKCHECK:
|
case MFT_MARKCHECK:
|
||||||
case MFT_BMPSTRING:
|
case MFT_BMPSTRING:
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
if (pmii->typedata == 0) {
|
if (pmii->typedata == 0) {
|
||||||
pmi->typedata = 0;
|
pmi->typedata = 0;
|
||||||
return ERR_INVALID_ARGS;
|
return ERR_INVALID_ARGS;
|
||||||
|
|||||||
+1
-16
@@ -50,24 +50,9 @@
|
|||||||
|
|
||||||
#include "comminput.h"
|
#include "comminput.h"
|
||||||
|
|
||||||
#define COMM_MOUSEINPUT 0x01
|
#include "exstubs.h"
|
||||||
#define COMM_KBINPUT 0x02
|
|
||||||
|
|
||||||
#define COMM_MOUSELBUTTON 0x01
|
|
||||||
#define COMM_MOUSERBUTTON 0x04
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
// OS input driver or application must implement these input functions
|
|
||||||
// hardware must be initialized before this engine can be used.
|
|
||||||
|
|
||||||
extern int __comminput_init (void);
|
|
||||||
extern int __comminput_ts_getdata (short *x, short *y, short *button);
|
|
||||||
extern int __comminput_kb_getdata (short *key, short *status);
|
|
||||||
extern int __comminput_wait_for_input (struct timeval *timeout);
|
|
||||||
extern void __comminput_deinit (void);
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0;
|
static short MOUSEX = 0, MOUSEY = 0, MOUSEBUTTON = 0;
|
||||||
static short KEYCODE = 0, KEYSTATUS = 0;
|
static short KEYCODE = 0, KEYSTATUS = 0;
|
||||||
|
|
||||||
|
|||||||
+19
-17
@@ -53,9 +53,9 @@ static int mouse_x, mouse_y, mouse_button;
|
|||||||
|
|
||||||
typedef struct tagPOS
|
typedef struct tagPOS
|
||||||
{
|
{
|
||||||
short x;
|
short x;
|
||||||
short y;
|
short y;
|
||||||
short b;
|
short b;
|
||||||
} POS;
|
} POS;
|
||||||
|
|
||||||
/************************ Low Level Input Operations **********************/
|
/************************ Low Level Input Operations **********************/
|
||||||
@@ -64,28 +64,28 @@ typedef struct tagPOS
|
|||||||
*/
|
*/
|
||||||
static int mouse_update(void)
|
static int mouse_update(void)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_getxy (int* x, int* y)
|
static void mouse_getxy (int* x, int* y)
|
||||||
{
|
{
|
||||||
*x = mouse_x;
|
*x = mouse_x;
|
||||||
*y = mouse_y;
|
*y = mouse_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mouse_getbutton(void)
|
static int mouse_getbutton(void)
|
||||||
{
|
{
|
||||||
return mouse_button;
|
return mouse_button;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int keyboard_update(void)
|
static int keyboard_update(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * keyboard_get_state (void)
|
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,
|
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
|
#ifdef _MGRM_THREADS
|
||||||
__mg_os_time_delay (300);
|
__mg_os_time_delay (300);
|
||||||
|
timeout->tv_sec = 0;
|
||||||
|
timeout->tv_usec = 0;
|
||||||
#else
|
#else
|
||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
if (!in) {
|
if (!in) {
|
||||||
in = &rfds;
|
in = &rfds;
|
||||||
mg_fd_zero (in);
|
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) {
|
if (e < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL InitDummyInput (INPUT* input, const char* mdev, const char* mtype)
|
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->set_leds = NULL;
|
||||||
|
|
||||||
input->wait_event = wait_event;
|
input->wait_event = wait_event;
|
||||||
mouse_x = 0;
|
mouse_x = 0;
|
||||||
mouse_y = 0;
|
mouse_y = 0;
|
||||||
mouse_button= 0;
|
mouse_button= 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/sysmacros.h> // for makedev
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|||||||
+80
-78
File diff suppressed because it is too large
Load Diff
+2
-34
@@ -35,10 +35,11 @@
|
|||||||
#ifndef GUI_IAL_NET_H
|
#ifndef GUI_IAL_NET_H
|
||||||
#define GUI_IAL_NET_H
|
#define GUI_IAL_NET_H
|
||||||
|
|
||||||
|
#include "ial.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
#include "customial.h"
|
|
||||||
|
|
||||||
#define IAL_MOUSE_LEFTBUTTON 1
|
#define IAL_MOUSE_LEFTBUTTON 1
|
||||||
#define IAL_MOUSE_RIGHTBUTTON 2
|
#define IAL_MOUSE_RIGHTBUTTON 2
|
||||||
@@ -50,42 +51,9 @@ extern "C" {
|
|||||||
|
|
||||||
#define IAL_MOUSEEVENT 1
|
#define IAL_MOUSEEVENT 1
|
||||||
#define IAL_KEYEVENT 2
|
#define IAL_KEYEVENT 2
|
||||||
/*
|
|
||||||
typedef struct tagINPUT
|
|
||||||
{
|
|
||||||
char* id;
|
|
||||||
|
|
||||||
// Initialization and termination
|
|
||||||
BOOL (*init_input) (struct tagINPUT *input, const char* mdev, const char* mtype);
|
|
||||||
void (*term_input) (void);
|
|
||||||
|
|
||||||
// Mouse operations
|
|
||||||
int (*update_mouse) (void);
|
|
||||||
void (*get_mouse_xy) (int* x, int* y);
|
|
||||||
void (*set_mouse_xy) (int x, int y);
|
|
||||||
int (*get_mouse_button) (void);
|
|
||||||
void (*set_mouse_range) (int minx, int miny, int maxx, int maxy);
|
|
||||||
void (*suspend_mouse) (void);
|
|
||||||
int (*resume_mouse) (void);
|
|
||||||
|
|
||||||
// Keyboard operations
|
|
||||||
int (*update_keyboard) (void);
|
|
||||||
const char* (*get_keyboard_state) (void);
|
|
||||||
void (*suspend_keyboard) (void);
|
|
||||||
int (*resume_keyboard) (void);
|
|
||||||
void (*set_leds) (unsigned int leds);
|
|
||||||
|
|
||||||
// Event
|
|
||||||
int (*wait_event) (int which, int maxfd, fd_set *in, fd_set *out,
|
|
||||||
fd_set *except, struct timeval *timeout);
|
|
||||||
|
|
||||||
char mdev [MAX_PATH + 1];
|
|
||||||
}INPUT;
|
|
||||||
*/
|
|
||||||
#ifdef _MGIAL_NET
|
|
||||||
extern BOOL InitNetInput (INPUT* input, const char* mdev, const char* mtype);
|
extern BOOL InitNetInput (INPUT* input, const char* mdev, const char* mtype);
|
||||||
extern void TermNetInput (void);
|
extern void TermNetInput (void);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,11 +225,11 @@ struct _FONTOPS
|
|||||||
|
|
||||||
/** The method to get mono-bitmap function. */
|
/** The method to get mono-bitmap function. */
|
||||||
const void* (*get_glyph_monobitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
const void* (*get_glyph_monobitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
const Glyph32 glyph_value, 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 */
|
/** The method to get grey bitmap, pitch and scale function */
|
||||||
const void* (*get_glyph_greybitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
const void* (*get_glyph_greybitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
const Glyph32 galph_value, 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. */
|
/** The method to get the pre-rendered bitmap of one glyph. */
|
||||||
int (*get_glyph_prbitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
int (*get_glyph_prbitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||||
|
|||||||
+24
-22
@@ -72,6 +72,7 @@ extern "C" {
|
|||||||
#define _ROT_DIR_HFLIP 0x08
|
#define _ROT_DIR_HFLIP 0x08
|
||||||
#define _ROT_DIR_VFLIP 0x10
|
#define _ROT_DIR_VFLIP 0x10
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void (*__mg_ial_change_mouse_xy_hook) (int* x, int* y);
|
extern void (*__mg_ial_change_mouse_xy_hook) (int* x, int* y);
|
||||||
extern DWORD __mg_shadow_rotate_flags;
|
extern DWORD __mg_shadow_rotate_flags;
|
||||||
|
|
||||||
@@ -89,36 +90,36 @@ extern INPUT* __mg_cur_input;
|
|||||||
#define IAL_UpdateMouse (*__mg_cur_input->update_mouse)
|
#define IAL_UpdateMouse (*__mg_cur_input->update_mouse)
|
||||||
|
|
||||||
//#define IAL_GetMouseXY (*__mg_cur_input->get_mouse_xy)
|
//#define IAL_GetMouseXY (*__mg_cur_input->get_mouse_xy)
|
||||||
static inline void IAL_GetMouseXY(int *x, int* y) {
|
static inline void IAL_GetMouseXY(int *x, int* y)
|
||||||
|
{
|
||||||
if (__mg_cur_input && __mg_cur_input->get_mouse_xy) {
|
if (__mg_cur_input && __mg_cur_input->get_mouse_xy) {
|
||||||
(*__mg_cur_input->get_mouse_xy) (x, y);
|
(*__mg_cur_input->get_mouse_xy) (x, y);
|
||||||
#ifdef _MGHAVE_MOUSECALIBRATE
|
#ifdef _MGHAVE_MOUSECALIBRATE
|
||||||
__mg_mouse_org_pos.x = *x;
|
__mg_mouse_org_pos.x = *x;
|
||||||
__mg_mouse_org_pos.y = *y;
|
__mg_mouse_org_pos.y = *y;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MGHAVE_MOUSECALIBRATE
|
#ifdef _MGHAVE_MOUSECALIBRATE
|
||||||
if (__mg_do_mouse_calibrate) __mg_do_mouse_calibrate (x, y);
|
if (__mg_do_mouse_calibrate) __mg_do_mouse_calibrate (x, y);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (*x < 0) *x = 0;
|
if (*x < 0) *x = 0;
|
||||||
if (*y < 0) *y = 0;
|
if (*y < 0) *y = 0;
|
||||||
|
|
||||||
if (__mg_ial_change_mouse_xy_hook)
|
if (__mg_ial_change_mouse_xy_hook)
|
||||||
__mg_ial_change_mouse_xy_hook (x, y);
|
__mg_ial_change_mouse_xy_hook (x, y);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (*x > (__gal_screen->w-1)) *x = (__gal_screen->w-1);
|
if (*x > (__gal_screen->w-1)) *x = (__gal_screen->w-1);
|
||||||
if (*y > (__gal_screen->h-1)) *y = (__gal_screen->h-1);
|
if (*y > (__gal_screen->h-1)) *y = (__gal_screen->h-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IAL_GetMouseButton (*__mg_cur_input->get_mouse_button)
|
#define IAL_GetMouseButton (*__mg_cur_input->get_mouse_button)
|
||||||
|
|
||||||
//#define IAL_SetMouseXY if (__mg_cur_input->set_mouse_xy) (*__mg_cur_input->set_mouse_xy)
|
static inline void IAL_SetMouseXY (int x, int y)
|
||||||
static inline void IAL_SetMouseXY (int x, int y) {
|
{
|
||||||
if (__mg_cur_input->set_mouse_xy) {
|
if (__mg_cur_input->set_mouse_xy) {
|
||||||
#ifdef _MGGAL_SHADOW
|
#ifdef _MGGAL_SHADOW
|
||||||
if (__mg_shadow_rotate_flags & _ROT_DIR_CW){
|
if (__mg_shadow_rotate_flags & _ROT_DIR_CW){
|
||||||
@@ -140,14 +141,15 @@ static inline void IAL_SetMouseXY (int x, int y) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#define IAL_SetMouseRange if (__mg_cur_input->set_mouse_range) (*__mg_cur_input->set_mouse_range)
|
static inline void IAL_SetMouseRange (int minx, int miny, int maxx, int maxy)
|
||||||
static inline void IAL_SetMouseRange (int minx, int miny, int maxx, int maxy) {
|
{
|
||||||
|
|
||||||
#ifdef _MGGAL_SHADOW
|
#ifdef _MGGAL_SHADOW
|
||||||
if (__mg_shadow_rotate_flags)
|
if (__mg_shadow_rotate_flags)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
if (__mg_cur_input->set_mouse_range) (*__mg_cur_input->set_mouse_range)(minx, miny, maxx, maxy);
|
if (__mg_cur_input->set_mouse_range)
|
||||||
|
__mg_cur_input->set_mouse_range(minx, miny, maxx, maxy);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-12
@@ -248,25 +248,21 @@ failure:
|
|||||||
static void sig_handler (int v)
|
static void sig_handler (int v)
|
||||||
{
|
{
|
||||||
if (v == SIGSEGV) {
|
if (v == SIGSEGV) {
|
||||||
#ifdef WIN32
|
|
||||||
raise(SIGABRT);
|
|
||||||
#else
|
|
||||||
kill (getpid(), SIGABRT); /* cause core dump */
|
kill (getpid(), SIGABRT); /* cause core dump */
|
||||||
#endif
|
}
|
||||||
}else if (__mg_quiting_stage > 0) {
|
else if (v == SIGINT) {
|
||||||
|
_exit(1); /* force to quit */
|
||||||
|
}
|
||||||
|
else if (__mg_quiting_stage > 0) {
|
||||||
ExitGUISafely(-1);
|
ExitGUISafely(-1);
|
||||||
}else{
|
}
|
||||||
|
else {
|
||||||
exit(1); /* force to quit */
|
exit(1); /* force to quit */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL InstallSEGVHandler (void)
|
static BOOL InstallSEGVHandler (void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
|
||||||
signal(SIGSEGV, sig_handler);
|
|
||||||
signal(SIGTERM, sig_handler);
|
|
||||||
signal(SIGINT, sig_handler);
|
|
||||||
#else
|
|
||||||
struct sigaction siga;
|
struct sigaction siga;
|
||||||
|
|
||||||
siga.sa_handler = sig_handler;
|
siga.sa_handler = sig_handler;
|
||||||
@@ -277,7 +273,6 @@ static BOOL InstallSEGVHandler (void)
|
|||||||
sigaction (SIGTERM, &siga, NULL);
|
sigaction (SIGTERM, &siga, NULL);
|
||||||
sigaction (SIGINT, &siga, NULL);
|
sigaction (SIGINT, &siga, NULL);
|
||||||
sigaction (SIGPIPE, &siga, NULL);
|
sigaction (SIGPIPE, &siga, NULL);
|
||||||
#endif
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -321,9 +321,14 @@ static void sig_handler (int v)
|
|||||||
{
|
{
|
||||||
if (v == SIGSEGV) {
|
if (v == SIGSEGV) {
|
||||||
kill (getpid(), SIGABRT); /* cause core dump */
|
kill (getpid(), SIGABRT); /* cause core dump */
|
||||||
}else if (__mg_quiting_stage > 0) {
|
}
|
||||||
|
else if (v == SIGINT) {
|
||||||
|
_exit(1);
|
||||||
|
}
|
||||||
|
else if (__mg_quiting_stage > 0) {
|
||||||
ExitGUISafely(-1);
|
ExitGUISafely(-1);
|
||||||
}else{
|
}
|
||||||
|
else {
|
||||||
exit(1); /* force to quit */
|
exit(1); /* force to quit */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1231,7 +1231,8 @@ int GUIAPI ThrowAwayMessages (HWND hWnd)
|
|||||||
if (pMsgQueue->TimerMask & (0x01UL << slot)) {
|
if (pMsgQueue->TimerMask & (0x01UL << slot)) {
|
||||||
HWND timer_wnd = __mg_get_timer_hwnd (slot);
|
HWND timer_wnd = __mg_get_timer_hwnd (slot);
|
||||||
if (timer_wnd == hWnd
|
if (timer_wnd == hWnd
|
||||||
|| gui_GetMainWindowPtrOfControl (timer_wnd) == (PMAINWIN)hWnd){
|
|| (MG_IS_MAIN_WINDOW (hWnd) &&
|
||||||
|
gui_GetMainWindowPtrOfControl (timer_wnd) == (PMAINWIN)hWnd)) {
|
||||||
RemoveMsgQueueTimerFlag (pMsgQueue, slot);
|
RemoveMsgQueueTimerFlag (pMsgQueue, slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -83,8 +83,10 @@ static pthread_mutex_t timerLock;
|
|||||||
#endif /* __LINUX__ */
|
#endif /* __LINUX__ */
|
||||||
|
|
||||||
#ifdef _MG_USE_BETTER_TIMER
|
#ifdef _MG_USE_BETTER_TIMER
|
||||||
|
#ifdef _MGRM_THREADS
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
static clock_t g_timer_started;
|
static clock_t g_timer_started;
|
||||||
|
#endif
|
||||||
static clock_t g_last_tick;
|
static clock_t g_last_tick;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -95,7 +97,7 @@ static void __mg_timer_action (void *data)
|
|||||||
SHAREDRES_TIMER_COUNTER += 1;
|
SHAREDRES_TIMER_COUNTER += 1;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined(__uClinux__) && defined(_MGRM_STANDALONE)
|
#if defined(_MGRM_STANDALONE)
|
||||||
__mg_timer_counter += 10;
|
__mg_timer_counter += 10;
|
||||||
#else
|
#else
|
||||||
# ifdef _MG_USE_BETTER_TIMER
|
# ifdef _MG_USE_BETTER_TIMER
|
||||||
@@ -136,7 +138,6 @@ static void* TimerEntry (void* data)
|
|||||||
__mg_os_time_delay (10);
|
__mg_os_time_delay (10);
|
||||||
__mg_timer_action (NULL);
|
__mg_timer_action (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* printf("quit from TimerEntry()\n"); */
|
/* printf("quit from TimerEntry()\n"); */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -157,6 +158,7 @@ int __mg_timer_init (void)
|
|||||||
{
|
{
|
||||||
sem_t wait;
|
sem_t wait;
|
||||||
sem_init (&wait, 0, 0);
|
sem_init (&wait, 0, 0);
|
||||||
|
|
||||||
pthread_create (&__mg_timer, NULL, TimerEntry, &wait);
|
pthread_create (&__mg_timer, NULL, TimerEntry, &wait);
|
||||||
sem_wait (&wait);
|
sem_wait (&wait);
|
||||||
sem_destroy (&wait);
|
sem_destroy (&wait);
|
||||||
|
|||||||
+3
-3
@@ -413,7 +413,7 @@ void __mg_os_time_delay (int ms)
|
|||||||
OSTimeDly (OS_TICKS_PER_SEC * ms / 1000);
|
OSTimeDly (OS_TICKS_PER_SEC * ms / 1000);
|
||||||
#elif defined (__VXWORKS__)
|
#elif defined (__VXWORKS__)
|
||||||
taskDelay (sysClkRateGet() * ms / 1000);
|
taskDelay (sysClkRateGet() * ms / 1000);
|
||||||
#elif defined (__PSOS__) || defined (__ECOS__)
|
#elif defined (__PSOS__) || defined (__ECOS__) || defined (__RTEMS__)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
ts.tv_sec = 0;
|
ts.tv_sec = 0;
|
||||||
ts.tv_nsec = ms * 1000000;
|
ts.tv_nsec = ms * 1000000;
|
||||||
@@ -481,8 +481,8 @@ int snprintf( char *s, size_t size, const char *format, ... )
|
|||||||
|
|
||||||
int __modsi3 (int numer, int denom)
|
int __modsi3 (int numer, int denom)
|
||||||
{
|
{
|
||||||
int quot = numer / denom;
|
int quot = numer / denom;
|
||||||
return numer - (quot * denom);
|
return numer - (quot * denom);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ static int L2F50113T00_getscreeninfo (struct commlcd_info *li, int width, int he
|
|||||||
li->width = SCREEN_WIDTH;
|
li->width = SCREEN_WIDTH;
|
||||||
li->fb = (void*)VRAM_ADDR_1;
|
li->fb = (void*)VRAM_ADDR_1;
|
||||||
li->bpp = LCD_BPP;
|
li->bpp = LCD_BPP;
|
||||||
li->rlen = SCREEN_WIDTH * LCD_BPP_UNIT;
|
li->pitch = SCREEN_WIDTH * LCD_BPP_UNIT;
|
||||||
li->async_update = 0;
|
li->async_update = 0;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
#include "newgal.h"
|
#include "newgal.h"
|
||||||
#include "sysvideo.h"
|
#include "sysvideo.h"
|
||||||
#include "pixels_c.h"
|
#include "pixels_c.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
#ifdef _MGGAL_COMMLCD
|
#ifdef _MGGAL_COMMLCD
|
||||||
|
|
||||||
@@ -78,6 +79,23 @@ static void COMMLCD_DeleteDevice(GAL_VideoDevice *device)
|
|||||||
free (device);
|
free (device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void COMMLCD_UpdateRects_Sync (_THIS, int numrects, GAL_Rect *rects)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* sync update */
|
||||||
|
for (i = 0; i < numrects; i++) {
|
||||||
|
RECT rc;
|
||||||
|
SetRect (&rc, rects[i].x, rects[i].y,
|
||||||
|
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
|
||||||
|
if (!IsRectEmpty (&rc)) {
|
||||||
|
__mg_commlcd_ops.update (&rc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL _valid_async_updater = TRUE;
|
||||||
|
|
||||||
static void* task_do_update (void* data)
|
static void* task_do_update (void* data)
|
||||||
{
|
{
|
||||||
_THIS;
|
_THIS;
|
||||||
@@ -92,35 +110,17 @@ static void* task_do_update (void* data)
|
|||||||
this->hidden->dirty = FALSE;
|
this->hidden->dirty = FALSE;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock (&this->hidden->update_lock);
|
pthread_mutex_unlock (&this->hidden->update_lock);
|
||||||
usleep (50*1000); /* 50 ms */
|
__mg_os_time_delay(50); /* 50 ms */
|
||||||
} while (1);
|
} while (_valid_async_updater);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void COMMLCD_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
|
static void COMMLCD_UpdateRects_Async (_THIS, int numrects, GAL_Rect *rects)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
RECT bound;
|
RECT bound;
|
||||||
|
|
||||||
if (__mg_commlcd_ops.update == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->hidden->update_th == 0) {
|
|
||||||
/* sync update */
|
|
||||||
for (i = 0; i < numrects; i++) {
|
|
||||||
RECT rc;
|
|
||||||
SetRect (&rc, rects[i].x, rects[i].y,
|
|
||||||
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
|
|
||||||
if (!IsRectEmpty (&rc)) {
|
|
||||||
__mg_commlcd_ops.update (&rc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
pthread_mutex_lock (&this->hidden->update_lock);
|
pthread_mutex_lock (&this->hidden->update_lock);
|
||||||
|
|
||||||
bound = this->hidden->rc_dirty;
|
bound = this->hidden->rc_dirty;
|
||||||
@@ -180,7 +180,7 @@ static GAL_VideoDevice *COMMLCD_CreateDevice (int devindex)
|
|||||||
device->SetHWColorKey = NULL;
|
device->SetHWColorKey = NULL;
|
||||||
device->SetHWAlpha = NULL;
|
device->SetHWAlpha = NULL;
|
||||||
device->FreeHWSurface = COMMLCD_FreeHWSurface;
|
device->FreeHWSurface = COMMLCD_FreeHWSurface;
|
||||||
device->UpdateRects = COMMLCD_UpdateRects;
|
device->UpdateRects = NULL;
|
||||||
|
|
||||||
device->free = COMMLCD_DeleteDevice;
|
device->free = COMMLCD_DeleteDevice;
|
||||||
return device;
|
return device;
|
||||||
@@ -193,11 +193,11 @@ VideoBootStrap COMMLCD_bootstrap = {
|
|||||||
|
|
||||||
static int COMMLCD_VideoInit(_THIS, GAL_PixelFormat *vformat)
|
static int COMMLCD_VideoInit(_THIS, GAL_PixelFormat *vformat)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "NEWGAL>COMMLCD: Calling init method!\n");
|
_ERR_PRINTF ("NEWGAL>COMMLCD: Calling init method!\n");
|
||||||
|
|
||||||
/* Initialize LCD screen */
|
/* Initialize LCD screen */
|
||||||
if (__mg_commlcd_ops.init ()) {
|
if (__mg_commlcd_ops.init ()) {
|
||||||
fprintf (stderr, "NEWGAL>COMMLCD: Couldn't initialize LCD\n");
|
_ERR_PRINTF ("NEWGAL>COMMLCD: Couldn't initialize LCD\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,18 +218,22 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
|
|||||||
memset (&li, 0, sizeof (struct commlcd_info));
|
memset (&li, 0, sizeof (struct commlcd_info));
|
||||||
|
|
||||||
if (__mg_commlcd_ops.getinfo (&li, width, height, bpp)) {
|
if (__mg_commlcd_ops.getinfo (&li, width, height, bpp)) {
|
||||||
fprintf (stderr, "NEWGAL>COMMLCD: "
|
_ERR_PRINTF ("NEWGAL>COMMLCD: "
|
||||||
"Couldn't get the LCD information\n");
|
"Couldn't get the LCD information\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (li.bpp != bpp) {
|
||||||
|
_ERR_PRINTF ("NEWGAL>COMMLCD: "
|
||||||
|
"Returned color depth (%d) does not matched the requested color depth (%d)\n",
|
||||||
|
li.bpp, bpp);
|
||||||
|
}
|
||||||
|
|
||||||
this->hidden->w = li.width;
|
this->hidden->w = li.width;
|
||||||
this->hidden->h = li.height;
|
this->hidden->h = li.height;
|
||||||
this->hidden->pitch = li.rlen;
|
this->hidden->pitch = li.pitch;
|
||||||
this->hidden->fb = li.fb;
|
this->hidden->fb = li.fb;
|
||||||
|
|
||||||
memset (li.fb, 0, li.rlen * height);
|
|
||||||
|
|
||||||
switch (li.type) {
|
switch (li.type) {
|
||||||
case COMMLCD_PSEUDO_RGB332:
|
case COMMLCD_PSEUDO_RGB332:
|
||||||
Rmask = 0xE0;
|
Rmask = 0xE0;
|
||||||
@@ -264,6 +268,12 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
|
|||||||
Gmask = 0x0000FF00;
|
Gmask = 0x0000FF00;
|
||||||
Bmask = 0x000000FF;
|
Bmask = 0x000000FF;
|
||||||
break;
|
break;
|
||||||
|
case COMMLCD_TRUE_ABRG8888:
|
||||||
|
Amask = 0xFF000000;
|
||||||
|
Bmask = 0x00FF0000;
|
||||||
|
Rmask = 0x0000FF00;
|
||||||
|
Gmask = 0x000000FF;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate the new pixel format for the screen */
|
/* Allocate the new pixel format for the screen */
|
||||||
@@ -272,7 +282,7 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
|
|||||||
__mg_commlcd_ops.release ();
|
__mg_commlcd_ops.release ();
|
||||||
|
|
||||||
this->hidden->fb = NULL;
|
this->hidden->fb = NULL;
|
||||||
fprintf (stderr, "NEWGAL>COMMLCD: "
|
_ERR_PRINTF ("NEWGAL>COMMLCD: "
|
||||||
"Couldn't allocate new pixel format for requested mode\n");
|
"Couldn't allocate new pixel format for requested mode\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -284,7 +294,14 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
|
|||||||
current->pitch = this->hidden->pitch;
|
current->pitch = this->hidden->pitch;
|
||||||
current->pixels = this->hidden->fb;
|
current->pixels = this->hidden->fb;
|
||||||
|
|
||||||
if (li.async_update && __mg_commlcd_ops.update) {
|
if (li.update_method == COMMLCD_UPDATE_NONE) {
|
||||||
|
this->UpdateRects = NULL;
|
||||||
|
this->hidden->update_th = 0;
|
||||||
|
}
|
||||||
|
else if (li.update_method == COMMLCD_UPDATE_ASYNC) {
|
||||||
|
this->UpdateRects = COMMLCD_UpdateRects_Async;
|
||||||
|
|
||||||
|
#if 0
|
||||||
pthread_attr_t new_attr;
|
pthread_attr_t new_attr;
|
||||||
|
|
||||||
pthread_attr_init (&new_attr);
|
pthread_attr_init (&new_attr);
|
||||||
@@ -292,9 +309,14 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
|
|||||||
pthread_create (&this->hidden->update_th, &new_attr,
|
pthread_create (&this->hidden->update_th, &new_attr,
|
||||||
task_do_update, this);
|
task_do_update, this);
|
||||||
pthread_attr_destroy (&new_attr);
|
pthread_attr_destroy (&new_attr);
|
||||||
|
#else
|
||||||
|
pthread_create (&this->hidden->update_th, NULL,
|
||||||
|
task_do_update, this);
|
||||||
|
#endif
|
||||||
pthread_mutex_init (&this->hidden->update_lock, NULL);
|
pthread_mutex_init (&this->hidden->update_lock, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
this->UpdateRects = COMMLCD_UpdateRects_Sync;
|
||||||
this->hidden->update_th = 0;
|
this->hidden->update_th = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,8 +330,10 @@ static void COMMLCD_VideoQuit (_THIS)
|
|||||||
this->screen->pixels = NULL;
|
this->screen->pixels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (__mg_commlcd_ops.update) {
|
if (this->hidden->update_th) {
|
||||||
/* quit the update task */
|
/* quit the update task */
|
||||||
|
_valid_async_updater = FALSE;
|
||||||
|
pthread_join(this->hidden->update_th, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (__mg_commlcd_ops.release)
|
if (__mg_commlcd_ops.release)
|
||||||
@@ -339,7 +363,7 @@ static int COMMLCD_SetColors (_THIS, int firstcolor, int ncolors,
|
|||||||
GAL_Color *colors)
|
GAL_Color *colors)
|
||||||
{
|
{
|
||||||
if (__mg_commlcd_ops.setclut)
|
if (__mg_commlcd_ops.setclut)
|
||||||
return __mg_commlcd_ops.setclut (firstcolor, ncolors, colors);
|
return __mg_commlcd_ops.setclut (firstcolor, ncolors, colors);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
|
|
||||||
#include "sysvideo.h"
|
#include "sysvideo.h"
|
||||||
|
|
||||||
|
#include "exstubs.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
@@ -56,26 +58,6 @@ struct GAL_PrivateVideoData {
|
|||||||
pthread_mutex_t update_lock;
|
pthread_mutex_t update_lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The pixel format defined by depth */
|
|
||||||
#define COMMLCD_PSEUDO_RGB332 1
|
|
||||||
#define COMMLCD_TRUE_RGB555 2
|
|
||||||
#define COMMLCD_TRUE_RGB565 3
|
|
||||||
#define COMMLCD_TRUE_RGB888 4
|
|
||||||
#define COMMLCD_TRUE_RGB0888 5
|
|
||||||
#define COMMLCD_TRUE_ARGB1555 6
|
|
||||||
#define COMMLCD_TRUE_ARGB8888 7
|
|
||||||
|
|
||||||
struct commlcd_info {
|
|
||||||
short height; // vertical resolution of the screen
|
|
||||||
short width; // horinzontal resolution of the screen
|
|
||||||
short bpp; // Depth (bits-per-pixel)
|
|
||||||
short type; // Pixel type
|
|
||||||
short rlen; // Length of one scan line in bytes
|
|
||||||
void *fb; // Frame buffer
|
|
||||||
|
|
||||||
short async_update; // update asynchronously or synchronously. 0 for synchronously; others for asynchronously.
|
|
||||||
};
|
|
||||||
|
|
||||||
struct commlcd_ops {
|
struct commlcd_ops {
|
||||||
/* return value: zero for OK */
|
/* return value: zero for OK */
|
||||||
int (*init) (void);
|
int (*init) (void);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ static int a_getinfo (struct commlcd_info *li, int width, int height, int bpp)
|
|||||||
li->width = ecos_lcd_info.width;
|
li->width = ecos_lcd_info.width;
|
||||||
li->fb = ecos_lcd_info.fb;
|
li->fb = ecos_lcd_info.fb;
|
||||||
li->bpp = ecos_lcd_info.bpp;
|
li->bpp = ecos_lcd_info.bpp;
|
||||||
li->rlen = ecos_lcd_info.rlen;
|
li->pitch = ecos_lcd_info.pitch;
|
||||||
li->async_update = 0;
|
li->async_update = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ static int a_getinfo (struct commlcd_info *li, int width, int height, int bpp)
|
|||||||
li->height = 240;
|
li->height = 240;
|
||||||
li->width = 320;
|
li->width = 320;
|
||||||
li->bpp = 32;
|
li->bpp = 32;
|
||||||
li->rlen = 320 * 32 / 8;
|
li->pitch = 320 * 32 / 8;
|
||||||
li->fb = 0xe40000;
|
li->fb = 0xe40000;
|
||||||
li->type = COMMLCD_TRUE_RGB0888;
|
li->type = COMMLCD_TRUE_RGB0888;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -33,18 +33,12 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
** extern.c: A subdriver of CommonLCD NEWGAL engine for some targets
|
** extern.c: A subdriver of CommonLCD NEWGAL engine for some targets
|
||||||
** which are defined by the external module.
|
** which are defined by the external module (__TARGET_EXTERNAL__).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#ifdef _MGGAL_COMMLCD
|
#if defined(_MGGAL_COMMLCD) && defined(__TARGET_EXTERNAL__)
|
||||||
|
|
||||||
#if defined (__VXWORKS__) || defined (__TARGET_UNKNOWN__)
|
|
||||||
|
|
||||||
#include "minigui.h"
|
#include "minigui.h"
|
||||||
#include "newgal.h"
|
#include "newgal.h"
|
||||||
@@ -52,12 +46,6 @@
|
|||||||
#include "pixels_c.h"
|
#include "pixels_c.h"
|
||||||
#include "commlcd.h"
|
#include "commlcd.h"
|
||||||
|
|
||||||
extern int __commlcd_drv_init (void);
|
|
||||||
extern int __commlcd_drv_getinfo (struct commlcd_info *li, int width, int height, int bpp);
|
|
||||||
extern int __commlcd_drv_release (void);
|
|
||||||
extern int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
|
|
||||||
extern int __commlcd_drv_update (const RECT* rc_dirty);
|
|
||||||
|
|
||||||
struct commlcd_ops __mg_commlcd_ops = {
|
struct commlcd_ops __mg_commlcd_ops = {
|
||||||
__commlcd_drv_init,
|
__commlcd_drv_init,
|
||||||
__commlcd_drv_getinfo,
|
__commlcd_drv_getinfo,
|
||||||
@@ -66,7 +54,5 @@ struct commlcd_ops __mg_commlcd_ops = {
|
|||||||
__commlcd_drv_update
|
__commlcd_drv_update
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif /* _MGGAL_COMMLCD && __TARGET_EXTERNAL__ */
|
||||||
|
|
||||||
#endif /* _MGGAL_COMMLCD */
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
abs_top_srcdir=../../..
|
abs_top_srcdir=../../..
|
||||||
|
LOCAL_INC=-I$(abs_top_srcdir)/src/newgal/
|
||||||
|
|
||||||
include Makefile.am
|
include Makefile.am
|
||||||
include ../../../rules.make
|
include ../../../rules.make
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ static int a_getinfo (struct commlcd_info *li, int width, int height, int bpp)
|
|||||||
li->width = fbinfo->width;
|
li->width = fbinfo->width;
|
||||||
li->fb = fbinfo->fb_ptr;
|
li->fb = fbinfo->fb_ptr;
|
||||||
li->bpp = fbinfo->depth;
|
li->bpp = fbinfo->depth;
|
||||||
li->rlen = (li->bpp*li->width + 7) / 8;
|
li->pitch = (li->bpp*li->width + 7) / 8;
|
||||||
/*li->rlen = fbinfo->fb_size;*/
|
/*li->pitch = fbinfo->fb_size;*/
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ static int a_getinfo (struct lcd_info *li, int width, int height, int bpp)
|
|||||||
li->width = modeInfo.width;
|
li->width = modeInfo.width;
|
||||||
li->fb = modeInfo.fbAddress;
|
li->fb = modeInfo.fbAddress;
|
||||||
li->bpp = modeInfo.colorDepth;
|
li->bpp = modeInfo.colorDepth;
|
||||||
li->rlen = (li->bpp*li->width + 7) / 8;
|
li->pitch = (li->bpp*li->width + 7) / 8;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ static int a_getinfo (struct lcd_info *li, int width, int height, int bpp)
|
|||||||
//li->bpp = modeInfo.colorDepth;
|
//li->bpp = modeInfo.colorDepth;
|
||||||
li->bpp = 32;
|
li->bpp = 32;
|
||||||
printf ("Current color depth is %d \n", modeInfo.colorDepth);
|
printf ("Current color depth is %d \n", modeInfo.colorDepth);
|
||||||
li->rlen = (li->bpp*1024 + 7) / 8;
|
li->pitch = (li->bpp*1024 + 7) / 8;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
abs_top_srcdir=../../..
|
abs_top_srcdir=../../..
|
||||||
|
LOCAL_INC=-I$(abs_top_srcdir)/src/newgal/
|
||||||
|
|
||||||
include Makefile.am
|
include Makefile.am
|
||||||
include ../../../rules.make
|
include ../../../rules.make
|
||||||
|
|||||||
@@ -709,8 +709,8 @@ static int SMI_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color
|
|||||||
int y = rect->y;
|
int y = rect->y;
|
||||||
|
|
||||||
if (this->screen->pixels != dst->pixels) {
|
if (this->screen->pixels != dst->pixels) {
|
||||||
y += ((UINT)dst->pixels - (UINT)this->screen->pixels)/this->screen->pitch;
|
y += ((uintptr_t)dst->pixels - (uintptr_t)this->screen->pixels)/this->screen->pitch;
|
||||||
x += (((UINT)dst->pixels - (UINT)this->screen->pixels)%this->screen->pitch)/pSmi->Bpp;
|
x += (((uintptr_t)dst->pixels - (uintptr_t)this->screen->pixels)%this->screen->pitch)/pSmi->Bpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
SMI_SetupForSolidFill (color, GXcopy, ~0);
|
SMI_SetupForSolidFill (color, GXcopy, ~0);
|
||||||
@@ -767,15 +767,15 @@ static int SMI_HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
|||||||
int dsty = dstrect->y;
|
int dsty = dstrect->y;
|
||||||
|
|
||||||
if (pSmi->this->screen->pixels != src->pixels) {
|
if (pSmi->this->screen->pixels != src->pixels) {
|
||||||
srcy += ((UINT)src->pixels - (UINT)pSmi->this->screen->pixels)
|
srcy += ((uintptr_t)src->pixels - (uintptr_t)pSmi->this->screen->pixels)
|
||||||
/pSmi->this->screen->pitch;
|
/pSmi->this->screen->pitch;
|
||||||
srcx += (((UINT)src->pixels - (UINT)pSmi->this->screen->pixels)
|
srcx += (((uintptr_t)src->pixels - (uintptr_t)pSmi->this->screen->pixels)
|
||||||
%pSmi->this->screen->pitch)/pSmi->Bpp;
|
%pSmi->this->screen->pitch)/pSmi->Bpp;
|
||||||
}
|
}
|
||||||
if (pSmi->this->screen->pixels != dst->pixels) {
|
if (pSmi->this->screen->pixels != dst->pixels) {
|
||||||
dsty += ((UINT)dst->pixels - (UINT)pSmi->this->screen->pixels)
|
dsty += ((uintptr_t)dst->pixels - (uintptr_t)pSmi->this->screen->pixels)
|
||||||
/pSmi->this->screen->pitch;
|
/pSmi->this->screen->pitch;
|
||||||
dstx += (((UINT)dst->pixels - (UINT)pSmi->this->screen->pixels)
|
dstx += (((uintptr_t)dst->pixels - (uintptr_t)pSmi->this->screen->pixels)
|
||||||
%pSmi->this->screen->pitch)/pSmi->Bpp;
|
%pSmi->this->screen->pitch)/pSmi->Bpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -219,7 +219,6 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
|
|||||||
format->Amask = Amask;
|
format->Amask = Amask;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate some standard bitmasks, if necessary
|
/* Calculate some standard bitmasks, if necessary
|
||||||
* Note: This could conflict with an alpha mask, if given.
|
* Note: This could conflict with an alpha mask, if given.
|
||||||
*/
|
*/
|
||||||
@@ -240,6 +239,7 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
|
|||||||
}
|
}
|
||||||
return(format);
|
return(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
GAL_PixelFormat *GAL_ReallocFormat(GAL_Surface *surface, int bpp,
|
GAL_PixelFormat *GAL_ReallocFormat(GAL_Surface *surface, int bpp,
|
||||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
|
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
|
||||||
{
|
{
|
||||||
@@ -247,6 +247,7 @@ GAL_PixelFormat *GAL_ReallocFormat(GAL_Surface *surface, int bpp,
|
|||||||
GAL_FreeFormat(surface->format);
|
GAL_FreeFormat(surface->format);
|
||||||
GAL_FormatChanged(surface);
|
GAL_FormatChanged(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
surface->format = GAL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
|
surface->format = GAL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
|
||||||
return surface->format;
|
return surface->format;
|
||||||
}
|
}
|
||||||
|
|||||||
+61
-57
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -75,22 +75,22 @@ static int make_alpha_pixel_format (PDC pdc)
|
|||||||
if (pdc->alpha_pixel_format == NULL) {
|
if (pdc->alpha_pixel_format == NULL) {
|
||||||
switch (pdc->surface->format->BytesPerPixel) {
|
switch (pdc->surface->format->BytesPerPixel) {
|
||||||
case 2:
|
case 2:
|
||||||
Rmask = 0x0000F000;
|
Amask = 0x0000F000;
|
||||||
Gmask = 0x00000F00;
|
Rmask = 0x00000F00;
|
||||||
Bmask = 0x000000F0;
|
Gmask = 0x000000F0;
|
||||||
Amask = 0x0000000F;
|
Bmask = 0x0000000F;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
Rmask = 0x00FC0000;
|
Amask = 0x00FC0000;
|
||||||
Gmask = 0x0003F000;
|
Rmask = 0x0003F000;
|
||||||
Bmask = 0x00000FC0;
|
Gmask = 0x00000FC0;
|
||||||
Amask = 0x0000003F;
|
Bmask = 0x0000003F;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
Rmask = 0xFF000000;
|
Amask = 0xFF000000;
|
||||||
Gmask = 0x00FF0000;
|
Rmask = 0x00FF0000;
|
||||||
Bmask = 0x0000FF00;
|
Gmask = 0x0000FF00;
|
||||||
Amask = 0x000000FF;
|
Bmask = 0x000000FF;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
+34
-29
@@ -203,25 +203,12 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
|||||||
{
|
{
|
||||||
int advance = 0;
|
int advance = 0;
|
||||||
int pitch = 0;
|
int pitch = 0;
|
||||||
|
SIZE sz;
|
||||||
|
|
||||||
/* get the relative device font*/
|
/* get the relative device font*/
|
||||||
DEVFONT* devfont = SELECT_DEVFONT(logfont, glyph_value);
|
DEVFONT* devfont = SELECT_DEVFONT(logfont, glyph_value);
|
||||||
glyph_value = REAL_GLYPH (glyph_value);
|
glyph_value = REAL_GLYPH (glyph_value);
|
||||||
|
|
||||||
/*get glyph type*/
|
|
||||||
if (glyph_info->mask & GLYPH_INFO_TYPE)
|
|
||||||
glyph_info->glyph_type = devfont->charset_ops->glyph_type (glyph_value);
|
|
||||||
|
|
||||||
/*get glyph type*/
|
|
||||||
if (glyph_info->mask & GLYPH_INFO_BIDI_TYPE) {
|
|
||||||
if (devfont->charset_ops->bidi_glyph_type) {
|
|
||||||
glyph_info->bidi_glyph_type = devfont->charset_ops->bidi_glyph_type (glyph_value);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
glyph_info->bidi_glyph_type = BIDI_TYPE_INVALID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
glyph_info->advance_x = 0;
|
glyph_info->advance_x = 0;
|
||||||
glyph_info->advance_y = 0;
|
glyph_info->advance_y = 0;
|
||||||
glyph_info->bbox_x = 0;
|
glyph_info->bbox_x = 0;
|
||||||
@@ -240,6 +227,9 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
|||||||
glyph_info->advance_x++;
|
glyph_info->advance_x++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sz.cx = glyph_info->bbox_w;
|
||||||
|
sz.cy = glyph_info->bbox_h;
|
||||||
|
|
||||||
/*get height and descent of devfont*/
|
/*get height and descent of devfont*/
|
||||||
if (glyph_info->mask & GLYPH_INFO_METRICS)
|
if (glyph_info->mask & GLYPH_INFO_METRICS)
|
||||||
{
|
{
|
||||||
@@ -256,7 +246,9 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
|||||||
switch (glyph_info->bmp_type) {
|
switch (glyph_info->bmp_type) {
|
||||||
case GLYPHBMP_TYPE_MONO:
|
case GLYPHBMP_TYPE_MONO:
|
||||||
glyph_info->bits = devfont->font_ops->get_glyph_monobitmap (
|
glyph_info->bits = devfont->font_ops->get_glyph_monobitmap (
|
||||||
logfont, devfont, glyph_value, &pitch, NULL);
|
logfont, devfont, glyph_value, &sz, &pitch, NULL);
|
||||||
|
glyph_info->bbox_w = sz.cx;
|
||||||
|
glyph_info->bbox_h = sz.cy;
|
||||||
glyph_info->bmp_pitch = pitch;
|
glyph_info->bmp_pitch = pitch;
|
||||||
glyph_info->bmp_size = pitch * glyph_info->bbox_h;
|
glyph_info->bmp_size = pitch * glyph_info->bbox_h;
|
||||||
break;
|
break;
|
||||||
@@ -264,7 +256,9 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
|||||||
case GLYPHBMP_TYPE_GREY:
|
case GLYPHBMP_TYPE_GREY:
|
||||||
glyph_info->bits = devfont->font_ops->get_glyph_greybitmap (
|
glyph_info->bits = devfont->font_ops->get_glyph_greybitmap (
|
||||||
logfont, devfont, glyph_value,
|
logfont, devfont, glyph_value,
|
||||||
&glyph_info->bmp_pitch, NULL);
|
&sz, &glyph_info->bmp_pitch, NULL);
|
||||||
|
glyph_info->bbox_w = sz.cx;
|
||||||
|
glyph_info->bbox_h = sz.cy;
|
||||||
glyph_info->bmp_size =
|
glyph_info->bmp_size =
|
||||||
glyph_info->bmp_pitch * glyph_info->bbox_h;
|
glyph_info->bmp_pitch * glyph_info->bbox_h;
|
||||||
break;
|
break;
|
||||||
@@ -272,7 +266,9 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
|||||||
case GLYPHBMP_TYPE_SUBPIXEL:
|
case GLYPHBMP_TYPE_SUBPIXEL:
|
||||||
glyph_info->bits = devfont->font_ops->get_glyph_greybitmap (
|
glyph_info->bits = devfont->font_ops->get_glyph_greybitmap (
|
||||||
logfont, devfont, glyph_value,
|
logfont, devfont, glyph_value,
|
||||||
&glyph_info->bmp_pitch, NULL);
|
&sz, &glyph_info->bmp_pitch, NULL);
|
||||||
|
glyph_info->bbox_w = sz.cx;
|
||||||
|
glyph_info->bbox_h = sz.cy;
|
||||||
glyph_info->bmp_size =
|
glyph_info->bmp_size =
|
||||||
glyph_info->bmp_pitch * glyph_info->bbox_h;
|
glyph_info->bmp_pitch * glyph_info->bbox_h;
|
||||||
break;
|
break;
|
||||||
@@ -287,7 +283,7 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
|||||||
return advance;
|
return advance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUIAPI inline GetGlyphBitmap (LOGFONT* logfont, const char* mchar,
|
void GUIAPI GetGlyphBitmap (LOGFONT* logfont, const char* mchar,
|
||||||
int mchar_len, GLYPHBITMAP* glyph_bitmap)
|
int mchar_len, GLYPHBITMAP* glyph_bitmap)
|
||||||
{
|
{
|
||||||
GLYPHINFO glyph_info;
|
GLYPHINFO glyph_info;
|
||||||
@@ -1838,14 +1834,14 @@ static BOOL get_subpixel_bmp (PDC pdc, Glyph32 glyph_value, SIZE* bbx_size,
|
|||||||
*devfont->font_ops->get_glyph_greybitmap) {
|
*devfont->font_ops->get_glyph_greybitmap) {
|
||||||
/* the returned bits will be the subpixled pixmap */
|
/* the returned bits will be the subpixled pixmap */
|
||||||
data = (*devfont->font_ops->get_glyph_greybitmap) (logfont, devfont,
|
data = (*devfont->font_ops->get_glyph_greybitmap) (logfont, devfont,
|
||||||
REAL_GLYPH(glyph_value), &data_pitch, &scale);
|
REAL_GLYPH(glyph_value), bbx_size, &data_pitch, &scale);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (data == NULL)
|
if (data == NULL) {
|
||||||
{
|
|
||||||
data = (*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
data = (*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
||||||
REAL_GLYPH(glyph_value), &data_pitch, &scale);
|
REAL_GLYPH(glyph_value), bbx_size, &data_pitch, &scale);
|
||||||
|
bbx_size->cx += bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
@@ -1891,7 +1887,7 @@ static BOOL get_book_bmp (PDC pdc, Glyph32 glyph_value, SIZE* bbx_size,
|
|||||||
/*get preybitmap and expand*/
|
/*get preybitmap and expand*/
|
||||||
if (devfont->font_ops->get_glyph_greybitmap) {
|
if (devfont->font_ops->get_glyph_greybitmap) {
|
||||||
data = (*devfont->font_ops->get_glyph_greybitmap) (logfont, devfont,
|
data = (*devfont->font_ops->get_glyph_greybitmap) (logfont, devfont,
|
||||||
REAL_GLYPH(glyph_value), &data_pitch, &scale);
|
REAL_GLYPH(glyph_value), bbx_size, &data_pitch, &scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
@@ -1928,7 +1924,8 @@ static BOOL get_book_bmp (PDC pdc, Glyph32 glyph_value, SIZE* bbx_size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = (*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
data = (*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
||||||
REAL_GLYPH(glyph_value), &data_pitch, &scale);
|
REAL_GLYPH(glyph_value), bbx_size, &data_pitch, &scale);
|
||||||
|
bbx_size->cx += bold;
|
||||||
|
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1991,7 +1988,8 @@ static BOOL get_light_bmp (PDC pdc, Glyph32 glyph_value, SIZE* bbx_size,
|
|||||||
data = NULL;
|
data = NULL;
|
||||||
|
|
||||||
data = (*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
data = (*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
||||||
REAL_GLYPH(glyph_value), &pitch, &scale);
|
REAL_GLYPH(glyph_value), bbx_size, &pitch, &scale);
|
||||||
|
bbx_size->cx += bold;
|
||||||
|
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -2079,7 +2077,8 @@ static BOOL get_regular_bmp (PDC pdc, Glyph32 glyph_value, SIZE* bbx_size,
|
|||||||
data = NULL;
|
data = NULL;
|
||||||
|
|
||||||
data = (*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
data = (*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
||||||
REAL_GLYPH(glyph_value), &pitch, &scale);
|
REAL_GLYPH(glyph_value), bbx_size, &pitch, &scale);
|
||||||
|
bbx_size->cx += bold;
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -2919,6 +2918,9 @@ static void _dc_ft2subpixel_scan_line(PDC pdc, int xpos, int ypos,
|
|||||||
goto nodraw_ret;
|
goto nodraw_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xpos += get_italic_offx (pdc, ctxt->glyph_italic,
|
||||||
|
ctxt->glyph_ascent, ctxt->glyph_line, ctxt->glyph_advance);
|
||||||
|
|
||||||
GAL_GetRGB (pdc->textcolor, pdc->surface->format, &rgba_fg.r,
|
GAL_GetRGB (pdc->textcolor, pdc->surface->format, &rgba_fg.r,
|
||||||
&rgba_fg.g, &rgba_fg.b);
|
&rgba_fg.g, &rgba_fg.b);
|
||||||
|
|
||||||
@@ -3726,7 +3728,8 @@ static BOOL _gdi_get_glyph_data (PDC pdc, Glyph32 glyph_value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = (BYTE*)(*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
data = (BYTE*)(*devfont->font_ops->get_glyph_monobitmap) (logfont, devfont,
|
||||||
REAL_GLYPH(glyph_value), &pitch, &scale);
|
REAL_GLYPH(glyph_value), bbox, &pitch, &scale);
|
||||||
|
bbox->cx += bold;
|
||||||
|
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
break;
|
break;
|
||||||
@@ -3760,7 +3763,7 @@ static BOOL _gdi_get_glyph_data (PDC pdc, Glyph32 glyph_value,
|
|||||||
/* get preybitmap */
|
/* get preybitmap */
|
||||||
if (devfont->font_ops->get_glyph_greybitmap) {
|
if (devfont->font_ops->get_glyph_greybitmap) {
|
||||||
data = (BYTE*)(*devfont->font_ops->get_glyph_greybitmap) (logfont, devfont,
|
data = (BYTE*)(*devfont->font_ops->get_glyph_greybitmap) (logfont, devfont,
|
||||||
REAL_GLYPH (glyph_value), &pitch, &scale);
|
REAL_GLYPH (glyph_value), bbox, &pitch, &scale);
|
||||||
ctxt->cb = _dc_bookgrey_scan_line;
|
ctxt->cb = _dc_bookgrey_scan_line;
|
||||||
if (data && scale > 1) {
|
if (data && scale > 1) {
|
||||||
bbox->cx = bbox->cx / scale;
|
bbox->cx = bbox->cx / scale;
|
||||||
@@ -3782,7 +3785,9 @@ static BOOL _gdi_get_glyph_data (PDC pdc, Glyph32 glyph_value,
|
|||||||
*devfont->font_ops->get_glyph_greybitmap) {
|
*devfont->font_ops->get_glyph_greybitmap) {
|
||||||
/* the returned bits will be the subpixled pixmap */
|
/* the returned bits will be the subpixled pixmap */
|
||||||
data = (BYTE*)(*devfont->font_ops->get_glyph_greybitmap) (logfont, devfont,
|
data = (BYTE*)(*devfont->font_ops->get_glyph_greybitmap) (logfont, devfont,
|
||||||
REAL_GLYPH(glyph_value), &pitch, &scale);
|
REAL_GLYPH(glyph_value), bbox, &pitch, &scale);
|
||||||
|
// the width of SUBPIXEL bitmap is 3x real width of bbox
|
||||||
|
bbox->cx /= 3;
|
||||||
ctxt->cb = _dc_ft2subpixel_scan_line;
|
ctxt->cb = _dc_ft2subpixel_scan_line;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+17
-3
@@ -56,15 +56,29 @@ static char* _system_keys[]={
|
|||||||
"mdev",
|
"mdev",
|
||||||
"mtype"
|
"mtype"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __TARGET_EXTERNAL__
|
||||||
static char* _system_values[]={
|
static char* _system_values[]={
|
||||||
// GAL engine and default options
|
// GAL engine and default options
|
||||||
"pc_xvfb",
|
"commlcd",
|
||||||
"800x600-16bpp",
|
"480x960-32bpp",
|
||||||
// IAL engine
|
// IAL engine
|
||||||
"pc_xvfb",
|
"comm",
|
||||||
"/dev/input/mice",
|
"/dev/input/mice",
|
||||||
"IMPS2"
|
"IMPS2"
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
static char* _system_values[]={
|
||||||
|
// GAL engine and default options
|
||||||
|
"dummy",
|
||||||
|
"480x960-32bpp",
|
||||||
|
// IAL engine
|
||||||
|
"dummy",
|
||||||
|
"/dev/input/mice",
|
||||||
|
"IMPS2"
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
// Section: fbcon
|
// Section: fbcon
|
||||||
static char* _fbcon_keys[]={
|
static char* _fbcon_keys[]={
|
||||||
"defaultmode"
|
"defaultmode"
|
||||||
|
|||||||
+28
-21
@@ -44,7 +44,9 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#if !defined(__NOUNIX__) && !defined(WIN32)
|
#include "common.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -54,8 +56,6 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "minigui.h"
|
#include "minigui.h"
|
||||||
#include "gdi.h"
|
#include "gdi.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
@@ -364,8 +364,10 @@ static void delete_entry_data(RES_ENTRY* entry)
|
|||||||
BOOL InitializeResManager(int hash_table_size)
|
BOOL InitializeResManager(int hash_table_size)
|
||||||
{
|
{
|
||||||
char szpath[MAX_PATH+1];
|
char szpath[MAX_PATH+1];
|
||||||
|
#if !defined(__NOUNIX__) || defined(WIN32)
|
||||||
char* p = NULL;
|
char* p = NULL;
|
||||||
pwd_res_path = strdup("./");
|
#endif
|
||||||
|
pwd_res_path = strdup("./");
|
||||||
|
|
||||||
//initialize paths
|
//initialize paths
|
||||||
#if !defined(__NOUNIX__) || defined(WIN32)
|
#if !defined(__NOUNIX__) || defined(WIN32)
|
||||||
@@ -514,7 +516,7 @@ int SetResPath(const char* path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//test path is valid directory
|
//test path is valid directory
|
||||||
#if !defined(__NOUNIX__) && !defined(WIN32)
|
#if !defined(__NOUNIX__) && !defined(WIN32)
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
|
if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
|
||||||
# ifdef _DEBUG
|
# ifdef _DEBUG
|
||||||
@@ -634,14 +636,17 @@ int UnregisterResType(int type)
|
|||||||
|
|
||||||
static char* get_res_file(const char* res_name, char* filename)
|
static char* get_res_file(const char* res_name, char* filename)
|
||||||
{
|
{
|
||||||
|
#ifndef _MGINCORE_RES
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
if (res_name == NULL || filename == NULL)
|
if (res_name == NULL || filename == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
//test it is a full path or not
|
//test it is a full path or not
|
||||||
for(i=0; res_name[i] && res_name[i] == '/'; i++);
|
for (i=0; res_name[i] && res_name[i] == '/'; i++)
|
||||||
if(i>0) //is full path
|
;
|
||||||
{
|
|
||||||
|
if (i > 0) {
|
||||||
#ifndef __NOUNIX__
|
#ifndef __NOUNIX__
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if(stat(res_name, &buf) == 0
|
if(stat(res_name, &buf) == 0
|
||||||
@@ -653,8 +658,8 @@ static char* get_res_file(const char* res_name, char* filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0; res_paths[i]; i++)
|
for(i=0; res_paths[i]; i++) {
|
||||||
{
|
|
||||||
#ifndef __NOUNIX__
|
#ifndef __NOUNIX__
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
sprintf(filename,"%s/%s", res_paths[i], res_name);
|
sprintf(filename,"%s/%s", res_paths[i], res_name);
|
||||||
@@ -670,6 +675,7 @@ static char* get_res_file(const char* res_name, char* filename)
|
|||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* !_MGINCORE_RES */
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -701,7 +707,7 @@ void* LoadResource(const char* res_name, int type, DWORD usr_param)
|
|||||||
RES_ENTRY * entry;
|
RES_ENTRY * entry;
|
||||||
RES_KEY key;
|
RES_KEY key;
|
||||||
RES_TYPE_INFO *ti = NULL;
|
RES_TYPE_INFO *ti = NULL;
|
||||||
int src_type = 0;
|
int src_type = 0;
|
||||||
void *data = NULL;
|
void *data = NULL;
|
||||||
char szfilename[MAX_PATH+1]={0};
|
char szfilename[MAX_PATH+1]={0};
|
||||||
|
|
||||||
@@ -752,11 +758,11 @@ void* LoadResource(const char* res_name, int type, DWORD usr_param)
|
|||||||
{
|
{
|
||||||
//add type info's
|
//add type info's
|
||||||
ti->ops_ref ++;
|
ti->ops_ref ++;
|
||||||
src_type = GetSourceType(entry);
|
src_type = GetSourceType(entry);
|
||||||
if(src_type == REF_SRC_NOTYPE){
|
if(src_type == REF_SRC_NOTYPE){
|
||||||
src_type = ti->def_source;
|
src_type = ti->def_source;
|
||||||
SetSourceType(entry, src_type);
|
SetSourceType(entry, src_type);
|
||||||
}
|
}
|
||||||
switch(src_type)
|
switch(src_type)
|
||||||
{
|
{
|
||||||
case REF_SRC_FILE:
|
case REF_SRC_FILE:
|
||||||
@@ -837,7 +843,7 @@ static void delete_entry(HASH_TABLE *table, RES_ENTRY* entry)
|
|||||||
|
|
||||||
int ReleaseRes(RES_KEY key)
|
int ReleaseRes(RES_KEY key)
|
||||||
{
|
{
|
||||||
int ref = 0;
|
int ref = 0;
|
||||||
RES_ENTRY *entry = NULL;
|
RES_ENTRY *entry = NULL;
|
||||||
RES_LOCK();
|
RES_LOCK();
|
||||||
entry = get_entry(&hash_table, key, FALSE);
|
entry = get_entry(&hash_table, key, FALSE);
|
||||||
@@ -845,7 +851,7 @@ int ReleaseRes(RES_KEY key)
|
|||||||
RES_UNLOCK();
|
RES_UNLOCK();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ref = --entry->refcnt;
|
ref = --entry->refcnt;
|
||||||
if(ref <= 0)
|
if(ref <= 0)
|
||||||
delete_entry(&hash_table, entry);
|
delete_entry(&hash_table, entry);
|
||||||
RES_UNLOCK();
|
RES_UNLOCK();
|
||||||
@@ -928,11 +934,12 @@ static void* img_get_res_data(RESOURCE* res, int src_type, DWORD usr_param)
|
|||||||
INNER_RES* inner = res->source.inner;
|
INNER_RES* inner = res->source.inner;
|
||||||
if(inner->additional == NULL) //raw bitmap
|
if(inner->additional == NULL) //raw bitmap
|
||||||
{
|
{
|
||||||
res->data = inner->data;
|
res->data = (void*)inner->data;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BITMAP *pbmp = NEW(BITMAP);
|
BITMAP *pbmp = NEW(BITMAP);
|
||||||
if(LoadBitmapFromMem((HDC)usr_param, pbmp, inner->data, inner->data_len, (const char*)inner->additional) != 0)
|
if(LoadBitmapFromMem((HDC)usr_param, pbmp, inner->data,
|
||||||
|
inner->data_len, (const char*)inner->additional) != 0)
|
||||||
{
|
{
|
||||||
DELETE(pbmp);
|
DELETE(pbmp);
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1177,7 +1184,7 @@ static void* etc_get_res_data(RESOURCE* res, int src_type, DWORD usr_param)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case REF_SRC_INNER:
|
case REF_SRC_INNER:
|
||||||
res->data = res->source.inner->data;
|
res->data = (void*)res->source.inner->data;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
+131
-133
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user