empty implementation of glyphs APIs for CSS

This commit is contained in:
Vincent Wei
2019-01-16 19:27:41 +08:00
parent 972085fa56
commit c9ec23dc70
3 changed files with 132 additions and 3 deletions
+45
View File
@@ -9277,6 +9277,51 @@ typedef enum {
WS_PRE_LINE,
} WhiteSpaceRule;
/**
* The character transformation rule for \a GetGlyphsByRules.
*/
typedef enum {
CT_NONE,
CT_CAPITALIZE,
CT_UPPERCASE,
CT_LOWERCASE,
CT_FULL_WIDTH,
CT_FULL_SIZE_KANA,
} CharTransformRule;
/**
* \fn int GUIAPI GetGlyphsByRules(LOGFONT* logfont, const char* mstr, int mstr_len,
* WhiteSpaceRule white_space, CharTransformRule trans_rule,
* Glyph32** glyphs, int* nr_glyphs);
* \brief Calculate the glyph string under the specified white space and
* transformation rule.
*
* This function calculates and allocates the glyph string from a multi-byte
* string under the specified white space rule \a white_space and transformation
* rule.
*
* The function will return if it encounters any hard line break or the null character.
* The hard line break will be included in the returned glyphs if there was one.
*
* \param logfont The logfont used to parse the string.
* \param mstr The pointer to the multi-byte string.
* \param mstr_len The length of \a mstr in bytes.
* \param white_space The white space rule. This parameter specifies two things:
* - whether and how white space inside the string is collapsed.
* - whether lines may wrap at unforced soft wrap opportunities.
* \param trans_rule The character transformation rule.
* \param glyphs The pointer to a buffer to store the address of the
* allocated glyph string.
* \param nr_glyphs The buffer to store the number of the allocated glyphs.
*
* \return The number of the bytes consumed in \a mstr.
*
* \sa WhiteSpaceRule, CharTransformRule, DrawGlyphStringEx
*/
MG_EXPORT int GUIAPI GetGlyphsByRules(LOGFONT* logfont, const char* mstr, int mstr_len,
WhiteSpaceRule white_space, CharTransformRule trans_rule,
Glyph32** glyphs, int* nr_glyphs);
/**
* \fn int GUIAPI GetGlyphsExtentPointEx(LOGFONT* logfont, int x, int y,
* const Glyph32* glyphs, int nr_glyphs,
+3 -3
View File
@@ -14,12 +14,12 @@ SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \
region.c generators.c polygon.c flood.c \
advapi.c midash.c mispans.c miwideline.c \
mifillarc.c mifpolycon.c miarc.c rotatebmp.c \
text.c glyph.c bidi.c \
textout.c tabbedtextout.c drawtext.c
text.c glyph.c bidi.c glyph-css.c \
textout.c tabbedtextout.c drawtext.c
endif
HDR_FILES = drawtext.h mi.h midc.h mistruct.h miwideline.h \
pixel_ops.h mifillarc.h mispans.h polygon.h mifpoly.h
pixel_ops.h mifillarc.h mispans.h polygon.h mifpoly.h
libnewgdi_la_SOURCES = $(SRC_FILES) $(HDR_FILES)
+84
View File
@@ -0,0 +1,84 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
/*
** glyph-css.c: The implementation of APIs which conform to the specifiction
** of CSS 3
**
** Create date: 2019/01/16
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#include "minigui.h"
#include "gdi.h"
#include "window.h"
#include "devfont.h"
#include "cliprect.h"
#include "gal.h"
#include "internals.h"
#include "ctrlclass.h"
#include "dc.h"
#include "pixel_ops.h"
#include "cursor.h"
#include "drawtext.h"
#include "fixedmath.h"
#include "glyph.h"
int GUIAPI GetGlyphsByRules(LOGFONT* logfont, const char* mstr, int mstr_len,
WhiteSpaceRule white_space, CharTransformRule trans_rule,
Glyph32** glyphs, int* nr_glyphs)
{
return 0;
}
int GUIAPI GetGlyphsExtentPointEx (LOGFONT* logfont, int x, int y,
const Glyph32* glyphs, int nr_glyphs,
DWORD break_flags, int letter_spacing, int word_spacing,
WhiteSpaceRule white_space, int tab_size,
int max_extent,
LINEEXTINFO* line_ext_info, GLYPHEXTINFO* glyph_ext_info, POINT* pts)
{
return 0;
}
int GUIAPI DrawGlyphStringEx (HDC hdc, const Glyph32* glyphs, int nr_glyphs,
const POINT* pts)
{
return 0;
}