Compare commits

...
320 Commits
Author SHA1 Message Date
Vincent Wei 2b01f35cac rename: LayoutInfo -> Layout, TextRunsInfo -> TextRuns 2019-04-06 11:25:21 +08:00
Vincent Wei e0b6a64402 tune position for west gravity 2019-04-04 19:00:45 +08:00
Vincent Wei 084d7e58a2 tune indentation 2019-04-04 18:53:37 +08:00
Vincent Wei 88753a5fd0 cleanup 2019-04-04 17:02:06 +08:00
Vincent Wei b739daadba cleanup FreeType2 font engine, remove redundant code 2019-04-04 16:51:54 +08:00
Vincent Wei 5529ab1e10 use mg_slice for TEXTRUNS, TEXTLAYOUT, GlyphRun, TextRun, LayoutRun, and so on 2019-04-04 15:10:19 +08:00
Vincent Wei 032fdcc3bb mg_slice_free -> mg_slice_delete; mg_slice_free1 -> mg_slice_free 2019-04-04 14:46:05 +08:00
Vincent Wei 1cb9922dad Initialize mutex of mgslice 2019-04-04 12:27:05 +08:00
Vincent Wei 8ac0d539d0 implementation of mg_slice_xxx 2019-04-04 12:18:10 +08:00
Vincent Wei e3ae994212 debug: line->nr_runs should be re-caculate for ellipsized line 2019-04-04 08:39:09 +08:00
Vincent Wei b0145a15d2 CalcLayoutBoundingRect 2019-04-03 19:13:27 +08:00
Vincent Wei 9dab380f3e GetLayoutLineRect 2019-04-03 19:01:19 +08:00
Vincent Wei d1facd5468 No shaping arabic for vertical layout 2019-04-03 15:50:32 +08:00
Vincent Wei 5996ede23b cleanup 2019-04-03 15:26:50 +08:00
Vincent Wei 837cd49045 debug: uninitialized length 2019-04-03 15:16:07 +08:00
Vincent Wei dc4f54ffe4 debug: uninitialized length 2019-04-03 15:15:39 +08:00
Vincent Wei f611fe3859 normal, word break and alignment 2019-04-03 12:27:10 +08:00
Vincent Wei 4ff5097dfb check pointer for get_glyph_advance 2019-04-02 19:00:13 +08:00
Vincent Wei 49421e1f88 implementation of DrawLayoutLine 2019-04-02 18:46:34 +08:00
Vincent Wei 6e33602e7d debug for glyph orientation in vertical layout 2019-04-02 17:27:15 +08:00
Vincent Wei d13c31a08a add ta (text align) to RENDERDATA 2019-04-02 12:36:31 +08:00
Vincent Wei 704b6287ff debug for MIXED orientation 2019-04-02 10:12:31 +08:00
Vincent Wei 1df726dd10 tune gravity and orientation 2019-04-02 09:27:06 +08:00
Vincent Wei b2afe815b5 debug DrawShapedGlyph 2019-04-01 19:12:41 +08:00
Vincent Wei f648c1a8c7 tune api desc 2019-04-01 14:37:09 +08:00
Vincent Wei 4d2fe61e52 remove (x,y) from CB_GLYPH_LAID_OUT 2019-04-01 14:26:56 +08:00
Vincent Wei 9644964e9c tune api description 2019-03-31 15:31:49 +08:00
Vincent Wei 61b799af88 fix bug: not convert AChar to Glyph32 2019-03-29 20:18:26 +08:00
Vincent Wei 2f52006cde fix a bug: no MSG_IDLE when using dummy IAL engine 2019-03-29 19:22:31 +08:00
Vincent Wei cf063aad32 disable debug print 2019-03-29 18:31:23 +08:00
Vincent Wei 0855e8b972 add null fonts for korea and japanese charsets 2019-03-29 16:13:16 +08:00
Vincent Wei a501557532 Tune CB_GLYPH_LAID_OUT 2019-03-29 14:51:57 +08:00
Vincent Wei 820d6aeac4 fix a bug 2019-03-29 12:27:04 +08:00
Vincent Wei 215242e3e8 tune 2019-03-29 12:14:19 +08:00
Vincent Wei c79f09fe87 implementation of GetLayoutLineSize and CalcLayoutBoundingRect 2019-03-29 11:44:29 +08:00
Vincent Wei f68c26860a Implementation of CreateLogFontForMChar2UChar; FONT_MIN_SIZE -> 1 2019-03-29 10:40:35 +08:00
Vincent Wei 53f1a05526 Tune new APIs 2019-03-29 10:09:23 +08:00
Vincent Wei 6a5cfd1052 new APIs: SetFontNameInTextRuns, SetTextColorInTextRuns, SetBackgroundColorInTextRuns, and GetXXXX 2019-03-28 18:57:21 +08:00
Vincent Wei 1c79cf510f Tune the TextRunsInfo and LayoutInfo related APIs 2019-03-28 17:47:12 +08:00
Vincent Wei 86965a0e9c fixbug in layout-ellipsize.c 2019-03-28 11:40:58 +08:00
Vincent Wei 9cca87878c tune CB_GLYPH_LAID_OUT 2019-03-27 19:28:19 +08:00
Vincent Wei 2cffa1154c API description 2019-03-27 19:16:33 +08:00
Vincent Wei 9adea7df64 implementation of NULL font engine and incored NULL devfonts for every charset 2019-03-27 17:58:56 +08:00
Vincent Wei 8f70dfcf69 UStrTailorBreaks 2019-03-27 16:46:42 +08:00
Vincent Wei ccf1e6f7a5 cleanup 2019-03-27 15:52:43 +08:00
Vincent Wei 913ea4db23 CreateTextRunsInfo and CreateLayoutInfo passed test cases 2019-03-27 15:50:16 +08:00
Vincent Wei 55baa8c741 cleanup 2019-03-27 12:39:27 +08:00
Vincent Wei db63d8cad3 cleanup 2019-03-27 11:40:34 +08:00
Vincent Wei 338fb0276e use _DEBUG for real output of _DBG_PRINTF 2019-03-27 10:08:01 +08:00
Vincent Wei 8dd64e7f2d api description 2019-03-26 19:14:05 +08:00
Vincent Wei c1cbb8423e parameters of CB_GLYPH_LAID_OUT 2019-03-26 18:44:05 +08:00
Vincent Wei a95ee5b181 debug 2019-03-26 18:09:49 +08:00
Vincent Wei 9d9bf95c21 cleanup 2019-03-26 12:25:08 +08:00
Vincent Wei ed6ceaa49c fixbug of layout implementation 2019-03-26 12:22:26 +08:00
Vincent Wei f5e1144cbe debug LayoutInfo implementaion 2019-03-26 11:24:31 +08:00
Vincent Wei c890e4296a add list_concat, list_move, list_reverse 2019-03-26 11:24:06 +08:00
Vincent Wei d09313407e reorder glyph runs according to embedding levels 2019-03-25 15:31:03 +08:00
Vincent Wei 7dfe5954f5 go on 2019-03-25 12:15:23 +08:00
Vincent Wei 390c5de6ef go on 2019-03-24 19:14:46 +08:00
Vincent Wei 274fdaaa31 go on 2019-03-24 19:00:15 +08:00
Vincent Wei 04725fc892 cleanup 2019-03-24 15:46:40 +08:00
Vincent Wei 4da29f635d Use CamelCase for internal structures and types 2019-03-24 15:32:08 +08:00
Vincent Wei 3e5ff0af91 tune implementation 2019-03-24 12:35:31 +08:00
Vincent Wei 1820e74b77 empty implementation 2019-03-22 18:42:08 +08:00
Vincent Wei 2278c4975c new file for ellipsisi 2019-03-22 18:34:11 +08:00
Vincent Wei af8a04570d more code 2019-03-22 18:33:37 +08:00
Vincent Wei 452edfa831 more code for layout 2019-03-22 12:33:53 +08:00
Vincent Wei 4fba705082 cleanup 2019-03-22 10:53:50 +08:00
Vincent Wei a049e387e0 some code for layout 2019-03-22 09:40:05 +08:00
Vincent Wei c67a18536d some code for layout 2019-03-21 19:12:52 +08:00
Vincent Wei d9e09ac34f Intent to add new APIs: DrawShapedGlyph and DrawShapedGlyphLine 2019-03-21 15:28:30 +08:00
Vincent Wei 65972861a0 bugfixs 2019-03-21 15:03:04 +08:00
Vincent Wei 96b06544b3 Optimize FreeType2 engine for get_glyph_advance; add new devfont op: get_kerning 2019-03-21 11:01:37 +08:00
Vincent Wei 838530d6b1 add new internal header: glyph.h; _font_get_glyph_log_width 2019-03-21 09:46:20 +08:00
Vincent Wei c276122f60 Start to implement InitBasicShapingEngine 2019-03-20 18:53:06 +08:00
Vincent Wei 46a8b1768a cleanup 2019-03-20 17:08:43 +08:00
Vincent Wei d5b57e8200 cleanup and add _WRN_PRINTF for warning 2019-03-20 17:06:43 +08:00
Vincent Wei ee179e6995 API description related to LAYOUTINFO 2019-03-20 16:31:41 +08:00
Vincent Wei 3571d88f3d use LoadResource for LOGFONTs of text runs 2019-03-19 19:33:11 +08:00
Vincent Wei 8ba346eec5 use logfont name for CreateTextRunsInfo instead of logfont object 2019-03-19 18:43:04 +08:00
Vincent Wei e110cb61f4 fix bugs 2019-03-19 17:14:42 +08:00
Vincent Wei d29aa1d881 Tune name of structure and functions 2019-03-19 15:37:30 +08:00
Vincent Wei 6337f5d6fa cleanup 2019-03-19 11:49:34 +08:00
Vincent Wei 14bfe263a3 Use LanguageCode and ScriptType types for external APIs 2019-03-19 11:48:24 +08:00
Vincent Wei cbd54e0766 add new APIs: ScriptGetGlyphOrientation and ScriptGetWideGlyphOrientation 2019-03-19 10:45:26 +08:00
Vincent Wei ceaec7e3d3 new API: UBidiGetParagraphEmbeddingLevelsAlt, an optimized call 2019-03-18 19:07:53 +08:00
Vincent Wei aab8d6e2c6 Emoji, Script, and Width iterators for Unicode string 2019-03-18 17:32:27 +08:00
Vincent Wei 8a856e5b99 cleanup 2019-03-18 14:30:46 +08:00
Vincent Wei 46f48a0d6c UCharGetVerticalOrientation 2019-03-18 12:42:45 +08:00
Vincent Wei 40fc11f324 gen-vop-tab: tool to generate the vertical orientation property table 2019-03-18 12:32:47 +08:00
Vincent Wei d63fe9849b Tune GlyphRunInfo 2019-03-16 19:12:57 +08:00
Vincent Wei 349f310148 cleanup 2019-03-16 16:28:46 +08:00
Vincent Wei ac60980bc2 tune GlyphRunInfo APIs and cleanup 2019-03-16 16:21:49 +08:00
Vincent Wei e7002ad870 cleanup; new -> new_entry 2019-03-16 11:33:40 +08:00
Vincent Wei 6838a67e7d some minor changes 2019-03-15 18:24:37 +08:00
Vincent Wei 9a8d997f63 new files 2019-03-15 17:13:47 +08:00
Vincent Wei f8b0a89d90 add glyphruninfo.h 2019-03-15 14:47:41 +08:00
Vincent Wei 72f61f17be trim UCHAR prefix from UCharScriptType and UCHAR_SCRIPT_XXXX 2019-03-15 14:46:24 +08:00
Vincent Wei 676dd0e6da cleanup 2019-03-14 19:08:15 +08:00
Vincent Wei 02c7a6e07c add unicode funcs for HarzBuff 2019-03-14 18:36:21 +08:00
Vincent Wei 8f841a0bc0 split shaped-glyph.c into three files 2019-03-14 17:26:14 +08:00
Vincent Wei f218b7b892 add enable option for complex scripts and harzbuff; cleanup options for TTF support (onley FreeType2) 2019-03-14 17:17:09 +08:00
Vincent Wei 1e1dd76fb1 tune interfaces of GetShapedGlyphsXXX 2019-03-14 12:34:21 +08:00
Vincent Wei 4ba0bcd0fe cleanup 2019-03-13 19:05:15 +08:00
Vincent Wei cc9d9f6d42 basic implementation of GetLangScriptFromName and NormalizeScriptType 2019-03-13 18:57:39 +08:00
Vincent Wei 4c9e8138b1 table for lang name to scripts 2019-03-13 18:27:57 +08:00
Vincent Wei f79a1bd86a cleanup 2019-03-13 18:24:56 +08:00
Vincent Wei 211135fbc5 cleanup 2019-03-13 17:52:43 +08:00
Vincent Wei 537b659fc7 tune implementation of GetShapedGlyphsBasic 2019-03-13 17:25:48 +08:00
Vincent Wei 6b45b74e32 return length of break_oppos instead of the number of consumed uchars 2019-03-13 15:05:18 +08:00
Vincent Wei 0ceb5616bf fix memory usage bug of UStrGetBreaks; UStrGetBreaks does not return when it encounters a hard break 2019-03-13 14:33:48 +08:00
Vincent Wei 62f9cf9e48 tune API description 2019-03-13 12:29:01 +08:00
Vincent Wei 6842cd3933 Split GetUCharsAndBreaks into two APIs: GetUCharsUntilParagraphBoundary and UStrGetBreaks 2019-03-13 12:21:45 +08:00
Vincent Wei 2c5ddd93cb add internal api: _unicode_normalize_script 2019-03-12 19:00:30 +08:00
Vincent Wei 64ddca1e2f Add UCharIsArabicVowel 2019-03-12 18:34:47 +08:00
Vincent Wei 9dea317925 cleanup 2019-03-12 17:53:14 +08:00
Vincent Wei a4e8a42707 cleanup 2019-03-12 17:52:06 +08:00
Vincent Wei 005519e7cc Tuen API of GetShapedGlyphsBasic and GetShapedGlyphsComplex 2019-03-12 15:41:57 +08:00
Vincent Wei da7c2175dd cleanup 2019-03-12 12:29:13 +08:00
Vincent Wei c7e6a867f4 cleanup 2019-03-12 11:57:04 +08:00
Vincent Wei 30c6033e8c cleanup 2019-03-12 09:27:11 +08:00
Vincent Wei 5a5d5d3bbb Passed BidiCharacterTest 2019-03-12 09:03:32 +08:00
Vincent Wei bdd75353d2 cleanup 2019-03-11 19:14:35 +08:00
Vincent Wei ce7b9eccca debug 2019-03-11 18:45:46 +08:00
Vincent Wei c66f1a5fa3 cleanup 2019-03-11 16:08:52 +08:00
Vincent Wei ba240cd53b cleanup 2019-03-11 15:55:14 +08:00
Vincent Wei ca9d0200f3 Implementation of UBidiXXX functions 2019-03-11 15:47:48 +08:00
Vincent Wei 5dd2a21919 Description of Bidi APIs 2019-03-11 12:33:42 +08:00
Vincent Wei 11124ef8a0 rename internal apis and cleanup 2019-03-11 11:51:16 +08:00
Vincent Wei e8714be5ef rename macros 2019-03-11 11:33:02 +08:00
Vincent Wei 13341e864c rename files and internal apis 2019-03-11 09:36:36 +08:00
Vincent Wei e1a464b32f cleanup 2019-03-10 18:55:07 +08:00
Vincent Wei a7601d8cfe tune UCD url 2019-03-10 18:31:15 +08:00
Vincent Wei 98ae3a6b35 Restore BidiBracketType 2019-03-10 18:19:21 +08:00
Vincent Wei f82e15ed5e use iso8859-bidi-tables 2019-03-10 18:08:53 +08:00
Vincent Wei 690f5487ab BIDIType to BidiType 2019-03-10 17:31:36 +08:00
Vincent Wei 4e0a9a8d37 two implementations for biditype, bracket and mirror 2019-03-10 16:54:45 +08:00
Vincent Wei c6f1004ba6 cleanup 2019-03-10 14:47:02 +08:00
Vincent Wei a4e9f56c08 cleanup 2019-03-10 14:44:33 +08:00
Vincent Wei d84a7ffbbe Bidi tables 2019-03-10 14:42:36 +08:00
Vincent Wei 11865764da cleanup 2019-03-10 13:21:08 +08:00
Vincent Wei fdc449335d utilities for generating Bidi tables 2019-03-10 13:17:52 +08:00
Vincent Wei 27e508848d new implementation of UNICODE BIDIRECTIONAL ALGORITHM 2019-03-08 20:38:04 +08:00
Vincent Wei cc01ce0bbc new implementation of UNICODE BIDIRECTIONAL ALGORITHM 2019-03-08 20:37:44 +08:00
Vincent Wei 0093ac3edc New APIs: UCHAR2ACHAR, UChar2AChar, UChars2AChars 2019-03-08 14:39:48 +08:00
Vincent Wei 45db7410c0 Update Unicode tables to 12.0.0 2019-03-08 11:52:49 +08:00
Vincent Wei e6df345736 Update LB8a rule to conform Unicode 12.0.0 2019-03-08 11:52:36 +08:00
Vincent Wei e7b05090cd Rename MCHAR_TYPE_XXX to ACHAR_BASIC_XXX; Tune implementation of GetACharType and GetACharBIDIType 2019-03-08 10:17:18 +08:00
Vincent Wei b82128091e add const for keymap data 2019-03-07 19:09:34 +08:00
Vincent Wei adab30261c add const to incore-res data 2019-03-07 18:57:04 +08:00
Vincent Wei 7e0b378475 add const to _cos_tbl, _tag_tbl, and _acos_tbl; add prefix __mg to these global variables 2019-03-07 18:46:42 +08:00
Vincent Wei d1ef9e2598 rename _unicode_is_emoji_extended_pictographic to _unicode_is_extended_pictographic 2019-03-07 17:46:35 +08:00
Vincent Wei 5887668b17 add new API UCharGetBracketType 2019-03-07 17:42:47 +08:00
Vincent Wei e6cb8f272b update Unicode bidi tables 2019-03-07 17:31:15 +08:00
Vincent Wei 90e4ee91fe Tune BIDIType to Uint16 instead of unsigned int 2019-03-07 12:40:37 +08:00
Vincent Wei 83207ca329 Update Unicode data to 11.0.0 2019-03-07 11:46:17 +08:00
Vincent Wei dcd31bed7c Indic shaping table 2019-03-07 11:02:51 +08:00
Vincent Wei 76cf8a02af Arabic shaping tables 2019-03-07 10:20:41 +08:00
Vincent Wei 10d8b43c61 update emoji data tables 2019-03-07 09:55:23 +08:00
Vincent Wei 554b709890 Restore prototype of DrawGlyphStringEx and add DrawShapedGlyphString 2019-03-07 08:55:47 +08:00
Vincent Wei d877e86adc New API description for GetShapedGlyphsBasic, GetShapedGlyphsComplex, GetGlyphsExtentInfo, and GetGlyphsPositionInfo 2019-03-06 17:20:19 +08:00
Vincent Wei c5e5bd01e8 implement get_glyph_value for FreeType2 engine; the glyph value of this devfont is the glyph index of the default CMap 2019-03-06 16:03:00 +08:00
Vincent Wei e3760457c4 GetGlyphsExtentPointEx -> GetGlyphsExtentFromUChars 2019-03-06 14:42:16 +08:00
Vincent Wei c6ed1626f9 cleanup 2019-03-05 19:09:26 +08:00
Vincent Wei b4b18828b2 change GLYPHTYPE_ to CHARTYPE_ 2019-03-05 18:44:39 +08:00
Vincent Wei 36167be7e6 Tune APIs of Achar32 2019-03-05 18:18:54 +08:00
Vincent Wei 4b633c801d Introduce the Mchar32 type, and distinguish glyph and character 2019-03-05 12:27:35 +08:00
Vincent Wei 33fd8a8668 tune TTF cache arguments 2019-03-05 10:50:25 +08:00
Vincent Wei 94f44890a5 tune code to handle auto-italic correctly 2019-03-05 10:42:16 +08:00
Vincent Wei cc7441c4dd add df_slot to get_font_size of DEVFONT operators in order to set scale correctly 2019-03-05 09:16:36 +08:00
Vincent Wei 6fdc0281ba handle whitespace gracefully 2019-03-04 18:08:36 +08:00
Vincent Wei 136a51d9b8 cleanup 2019-03-04 16:47:19 +08:00
Vincent Wei 5e871c486b Tune FS_SLANT_XXX and tune auto bold implementation 2019-03-04 16:30:25 +08:00
Vincent Wei fdd69bf470 fix bug: do not override bitmap size for grey and subpixel glyph 2019-03-04 16:30:17 +08:00
Vincent Wei 10e55b0d4f restore style for TTF cache 2019-03-04 14:37:59 +08:00
Vincent Wei 682c81d636 tune 2019-03-04 11:52:47 +08:00
Vincent Wei 9eb4e54b75 cleanup 2019-03-04 11:39:32 +08:00
Vincent Wei e43bc07a63 tune fontcache functions: use devfont name instead of family and style 2019-03-04 11:37:50 +08:00
Vincent Wei 508130afdc tune 2019-03-03 20:06:07 +08:00
Vincent Wei d60c057dc4 tune load_flags 2019-03-03 20:00:54 +08:00
Vincent Wei 8f5a741af6 tune load_flags 2019-03-03 19:58:29 +08:00
Vincent Wei bee1bc87c4 tune code for size_request of LOGFONT 2019-03-03 19:14:18 +08:00
Vincent Wei 3a9274e9a0 add SIZE* sz for get_glyph_monobmp and get_glyph_graybmp 2019-03-03 18:54:39 +08:00
Vincent Wei 44ee735cd6 fix a bug of is_glyph_exsited (always returns FALSE) 2019-03-03 18:54:14 +08:00
Vincent Wei 2c010cdbeb fix a bug of fontDoesMatchFamily 2019-03-03 16:51:49 +08:00
Vincent Wei a04ae43bdb fix bug of gdiCreateLogFont 2019-03-03 16:43:40 +08:00
Vincent Wei 5c333445c5 tune font styles 2019-03-01 20:01:30 +08:00
Vincent Wei dd93e67a3d tune document 2019-03-01 14:38:48 +08:00
Vincent Wei d886268eee cleanup and check the duplicated fontname of a new devfont 2019-03-01 14:20:46 +08:00
Vincent Wei 090824cb91 bugfix 2019-02-28 19:08:05 +08:00
Vincent Wei 00eb4e363f Enhance LOGFONT to support multiple MBC devfonts (up to 7) 2019-02-28 18:47:44 +08:00
Vincent Wei f73f0786ee remove break_classes argument and add uchars argument for GetGlyphsAndBreaks 2019-02-28 11:50:00 +08:00
Vincent Wei dacc81cf2a Rename UCharGetBreak to UCharGetBreakType; Cleanup and optimization 2019-02-28 09:47:25 +08:00
Vincent Wei 97c6249af5 cleanup: remove definition of DEBUG 2019-02-27 18:47:25 +08:00
Vincent Wei 7ce1fe47ff implementation of character transformation of GetGlyphsAndBreaks; fix a bug of UCharToFullSizeKana 2019-02-27 18:33:32 +08:00
Vincent Wei 8e66bb366e tune word breaks and sentence breaks 2019-02-27 17:56:41 +08:00
Vincent Wei ce7fd6e776 passed all test cases for UAX#14 and UAX#29 2019-02-27 11:37:17 +08:00
Vincent Wei 957f9cbb47 remove break_classes argument from GetGlyphsExtentPointEx 2019-02-26 19:07:37 +08:00
Vincent Wei 2a7e3003bd Rename GetGlyphsByRules to GetGlyphsAndBreaks 2019-02-26 18:47:33 +08:00
Vincent Wei 19cd208a6e support for GB, WB, SB in break_oppos; add emoji tables 2019-02-26 17:59:50 +08:00
Vincent Wei 6a44111a35 cleanup 2019-02-25 17:09:37 +08:00
Vincent Wei fd5d55942b use Uint16 type for break_oppo instead of Uint8 type in order to contain GB, WB, SB flags 2019-02-25 16:42:49 +08:00
Vincent Wei d4e7f048f0 fixbug 2019-02-25 09:12:51 +08:00
Vincent Wei d90c4d5842 cleanup 2019-02-24 18:31:38 +08:00
Vincent Wei 0f562cd39f cleanup 2019-02-24 15:02:16 +08:00
Vincent Wei fb01003c45 use LEN_VBF_NAME instead of LEN_DEVFONT_NAME 2019-02-24 14:56:43 +08:00
Vincent Wei 9bcea02975 cleanup 2019-02-24 13:35:43 +08:00
Vincent Wei c51ae8d1c1 cleanup 2019-02-22 19:11:37 +08:00
Vincent Wei b8a5ad2d73 return NULL when not matched devfont 2019-02-22 19:11:26 +08:00
Vincent Wei 39b8c88d1b new DC attribute: DC_ATTR_WORD_EXTRA 2019-02-22 18:46:23 +08:00
Vincent Wei 1e73f6713a enable cache of freetype2 engine for rotated glyphs 2019-02-22 17:51:41 +08:00
Vincent Wei 97babaa4e2 add size_request in LOGFONT for original requested size 2019-02-22 17:46:13 +08:00
Vincent Wei c6c486f306 almost there 2019-02-22 15:47:20 +08:00
Vincent Wei 338f10b896 debug 2019-02-22 12:39:07 +08:00
Vincent Wei 2353a873a8 debug GetGlyphsExtentPointEx 2019-02-22 10:49:02 +08:00
Vincent Wei 52c539e870 debug 2019-02-21 20:21:02 +08:00
Vincent Wei 64d63a84c5 cleanup and bugfixs 2019-02-21 18:43:14 +08:00
Vincent Wei 3d80d73450 cleanup and bugfixs 2019-02-21 18:38:49 +08:00
Vincent Wei 2e04898fbe fix bugs 2019-02-21 15:56:51 +08:00
Vincent Wei f390e1a091 fix bugs 2019-02-21 15:51:11 +08:00
Vincent Wei 848c1d7ce1 tune 2019-02-21 12:07:02 +08:00
Vincent Wei 0c0becc780 tune 2019-02-21 10:32:16 +08:00
Vincent Wei 0e918da2a4 bugfix: get_ch_width does not check glyph value 2019-02-21 10:32:01 +08:00
Vincent Wei 7f36c339b7 tune 2019-02-20 18:21:17 +08:00
Vincent Wei 871486daab cleanup 2019-02-20 16:41:21 +08:00
Vincent Wei 0cffc8798f Suppress and/or hang spaces and punctations for GetGlyphsExtentPointEx 2019-02-20 16:00:16 +08:00
Vincent Wei 4d4a3901eb TODOs 2019-02-19 18:53:20 +08:00
Vincent Wei 50e95cb461 Initial implementation of GetGlyphsExtentPointEx and DrawGlyphStringEx 2019-02-19 18:38:57 +08:00
Vincent Wei d223edf0ba partial implementation of GetGlyphsExtentPointEx 2019-02-19 17:48:39 +08:00
Vincent Wei 8e88082f07 UCharGetType -> UCharGetCategory 2019-02-19 10:45:49 +08:00
Vincent Wei 5b1762b637 Enhance GetGlyphsByRules to return breaking classes 2019-02-19 09:41:22 +08:00
Vincent Wei 6c83ea4ceb implementation for LBP_NORMAL and LBP_STRICT; both passed all test cases 2019-02-18 18:24:59 +08:00
Vincent Wei 5aa5e75813 UCharBasicType -> UCharGeneralCategory 2019-02-18 12:16:49 +08:00
Vincent Wei 1ba35dcbf6 implementation of WBR_BREAK_ALL and WBR_KEEP_ALL 2019-02-18 11:44:54 +08:00
Vincent Wei 8828824b23 Add BOV_NOTALLOWED_DEFINITELY and BOV_NOTALLOWED_UNCERTAINLY 2019-02-18 09:25:18 +08:00
Vincent Wei e3f2cc22ec tune BIDILogGlyphs2VisGlyphsEx and BIDILogGlyphs2VisGlyphs 2019-02-17 12:56:35 +08:00
Vincent Wei 93aae6782e Tune GetGlyphsByRules and GetGlyphsExtentPointEx 2019-02-17 11:53:35 +08:00
Vincent Wei b746d2927e Partial implementation of GetGlyphsExtentPointEx 2019-02-15 18:07:03 +08:00
Vincent Wei 79e3be705c simplify the interfaces of GetGlyphsExtentPointEx and DrawGlyphStringEx 2019-02-15 11:07:54 +08:00
Vincent Wei a052b7bf55 cleanup BIDI APIs 2019-02-14 19:45:50 +08:00
Vincent Wei 74a84362ca correct some bad names of BIDI-related APIs 2019-02-14 17:27:11 +08:00
Vincent Wei d673008f5a tune API description 2019-02-14 11:52:59 +08:00
Vincent Wei 09c9438de8 tune api description 2019-01-29 17:02:48 +08:00
Vincent Wei 0734180d70 set user_comp_ctxt to be pixel format for default composition operators 2019-01-29 15:43:23 +08:00
Vincent Wei 8ca8deb02d list developers 2019-01-29 10:51:15 +08:00
Vincent Wei 9aa719aeb3 list developers 2019-01-29 10:42:43 +08:00
Vincent Wei 447eebbafc all UNICODE LINE BREAKING ALGORITHM test cases for GetGlyphsByRules passed 2019-01-27 12:45:20 +08:00
Vincent Wei 19f8689a20 almost passed the test cases for GetGlyphsByRules 2019-01-25 21:34:34 +08:00
Vincent Wei 60902f83d5 debug GetGlyphsByRules 2019-01-25 20:42:32 +08:00
Vincent Wei a725acfd5e debug GetGlyphsByRules 2019-01-25 16:14:42 +08:00
Vincent Wei 0191772111 Tune the implementation of UNICODE LINE BREAKING ALGORITHM 2019-01-24 20:17:27 +08:00
Vincent Wei a11cef5f2e push 2019-01-24 18:43:30 +08:00
Vincent Wei cf4c75bcbc almost finished GetGlyphsByRules 2019-01-24 11:31:54 +08:00
Vincent Wei f85801dcbe part implementation of GetGlyphsByRules 2019-01-23 17:08:03 +08:00
Vincent Wei 4e67f8c56b part implementation of GetGlyphsByRules 2019-01-23 14:36:56 +08:00
Vincent Wei 1cfd2fe324 part implementation of GetGlyphsByRules 2019-01-22 10:50:15 +08:00
Vincent Wei 5ef2e0fa42 temp 2019-01-21 17:14:59 +08:00
Vincent Wei 57b71e985c Add UCharGetType, UCharGetBreak, UCharGetBIDIType, and UCharGetMirror for completeness 2019-01-21 16:19:20 +08:00
Vincent Wei d9d76ec59b DrawGlyphStringEx returns BOOL 2019-01-19 18:29:09 +08:00
Vincent Wei 7935883267 GetGlyphsByRules returns line break opportunities 2019-01-19 18:20:55 +08:00
Vincent Wei 0385def7b2 tune 2019-01-19 15:05:53 +08:00
Vincent Wei 565f4b34e5 cleanup 2019-01-19 15:02:55 +08:00
Vincent Wei 70ba8a0420 cleanup 2019-01-19 14:59:12 +08:00
Vincent Wei 4bdbe4a002 tune 2019-01-19 14:53:35 +08:00
Vincent Wei 2c98ef96da tune release notes 2019-01-19 14:24:26 +08:00
Vincent Wei 6663c98787 add CreateLogFontIndirectEx function 2019-01-19 14:21:46 +08:00
Vincent Wei bbf2376f7a fix a potential bug: reserve key when creating logfont by calling CreateLogFontIndirect 2019-01-19 14:04:11 +08:00
Vincent Wei 21ac9f2def add content language and writing system parameters for rendering glyphs for CSS 2019-01-19 13:27:01 +08:00
Vincent Wei a10d28dd11 unicode script and language code 2019-01-19 12:57:34 +08:00
Vincent Wei 856126c72e make GRF_HANGING_PUNC_FIRST and GRF_HANGING_PUNC_LAST as flag bits 2019-01-18 18:07:44 +08:00
Vincent Wei 547fc0059c tune readme 2019-01-18 16:45:23 +08:00
Vincent Wei 195363dc82 use the same table for UCharToFullSizeKana and UCharToSmallKana 2019-01-18 16:24:56 +08:00
Vincent Wei 54288e5687 more API description 2019-01-18 16:15:14 +08:00
Vincent Wei 9d46406a95 some API description 2019-01-18 15:49:10 +08:00
Vincent Wei d365feca5d tune 2019-01-18 14:05:19 +08:00
Vincent Wei f34ac9d0fe UChar32 -> Uchar32; UChar16 -> Uchar16 2019-01-18 13:56:18 +08:00
Vincent Wei 3a02b056ca Tune format 2019-01-18 12:39:23 +08:00
Vincent Wei 1a1e8cf652 Add UCharToFullWidth and UCharToFullSizeKana 2019-01-18 12:37:53 +08:00
Vincent Wei 94feb0ae44 Tune Glyph32 and UChar32 to be unsigned 2019-01-18 11:43:42 +08:00
Vincent Wei 1e1a5edd13 tune 2019-01-18 11:29:35 +08:00
Vincent Wei ae9b14201b make sure the strings are null-terminated (fontDoesMatchFamily) 2019-01-18 09:29:39 +08:00
Vincent Wei 742150d4f1 restore LEN_FONT_NAME 2019-01-17 19:29:14 +08:00
Vincent Wei 03eac03c8c add UCharCanonicalOrdering and others for composition and decomposition 2019-01-17 18:45:22 +08:00
Vincent Wei 8cd6b037ec tuen release notes 2019-01-17 14:59:40 +08:00
Vincent Wei b35e38bdff tune length of devfont name fields; devfont now supports family aliases 2019-01-17 14:55:06 +08:00
Vincent Wei 58275c88e9 call REAL_GLYPH for devfont operators 2019-01-17 12:40:25 +08:00
Vincent Wei 31b43521d0 call REAL_GLYPH for charset operators 2019-01-17 12:14:02 +08:00
Vincent Wei e68ee00b85 rename glyph type macros and glyph type now includes MCHAR_TYPE_XXX for ASCII characters 2019-01-17 11:59:29 +08:00
Vincent Wei 6e54d4a7d7 add macro GLYPH2UCHAR 2019-01-16 20:43:01 +08:00
Vincent Wei 69b1d63569 Rename IsGlyphAlnum, GlyphToUpper to IsUCharAlnum, UCharToTitle and so on 2019-01-16 20:37:56 +08:00
Vincent Wei 817f4063a1 Add UNICODE utilities: IsGlyphAlnum, GlyphToUpper, ... 2019-01-16 20:34:51 +08:00
Vincent Wei c9ec23dc70 empty implementation of glyphs APIs for CSS 2019-01-16 19:27:41 +08:00
Vincent Wei 972085fa56 cleanup 2019-01-16 17:50:21 +08:00
Vincent Wei c2e24b61e3 cleanup 2019-01-16 17:44:48 +08:00
Vincent Wei bd1fb67930 retrive the break type of UNICODE char; upgrade UNICODE tables to 10.0.0 2019-01-16 17:10:50 +08:00
Vincent Wei 0fcedfca08 cleanup 2019-01-16 14:52:12 +08:00
Vincent Wei c39ce7c0b8 cleanup 2019-01-16 12:04:43 +08:00
Vincent Wei 97014ccdc8 cleanup 2019-01-16 12:02:58 +08:00
Vincent Wei 48e7f6e928 cleanup 2019-01-16 11:53:46 +08:00
Vincent Wei 473f9f98ff cleanup 2019-01-16 11:52:56 +08:00
Vincent Wei 95d09a7673 tune and cleanup 2019-01-16 11:43:27 +08:00
Vincent Wei 53253ed101 optimize the font matching algorithm 2019-01-16 10:18:26 +08:00
Vincent Wei 4bd7c0eef4 add mutex for freetype2 font engine (MGRM_THREADS) and remove lock/unlock of __mg_gdi_lock in _font_get_glyph_advance 2019-01-16 10:06:46 +08:00
Vincent Wei 9af71438dd cleanup 2019-01-15 17:02:11 +08:00
Vincent Wei 747894247b tune release notes 2019-01-15 16:18:45 +08:00
Vincent Wei 1ed5b44926 cleanup for 3.2.2 2019-01-15 15:13:50 +08:00
Vincent Wei 16287af2a6 fix the bug of wrong bbox handling for SUBPIXEL rendering of glyph 2019-01-15 14:53:57 +08:00
Vincent Wei 82033a44dd cleanup and fix the bug of wrong bboxing handling for SUBPIXEL rendering of glyph 2019-01-15 14:50:46 +08:00
Vincent Wei 1c9537fc63 BMP_TYPE_REPLACEKEY for BITMAP; Declaration of GetGlyphsExtentPointEx and DrawGlyphStringEx; cleanup of GLYPHINFO and GLYPHBITMAP 2019-01-15 10:17:25 +08:00
Vincent Wei 612c395c06 Backward compatiblity of CreateLogFont 2019-01-14 10:23:37 +08:00
Vincent Wei 8dc0ee2ade cleanup 2019-01-13 18:56:41 +08:00
Vincent Wei caefd7355a cleanup 2019-01-13 18:36:03 +08:00
Vincent Wei 9ea0e15dba try to match devfont without style 2019-01-13 17:42:27 +08:00
Vincent Wei 83c8984c74 support flipping glyph for subpixel rendering 2019-01-13 16:59:36 +08:00
Vincent Wei c975fe5b8d tune release notes 2019-01-13 16:23:57 +08:00
Vincent Wei b4569adbd5 skipp null pixels for subpixel glyph 2019-01-13 16:22:34 +08:00
Vincent Wei 4761333a1a skip null pixels for subpixel 2019-01-13 16:20:08 +08:00
Vincent Wei 715a44beeb typo for pitch 2019-01-13 14:32:49 +08:00
Vincent Wei e6bb4fa05f tune RELEASE NOTES 2019-01-13 14:24:14 +08:00
Vincent Wei c436af69bb fixbug: No need to make the pitch of FT2 monobitmap is single-byte aligned 2019-01-13 14:22:54 +08:00
290 changed files with 134968 additions and 29588 deletions
-2
View File
@@ -1,2 +0,0 @@
Beijing FMSoft Technologies Co., Ltd.. (http://www.fmsoft.cn)
+16
View File
@@ -0,0 +1,16 @@
The current main maintainers and/or developers:
* WEI Yongming
As employed engineers of [Beijing FMSoft Technologies Co., Ltd.],
the following people have participated in the development of MiniGUI Core:
* HOU Huihua
* WAN Zheng
* DONG Kai
* DONG Junjie
* YAN Xiaowei
For community contributors, please see RELASENOTES.md documentation.
[Beijing FMSoft Technologies Co., Ltd.]: http://www.fmsoft.cn
+2 -2
View File
@@ -3216,7 +3216,7 @@ alExtra.(xwyan)
* src/gui/lf_flat.c
* src/gui/lf_skin.c
08/24: ENHANCEMENT #1: Add a new method for FONTOPS: get_glyph_type to return
08/24: ENHANCEMENT #1: Add a new method for FONTOPS: get_char_type to return
the glyph type the devfont can give us.
* src/include/devfont.h
* src/font/*.c
@@ -4761,7 +4761,7 @@ create_skin_main_window_ex:
* ext/skin/skin.c
05/16. ENHANCEMENT #8: Support for UTF-16LE and UTF-16BE charsets/encodings.
* Change the definition of UChar32 to 'int'.
* Change the definition of Uchar32 to 'int'.
* include/gdi.h
05/16. ENHANCEMENT #11: Support for FreeType2.
+1 -1
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Standalone)"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v3.2.0
PROJECT_NUMBER = v3.4.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
+109 -98
View File
@@ -7,6 +7,7 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
1. Introduction
1. A brief building instruction
1. New features in version 3.4.x
1. New features in version 3.2.x
1. The runtime modes of MiniGUI
1. History
@@ -18,42 +19,42 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
## INTRODUCTION
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
User Interface) support system for embedded systems and smart IoT devices.
This is the version 3.2.x of MiniGUI maintained by WEI Yongming
This is the version 3.2.x of MiniGUI maintained by WEI Yongming
(Vincent Wei, https://github.com/VincentWei).
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial
use.
MiniGUI aims to provide a fast, stable, full-featured, and cross-platform
windowing and GUI support system, which is especially fit for
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
traditional RTOSes, such as VxWorks, ThreadX, Nucleus, pSOS, uC/OS-II,
windowing and GUI support system, which is especially fit for
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
traditional RTOSes, such as VxWorks, ThreadX, Nucleus, pSOS, uC/OS-II,
and OSE.
This is the MiniGUI core source tree, which provides windowing
and graphics interfaces as well as a lot of standard controls (tookit).
This is the MiniGUI core source tree, which provides windowing
and graphics interfaces as well as a lot of standard controls (tookit).
Besides MiniGUI core, FMSoft also provides some components
for the developers to develop app much easier:
* mGUtils: A MiniGUI component which contains miscellaneous utilities
like ColorSelectionDialogBox, FileOpenDialogBox, and so on.
* mGUtils: A MiniGUI component which contains miscellaneous utilities
like ColorSelectionDialogBox, FileOpenDialogBox, and so on.
* mGPlus: A MiniGUI component which provides support for advanced graphics
* mGPlus: A MiniGUI component which provides support for advanced graphics
functions like path, gradient, anti-aliase stretch, and color combination.
* mGEff: mGEff provides an animation framework for MiniGUI app.
* mGEff: mGEff provides an animation framework for MiniGUI app.
It also provides some popular UI/UE special effects.
* mGNCS: This component provides a new control set for MiniGUI app.
By using mGNCS, you can use miniStudio to develop MiniGUI app in
WYSIWYG way.
* mGNCS: This component provides a new control set for MiniGUI app.
By using mGNCS, you can use miniStudio to develop MiniGUI app in
WYSIWYG way.
* mGNCS4Touch: This component provides some new controls, which are
compliant to the new control API spec of mGNCS, for devices with
* mGNCS4Touch: This component provides some new controls, which are
compliant to the new control API spec of mGNCS, for devices with
a touch screen.
There are also some legacy MiniGUI components. We will not maintain these
@@ -61,7 +62,7 @@ components for MiniGUI core v3.2:
* mGi: An input method component for MiniGUI. This component provides
some typical input methods (such as softkey, hand-writing, and predict
text input for mobile phone) for MiniGUI apps.
text input for mobile phone) for MiniGUI apps.
* mGp: A printing component for MiniGUI. By using mGp, you can print
out the graphics created by MiniGUI app to general-purpose printers.
@@ -70,11 +71,11 @@ components for MiniGUI core v3.2:
provides a simple 3D API for app. You can use mG3d to create simple
3D UI.
MiniGUI is a free software project. In December 1998, the initiator of
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
License (GPL). In September 2002, the core developers of
MiniGUI founded FMSoft and started the commercial marketing with
the free software. By now, FMSoft still continues to release MiniGUI
MiniGUI is a free software project. In December 1998, the initiator of
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
License (GPL). In September 2002, the core developers of
MiniGUI founded FMSoft and started the commercial marketing with
the free software. By now, FMSoft still continues to release MiniGUI
as a free software project.
You can download the source code tarball of MiniGUI and the dependent libraries
@@ -82,27 +83,27 @@ from the download zone of the site:
http://www.minigui.com
FMSoft also releases some open source apps for MiniGUI on the site above,
FMSoft also releases some open source apps for MiniGUI on the site above,
for examples:
* mDolphin, licensed under Apache 2.0, is a full-featured
WEB/WAP browser, which is developed based on the open source browser
* mDolphin, licensed under Apache 2.0, is a full-featured
WEB/WAP browser, which is developed based on the open source browser
core WebKit and uses MiniGUI as its underlying graphics support system.
* mGallery, licensed under Apache 2.0, intends to
provide a total solution for PMP (Portable Multimedia Player),
* mGallery, licensed under Apache 2.0, intends to
provide a total solution for PMP (Portable Multimedia Player),
which uses MiniGUI as the graphics platform.
* mSpider, licensed under GPL 3.0, intends to provide a
* mSpider, licensed under GPL 3.0, intends to provide a
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
FMSoft had created the public repositories for MiniGUI core, MiniGUI
FMSoft had created the public repositories for MiniGUI core, MiniGUI
components, and other open source apps on GitHub. You can visit them on:
https://github.com/VincentWei
https://github.com/VincentWei
FMSoft also releases miniStudio, which is a WYSIWYG IDE for MiniGUI, as a shareware.
You can also download it from the official site of MiniGUI.
@@ -146,6 +147,15 @@ For more information, please run
$ ./configure --help
## NEW FEATURES IN VERSION 3.4.x
We introduce some new features in MiniGUI Version 3.4.x:
* The font and UNICODE related APIs are tuned or enhanced,
in order to support HybridOS Foundation C++ Library.
For more information, please refer to RELEASENOTES.md file.
## NEW FEATURES IN VERSION 3.2.x
We introduce some new features in MiniGUI Version 3.2.x:
@@ -154,7 +164,7 @@ We introduce some new features in MiniGUI Version 3.2.x:
to support 64-bit platform. For more information, please refer to
RELEASE-NOTES.md file.
Because of the changes of some APIs, we recommended strongly that you
Because of the changes of some APIs, we recommended strongly that you
use this version for new projects.
## THE RUNTIME MODES OF MINIGUI
@@ -164,64 +174,64 @@ You can configure and compile MiniGUI as one of three runtime modes:
* 'MiniGUI-Threads': A program running on MiniGUI-Threads can create
multiple cascaded windows in different threads, and all the windows
belong to a single process. MiniGUI-Threads is fit for some real-time
systems on Linux/uClinux, eCos, uC/OS-II, VxWorks, pSOS, ThreadX,
systems on Linux/uClinux, eCos, uC/OS-II, VxWorks, pSOS, ThreadX,
and OSE.
* 'MiniGUI-Processes': A program running on MiniGUI-Processes is
an independent process, which can also create multiple windows.
MiniGUI-Processes is fit for some complex embedded systems, such as
PDAs, Thin-Clients or STBs. This mode is only useful for full-featured
* 'MiniGUI-Processes': A program running on MiniGUI-Processes is
an independent process, which can also create multiple windows.
MiniGUI-Processes is fit for some complex embedded systems, such as
PDAs, Thin-Clients or STBs. This mode is only useful for full-featured
UNIX-like operating systems, like Linux.
* 'MiniGUI-Standalone': A single process version of MiniGUI. This mode
is useful for some small systems, like uClinux or RTOSes.
The original MiniGUI (version 1.0) run in MiniGUI-Threads mode.
It is based on POSIX-compliant thread library. And this thread-based
architecture of MiniGUI is very fit for most traditional embedded
operating systems, such as eCos, uC/OS-II, and VxWorks. However,
if you use embedded Linux, the architecture like X Window will have
better stability and scalability, because of the independent memory
It is based on POSIX-compliant thread library. And this thread-based
architecture of MiniGUI is very fit for most traditional embedded
operating systems, such as eCos, uC/OS-II, and VxWorks. However,
if you use embedded Linux, the architecture like X Window will have
better stability and scalability, because of the independent memory
address space of every process.
Since version 2.0, we provides a new runtime mode called MiniGUI-Processes.
You can use MiniGUI-Processes to run more than one MiniGUI-based
program in the form of UNIX process at the same time. MiniGUI-Processes
is a full-featured multi-process version of original MiniGUI -- You
can run a program based on MiniGUI-Processes from a program called
'mginit'. Just like X Window, the former process is called a client,
and the latter the server.
You can use MiniGUI-Processes to run more than one MiniGUI-based
program in the form of UNIX process at the same time. MiniGUI-Processes
is a full-featured multi-process version of original MiniGUI -- You
can run a program based on MiniGUI-Processes from a program called
'mginit'. Just like X Window, the former process is called a client,
and the latter the server.
Clients connect to the server via UNIX domain socket, and the server
receives and responses requests from clients. The server provides shared
resources for clients, manage window objects, and sends mouse
(or touch screen) and keyboard events to the active top-most client.
If a client exits or dies for some reasons, it will not damage other
Clients connect to the server via UNIX domain socket, and the server
receives and responses requests from clients. The server provides shared
resources for clients, manage window objects, and sends mouse
(or touch screen) and keyboard events to the active top-most client.
If a client exits or dies for some reasons, it will not damage other
clients and the server.
## HISTORY
About ten years have pasted since MiniGUI was initially created at
the end of 1998, and now it becomes much reliable and stable.
During the past years, many remarkable changes have taken place in
21 years have pasted since MiniGUI was initially created at
the end of 1998, and now it becomes much reliable and stable.
During the past years, many remarkable changes have taken place in
the MiniGUI project.
At the original, the version 0.2.xx was based on SVGALib and PThread
(LinuxThreads). Then the version 0.3.xx had many enhanced features
including Graphics Abstract Layer (GAL), Input Abstract Layer (IAL),
and the support for multiple charsets and multiple fonts.
At the original, the version 0.2.xx was based on SVGALib and PThread
(LinuxThreads). Then the version 0.3.xx had many enhanced features
including Graphics Abstract Layer (GAL), Input Abstract Layer (IAL),
and the support for multiple charsets and multiple fonts.
In version 1.0.00, we designed MiniGUI-Lite, which was more fit for
some complex embedded systems, such as PDAs, Thin-Clients, or STBs.
MiniGUI-Lite made the embedded systems more stable and efficient.
The version 1.0.00 provided the native fbcon engine based on Linux
frame buffer device directly as well.
In version 1.0.00, we designed MiniGUI-Lite, which was more fit for
some complex embedded systems, such as PDAs, Thin-Clients, or STBs.
MiniGUI-Lite made the embedded systems more stable and efficient.
The version 1.0.00 provided the native fbcon engine based on Linux
frame buffer device directly as well.
In the development of version 1.1.00, we re-wrote the GAL and GDI
interfaces, and provided some advanced video features, such as raster
operation, transparent blitting, alpha blending, and video hardware
acceleration. We also provided some important GDI functions, such as
In the development of version 1.1.00, we re-wrote the GAL and GDI
interfaces, and provided some advanced video features, such as raster
operation, transparent blitting, alpha blending, and video hardware
acceleration. We also provided some important GDI functions, such as
Ellipse, Arc, Polygon, and FloodFill.
In the development of version 1.6.0, we added advanced 2D graphics
@@ -238,7 +248,7 @@ A brief history description of the development progress lay below:
0) 1994 ~ 1996: MiniGUI DOS version.
1) Dec, 1998: Began to write.
2) Apr, 1999: The skeleton of MiniGUI, windowing sub-system
2) Apr, 1999: The skeleton of MiniGUI, windowing sub-system
and basic graphics device interfaces.
3) May, 1999: Timer, menu, and the skeleton of control sub-system.
4) Jun, 1999: Chinese input method (by Kang Xiaoning).
@@ -247,29 +257,29 @@ A brief history description of the development progress lay below:
7) Sep, 1999: Dialog boxes and message boxes.
8) Sep, 1999: Snapshot of screen or window.
9) Jan., 2000: VCOnGUI (Virtual Console on MiniGUI) version 0.2.02.
10) Mar., 2000: Linux distribution installer based-on MiniGUI for
10) Mar., 2000: Linux distribution installer based-on MiniGUI for
HappyLinux 1.0.
11) Jun., 2000: Began to develop version 1.0.xx.
12) Sep., 2000: MiniGUI version 0.3.06 released.
13) Oct., 2000: MiniGUI version 0.9.00 released.
14) Nov., 2000: MiniGUI version 0.9.96 released.
15) Jan., 2001: MiniGUI version 0.9.98 released. You can build
13) Oct., 2000: MiniGUI version 0.9.00 released.
14) Nov., 2000: MiniGUI version 0.9.96 released.
15) Jan., 2001: MiniGUI version 0.9.98 released. You can build
MiniGUI-Lite from this version.
16) Jan., 2001: MiniGUI version 1.0.00Beta1 released.
17) Feb., 2001: MiniGUI version 1.0.00Pre1 released.
18) Apr., 2001: MiniGUI version 1.0.00 released (2001/04/16).
18) Sep., 2001: MiniGUI version 1.1.0Pre1 released (2001/09/12).
19) Sep., 2001: MiniGUI version 1.0.9 released (2001/09/17),
this will be the last version of source branch 1.0.x.
20) Oct., 2001: MiniGUI version 1.1.0Pre4 released (2001/10/22).
19) Sep., 2001: MiniGUI version 1.0.9 released (2001/09/17),
this will be the last version of source branch 1.0.x.
20) Oct., 2001: MiniGUI version 1.1.0Pre4 released (2001/10/22).
This version have new GAL and GDI interfaces.
21) Mar., 2002: MiniGUI official version 1.1.0 released (2002/03/08).
21) Mar., 2002: MiniGUI official version 1.1.0 released (2002/03/08).
MiniGUI API Reference documentation version 0.9 released.
22) Mar., 2002: MiniGUI API Reference documentation version 1.0 released.
23) Apr., 2002: MiniGUI the new stable version 1.2.0 released (2002/04/11).
24) Sep., 2002: The main developers of MiniGUI founded a
new software corporation: Beijing FMSoft Technology Co., Ltd..
And the development and maintenance of MiniGUI changes from
23) Apr., 2002: MiniGUI the new stable version 1.2.0 released (2002/04/11).
24) Sep., 2002: The main developers of MiniGUI founded a
new software corporation: Beijing FMSoft Technology Co., Ltd..
And the development and maintenance of MiniGUI changes from
loosely-knit team to business organization.
25) Mar., 2003: MiniGUI official version 1.2.5 released (2003/03/23).
25) May., 2003: MiniGUI official version 1.2.6 released (2003/05/18).
@@ -295,18 +305,19 @@ A brief history description of the development progress lay below:
45) Aug., 2017: FMSoft released the latest source code of mDolphin under Apache 2.0.
46) Dec., 2017: FMSoft updated MiniGUI and miniStudio for latest Linux distributions.
47) Feb., 2018: FMSoft released MiniGUI version 3.2.
47) Jun., 2019: FMSoft released MiniGUI version 3.4.
## ABOUT THE AUTHORS
The original author of MiniGUI is WEI Yongming, and now MiniGUI is
maintained by FMSoft. For more information, please browse
The original author of MiniGUI is WEI Yongming, and now MiniGUI is
maintained by FMSoft. For more information, please browse
our home page: http://www.fmsoft.cn.
## IF YOU HAVE A PROBLEM
If you have any technical problem, advice or comment, please send
If you have any technical problem, advice or comment, please send
messages to consult@minigui.com.
@@ -314,15 +325,15 @@ messages to consult@minigui.com.
Q: Is GPL'd MiniGUI free for commercial use?
A: Simply no. FMSoft releases MiniGUI under GPLv3 license.
It is free for those who are 100% GPL and those who never copy, modify
and distribute MiniGUI. But if you want to use these GPL'd versions
A: Simply no. FMSoft releases MiniGUI under GPLv3 license.
It is free for those who are 100% GPL and those who never copy, modify
and distribute MiniGUI. But if you want to use these GPL'd versions
for commerce, you should get the commercial license from FMSoft first.
Q: Which operating system does MiniGUI support?
A: MiniGUI can run on Linux/uClinux, uC/OS-II, eCos, ThreadX, pSOS,
VxWorks, ThreadX, OSE, and even Win32. Any other real-time OSes can
A: MiniGUI can run on Linux/uClinux, uC/OS-II, eCos, ThreadX, pSOS,
VxWorks, ThreadX, OSE, and even Win32. Any other real-time OSes can
be supported theoretically.
Q: Which architecture does MiniGUI support?
@@ -332,19 +343,19 @@ A: x86 32/64-bit, ARM 32/64-bit (e.g., ARMv7 and ARM Cortex-A7),
Q: Does MiniGUI offer the support for grey LCD with 4bpp (bits per pixel)?
A: Yes, it offers. It even offers the support for 1bpp and 2bpp LCD.
A: Yes, it offers. It even offers the support for 1bpp and 2bpp LCD.
## NOT FREE FOR COMMERCIAL USE
MiniGUI and its components are licensed under the GPL license.
So any links about MiniGUI must follow GPL. If you cannot accept GPL,
you need to be licensed from FMSoft. If you wonder that if you need
MiniGUI and its components are licensed under the GPL license.
So any links about MiniGUI must follow GPL. If you cannot accept GPL,
you need to be licensed from FMSoft. If you wonder that if you need
the commercial license of MiniGUI, please refer to the LICENSE-POLICY file.
We provide you the commercial license of MiniGUI according to the number
of the run-time binary copies of MiniGUI. If you are interested in
the commercial license of MiniGUI, please write to sales@minigui.com.
We provide you the commercial license of MiniGUI according to the number
of the run-time binary copies of MiniGUI. If you are interested in
the commercial license of MiniGUI, please write to sales@minigui.com.
## COPYING
+152 -86
View File
@@ -10,6 +10,8 @@ Please report any bugs and incompatibilities in
### What's new in this version
In this version, we mainly enhanced and tuned the APIs of font rendering.
#### Tunning the logical font APIs
The styles of LOGFONT changed.
@@ -17,37 +19,42 @@ The styles of LOGFONT changed.
* Add new rendering style:
1. `FS_RENDER_ANY`: Not specified
1. `FS_RENDER_MONO`:
1. `FS_RENDER_OUTLINE`:
1. `FS_RENDER_GREY`:
1. `FS_RENDER_SUBPIXEL`:
* Remove some bad style definitions:
1. `FS_WEIGHT_BOOK`, use `FS_RENDER_GREY` instead.
1. `FS_WEIGHT_LIGHT`, use `FS_RENDER_OUTLINE` instead.
* Introduced the new weight styles:
* Some old styles are deprecated:
1. `FS_WEIGHT_BOOK`; use `FS_RENDER_GREY` instead.
1. `FS_WEIGHT_SUBPIXEL`; use `FS_RENDER_SUBPIXEL` instead.
* Introduced or redefined the weight styles to follow OpenType specification:
1. `FONT_WEIGHT_ANY`: Not specified
1. `FONT_WEIGHT_THIN`:
1. `FONT_WEIGHT_EXTRA_LIGHT`:
1. `FONT_WEIGHT_LIGHT`:
1. `FONT_WEIGHT_REGULAR`:
1. `FONT_WEIGHT_MEDIUM`:
1. `FONT_WEIGHT_DEMIBOLD`:
1. `FONT_WEIGHT_BOLD`:
1. `FONT_WEIGHT_EXTRA_BOLD`:
1. `FONT_WEIGHT_BLACK`:
1. `FONT_WEIGHT_THIN`: Thin.
1. `FONT_WEIGHT_EXTRA_LIGHT`: Extra light (Ultra Light).
1. `FONT_WEIGHT_LIGHT`: Light.
1. `FONT_WEIGHT_REGULAR`: Regular (Normal).
1. `FONT_WEIGHT_MEDIUM`: Medium.
1. `FONT_WEIGHT_DEMIBOLD`: Demi Bold (Semi Bold)
1. `FONT_WEIGHT_BOLD`: Bold.
1. `FONT_WEIGHT_EXTRA_BOLD`: Extra Bold (Ultra Bold).
1. `FONT_WEIGHT_BLACK`: Black (Heavy).
* Introduce the new decoration styles and replace
`FONT_UNDERLINE_LINE` and `FONT_STRUCKOUT_LINE` with them:
1. `FONT_DECORATE_ANY`:
1. `FONT_DECORATE_NONE`:
1. `FONT_DECORATE_UNDERLINE`:
1. `FONT_DECORATE_STRUCKOUT`:
1. `FONT_DECORATE_BOTH`:
1. `FONT_DECORATE_ANY`: Not specified.
1. `FONT_DECORATE_NONE`: None.
1. `FONT_DECORATE_UNDERLINE`: glyphs are underscored.
1. `FONT_DECORATE_STRUCKOUT`: glyphs are overstruck.
1. `FONT_DECORATE_US`: Both `FONT_DECORATE_UNDERLINE` and `FONT_DECORATE_STRUCKOUT`.
1. `FONT_DECORATE_OUTLINE`: Outline (hollow) glyphs.
1. `FONT_DECORATE_REVERSE`: Reverved for future. Glyphs have their foreground and background reversed.
* The following style are deprecated:
1. `FONT_OTHER_LCDPORTRAIT`
1. `FONT_OTHER_LCDPORTRAITKERN`
For the back-compatibility, you can still use `CreateLogFont` to
create a new LOGFONT. However, the `FS_WEIGHT_BOOK` and `FS_WEIGHT_LIGHT`
will be ignored, and the rendering type will be set as `FS_RENDER_ANY`.
For a new app, you should use the new function `CreateLogFontEx` to
create a LOGFONT, and specify the weight and rendering method of the glyph.
For new app, you should use the new function `CreateLogFontEx` to
create a LOGFONT.
For the back-compatibility, you can still use `CreateLogFont` to create a new
LOGFONT. However, `FS_WEIGHT_BOOK` will be treated `FS_WEIGHT_REGULAR` and
`FS_RENDER_GREY`, while `FS_WEIGHT_SUBPIXEL` will be treated
`FS_WEIGHT_REGULAR` and `FS_RENDER_SUBPIXEL`.
You can still use `CreateLogFontByName` to create a new LOGFONT.
But the style string in the font name changed from
@@ -58,21 +65,75 @@ to
<weight><slant><flipping><other><decoration><rendering>
Obviously, `<underline>` and `<struckout>` are merged to `<decoration>`
Note that `<underline>` and `<struckout>` are merged to `<decoration>`
in order to keep the style string is still 6-character long.
Now, if you want to use the rendering style SUPIXEL for a TTF font,
please define the font name in the following way:
Consequently, if you want to use the rendering method SUPIXEL for a TTF font,
please define the logical font name in the following way:
ttf-Courier-rrncns-*-16-UTF-8
#### Changes of font rendering manners
Moreover, the family name of a DEVFONT supports aliases since 3.4.0:
<fonttype>-<family[,aliase]*>-<styles>-<width>-<height>-<charset[,charset]*>
for example:
ttf-Arial,Sans Serif-rrncnn-8-16-ISO8859-1,UTF-8
ttf-courier,monospace,serif-rrncnn-8-16-ISO8859-1,UTF-8
Note that the length of one DEVFONT name can not exceed 255 bytes.
#### Changed APIs
* The fields `height` and `descent` have been removed from GLYPHINFO struct.
One should get the font metrics information by calling `GetFontMetrics` function
if you want to get the height and descent data of one font.
* More fields added for GLYPHBITMAP struct in order to return the completed
rasterized glyph bitmap information.
* `GetGlyphInfo` now can return the basic glyph type and break type of a
UNICODE character. If the glyph is an ASCII character, the old `MCHAR_TYPE`
can also be returned.
* Rename `mg_FT_LcdFilter` to `FT2LCDFilter` in order to follow MiniGUI naming
rules.
* Rename `UChar32` to `Uchar32` and `UChar16` to `Uchar16` in order to
avoid the conflict with typedef of UChar32 in 'unicode/umachine.h'.
* Redefine `Uchar32` and `Glyph32` as `Uint32` instead of `int`.
#### New APIs
* `GetGlyphsByRules` function calculates and allocates the glyph string from
a multi-byte string under the specified white space rule and transformation
rule.
* `GetGlyphsExtentPointEx` function gets the visual extent information
of a glyph string which can fit in a line with the specified maximal extent.
* `DrawGlyphStringEx` function draws a glyph string to the specific
positions of a DC.
* `CreateLogFontIndirectEx` creates a new LOGFONT by using the value of
an existed LOGFONT but with a new rotation value.
#### Others
* Support for FreeType1 removed.
You should always use FreeType2 to support vector fonts, such as TrueType
fonts (TTF), TrueType collections (TTC), OpenType fonts (OTF, both TrueType
and CFF variants), OpenType collections (OTC), and Type 1 fonts (PFA and PFB).
### Other Changes
* A new BITMAP type: `BMP_TYPE_REPLACEKEY`. When `bmType` of a BITMAP object
has this bit set, any pixel which is equal to `bmColorKey` will be replaced by
`bmColorRep`.
## Version 3.2.1
The MiniGUI development team announces the availability of MiniGUI 3.2.1.
@@ -84,23 +145,23 @@ Please report any bugs and incompatibilities in
### What's new in this version
* ENHANCEMENTS:
1. Add a new key `dpi` for NEWGAL engine to define the DPI of the screen.
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.
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
represents the shadow frame buffer of the screen.
represents the shadow frame buffer of the screen.
* configure option: `--enable-syncupdate`
* macro: `_MGUSE_SYNC_UPDATE`
1. New API: `UpdateInvalidClient`. You can use this function to update
the invalid client region of a window instantly.
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. Modified logic for checking JPEG format (10km).
1. Add `__mg_save_jpg` function for storing MYBITMAP as JPEG file (@10km).
1. Modified logic for checking JPEG format (@10km).
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.
1. Enhance commlcd engint to support more pixel type and synchronously update.
1. New USVFB IAL engine and NEWGAL engine for web display server.
@@ -116,6 +177,11 @@ Please report any bugs and incompatibilities in
* BUGFIXING:
1. handle `PNG_COLOR_TYPE_GRAY_ALPHA` color type of PNG files.
1. Fix a bug to free a null pointer (ReleaseDC).
1. No need to make the pitch of FT2 monobitmap is single-byte aligned.
This bug may generate dirty dots for monobitmap glyph from TTF.
1. Skip null pixels for SUBPIXEL glyphs. This bug will always show background
pixels of one SUBPIXEL glyph.
1. Fix the bug of wrong bounding box handling for SUBPIXEL rendering of glyph.
* TUNNING:
1. Tune GLYPHINFO structure and GetGlyphInfo to return BIDI glyph type.
@@ -126,12 +192,12 @@ The MiniGUI development team announces the availability of MiniGUI 3.2.0.
All users of MiniGUI are recommended strongly to use this version for new
MiniGUI apps. Please report any bugs and incompatibilities in
https://github.com/VincentWei/minigui.
https://github.com/VincentWei/minigui
### What's new in this version
* Support for 64-bit platform. Note that the definitions of some types
and APIs changed.
* Support for 64-bit platform. Note that the definitions of some types
and APIs changed.
* Compliant to the latest GCC, and eliminate all compilation warnings.
### Type changes
@@ -139,37 +205,37 @@ MiniGUI apps. Please report any bugs and incompatibilities in
#### Changes of handle types
All handle types, including `GHANDLE`, `HWND`, `HDC`, etc.,
are now defined as aliases of `PVOID` (`typedef void* PVOID`).
You may need to check your code to reflect this change.
are now defined as aliases of `PVOID` (`typedef void* PVOID`).
You may need to check your code to reflect this change.
#### Changes of integer types.
The type of `DWORD` now has pointer precision. That is,
the size of `DWORD` will be 4 bytes on 32-bit platform, and 8 bytes on
64-bit platform.
the size of `DWORD` will be 4 bytes on 32-bit platform, and 8 bytes on
64-bit platform.
Similarly, `WPARAM` and `LPARAM` now have pointer precision.
`WORD` and `SWORD` has a half of pointer precision. The size of these
`WORD` and `SWORD` has a half of pointer precision. The size of these
two types is 2 bytes on 32-bit platform, and 4 bytes on 64-bit platform.
`RGBCOLOR` now is defined as an alias of `DWORD32` (see below).
Note that the type of `BYTE` always has the size of 8-bit on both
Note that the type of `BYTE` always has the size of 8-bit on both
32-bit and 64-bit platforms.
#### New integer types:
We introduce `DWORD32` and `SDWORD32` types,
which have the size of 4 bytes on both 32-bit and 64-bit platforms.
You should use these types when reading/writing 32-bit integers from
a binary files for the portability. Of course, you can also use
We introduce `DWORD32` and `SDWORD32` types,
which have the size of 4 bytes on both 32-bit and 64-bit platforms.
You should use these types when reading/writing 32-bit integers from
a binary files for the portability. Of course, you can also use
`Uint32` or `Sint32` types.
Similarly, we introduce `WORD16` and `SWORD16` types,
which have the size of 2 bytes on both 32-bit and 64-bit platforms.
You should use these types when reading/writing 16-bit integers from
a binary file for the portability. Of course, you can also use
which have the size of 2 bytes on both 32-bit and 64-bit platforms.
You should use these types when reading/writing 16-bit integers from
a binary file for the portability. Of course, you can also use
`Uint16` or `SUint16` types.
`LRESULT` is defined for window callback procedure, and it has
@@ -182,7 +248,7 @@ pointer precision.
#### Integer macros
`MAKEWPARAM`: this new macro makes a WPARAM value by using four bytes.
On the contrary, `FIRSTBYTE`, `SECONDBYTE`, `THIRDBYTE`, and `FOURTH`
On the contrary, `FIRSTBYTE`, `SECONDBYTE`, `THIRDBYTE`, and `FOURTH`
macros get the four bytes from a `WPARAM` or a `Uint32` value.
`MAKEWORD16`: this new macro makes a 16-bit word by using two bytes.
@@ -192,12 +258,12 @@ word on 64-bit platform.
Note that `MAKELONG` macro always makes a `DWORD` integer, which has pointer
precision. Meanwhile, `MAKELONG32` macro makes a `Uint32` integer.
Note that `MakeRGB` and `MakeRGBA` macros always make `DWORD32` integers.
In contract, `GetRValue`, `GetRValue`, `GetBValue`, `GetAValue` always
get red, green, blue, and alpha components from a `DWORD32` integer
Note that `MakeRGB` and `MakeRGBA` macros always make `DWORD32` integers.
In contract, `GetRValue`, `GetRValue`, `GetBValue`, `GetAValue` always
get red, green, blue, and alpha components from a `DWORD32` integer
respectively.
Note that you should use `(-1)` instead of `0xFFFFFFFF` for the invalid
Note that you should use `(-1)` instead of `0xFFFFFFFF` for the invalid
integer or pointer type value for good portability.
#### Structure and functions
@@ -211,16 +277,16 @@ The main changes in structure and functions:
* We now use a `LRESULT` integer for the return value of a window callback
procedure. Now it is safe to return a pointer from the callback procedure
on 64-bit platform. This is a very important change, and it will break the
on 64-bit platform. This is a very important change, and it will break the
source compatibilty of your code. You should check the source code (use
gcc option `-Wall`) carefully.
* We now use a `LINT` integer for the identifier of a timer. So you can pass
a pointer as the identifier of the timer on 64-bit platform. mGNCS uses
a pointer as the identifier of the timer on 64-bit platform. mGNCS uses
MiniGUI timer in this manner.
* We now use a `LINT` integer for the identifier of a control/widget and a
menu item. So you can pass a pointer as the identifier of the timer on
menu item. So you can pass a pointer as the identifier of the timer on
64-bit platform. mGNCS works in this manner.
##### Message
@@ -229,7 +295,7 @@ The strcuture `MSG` and all message-related functions changed.
For example, the prototype of `SendMessage` changed from
int SendMessage (HWND hWnd, int nMsg, WPARAM wParam, LPARAM lParam)
to
LRESULT SendMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
@@ -237,7 +303,7 @@ to
_IMPORTANT NOTE_
For best portability, you should use `FIRSTBYTE` to `FOURTHBYTE` macros
to get the bytes of a character when you extract the bytes from `WPARAM`
to get the bytes of a character when you extract the bytes from `WPARAM`
parameter of a `MSG_CHAR` message:
MSG_CHAR
@@ -247,10 +313,10 @@ parameter of a `MSG_CHAR` message:
unsigned char ch_buff [2] = THIRDBYTE(wParam);
unsigned char ch_buff [3] = FOURTHBYTE(wParam);
##### Window callback procedure
##### Window callback procedure
Furthermore, the structure and functions to register window class,
create main window, and create dialog box changed. For example, the prototype
Furthermore, the structure and functions to register window class,
create main window, and create dialog box changed. For example, the prototype
of `WNDPROC` changed from
typedef int (* WNDPROC)(HWND, int, WPARAM, LPARAM)
@@ -289,8 +355,8 @@ to
_IMPORTANT NOTE_
If you use `MSG_COMMAND` message to handle the notification sent from children
controls, you should make sure the identifier is small enough on 64-bit
platform. Because MiniGUI packs the identifier and the notification code
controls, you should make sure the identifier is small enough on 64-bit
platform. Because MiniGUI packs the identifier and the notification code
in the `WPARAM` parameter:
MSG_COMMAND
@@ -301,8 +367,8 @@ in the `WPARAM` parameter:
The code above will not work on 64-bit if you use a pointer as the identifier
of the control.
Therefore, we recommend strongly that you use a `NOTIFYPOROC` callback to
handle the notification sent from controls. To do this, please call
Therefore, we recommend strongly that you use a `NOTIFYPOROC` callback to
handle the notification sent from controls. To do this, please call
`SetNotificationCallback` function to set the notification callback function.
##### Time and timer
@@ -328,10 +394,10 @@ to
In addition, we correct the bad or wrong definitions of some APIs:
* `DWORD2PIXEL` to `DWORD2Pixel`. The old one has a bad name.
* `GetWindowRendererFromName`: The return type changes from
* `GetWindowRendererFromName`: The return type changes from
`const WINDOW_ELEMENT_RENDERER*` to `WINDOW_ELEMENT_RENDERER*`.
So you can overload some methods directly of a renderer.
* `GetDefaultWindowElementRenderer`: The return type changes from
* `GetDefaultWindowElementRenderer`: The return type changes from
`const WINDOW_ELEMENT_RENDERER*` to `WINDOW_ELEMENT_RENDERER*`.
So you can overload some methods directly of the default renderer.
@@ -345,15 +411,15 @@ We add some new options for autoconf script (`configure`):
* `--enable-develmode`: You should use this option to define `_DEBUG` macro,
enable `-Wall -Werror` option, and enable all features of MiniGUI,
if you were a MiniGUI developer.
if you were a MiniGUI developer.
## Version 3.0.13
The MiniGUI development team announces the availability of MiniGUI 3.0.13.
All users of MiniGUI are encouraged to test this version carefully, and
All users of MiniGUI are encouraged to test this version carefully, and
report any bugs and incompatibilities in
https://github.com/VincentWei/minigui.
https://github.com/VincentWei/minigui.
### What's new in this version
@@ -361,7 +427,7 @@ report any bugs and incompatibilities in
* The autoconf/automake config scripts are cleaned up.
* Remove most of compilation warnings (not used variables).
* Remove some inline function definitions, especially GetIMEPos/SetIMEPos.
* Fix some bugs.
* Fix some bugs.
### API changes
@@ -370,12 +436,12 @@ report any bugs and incompatibilities in
* [NEW] ToUnicode/ToAscii: Converts the key code between Unicode and ASCII.
* [NEW] GetWindowRegion: The function obtains a copy of the window region of a window.
* [NEW] InvalidateRegion: Invalidates the client area within the specified region.
* [NEW] ValidateRect: Validates the client area within a rectangle by removing the
* [NEW] ValidateRect: Validates the client area within a rectangle by removing the
rectangle from the update region of the specified window.
* [NEW] ValidateRegion: Validates the client area within a region by removing the
* [NEW] ValidateRegion: Validates the client area within a region by removing the
region from the current update region of the specified window.
* [NEW] GetUpdateRegion: Copy the update region of a window to a region.
* [NEW] AdjustWindowRectEx: Calculates the required size of the window rectangle
* [NEW] AdjustWindowRectEx: Calculates the required size of the window rectangle
based on the desired size of the client rectangle.
* [NEW] WindowFromPointEx: Retrieves a handle to the window that contains the specified point.
* [NEW] ChildWindowFromPointEx: Retrieves a handle to the child window that contains the
@@ -385,15 +451,15 @@ report any bugs and incompatibilities in
* [ADJUST] WindowFromPoint: normal function -> inline function.
* [ADJUST] ChildWindowFromPoint: normal function -> inline function.
* [ADJUST] ScrollWindow: normal function -> inline function.
## Version 3.0.2
The MiniGUI development team announces the availability of MiniGUI 3.0.2.
All users of MiniGUI are encouraged to test this version carefully, and
All users of MiniGUI are encouraged to test this version carefully, and
report any bugs and incompatibilities in
https://github.com/VincentWei/minigui.
https://github.com/VincentWei/minigui.
### What's new in this version
@@ -402,20 +468,20 @@ report any bugs and incompatibilities in
* Support for Look and Feel (LF) concept.
* Remove SKIN interfaces of MGExt library, move MGExt library and vcongui into mGUtils component.
* Newly added bitmap font.
* Developing interfaces of desktop for MiniGUI.
* Developing interfaces of desktop for MiniGUI.
* Support direct draw to DC for higher efficiency.
* Enhancement of resource management
* Enhancement of controls: Support of independent scrollbar and transparent control.
* Enhancement of font and character set, support bidi text support.
* Enhancement of zoom of picture
### API changes
* [NEW] ScaleBitmapEx: a bilinear interpolation algorithm which is better than the original.
* [NEW] GetWindowInfo: get New structure WINDOWINFO.
* [NEW] CreateMainWindowEx: enhance of CreeateMainWindow, compatiable with CreeateMainWindow.
* [NEW] CreateWindowEx2enhance of CreateWindowEx2, compatiable with CreateWindowEx2.
* [NEW] CreateWindowEx2enhance of CreateWindowEx2, compatiable with CreateWindowEx2.
* [NEW] DialogBoxIndirectParamEx: new create dialog.
* [NEW] CreateMainWindowIndirectParamEx:new create dialog.
* [NEW] GetWindowRendererFromName: get LF renderer by name
@@ -429,7 +495,7 @@ report any bugs and incompatibilities in
* [NEW] CreateBMPDevFont: create an bitmap device font.
* [NEW] AddGlyphsToBMPFont: add an bitmap font glyph.
* [NEW] DestroyBMPFont: destroy bitmap device font.
* [NEW] SetCustomDesktopOperationSet: set the custom desktop operation set.
* [NEW] SetCustomDesktopOperationSet: set the custom desktop operation set.
* [NEW] DesktopUpdateAllWindow: refresh all windows on the desktop.
* [NEW] PopupDesktopMenu: pop up a menu on the desktop
* [NEW] GetTextAlign: get the current text-alignment flags of a DC.
@@ -437,5 +503,5 @@ report any bugs and incompatibilities in
* [NEW] SetWindowMask: set non-rectangle window mask rect.
* [NEW] SetWindowRegion: set non-rectangle window visible region
* [NEW] LockDCEx: support for directly read and write the pixels in a DC.
* [NEW] CreateSecondaryDC: Creates a secondary window DC of a window.
* [NEW] CreateSecondaryDC: Creates a secondary window DC of a window.
* [NEW] SetSecondaryDC:set a window's secondary DC and the callback for double buffer window.
+3 -3
View File
@@ -1,9 +1,9 @@
Version 3.2.0 (2018/02/10)
Version 3.4.0 (2019/06/30)
This release needs the following resource packages:
* minigui-res-3.0.13.tar.gz
* minigui-res-3.4.0.tar.gz
The latest samples package is:
* mg-samples-3.2.0.tar.gz
* mg-samples-3.4.0.tar.gz
+115 -94
View File
@@ -76,7 +76,8 @@ AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_FUNC_MMAP
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)
AC_CHECK_FUNCS(posix_memalign memalign valloc)
dnl ========================================================================
dnl User selectable options
@@ -164,7 +165,8 @@ build_incorefont_times="yes"
build_sef_support="no"
build_qpf_support="no"
use_ttf_lib="ft2"
build_ttf_support="yes"
build_complex_scripts="yes"
build_ttfcache_support="yes"
build_bmpf_support="yes"
@@ -193,6 +195,7 @@ build_eucjp_support="no"
build_shiftjis_support="no"
build_unicode_support="yes"
build_full_unicode="yes"
dnl Keyboard layout specific options
use_kbd_hebrewpc="no"
@@ -389,7 +392,7 @@ AC_ARG_ENABLE(netial,
build_net_ial_engine=$enableval)
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)
AC_ARG_ENABLE(mstar_ial,
@@ -536,14 +539,18 @@ AC_ARG_ENABLE(sefsupport,
[ --enable-sefsupport build support for koxomo scripteasy (SEF) <default=no>],
build_sef_support=$enableval)
AC_ARG_WITH(ttfsupport,
[ --with-ttfsupport=ft2/none How to support TrueType font (FreeType 2 or None) <default=ft2>],
use_ttf_lib=$withval)
AC_ARG_ENABLE(ttfsupport,
[ --enable-ttfsupport build support for TrueType/OpenType (needs FreeType2 library) <default=yes>],
build_ttf_support=$enableval)
AC_ARG_ENABLE(ttfcache,
[ --enable-ttfcache include ttf cache support <default=no>],
[ --enable-ttfcache build ttf cache support <default=no>],
build_ttfcache_support=$enableval)
AC_ARG_ENABLE(complexscripts,
[ --enable-complexscripts build support for complex scripts (needs HarzBuff library) <default=yes>],
build_complex_scripts=$enableval)
AC_ARG_ENABLE(bmpfsupport,
[ --enable-bmpfsupport build support for Bitmap Font (bmpf) <default=yes>],
build_bmpf_support=$enableval)
@@ -636,6 +643,10 @@ AC_ARG_ENABLE(unicodesupport,
[ --enable-unicodesupport include UNICODE (ISO-10646-1 and UTF-8 encoding) support <default=yes>],
build_unicode_support=$enableval)
AC_ARG_ENABLE(fullunicode,
[ --enable-fullunicode include support for full UNICODE code points <default=yes>],
build_full_unicode=$enableval)
AC_ARG_ENABLE(kbdhebrewpc,
[ --enable-kbdhebrewpc include keyboard layout for Hebrew PC keyboard <default=no>],
use_kbd_hebrewpc=$enableval)
@@ -834,7 +845,7 @@ CheckFBCON()
AC_ARG_ENABLE(videofbcon,
[ --enable-videofbcon include FrameBuffer console NEWGAL engine <default=yes>],
enable_video_fbcon=$enableval)
if test x$enable_video_fbcon = xyes; then
if test "x$enable_video_fbcon" = "xyes"; then
AC_MSG_CHECKING(for FrameBuffer console support)
video_fbcon=no
AC_TRY_COMPILE([
@@ -846,7 +857,7 @@ CheckFBCON()
video_fbcon=yes
])
AC_MSG_RESULT($video_fbcon)
if test x$video_fbcon = xyes; then
if test "x$video_fbcon" = "xyes"; then
AC_DEFINE(_MGGAL_FBCON, 1,
[Define if include FrameBuffer console NEWGAL engine])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
@@ -856,7 +867,7 @@ CheckFBCON()
AC_CHECK_LIB(pciaccess, pci_system_init,
DEP_LIBS="$DEP_LIBS -lpciaccess", have_pciaccess="no")
if test x$have_pciaccess = xyes; then
if test "x$have_pciaccess" = "xyes"; then
AC_DEFINE(_MGHAVE_PCIACCESS, 1,
[Define if PCIAccess lib is available])
LDFLAGS="$LDFLAGS -lpciaccess"
@@ -892,21 +903,21 @@ CheckXVFB()
[ --enable-videortosxvfb include RTOS Virtual FrameBuffer NEWGAL engine <default=no>. Please disable pcxvfb to enable rtosxvfb],
enable_video_rtos_xvfb=$enableval)
if test "x$enable_video_pc_xvfb" = "xyes"; then
dnl CheckPCXVFB
if test "x$enable_video_pc_xvfb" = "xyes"; then
dnl CheckPCXVFB
AC_DEFINE(_MGGAL_PCXVFB, 1,
[Define if include PC Virtual FrameBuffer NEWGAL engine])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS pcxvfb"
VIDEO_DRIVERS="$VIDEO_DRIVERS pcxvfb/libvideo_pcxvfb.la"
else
if test "x$enable_video_rtos_xvfb" = "xyes"; then
dnl CheckRTOSXVFB
else
if test "x$enable_video_rtos_xvfb" = "xyes"; then
dnl CheckRTOSXVFB
AC_DEFINE(_MGGAL_RTOSXVFB, 1,
[Define if include RTOS Virtual FrameBuffer NEWGAL engine])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS rtos_xvfb"
VIDEO_DRIVERS="$VIDEO_DRIVERS rtos_xvfb/libvideo_rtos_xvfb.la"
fi
fi
fi
fi
}
@@ -1099,7 +1110,7 @@ CheckDirectFBVideo()
[ --enable-videodfb include NEWGAL engine for DirectFB <default=no>],
enable_video_dfb=$enableval)
if test x$enable_video_dfb = xyes; then
if test "x$enable_video_dfb" = "xyes"; then
AC_MSG_CHECKING(for DirectFB support)
video_dfb=no
AC_TRY_COMPILE([
@@ -1109,7 +1120,7 @@ CheckDirectFBVideo()
video_dfb=yes
])
AC_MSG_RESULT($video_dfb)
if test x$video_dfb = xyes; then
if test "x$video_dfb" = "xyes"; then
AC_DEFINE(_MGGAL_DFB, 1,
[Define if include NEWGAL engine for DirectFB])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS dfb"
@@ -1121,7 +1132,7 @@ CheckDirectFBVideo()
[ --enable-videost7167 include NEWGAL engine for ST7167 on DirectFB <default=no>],
enable_video_dfb_st7167=$enableval)
if test x$enable_video_dfb_st7167 = xyes; then
if test "x$enable_video_dfb_st7167" = "xyes"; then
AC_DEFINE(_MGGAL_DFB_ST7167, 1,
[Define if include ST7167 subdriver for NEWGAL engine of DirectFB])
fi
@@ -1515,11 +1526,11 @@ AC_ARG_WITH(targetname,
case "$with_targetname" in
fmsoft)
AC_DEFINE(__TARGET_FMSOFT__, 1,
[Define for FMSoft internal use])
[Define for FMSoft internal use])
;;
mstudio)
AC_DEFINE(__TARGET_MSTUDIO__, 1,
[Define for FMSoft miniStudio])
[Define for FMSoft miniStudio])
;;
stb810)
AC_DEFINE(__TARGET_STB810__, 1,
@@ -1547,11 +1558,11 @@ case "$with_targetname" in
;;
bfin)
AC_DEFINE(__TARGET_BLACKFIN__, 1,
[Define for Blackfin run uClinux])
[Define for Blackfin run uClinux])
;;
c33l05)
AC_DEFINE(__TARGET_C33L05__, 1,
[Define for EPSON C33L05 (axLinux)])
[Define for EPSON C33L05 (axLinux)])
;;
S3C6410)
CFLAGS="$CFLAGS -D_WITH_TARGET_S3C6410"
@@ -1977,33 +1988,29 @@ if test "x$build_upf_support" = "xyes"; then
fi
dnl Check FreeType lib
case "$use_ttf_lib" in
ft2)
dnl Check for FreeType2 library
if test "x$build_ttf_support" = "xyes"; then
dnl Check for FreeType2 library
AC_CHECK_LIB(freetype, FT_Library_Version,
DEP_LIBS="$DEP_LIBS -lfreetype",
use_ttf_lib="none")
;;
ft1)
dnl Check for FreeType1 library
AC_CHECK_LIB(ttf, TT_FreeType_Version,
DEP_LIBS="$DEP_LIBS -lttf",
use_ttf_lib="none")
;;
*)
use_ttf_lib="none"
;;
esac
build_ttf_support="no")
fi
dnl Dealing with TTF cache size
if test "x$build_ttf_support" = "xyes"; then
if test "x$build_complex_scripts" = "xyes"; then
dnl Check for HarfBuzz library
AC_CHECK_LIB(harfbuzz, hb_version,
DEP_LIBS="$DEP_LIBS -lharfbuzzex",
build_complex_scripts="no")
fi
dnl Dealing with TTF cache size
case "$use_ttf_lib" in
ft1|ft2)
if test "x$build_ttfcache_support" = "xyes"; then
AC_DEFINE(_MGFONT_TTF_CACHE, 1,
[Define if include ttf cache])
AC_ARG_WITH(ttfcachesize,
[ --with-ttfcachesize=[64/128/256/512/1024]])
[ --with-ttfcachesize=[64/128/256/512/1024/2048]])
case "$with_ttfcachesize" in
64)
@@ -2026,79 +2033,85 @@ case "$use_ttf_lib" in
AC_DEFINE(_MGTTF_CACHE_SIZE, 1024,
[Define if compile max ttf cahce size for 1024k])
;;
2048)
AC_DEFINE(_MGTTF_CACHE_SIZE, 2048,
[Define if compile max ttf cahce size for 2048k])
;;
*)
AC_DEFINE(_MGTTF_CACHE_SIZE, 256,
[Define if compile max ttf cahce size for 256k])
AC_DEFINE(_MGTTF_CACHE_SIZE, 1024,
[Define if compile max ttf cahce size for 1024k (default value)])
;;
esac
AC_ARG_WITH(ttfcachenum,
[ --with-mttfcachenum=[10/20/40]])
case "$with_mttfcachenum" in
10)
AC_DEFINE(_MGMAX_TTF_CACHE, 10,
[Define if compile max ttf cahce number for 10])
[ --with-ttfcachenum=[16/32/64/128]])
case "$with_ttfcachenum" in
16)
AC_DEFINE(_MGMAX_TTF_CACHE, 16,
[Define if compile max ttf cahce number for 16])
;;
20)
AC_DEFINE(_MGMAX_TTF_CACHE, 20,
[Define if compile max ttf cahce number for 20])
32)
AC_DEFINE(_MGMAX_TTF_CACHE, 32,
[Define if compile max ttf cahce number for 32])
;;
40)
AC_DEFINE(_MGMAX_TTF_CACHE, 40,
[Define if compile max ttf cahce number for 40])
64)
AC_DEFINE(_MGMAX_TTF_CACHE, 64,
[Define if compile max ttf cahce number for 64])
;;
128)
AC_DEFINE(_MGMAX_TTF_CACHE, 128,
[Define if compile max ttf cahce number for 128])
;;
*)
AC_DEFINE(_MGMAX_TTF_CACHE, 10,
[Define if compile max ttf cahce number for 10 (default value)])
AC_DEFINE(_MGMAX_TTF_CACHE, 32,
[Define if compile max ttf cahce number for 32 (default value)])
;;
esac
fi
;;
esac
fi
dnl Dealing with CFLAGS and LDFLAGS
case "$use_ttf_lib" in
ft1)
build_unicode_support="yes"
if test "x$build_complex_scripts" = "xyes"; then
build_ttf_support="yes"
AC_DEFINE(_MGCOMPLEX_SCRIPTS, 1,
[Define if support complex scripts based on HarfBuzz])
AC_DEFINE(_MGFONT_TTF, 1,
[Define if support TrueType font])
AC_ARG_WITH(hb_includes,
[ --with-hb-includes=DIR where the HarfBuzz includes are])
AC_ARG_WITH(ft1_includes,
[ --with-ft1-includes=DIR where the FreeType1 includes are])
if test "x$with_hb_includes" = "x"; then
HB_INC_DIR="-I/usr/local/include/harfbuzz"
else
HB_INC_DIR="-I$with_hb_includes"
fi
if test "x$with_ft1_includes" = "x"; then
FT1_INC_DIR="-I/usr/include/freetype1"
else
FT1_INC_DIR="-I$with_ft1_includes"
fi
AC_SUBST(HB_INC_DIR)
fi
AC_SUBST(FT1_INC_DIR)
;;
ft2)
build_unicode_support="yes"
AC_DEFINE(_MGFONT_FT2, 1,
[Define if support TrueType font based on FreeType2])
if test "x$build_ttf_support" = "xyes"; then
build_unicode_support="yes"
AC_DEFINE(_MGFONT_FT2, 1,
[Define if support TrueType/OpenType fonts based on FreeType2])
AC_ARG_WITH(ft2_includes,
[ --with-ft2-includes=DIR where the FreeType2 includes are])
with_ft2_includes=""
AC_ARG_WITH(ft2_includes,
[ --with-ft2-includes=DIR where the FreeType2 includes are],
with_ft2_includes=$withval)
if test "x$with_ft2_includes" = "x"; then
FT2_INC_DIR="-I/usr/include/freetype2"
else
FT2_INC_DIR="-I$with_ft2_includes"
fi
if test "x$with_ft2_includes" = "x"; then
FT2_INC_DIR="-I/usr/include/freetype2"
else
FT2_INC_DIR="-I$with_ft2_includes"
fi
AC_SUBST(FT2_INC_DIR)
;;
esac
AC_SUBST(FT2_INC_DIR)
fi
if test "x$build_bmpf_support" = "xyes"; then
AC_DEFINE(_MGFONT_BMPF, 1,
[Define if support Bitmap fonts])
fi
if test "x$build_latin2_support" = "xyes"; then
AC_DEFINE(_MGCHARSET_LATIN2, 1,
[Define if support Latin 2 charset])
@@ -2209,6 +2222,11 @@ if test "x$build_unicode_support" = "xyes"; then
[Define if support UNICODE])
fi
if test "x$build_full_unicode" = "xyes"; then
AC_DEFINE(_MGCHARSET_UNICODE_FULL, 1,
[Define if support full UNICODE code points])
fi
if test "x$use_kbd_hebrewpc" = "xyes"; then
AC_DEFINE(_MGKBDLAYOUT_HEBREWPC, 1,
[Define if use the Hebrew PC keyboard layout])
@@ -2433,8 +2451,8 @@ fi
if test "x$build_ctrl_textedit_new" = "xyes"; then
AC_DEFINE(_MGCTRL_TEXTEDIT, 1,
[Define if include TEXTEDIT control])
AC_DEFINE(_MGCTRL_TEXTEDIT_USE_NEW_IMPL, 1,
[Define if use new implementation of TEXTEDIT control])
AC_DEFINE(_MGCTRL_TEXTEDIT_USE_NEW_IMPL, 1,
[Define if use new implementation of TEXTEDIT control])
fi
if test "x$build_splash" = "xyes"; then
@@ -2462,20 +2480,23 @@ dnl define _GNU_SOURCE for pthread_rwlock_t
CFLAGS="$CFLAGS -D_GNU_SOURCE"
if test "x$devel_mode" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_DEBUG"
CPPFLAGS="$CPPFLAGS -DDEBUG"
if test "x$detail_debug" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DDEBUG"
CPPFLAGS="$CPPFLAGS -D_DEBUG"
fi
if test "$ac_cv_prog_gcc" = "yes"; then
CPPFLAGS="$CPPFLAGS -Wall -Werror"
fi
AC_DEFINE(_MGDEVEL_MODE, 1,
[Define if developer mode enabled])
else
CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi
if test "$ac_cv_prog_gcc" = "yes"; then
CFLAGS="$CFLAGS -O2 -Wstrict-prototypes -pipe"
CFLAGS="$CFLAGS -O2 -fmax-errors=10 -Wstrict-prototypes -pipe"
fi
if test "x$runtime_mode" = "xths"; then
+5 -5
View File
@@ -239,9 +239,9 @@ int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len,
496 static int euckr_is_this_charset (const unsigned char* charset)
497 {
498 int i;
499 char name [LEN_FONT_NAME + 1];
499 char name [LEN_LOGFONT_NAME_FIELD + 1];
500
501 for (i = 0; i &lt; LEN_FONT_NAME + 1; i++) {
501 for (i = 0; i &lt; LEN_LOGFONT_NAME_FIELD + 1; i++) {
502 if (charset [i] == '\0')
503 break;
504 name [i] = toupper (charset [i]);
@@ -388,9 +388,9 @@ int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len,
<table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td> <pre>
228 typedef struct _LOGFONT {
229 char type [LEN_FONT_NAME + 1];
230 char family [LEN_FONT_NAME + 1];
231 char charset [LEN_FONT_NAME + 1];
229 char type [LEN_LOGFONT_NAME_FIELD + 1];
230 char family [LEN_LOGFONT_NAME_FIELD + 1];
231 char charset [LEN_LOGFONT_NAME_FIELD + 1];
232 DWORD style;
233 int size;
234 int rotation;
+156 -103
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -2,12 +2,12 @@
* \file control.h
* \author Wei Yongming <vincent@minigui.org>
* \date 2001/12/29
*
*
* \brief This file includes interfaces of standard controls of MiniGUI.
*
\verbatim
This file is part of MiniGUI, a mature cross-platform windowing
This file is part of MiniGUI, a mature cross-platform windowing
and Graphics User Interface (GUI) support system for embedded systems
and smart IoT devices.
@@ -45,7 +45,7 @@
/*
* $Id: control.h 11349 2009-03-02 05:00:43Z weiym $
*
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
* pSOS, ThreadX, NuCleus, OSE, and Win32.
*
*/
+66 -66
View File
@@ -2,12 +2,12 @@
* \file fixedmath.h
* \author Wei Yongming <vincent@minigui.org>
* \date 2002/01/12
*
*
* \brief This file includes fixed point and three-dimension math routines.
*
\verbatim
This file is part of MiniGUI, a mature cross-platform windowing
This file is part of MiniGUI, a mature cross-platform windowing
and Graphics User Interface (GUI) support system for embedded systems
and smart IoT devices.
@@ -45,7 +45,7 @@
/*
* $Id: fixedmath.h 12154 2009-10-15 07:21:34Z weiym $
*
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
* pSOS, ThreadX, NuCleus, OSE, and Win32.
*
* Fixed-point math routins come from Allegro (a gift software)
@@ -79,21 +79,21 @@ extern "C" {
/**
* \defgroup fixed_math_fns Fixed point math functions
*
*
* You know that the float point mathematics routines are very
* expensive. If you do not want precision mathematics result,
* expensive. If you do not want precision mathematics result,
* you can use fixed point. MiniGUI uses a double word (32-bit)
* integer to represent a fixed point ranged from -32767.0 to
* 32767.0, and defines some fixed point mathematics routines for
* your application. Some GDI functions need fixed point
* integer to represent a fixed point ranged from -32767.0 to
* 32767.0, and defines some fixed point mathematics routines for
* your application. Some GDI functions need fixed point
* math routines, like \a Arc.
*
* Example 1:
*
*
* \include fixed_point.c
*
* Example 2:
*
*
* \include fixedpoint.c
* @{
*/
@@ -112,9 +112,9 @@ MG_EXPORT fixed fixsqrt (fixed x);
/**
* \fn fixed fixhypot (fixed x, fixed y)
* \brief Returns the Euclidean distance from the origin.
*
* The function returns the \a sqrt(x*x+y*y). This is the length of
* the hypotenuse of a right-angle triangle with sides of length \a x and \a y,
*
* The function returns the \a sqrt(x*x+y*y). This is the length of
* the hypotenuse of a right-angle triangle with sides of length \a x and \a y,
* or the distance of the point \a (x,y) from the origin.
*
* \sa fixsqrt
@@ -125,10 +125,10 @@ MG_EXPORT fixed fixhypot (fixed x, fixed y);
* \fn fixed fixatan (fixed x)
* \brief Calculates the arc tangent of a fixed point value.
*
* This function calculates the arc tangent of \a x; that is the value
* This function calculates the arc tangent of \a x; that is the value
* whose tangent is \a x.
*
* \return Returns the arc tangent in radians and the value is
* \return Returns the arc tangent in radians and the value is
* mathematically defined to be between -PI/2 and PI/2 (inclusive).
*
* \sa fixatan2
@@ -140,20 +140,20 @@ MG_EXPORT fixed fixatan (fixed x);
* \brief Calculates the arc tangent of two fixed point variables.
*
* This function calculates the arc tangent of the two variables \a x and \a y.
* It is similar to calculating the arc tangent of \a y / \a x, except that
* the signs of both arguments are used to determine the quadrant of the
* It is similar to calculating the arc tangent of \a y / \a x, except that
* the signs of both arguments are used to determine the quadrant of the
* result.
*
* \return Returns the result in radians, which is between -PI and PI
* \return Returns the result in radians, which is between -PI and PI
* (inclusive).
*
* \sa fixatan
*/
MG_EXPORT fixed fixatan2 (fixed y, fixed x);
extern MG_EXPORT fixed _cos_tbl[];
extern MG_EXPORT fixed _tan_tbl[];
extern MG_EXPORT fixed _acos_tbl[];
extern MG_EXPORT const fixed __mg_cos_tbl[];
extern MG_EXPORT const fixed __mg_tan_tbl[];
extern MG_EXPORT const fixed __mg_acos_tbl[];
/************************** inline fixed point math functions *****************/
/* ftofix and fixtof are used in generic C versions of fixmul and fixdiv */
@@ -162,7 +162,7 @@ extern MG_EXPORT fixed _acos_tbl[];
* \fn fixed ftofix (double x)
* \brief Converts a float point value to a fixed point value.
*
* This function converts the specified float point value \a x to
* This function converts the specified float point value \a x to
* a fixed point value.
*
* \note The float point should be ranged from -32767.0 to 32767.0.
@@ -171,7 +171,7 @@ extern MG_EXPORT fixed _acos_tbl[];
* \sa fixtof
*/
static inline fixed ftofix (double x)
{
{
if (x > 32767.0) {
errno = ERANGE;
return 0x7FFFFFFF;
@@ -182,21 +182,21 @@ static inline fixed ftofix (double x)
return -0x7FFFFFFF;
}
return (long)(x * 65536.0 + (x < 0 ? -0.5 : 0.5));
return (long)(x * 65536.0 + (x < 0 ? -0.5 : 0.5));
}
/**
* \fn double fixtof (fixed x)
* \brief Converts a fixed point value to a float point value.
*
* This function converts the specified fixed point value \a x to
* This function converts the specified fixed point value \a x to
* a float point value.
*
* \sa ftofix
*/
static inline double fixtof (fixed x)
{
return (double)x / 65536.0;
{
return (double)x / 65536.0;
}
@@ -209,7 +209,7 @@ static inline double fixtof (fixed x)
*
* \param x x,y: Two addends.
* \param y x,y: Two addends.
* \return The sum. If the result runs out of range of fixed point,
* \return The sum. If the result runs out of range of fixed point,
* this function sets \a errno to \a ERANGE.
*
* \sa fixsub
@@ -220,19 +220,19 @@ static inline fixed fixadd (fixed x, fixed y)
if (result >= 0) {
if ((x < 0) && (y < 0)) {
errno = ERANGE;
return -0x7FFFFFFF;
errno = ERANGE;
return -0x7FFFFFFF;
}
else
return result;
return result;
}
else {
if ((x > 0) && (y > 0)) {
errno = ERANGE;
return 0x7FFFFFFF;
errno = ERANGE;
return 0x7FFFFFFF;
}
else
return result;
return result;
}
}
@@ -240,13 +240,13 @@ static inline fixed fixadd (fixed x, fixed y)
* \fn fixed fixsub (fixed x, fixed y)
* \brief Subtract a fixed point value from another.
*
* This function subtracts the fixed point values \a y from the fixed
* This function subtracts the fixed point values \a y from the fixed
* point value \a x, and returns the difference.
*
* \param x The minuend.
* \param y The subtrahend.
*
* \return The difference. If the result runs out of range of fixed point,
* \return The difference. If the result runs out of range of fixed point,
* this function sets \a errno to \a ERANGE.
*
* \sa fixadd
@@ -257,33 +257,33 @@ static inline fixed fixsub (fixed x, fixed y)
if (result >= 0) {
if ((x < 0) && (y > 0)) {
errno = ERANGE;
return -0x7FFFFFFF;
errno = ERANGE;
return -0x7FFFFFFF;
}
else
return result;
return result;
}
else {
if ((x > 0) && (y < 0)) {
errno = ERANGE;
return 0x7FFFFFFF;
errno = ERANGE;
return 0x7FFFFFFF;
}
else
return result;
return result;
}
}
/**
* \fn fixed fixmul (fixed x, fixed y)
* \brief Returns the product of two fixed point values.
*
*
* This function returns the product of two fixed point values \a x and \a y.
*
* \param x The faciend.
* \param y The multiplicato.
* \return The prodcut. If the result runs out of range of fixed point,
* \return The prodcut. If the result runs out of range of fixed point,
* this function sets \a errno to \a ERANGE.
*
*
* \sa fixdiv
*/
MG_EXPORT fixed fixmul (fixed x, fixed y);
@@ -291,14 +291,14 @@ MG_EXPORT fixed fixmul (fixed x, fixed y);
/**
* \fn fixed fixdiv (fixed x, fixed y)
* \brief Returns the quotient of two fixed point values.
*
*
* This function returns the quotient of two fixed point values \a x and \a y.
*
* \param x The dividend.
* \param y The divisor.
* \return The quotient. If the result runs out of range of fixed point,
* \return The quotient. If the result runs out of range of fixed point,
* this function sets \a errno to \a ERANGE.
*
*
* \sa fixmul
*/
MG_EXPORT fixed fixdiv (fixed x, fixed y);
@@ -336,7 +336,7 @@ static inline int fixceil (fixed x)
* \sa fixtoi
*/
static inline fixed itofix (int x)
{
{
return x << 16;
}
@@ -349,61 +349,61 @@ static inline fixed itofix (int x)
* \sa itofix
*/
static inline int fixtoi (fixed x)
{
return (x >> 16) + ((x & 0x8000) >> 15);
{
return (x >> 16) + ((x & 0x8000) >> 15);
}
/**
* \fn fixed fixcos (fixed x)
* \brief Returns the cosine of a fixed point.
*
* This function returns the cosine of the fixed point \a x,
* This function returns the cosine of the fixed point \a x,
* where \a x is given in radians.
*
* \sa fixacos
*/
static inline fixed fixcos (fixed x)
{
return _cos_tbl[((x + 0x4000) >> 15) & 0x1FF];
return __mg_cos_tbl[((x + 0x4000) >> 15) & 0x1FF];
}
/**
* \fn fixed fixsin (fixed x)
* \brief Returns the sine of a fixed point.
*
* This function returns the sine of the fixed point \a x,
* This function returns the sine of the fixed point \a x,
* where \a x is given in radians.
*
* \sa fixasin
*/
static inline fixed fixsin (fixed x)
{
return _cos_tbl[((x - 0x400000 + 0x4000) >> 15) & 0x1FF];
{
return __mg_cos_tbl[((x - 0x400000 + 0x4000) >> 15) & 0x1FF];
}
/**
* \fn fixed fixtan (fixed x)
* \brief Returns the tangent of a fixed point.
*
* This function returns the tangent of the fixed point \a x,
* This function returns the tangent of the fixed point \a x,
* where \a x is given in radians.
*
* \sa fixcos, fixsin
*/
static inline fixed fixtan (fixed x)
{
return _tan_tbl[((x + 0x4000) >> 15) & 0xFF];
{
return __mg_tan_tbl[((x + 0x4000) >> 15) & 0xFF];
}
/**
* \fn fixed fixacos (fixed x)
* \brief Calculates and returns the arc cosine of a fixed point.
*
* This function calculates the arc cosine of the fixed point \a x;
* This function calculates the arc cosine of the fixed point \a x;
* that is the value whose cosine is \a x. If \a x falls outside
* the range -1 to 1, this function fails and \a errno is set to EDOM.
*
* \return Returns the arc cosine in radians and the value is mathematically
* \return Returns the arc cosine in radians and the value is mathematically
* defined to be between 0 and PI (inclusive).
*
* \sa fixcos
@@ -415,30 +415,30 @@ static inline fixed fixacos (fixed x)
return 0;
}
return _acos_tbl[(x+65536+127)>>8];
return __mg_acos_tbl[(x+65536+127)>>8];
}
/**
* \fn fixed fixasin (fixed x)
* \brief Calculates and returns the arc sine of a fixed point.
*
* This function calculates the arc sine of the fixed point \a x;
* This function calculates the arc sine of the fixed point \a x;
* that is the value whose sine is \a x. If \a x falls outside
* the range -1 to 1, this function fails and \a errno is set to EDOM.
*
* \return Returns the arc sine in radians and the value is mathematically
* \return Returns the arc sine in radians and the value is mathematically
* defined to be between -PI/2 and PI/2 (inclusive).
*
* \sa fixsin
*/
static inline fixed fixasin (fixed x)
{
{
if ((x < -65536) || (x > 65536)) {
errno = EDOM;
return 0;
}
return 0x00400000 - _acos_tbl[(x+65536+127)>>8];
return 0x00400000 - __mg_acos_tbl[(x+65536+127)>>8];
}
/** @} end of fixed_math_fns */
+5771 -1974
View File
File diff suppressed because it is too large Load Diff
+660 -339
View File
File diff suppressed because it is too large Load Diff
+1012 -1012
View File
File diff suppressed because it is too large Load Diff
+444 -446
View File
File diff suppressed because it is too large Load Diff
+37 -38
View File
@@ -44,21 +44,20 @@
extern "C" {
#endif
typedef struct _GLYPHBUF
{
GLYPHMAPINFO* glyph_map; /* glyph info array */
int* glyphs; /* glyph array */
int glyphs_len; /* glyph array len or buffer used size */
typedef struct _ACHARBUF
{
ACHARMAPINFO* achar_map; /* achar info array */
Achar32* achars; /* achar array */
int achars_len; /* achar array len or buffer used size */
int blocksize; /* block size, a block is an allocate unit */
int glyphs_buffsize; /* glyph string buffer size */
int glyphmap_buffsize; /* glyph map buffer size */
} GLYPHBUF;
int achars_buffsize; /* achar string buffer size */
int acharmap_buffsize; /* achar map buffer size */
} ACHARBUF;
typedef struct tagBIDISLEDITDATA
{
StrBuffer str_content; // string text buffer
GLYPHBUF glyph_content; // glyph string buffer
ACHARBUF achar_content; // achar string buffer
int editPos; // current edit position
int selStart; // selection start position
@@ -92,48 +91,48 @@ typedef struct tagBIDISLEDITDATA
typedef BIDISLEDITDATA* PBIDISLEDITDATA;
static inline void*
glyphbuf_alloc (GLYPHBUF* glyph_buff, int len, int block_size)
acharbuf_alloc (ACHARBUF* achar_buff, int len, int block_size)
{
glyph_buff->glyphs_buffsize = (len + (block_size - len % block_size))
* sizeof (int);
glyph_buff->glyphs = malloc (glyph_buff->glyphs_buffsize);
achar_buff->achars_buffsize = (len + (block_size - len % block_size))
* sizeof (Achar32);
achar_buff->achars = malloc (achar_buff->achars_buffsize);
glyph_buff->glyphmap_buffsize = (len + (block_size - len % block_size))
* sizeof (GLYPHMAPINFO);
glyph_buff->glyph_map = malloc (glyph_buff->glyphmap_buffsize);
achar_buff->acharmap_buffsize = (len + (block_size - len % block_size))
* sizeof (ACHARMAPINFO);
achar_buff->achar_map = malloc (achar_buff->acharmap_buffsize);
glyph_buff->glyphs_len = len;
glyph_buff->blocksize = block_size;
achar_buff->achars_len = len;
achar_buff->blocksize = block_size;
return glyph_buff->glyphs;
return achar_buff->achars;
}
static inline void glyphbuf_free (GLYPHBUF *glyph_buff)
static inline void acharbuf_free (ACHARBUF *achar_buff)
{
if (glyph_buff) {
free (glyph_buff->glyphs);
free (glyph_buff->glyph_map);
if (achar_buff) {
free (achar_buff->achars);
free (achar_buff->achar_map);
}
}
static inline void* glyphbuf_realloc (GLYPHBUF *glyph_buff, int len)
static inline void* acharbuf_realloc (ACHARBUF *achar_buff, int len)
{
if (len * sizeof(int) > glyph_buff->glyphs_buffsize ||
len * sizeof(int) < glyph_buff->glyphs_buffsize - glyph_buff->blocksize) {
/* realloc glyph string mem */
glyph_buff->glyphs_buffsize = (len + (glyph_buff->blocksize -
len % glyph_buff->blocksize))* sizeof(int);
glyph_buff->glyphs = realloc (glyph_buff->glyphs,
glyph_buff->glyphs_buffsize);
if (len * sizeof(int) > achar_buff->achars_buffsize ||
len * sizeof(int) < achar_buff->achars_buffsize - achar_buff->blocksize) {
/* realloc achar string mem */
achar_buff->achars_buffsize = (len + (achar_buff->blocksize -
len % achar_buff->blocksize))* sizeof(Achar32);
achar_buff->achars = realloc (achar_buff->achars,
achar_buff->achars_buffsize);
/* realloc glyph map mem */
glyph_buff->glyphmap_buffsize = (len + (glyph_buff->blocksize -
len % glyph_buff->blocksize))* sizeof(GLYPHMAPINFO);
glyph_buff->glyph_map = realloc (glyph_buff->glyph_map,
glyph_buff->glyphmap_buffsize);
/* realloc achar map mem */
achar_buff->acharmap_buffsize = (len + (achar_buff->blocksize -
len % achar_buff->blocksize))* sizeof(ACHARMAPINFO);
achar_buff->achar_map = realloc (achar_buff->achar_map,
achar_buff->acharmap_buffsize);
}
return glyph_buff->glyphs;
return achar_buff->achars;
}
BOOL RegisterBIDISLEditControl (void);
+141 -141
View File
File diff suppressed because it is too large Load Diff
+189 -189
View File
File diff suppressed because it is too large Load Diff
+32 -32
View File
@@ -1,33 +1,33 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Or,
*
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
@@ -56,7 +56,7 @@
#include "ctrlmisc.h"
#include "progressbar_impl.h"
static void pbarNormalizeParams (const CONTROL* pCtrl,
static void pbarNormalizeParams (const CONTROL* pCtrl,
PROGRESSDATA* pData, BOOL fNotify)
{
if (pData->nPos >= pData->nMax) {
@@ -72,8 +72,8 @@ static void pbarNormalizeParams (const CONTROL* pCtrl,
}
}
static void
pbarOnNewPos (const CONTROL* pCtrl,
static void
pbarOnNewPos (const CONTROL* pCtrl,
PROGRESSDATA* pData, unsigned int new_pos)
{
unsigned int old_pos;
@@ -97,32 +97,32 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
HDC hdc;
PCONTROL pCtrl;
PROGRESSDATA* pData;
pCtrl = gui_Control (hwnd);
pCtrl = gui_Control (hwnd);
switch (message)
{
case MSG_CREATE:
if (!(pData = malloc (sizeof (PROGRESSDATA)))) {
_MG_PRINTF ("CONTROL>ProgressBar: Create control failure!\n");
_WRN_PRINTF ("Create control failure!");
return -1;
}
pData->nMax = 100;
pData->nMin = 0;
pData->nPos = 0;
pData->nStepInc = 10;
pCtrl->dwAddData2 = (DWORD)pData;
break;
case MSG_DESTROY:
free ((void *)(pCtrl->dwAddData2));
break;
case MSG_NCPAINT:
return 0;
case MSG_GETDLGCODE:
return DLGC_STATIC;
@@ -135,8 +135,8 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PROGRESSDATA *data = (PROGRESSDATA *)pCtrl->dwAddData2;
hdc = BeginPaint (hwnd);
GetWindowInfo (hwnd)->we_rdr->draw_progress (hwnd,
hdc, data->nMax, data->nMin,
GetWindowInfo (hwnd)->we_rdr->draw_progress (hwnd,
hdc, data->nMax, data->nMin,
data->nPos, pCtrl->dwStyle & PBS_VERTICAL);
EndPaint (hwnd, hdc);
@@ -160,7 +160,7 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
InvalidateRect (hwnd, NULL, TRUE);
return PB_OKAY;
case PBM_SETSTEP:
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
if ((int)wParam > (int)(pData->nMax - pData->nMin))
@@ -168,39 +168,39 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
pData->nStepInc = wParam;
return PB_OKAY;
case PBM_SETPOS:
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
if (pData->nPos == wParam)
return PB_OKAY;
pbarOnNewPos (pCtrl, pData, wParam);
return PB_OKAY;
case PBM_DELTAPOS:
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
if (wParam == 0)
return PB_OKAY;
pbarOnNewPos (pCtrl, pData, pData->nPos + wParam);
return PB_OKAY;
case PBM_STEPIT:
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
if (pData->nStepInc == 0)
return PB_OKAY;
pbarOnNewPos (pCtrl, pData, pData->nPos + pData->nStepInc);
return PB_OKAY;
case MSG_FONTCHANGED:
InvalidateRect (hwnd, NULL, TRUE);
break;
}
return DefaultControlProc (hwnd, message, wParam, lParam);
}
@@ -212,7 +212,7 @@ BOOL RegisterProgressBarControl (void)
WndClass.dwStyle = WS_NONE;
WndClass.dwExStyle = WS_EX_NONE;
WndClass.hCursor = GetSystemCursor (0);
WndClass.iBkColor =
WndClass.iBkColor =
GetWindowElementPixel (HWND_NULL, WE_MAINC_THREED_BODY);
WndClass.WinProc = ProgressBarCtrlProc;
+143 -144
View File
File diff suppressed because it is too large Load Diff
+9 -9
View File
@@ -271,30 +271,30 @@ static void set_keyboard_layout(HWND hDlg)
}
#if 0
if (cur_type == GLYPH_TYPE_RTL) {
if (l_glyph_type == GLYPH_TYPE_RTL)
if (cur_type == CHAR_TYPE_RTL) {
if (l_char_type == CHAR_TYPE_RTL)
return INSERTPOS_BEFORE (sled, l_glyph_index);
else if (r_glyph_type == GLYPH_TYPE_RTL)
else if (r_char_type == CHAR_TYPE_RTL)
return INSERTPOS_AFTER (sled, r_glyph_index);
else
{
if (l_glyph_type == GLYPH_TYPE_LTR)
if (l_char_type == CHAR_TYPE_LTR)
return INSERTPOS_AFTER (sled, l_glyph_index);
else if (l_glyph_type == GLYPH_TYPE_LTR)
else if (l_char_type == CHAR_TYPE_LTR)
return INSERTPOS_BEFORE (sled, r_glyph_index);
else
return 0;
}
}
else {
if (l_glyph_type == GLYPH_TYPE_LTR)
if (l_char_type == CHAR_TYPE_LTR)
return INSERTPOS_AFTER (sled, l_glyph_index);
else if (r_glyph_type == GLYPH_TYPE_LTR)
else if (r_char_type == CHAR_TYPE_LTR)
return INSERTPOS_BEFORE (sled, r_glyph_index);
else {
if (l_glyph_type == GLYPH_TYPE_RTL)
if (l_char_type == CHAR_TYPE_RTL)
return INSERTPOS_BEFORE (sled, l_glyph_index);
else if (l_glyph_type == GLYPH_TYPE_RTL)
else if (l_char_type == CHAR_TYPE_RTL)
return INSERTPOS_AFTER (sled, r_glyph_index);
else
return 0;
+3 -3
View File
@@ -916,7 +916,7 @@ textdoc_insert_text (TextDoc *txtdoc, const char* newtext, int len)
/* insert last strings */
/* FIXME */
if (!nextnode) {
_MG_PRINTF ("CONTROL>TextEdit: (Warning) nextnode is NULL!\n");
_WRN_PRINTF ("nextnode is NULL!");
/* set_current_node (txtdoc, LASTNODE(txtdoc), FALSE, TRUE); */
}
else {
@@ -1446,7 +1446,7 @@ static int get_line_nr (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
HDC hdc;
if (!node) {
_MG_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to get_line_nr\n");
_WRN_PRINTF ("pass NULL text node to get_line_nr");
return 0;
}
@@ -1571,7 +1571,7 @@ set_line_width (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
HDC hdc;
if (!node) {
_MG_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to set_line_width\n");
_WRN_PRINTF ("pass NULL text node to set_line_width");
return -1;
}
+64 -64
View File
@@ -1,33 +1,33 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Or,
*
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
@@ -64,13 +64,13 @@ static void TrackBarOnDraw (HWND hwnd, HDC hdc, TRACKBARDATA* pData, DWORD dwSty
win_rdr = GetWindowInfo(hwnd)->we_rdr;
if (!win_rdr) {
_MG_PRINTF ("CONTROL>TrackBar: window renderer is NULL.\n");
_WRN_PRINTF ("window renderer is NULL");
return;
}
GetClientRect (hwnd, &rc_client);
win_rdr->draw_trackbar (hwnd, hdc, (LFRDR_TRACKBARINFO *)pData);
win_rdr->draw_trackbar (hwnd, hdc, (LFRDR_TRACKBARINFO *)pData);
/* draw the tip of trackbar. */
if ((dwStyle & TBS_TIP) && !(dwStyle & TBS_VERTICAL)) {
@@ -79,7 +79,7 @@ static void TrackBarOnDraw (HWND hwnd, HDC hdc, TRACKBARDATA* pData, DWORD dwSty
RECT rc_bar, rc_border;
int sliderh, EndTipLen, x, y, w, h;
win_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
win_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
dwStyle, &rc_client, NULL, &rc_bar, &rc_border);
sliderh = RECTH (rc_bar);
@@ -88,23 +88,23 @@ static void TrackBarOnDraw (HWND hwnd, HDC hdc, TRACKBARDATA* pData, DWORD dwSty
w = RECTW (rc_border);
h = RECTH (rc_border);
SelectFont (hdc, (PLOGFONT)GetWindowElementAttr
SelectFont (hdc, (PLOGFONT)GetWindowElementAttr
(hwnd, WE_FONT_TOOLTIP));
SetBkMode (hdc, BM_TRANSPARENT);
SetBkColor (hdc, GetWindowBkColor (hwnd));
SetTextColor (hdc, GetWindowElementPixel (hwnd, WE_FGC_THREED_BODY));
TextOut (hdc, x + 1, y + (h>>1) - (sliderh>>1) - GAP_TIP_SLIDER,
TextOut (hdc, x + 1, y + (h>>1) - (sliderh>>1) - GAP_TIP_SLIDER,
pData->sStartTip);
GetTextExtent (hdc, pData->sEndTip, -1, &text_ext);
EndTipLen = text_ext.cx + 4;
TextOut (hdc, (EndTipLen > (w>>1) - 20 ? x + (w>>1) + 20 : x + w -EndTipLen),
y + (h>>1) - (sliderh>>1) - GAP_TIP_SLIDER, pData->sEndTip);
TextOut (hdc, (EndTipLen > (w>>1) - 20 ? x + (w>>1) + 20 : x + w -EndTipLen),
y + (h>>1) - (sliderh>>1) - GAP_TIP_SLIDER, pData->sEndTip);
sprintf (sPos, "%d", pData->nPos);
GetTextExtent (hdc, sPos, -1, &text_ext);
TextOut (hdc, x + ((w - text_ext.cx) >> 1),
TextOut (hdc, x + ((w - text_ext.cx) >> 1),
y + (h>>1) -(sliderh>>1) - GAP_TIP_SLIDER, sPos);
}
}
@@ -137,23 +137,23 @@ static void SetSliderPos (const CONTROL* pCtrl, int new_pos)
RECT rc_client, old_slider, new_slider;
if (new_pos > pData->nMax)
new_pos = pData->nMax;
new_pos = pData->nMax;
if (new_pos < pData->nMin)
new_pos = pData->nMin;
new_pos = pData->nMin;
if (pData->nPos == new_pos)
if (pData->nPos == new_pos)
return;
GetClientRect ((HWND)pCtrl, &rc_client);
pCtrl->we_rdr->calc_trackbar_rect ((HWND)pCtrl, (LFRDR_TRACKBARINFO *)pData,
pCtrl->we_rdr->calc_trackbar_rect ((HWND)pCtrl, (LFRDR_TRACKBARINFO *)pData,
pCtrl->dwStyle, &rc_client, NULL, &old_slider, NULL);
pData->nPos = new_pos;
TrackBarNormalizeParams (pCtrl, pData, pCtrl->dwStyle & TBS_NOTIFY);
pCtrl->we_rdr->calc_trackbar_rect ((HWND)pCtrl, (LFRDR_TRACKBARINFO *)pData,
pCtrl->we_rdr->calc_trackbar_rect ((HWND)pCtrl, (LFRDR_TRACKBARINFO *)pData,
pCtrl->dwStyle, &rc_client, NULL, &new_slider, NULL);
if (pCtrl->dwStyle & TBS_TIP) {
@@ -180,7 +180,7 @@ static int NormalizeMousePos (HWND hwnd, TRACKBARDATA* pData, int mousepos)
dwStyle = GetWindowStyle (hwnd);
win_rdr = GetWindowInfo(hwnd)->we_rdr;
win_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
win_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
dwStyle, &rcClient, NULL, &rcBar, NULL);
if (dwStyle & TBS_VERTICAL) {
@@ -212,12 +212,12 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
PCONTROL pCtrl;
TRACKBARDATA* pData;
pCtrl = gui_Control (hwnd);
switch (message)
{
case MSG_CREATE:
if (!(pData = malloc (sizeof (TRACKBARDATA)))) {
_MG_PRINTF ("CONTROL>TrackBar: Create control failure!\n");
_WRN_PRINTF ("Create control failure!");
return -1;
}
pData->nMax = 10;
@@ -230,14 +230,14 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pData->nTickFreq = 1;
pCtrl->dwAddData2 = (DWORD)pData;
break;
case MSG_DESTROY:
free((void *)(pCtrl->dwAddData2));
break;
case MSG_NCPAINT:
return 0;
case MSG_GETTEXTLENGTH:
case MSG_GETTEXT:
case MSG_SETTEXT:
@@ -272,15 +272,15 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
SendMessage (hwnd, TBM_SETPOS, pData->nPos, 0);
return 0;
}
case TBM_GETMIN:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nMin;
case TBM_GETMAX:
case TBM_GETMAX:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nMax;
case TBM_SETMIN:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
@@ -292,7 +292,7 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pData->nPos = pData->nMin;
SendMessage (hwnd, TBM_SETPOS, pData->nPos, 0);
return 0;
case TBM_SETMAX:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
@@ -304,7 +304,7 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pData->nPos = pData->nMax;
SendMessage (hwnd, TBM_SETPOS, pData->nPos, 0);
return 0;
case TBM_SETLINESIZE:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
if (wParam > (pData->nMax - pData->nMin))
@@ -315,26 +315,26 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case TBM_GETLINESIZE:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nLineSize;
case TBM_SETPAGESIZE:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
if (wParam > (pData->nMax - pData->nMin))
return -1;
pData->nPageSize = wParam;
return 0;
case TBM_GETPAGESIZE:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nPageSize;
case TBM_SETPOS:
SetSliderPos (pCtrl, wParam);
return 0;
case TBM_GETPOS:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nPos;
case TBM_SETTICKFREQ:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
if (wParam > (pData->nMax - pData->nMin))
@@ -346,10 +346,10 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case TBM_GETTICKFREQ:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nTickFreq;
case TBM_SETTIP:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
if (wParam)
if (wParam)
strncpy(pData->sStartTip, (char *) wParam, TBLEN_TIP);
if (lParam)
strncpy (pData->sEndTip, (char *) lParam, TBLEN_TIP);
@@ -363,19 +363,19 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (lParam)
strcpy ((char *) lParam, pData->sEndTip);
return 0;
case MSG_SETFOCUS:
if (pCtrl->dwStyle & TBS_FOCUS)
break;
pCtrl->dwStyle |= TBS_FOCUS;
InvalidateRect (hwnd, NULL, TRUE);
break;
case MSG_KILLFOCUS:
pCtrl->dwStyle &= ~TBS_FOCUS;
InvalidateRect (hwnd, NULL, TRUE);
break;
case MSG_GETDLGCODE:
return DLGC_WANTARROWS;
@@ -406,21 +406,21 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case SCANCODE_CURSORBLOCKLEFT:
SetSliderPos (pCtrl, pData->nPos - pData->nLineSize);
break;
case SCANCODE_PAGEDOWN:
SetSliderPos (pCtrl, pData->nPos - pData->nPageSize);
break;
case SCANCODE_PAGEUP:
SetSliderPos (pCtrl, pData->nPos + pData->nPageSize);
break;
case SCANCODE_HOME:
pData->nPos = pData->nMin;
TrackBarNormalizeParams (pCtrl, pData, pCtrl->dwStyle & TBS_NOTIFY);
InvalidateRect (hwnd, NULL, TRUE);
break;
case SCANCODE_END:
pData->nPos = pData->nMax;
TrackBarNormalizeParams (pCtrl, pData, pCtrl->dwStyle & TBS_NOTIFY);
@@ -433,9 +433,9 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (GetCapture() != hwnd) {
int mouseX = LOSWORD(lParam);
int mouseY = HISWORD(lParam);
/** set state to press slider */
pCtrl->dwStyle |= LFRDR_TBS_PRESSED;
/** set state to press slider */
pCtrl->dwStyle |= LFRDR_TBS_PRESSED;
SetCapture (hwnd);
@@ -448,7 +448,7 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
(pCtrl->dwStyle & TBS_VERTICAL)?mouseY:mouseX));
}
break;
case MSG_MOUSEMOVE:
{
/** hilite slider */
@@ -461,16 +461,16 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
GetClientRect (hwnd, &rc_client);
pCtrl->we_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
pCtrl->we_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
pCtrl->dwStyle, &rc_client, NULL, &rc_slider, NULL);
if (GetCapture() == hwnd)
{
ScreenToClient (hwnd, &mouseX, &mouseY);
if (PtInRect (&rc_slider, mouseX, mouseY))
pCtrl->dwStyle |= LFRDR_TBS_HILITE;
else
pCtrl->dwStyle &= ~LFRDR_TBS_HILITE;
pCtrl->dwStyle |= LFRDR_TBS_HILITE;
else
pCtrl->dwStyle &= ~LFRDR_TBS_HILITE;
}
else
{
@@ -479,16 +479,16 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
/** avoid twinkle by valid redraw */
if (!(pCtrl->dwStyle & LFRDR_TBS_HILITE))
{
pCtrl->dwStyle |= LFRDR_TBS_HILITE;
pCtrl->dwStyle |= LFRDR_TBS_HILITE;
InvalidateRect (hwnd, NULL, TRUE);
}
}
else
else
{
/** avoid twinkle by valid redraw */
if (pCtrl->dwStyle & LFRDR_TBS_HILITE)
{
pCtrl->dwStyle &= ~LFRDR_TBS_HILITE;
pCtrl->dwStyle &= ~LFRDR_TBS_HILITE;
InvalidateRect (hwnd, NULL, TRUE);
}
}
@@ -503,8 +503,8 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case MSG_LBUTTONUP:
if (GetCapture() == hwnd) {
/** set state to press slider */
pCtrl->dwStyle &= ~LFRDR_TBS_PRESSED;
/** set state to press slider */
pCtrl->dwStyle &= ~LFRDR_TBS_PRESSED;
ReleaseCapture ();
NotifyParent ((HWND)pCtrl, pCtrl->id, TBN_STOPDRAG);
@@ -512,15 +512,15 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
InvalidateRect (hwnd, NULL, TRUE);
}
break;
case MSG_FONTCHANGED:
InvalidateRect (hwnd, NULL, TRUE);
return 0;
default:
break;
break;
}
return DefaultControlProc (hwnd, message, wParam, lParam);
}
+18 -18
View File
@@ -216,7 +216,7 @@ static int LWZReadByte (MG_RWops *area, int flag, int input_code_size)
while (code >= clear_code) {
*sp++ = table[1][code];
if (code == table[0][code]) {
_MG_PRINTF ("EX_CTRL>GIF89a: circular table entry\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: circular table entry\n");
return -1;
}
code = table[0][code];
@@ -259,7 +259,7 @@ static int GetCode(MG_RWops *area, int code_size, int flag)
if ((curbit + code_size) >= lastbit) {
if (done) {
if (curbit >= lastbit)
_MG_PRINTF ("EX_CTRL>GIF89a: bad decode\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad decode\n");
return -1;
}
buf[0] = buf[last_byte - 2];
@@ -362,7 +362,7 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
version [3] = '\0';
if (strcmp ((const char*)version, "87a") != 0 && strcmp ((const char*)version, "89a") != 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: GIF version number not 87a or 89a.\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: GIF version number not 87a or 89a.\n");
return -1; /* image loading error*/
}
@@ -373,7 +373,7 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
GifScreen->disposal = 0;
if (!ReadOK (area, buf, 7)) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad screen descriptor\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad screen descriptor\n");
return -1; /* image loading error*/
}
GifScreen->Width = LM_to_uint (buf[0], buf[1]);
@@ -384,10 +384,10 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
GifScreen->AspectRatio = buf[6];
if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
_MG_PRINTF ("EX_CTRL>GIF89a: have global colormap: %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: have global colormap: %d\n",
GifScreen->Background);
if (ReadColorMap (area, GifScreen->BitPixel, GifScreen->ColorMap)) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad global colormap\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad global colormap\n");
return -1; /* image loading error*/
}
}
@@ -399,7 +399,7 @@ static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifSc
{
unsigned char buf[16];
if (!ReadOK (area, buf, 9)) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
return -1;
}
@@ -414,9 +414,9 @@ static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifSc
ImageDesc->interlace = BitSet(buf[8], INTERLACE);
if (ImageDesc->haveColorMap) {
_MG_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
if (ReadColorMap (area, ImageDesc->bitPixel, ImageDesc->ColorMap) < 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
return -1;
}
} else {
@@ -437,12 +437,12 @@ static int ReadImage (MG_RWops* area, MYBITMAP* bmp, IMAGEDESC* ImageDesc, GIFSC
* initialize the compression routines
*/
if (!ReadOK (area, &c, 1)) {
_MG_PRINTF ("EX_CTRL>GIF89a: eof on image data\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: eof on image data\n");
return -1;
}
if (LWZReadByte (area, TRUE, c) < 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: error reading image\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: error reading image\n");
return -1;
}
@@ -549,11 +549,11 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
anim->bk.a = 0;
}
_MG_PRINTF ("EX_CTRL>GIF89a: Background: %d, %d, %d.\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: Background: %d, %d, %d.\n",
anim->bk.r, anim->bk.g, anim->bk.b);
if ((ok = ReadOK (area, &c, 1)) == 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
goto error;
}
@@ -561,11 +561,11 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
switch (c) {
case '!':
if ( (ok = ReadOK (area, &c, 1)) == 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
goto error;
}
DoExtension (area, c, &GifScreen);
_MG_PRINTF ("EX_CTRL>GIF89a: Extension info: %d, %d, %d, %d, %d, %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: Extension info: %d, %d, %d, %d, %d, %d\n",
GifScreen.Width, GifScreen.Height,
GifScreen.AspectRatio, GifScreen.delayTime,
GifScreen.disposal, GifScreen.transparent);
@@ -579,7 +579,7 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
if (ReadImage (area, &mybmp, &ImageDesc, &GifScreen, 0) < 0)
goto error;
}
_MG_PRINTF ("EX_CTRL>GIF89a: Image Descriptor: %d, %d, %d, %d, %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: Image Descriptor: %d, %d, %d, %d, %d\n",
ImageDesc.Top, ImageDesc.Left,
ImageDesc.Width, ImageDesc.Height,
ImageDesc.haveColorMap);
@@ -595,14 +595,14 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
frame->width = mybmp.w;
frame->height = mybmp.h;
frame->delay_time = (GifScreen.delayTime>10)?GifScreen.delayTime:10;
_MG_PRINTF ("EX_CTRL>GIF89a: frame info: %d, %d, %d, %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: frame info: %d, %d, %d, %d\n",
frame->off_x, frame->off_y, frame->delay_time,
GifScreen.transparent);
if ((frame->mem_dc = CreateMemDCFromMyBitmap (&mybmp, ImageDesc.ColorMap)) == 0) {
free (mybmp.bits);
free (frame);
_MG_PRINTF ("EX_CTRL>GIF89a: Error when expand frame bitmap.\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: Error when expand frame bitmap.\n");
goto error;
}
frame->bits = mybmp.bits;
+1 -1
View File
@@ -1108,7 +1108,7 @@ void GridCellTypeNumber_set_text_value(gvGridCellData* cell, int row, int col, c
if (INF[0] != 'I' && INF[0] != 'i')
cell->data.number.num = number;
else
_MG_PRINTF ("EX_CTRL>Grid: The inputed number is too big!\n");
_WRN_PRINTF ("EX_CTRL>Grid: The inputed number is too big!\n");
}
double GridCellTypeNumber_get_double_value(gvGridCellData* cell, int row, int col)
+31 -8
View File
@@ -2,23 +2,46 @@ SUBDIRS = in-core
noinst_LTLIBRARIES = libfont.la
SRC_FILES = charset.c charset-arabic.c charset-bidi.c \
SRC_FILES = charset.c charset-arabic.c legacy-bidi.c charset-unicode.c \
unicode-comp.c unicode-script.c language-code.c \
sysfont.c logfont.c devfont.c fontname.c \
rawbitmap.c varbitmap.c qpf.c upf.c \
nullfont.c rawbitmap.c varbitmap.c qpf.c upf.c \
fontcache.c freetype2.c font-engines.c\
gbunimap.c gbkunimap.c gb18030unimap.c big5unimap.c \
ujisunimap.c sjisunimap.c euckrunimap.c \
textops.c mapunitogb.c mapunitogbk.c mapunitobig5.c mapunitogb18030.c \
bitmapfont.c scripteasy.c
textops.c \
mapunitogb.c mapunitogbk.c mapunitobig5.c mapunitogb18030.c \
bitmapfont.c scripteasy.c \
unicode-emoji.c unicode-vop.c \
unicode-bidi.c \
unicode-break.c unicode-break-arabic.c unicode-break-indic.c unicode-break-thai.c \
unicode-joining-types.c unicode-joining.c unicode-shape.c \
unicode-shape-arabic.c harzbuff-minigui-funcs.c \
unicode-iterators.c
HDR_FILES = charset.h rawbitmap.h varbitmap.h freetype2.h qpf.h \
upf.h bitmapfont.h gunichartables.h se_minigui.h unicode-bidi-tables.h
HDR_FILES = charset.h rawbitmap.h varbitmap.h freetype2.h qpf.h se_minigui.h \
upf.h bitmapfont.h unicode-bidi-tables.h \
unicode-tables.h unicode-break-tables.h unicode-script-table.h \
unicode-decomp.h unicode-comp.h \
unicode-emoji-tables.h \
legacy-bidi-tables.inc \
unicode-bidi.h unicode-vop-table.inc \
unicode-joining-types-list.inc \
unicode-joining-type-table.inc \
unicode-arabic-shaping-table.inc \
unicode-arabic-misc-table.inc \
unicode-bidi-bidi-types-list.inc \
unicode-bidi-bidi-type-table.inc \
unicode-bidi-brackets-table.inc \
unicode-bidi-brackets-type-table.inc \
unicode-bidi-mirroring-table.inc \
script-language-table.inc \
emoji_presentation_scanner.inc
EXTRA_DIST = convgbmap.c jisunimap.c $(SRC_FILES) $(HDR_FILES) \
makefile.ng makefile.msvc
# AM_CPPFLAGS = $(FT1_INC_DIR) $(FT2_INC_DIR)
AM_CPPFLAGS = $(FT2_INC_DIR)
AM_CPPFLAGS = $(FT2_INC_DIR) $(HB_INC_DIR)
AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
libfont_la_SOURCES = $(SRC_FILES) $(HDR_FILES)
+11 -8
View File
@@ -190,7 +190,7 @@ static void destroy (GLYPHTREENODE *root)
/*** device font ops ***/
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{
return DEVFONTGLYPHTYPE_PRERDRBMP;
}
@@ -210,8 +210,11 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
return ((BMPFONTINFO *)devfont->data)->height;
}
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
{
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
SET_DEVFONT_SCALE (logfont, df_slot, 1);
return ((BMPFONTINFO *)devfont->data)->height;
}
@@ -271,7 +274,7 @@ get_glyph_prbitmap (LOGFONT* logfont, DEVFONT* devfont,
bmp->bmHeight = 0;
bmp->bmPitch = 0;
_MG_PRINTF ("FONT>Bitmap: "
_DBG_PRINTF ("FONT>Bitmap: "
"Glyph %d does not exist and is replaced with default glyph. \n",
glyph_value);
return 1;
@@ -365,7 +368,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
/**************************** Global data ************************************/
FONTOPS __mg_bitmap_font_ops = {
get_glyph_type,
get_glyph_bmptype,
get_ave_width,
get_max_width,
get_font_height,
@@ -469,7 +472,7 @@ DEVFONT *CreateBMPDevFont (const char *bmpfont_name, const BITMAP* glyph_bmp,
{
DEVFONT* bitmapfont_dev_font = NULL;
CHARSETOPS* charset_ops;
char charset[LEN_FONT_NAME + 1];
char charset[LEN_LOGFONT_NAME_FIELD + 1];
BMPFONTINFO *bmpfont_info;
int offset;
@@ -484,7 +487,7 @@ DEVFONT *CreateBMPDevFont (const char *bmpfont_name, const BITMAP* glyph_bmp,
goto error_create;
}
offset = (charset_ops->char_glyph_value) (NULL, 0,
offset = (charset_ops->get_char_value) (NULL, 0,
(const unsigned char*) start_mchar, 0);
bmpfont_info = build_bmpfont_info (bmpfont_name, glyph_bmp,
@@ -547,7 +550,7 @@ BOOL AddGlyphsToBMPFont (DEVFONT* dev_font, BITMAP* glyph_bmp,
return FALSE;
/* Insert a node in the avl tree */
offset = (*dev_font->charset_ops->char_glyph_value) (NULL, 0,
offset = (*dev_font->charset_ops->get_char_value) (NULL, 0,
(const unsigned char*)start_mchar, 0);
if (look_up (root, offset) == NULL) {
@@ -641,7 +644,7 @@ static int avl_look_up (DEVFONT *dev_font, char *start_mchar, int n)
GLYPHTREENODE *p;
int offset;
offset = (*dev_font->charset_ops->char_glyph_value) (NULL, 0,
offset = (*dev_font->charset_ops->get_char_value) (NULL, 0,
(const unsigned char*)start_mchar, n);
offset += n;
+207 -194
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+391 -1156
View File
File diff suppressed because it is too large Load Diff
+333 -105
View File
File diff suppressed because it is too large Load Diff
+284
View File
@@ -0,0 +1,284 @@
#line 1 "emoji_presentation_scanner.rl"
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#line 9 "emoji_presentation_scanner.c"
static const char _emoji_presentation_actions[] = {
0, 1, 0, 1, 1, 1, 5, 1,
6, 1, 7, 1, 8, 1, 9, 1,
10, 1, 11, 2, 2, 3, 2, 2,
4
};
static const char _emoji_presentation_key_offsets[] = {
0, 5, 7, 14, 18, 20, 21, 24,
29, 30, 34, 36
};
static const unsigned char _emoji_presentation_trans_keys[] = {
3u, 7u, 13u, 0u, 2u, 14u, 15u, 2u,
3u, 6u, 7u, 13u, 0u, 1u, 9u, 10u,
11u, 12u, 10u, 12u, 10u, 4u, 10u, 12u,
4u, 9u, 10u, 11u, 12u, 6u, 9u, 10u,
11u, 12u, 8u, 10u, 9u, 10u, 11u, 12u,
14u, 0
};
static const char _emoji_presentation_single_lengths[] = {
3, 2, 5, 4, 2, 1, 3, 5,
1, 4, 2, 5
};
static const char _emoji_presentation_range_lengths[] = {
1, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0
};
static const char _emoji_presentation_index_offsets[] = {
0, 5, 8, 15, 20, 23, 25, 29,
35, 37, 42, 45
};
static const char _emoji_presentation_indicies[] = {
2, 1, 1, 1, 0, 4, 5, 3,
7, 8, 10, 11, 12, 6, 9, 5,
13, 14, 15, 0, 13, 15, 16, 13,
16, 15, 13, 15, 16, 15, 5, 13,
14, 15, 16, 5, 17, 5, 13, 14,
18, 17, 5, 13, 16, 5, 13, 14,
15, 4, 16, 0
};
static const char _emoji_presentation_trans_targs[] = {
2, 4, 6, 2, 1, 2, 3, 3,
7, 2, 8, 9, 11, 0, 2, 5,
2, 2, 10
};
static const char _emoji_presentation_trans_actions[] = {
17, 19, 19, 15, 0, 7, 22, 19,
19, 9, 0, 22, 19, 0, 5, 19,
11, 13, 19
};
static const char _emoji_presentation_to_state_actions[] = {
0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0
};
static const char _emoji_presentation_from_state_actions[] = {
0, 0, 3, 0, 0, 0, 0, 0,
0, 0, 0, 0
};
static const char _emoji_presentation_eof_trans[] = {
1, 4, 0, 1, 17, 17, 17, 17,
18, 18, 17, 17
};
static const int emoji_presentation_start = 2;
static const int emoji_presentation_en_text_and_emoji_run = 2;
#line 9 "emoji_presentation_scanner.rl"
#line 78 "emoji_presentation_scanner.rl"
static emoji_text_iter_t
scan_emoji_presentation (emoji_text_iter_t p,
const emoji_text_iter_t pe,
bool* is_emoji)
{
emoji_text_iter_t ts, te;
const emoji_text_iter_t eof = pe;
unsigned act;
int cs;
#line 107 "emoji_presentation_scanner.c"
{
cs = emoji_presentation_start;
ts = 0;
te = 0;
act = 0;
}
#line 115 "emoji_presentation_scanner.c"
{
int _klen;
unsigned int _trans;
const char *_acts;
unsigned int _nacts;
const unsigned char *_keys;
if ( p == pe )
goto _test_eof;
_resume:
_acts = _emoji_presentation_actions + _emoji_presentation_from_state_actions[cs];
_nacts = (unsigned int) *_acts++;
while ( _nacts-- > 0 ) {
switch ( *_acts++ ) {
case 1:
#line 1 "NONE"
{ts = p;}
break;
#line 134 "emoji_presentation_scanner.c"
}
}
_keys = _emoji_presentation_trans_keys + _emoji_presentation_key_offsets[cs];
_trans = _emoji_presentation_index_offsets[cs];
_klen = _emoji_presentation_single_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_mid;
const unsigned char *_upper = _keys + _klen - 1;
while (1) {
if ( _upper < _lower )
break;
_mid = _lower + ((_upper-_lower) >> 1);
if ( (*p) < *_mid )
_upper = _mid - 1;
else if ( (*p) > *_mid )
_lower = _mid + 1;
else {
_trans += (unsigned int)(_mid - _keys);
goto _match;
}
}
_keys += _klen;
_trans += _klen;
}
_klen = _emoji_presentation_range_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_mid;
const unsigned char *_upper = _keys + (_klen<<1) - 2;
while (1) {
if ( _upper < _lower )
break;
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
if ( (*p) < _mid[0] )
_upper = _mid - 2;
else if ( (*p) > _mid[1] )
_lower = _mid + 2;
else {
_trans += (unsigned int)((_mid - _keys)>>1);
goto _match;
}
}
_trans += _klen;
}
_match:
_trans = _emoji_presentation_indicies[_trans];
_eof_trans:
cs = _emoji_presentation_trans_targs[_trans];
if ( _emoji_presentation_trans_actions[_trans] == 0 )
goto _again;
_acts = _emoji_presentation_actions + _emoji_presentation_trans_actions[_trans];
_nacts = (unsigned int) *_acts++;
while ( _nacts-- > 0 )
{
switch ( *_acts++ )
{
case 2:
#line 1 "NONE"
{te = p+1;}
break;
case 3:
#line 74 "emoji_presentation_scanner.rl"
{act = 2;}
break;
case 4:
#line 75 "emoji_presentation_scanner.rl"
{act = 3;}
break;
case 5:
#line 73 "emoji_presentation_scanner.rl"
{te = p+1;{ *is_emoji = false; return te; }}
break;
case 6:
#line 74 "emoji_presentation_scanner.rl"
{te = p+1;{ *is_emoji = true; return te; }}
break;
case 7:
#line 75 "emoji_presentation_scanner.rl"
{te = p+1;{ *is_emoji = false; return te; }}
break;
case 8:
#line 74 "emoji_presentation_scanner.rl"
{te = p;p--;{ *is_emoji = true; return te; }}
break;
case 9:
#line 75 "emoji_presentation_scanner.rl"
{te = p;p--;{ *is_emoji = false; return te; }}
break;
case 10:
#line 74 "emoji_presentation_scanner.rl"
{{p = ((te))-1;}{ *is_emoji = true; return te; }}
break;
case 11:
#line 1 "NONE"
{ switch( act ) {
case 2:
{{p = ((te))-1;} *is_emoji = true; return te; }
break;
case 3:
{{p = ((te))-1;} *is_emoji = false; return te; }
break;
}
}
break;
#line 248 "emoji_presentation_scanner.c"
}
}
_again:
_acts = _emoji_presentation_actions + _emoji_presentation_to_state_actions[cs];
_nacts = (unsigned int) *_acts++;
while ( _nacts-- > 0 ) {
switch ( *_acts++ ) {
case 0:
#line 1 "NONE"
{ts = 0;}
break;
#line 261 "emoji_presentation_scanner.c"
}
}
if ( ++p != pe )
goto _resume;
_test_eof: {}
if ( p == eof )
{
if ( _emoji_presentation_eof_trans[cs] > 0 ) {
_trans = _emoji_presentation_eof_trans[cs] - 1;
goto _eof_trans;
}
}
}
#line 94 "emoji_presentation_scanner.rl"
/* Should not be reached. */
ts = ts + 0; // suppress compilation warning.
*is_emoji = false;
return pe;
}
+15 -11
View File
@@ -1,45 +1,48 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Or,
*
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
#include "common.h"
#include "minigui.h"
#include "gdi.h"
typedef struct {
char* type;
FONTOPS* ops;
char* type;
FONTOPS* ops;
}FONTOPS_INFO;
extern FONTOPS __mg_null_font_ops;
#ifdef _MGFONT_RBF
extern FONTOPS __mg_rbf_ops;
#endif
@@ -61,6 +64,7 @@ extern FONTOPS __mg_ttf_ops;
#endif
FONTOPS_INFO __mg_fontops_infos[] = {
{FONT_TYPE_NAME_BITMAP_NUF, &__mg_null_font_ops},
#ifdef _MGFONT_RBF
{FONT_TYPE_NAME_BITMAP_RAW, &__mg_rbf_ops},
#endif
+33 -78
View File
@@ -43,20 +43,11 @@
#include "common.h"
#ifdef _MGFONT_TTF_CACHE
#if defined(_MGFONT_FT2) && defined(_MGFONT_TTF_CACHE)
#include "minigui.h"
#include "gdi.h"
#ifdef _MGFONT_TTF
#include <freetype/freetype.h>
#include <freetype/ftxkern.h>
#include <freetype/ftnameid.h>
#include <freetype/ftxcmap.h>
#include <freetype/ftxwidth.h>
#include "freetype.h"
#else
#include "freetype2.h"
#endif
typedef struct _MemBlk {
void *data;
@@ -85,15 +76,12 @@ typedef struct _HashDirectory {
*hashDir : the hash directory pointer
lruQueueDummyHead : head node of lru queue
makeHashKeyFunc : the function which make hash key */
typedef struct cache {
typedef struct _FontCache {
/* Information about font */
char family[LEN_FONT_NAME + 1];
// VincentWei: no need to check charset for TrueType
//char charset[LEN_FONT_NAME + 1];
int render_style; // render style
char df_name[LEN_UNIDEVFONT_NAME + 1];
int style;
int fontsize;
int rotation;
int refers;
int blkSize;
int nBlk;
@@ -103,7 +91,7 @@ typedef struct cache {
HashDirectory *hashDir;
LruQueueDummyHead lruQueueDummyHead;
MakeHashKeyFunc makeHashKeyFunc;
} cache_t;
} FontCache;
/* Least-Recently-Used-Order
global cache LRU queue */
@@ -111,7 +99,7 @@ typedef struct _CacheQueueNode
{
/* hold global cache queue
max cache node maybe 10 */
cache_t cache;
FontCache cache;
struct _CacheQueueNode *prevCache;
struct _CacheQueueNode *nextCache;
}CacheQueueNode;
@@ -149,7 +137,7 @@ AppendCache(CacheQueueNode *new)
/* create a new LRU-Queue. */
static int
CreateCacheLruQueue(cache_t *cache, int nblk)
CreateCacheLruQueue(FontCache *cache, int nblk)
{
int i;
MemBlk *blk;
@@ -221,7 +209,7 @@ InitCache(CacheQueueNode *new, int ndir, int nblock)
static void
LruQueueBufferSplit(cache_t *cache, int bufsize)
LruQueueBufferSplit(FontCache *cache, int bufsize)
{
MemBlk *blk;
unsigned char *buff;
@@ -236,7 +224,7 @@ LruQueueBufferSplit(cache_t *cache, int bufsize)
}
static void
DestroyCache(cache_t *cache)
DestroyCache(FontCache *cache)
{
if (cache->hashDir != NULL) {
free(cache->hashDir);
@@ -325,7 +313,7 @@ GetCache(int nblock, int ndir)
lru-queue and also Hash queue(anywhere in hash q).
Relink the lru queue and hash queue */
static MemBlk *
PickOffBlk(cache_t *cache)
PickOffBlk(FontCache *cache)
{
MemBlk *blk;
@@ -352,7 +340,7 @@ PickOffBlk(cache_t *cache)
}
static void
AppendBlk(cache_t *cache, MemBlk *blk, int key)
AppendBlk(FontCache *cache, MemBlk *blk, int key)
{
/* first, append the blcok at the end of the
lru-queue. */
@@ -381,7 +369,7 @@ AppendBlk(cache_t *cache, MemBlk *blk, int key)
*size : if found the data, how long is the data(return val)
reutrn = pointer to the data */
TTFCACHEINFO *
__mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size)
{
int key;
CacheQueueNode *ca;
@@ -391,7 +379,7 @@ __mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
return NULL;
}
ca = (CacheQueueNode *)(hCache);
key = ca->cache.makeHashKeyFunc(unicode);
key = ca->cache.makeHashKeyFunc(gv);
if (key > (ca->cache.nDir - 1)) {
return NULL;
}
@@ -399,7 +387,8 @@ __mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
for ( ; blk != &(ca->cache.hashDir[key].hashHead);
blk = blk->hashNext) {
if (*(unsigned short *)(blk->data) == unicode) {
TTFCACHEINFO* tci = (TTFCACHEINFO*)blk->data;
if (tci->glyph_code == gv) {
/* If found the blk, we should pick off it
and link it at the end of LRU-q */
*size = blk->len;
@@ -409,17 +398,18 @@ __mg_ttc_search(HCACHE hCache, unsigned short unicode, int *size)
blk->lruPrev = ca->cache.lruQueueDummyHead.lruPrev;
(ca->cache.lruQueueDummyHead.lruPrev)->lruNext = blk;
ca->cache.lruQueueDummyHead.lruPrev = blk;
return blk->data;
return tci;
}
}
return NULL;
}
/* add data into a speicial cache
/* add data into the specific cache
hCache : which cache ,
*data : your data pointer
size : your data's bytes
key : hash key of your data */
key : hash key of your data
*/
int
__mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
{
@@ -434,7 +424,7 @@ __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
if (ca->cache.blkSize < size) {
return -1;
}
key = ca->cache.makeHashKeyFunc(*(unsigned short *)data);
key = ca->cache.makeHashKeyFunc(data->glyph_code);
/* pick off a block from lru queue */
if ((blk = PickOffBlk(&ca->cache)) == NULL) {
@@ -461,12 +451,11 @@ __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
ndir : how many hash entries in the cache
makeHashKey : the function which make the hash key */
HCACHE
__mg_ttc_create(char *family, char *charset,
DWORD style, int size, int rotation,
__mg_ttc_create(const char *df_name, int style, int size, int rotation,
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey)
{
CacheQueueNode *temp;
if (family == NULL || /* charset == NULL || */makeHashKey == NULL) {
if (df_name == NULL || makeHashKey == NULL) {
return (HCACHE)(0);
}
if (nblk <= 0 || blksize <= 0 || size <= 0 || ndir <= 0) {
@@ -480,9 +469,9 @@ __mg_ttc_create(char *family, char *charset,
return (HCACHE)(0);
}
strncpy(temp->cache.family, family, LEN_FONT_NAME);
//strncpy(temp->cache.charset, charset, LEN_FONT_NAME);
temp->cache.render_style = (style & FS_RENDER_MASK);
memset(temp->cache.df_name, 0, LEN_UNIDEVFONT_NAME + 1);
strncpy(temp->cache.df_name, df_name, LEN_UNIDEVFONT_NAME);
temp->cache.style = style & FS_RENDER_MASK;
temp->cache.fontsize = size;
temp->cache.rotation = rotation;
temp->cache.blkSize = blksize;
@@ -572,11 +561,8 @@ __mg_ttc_sys_deinit(void)
}
}
HCACHE
__mg_ttc_is_exist(char *family, char *charset,
DWORD style, int size, int rotation)
__mg_ttc_is_exist(const char *df_name, int style, int size, int rotation)
{
CacheQueueNode *p;
@@ -584,44 +570,17 @@ __mg_ttc_is_exist(char *family, char *charset,
return (HCACHE)0;
}
#if 0 // VincentWei: Use FS_RENDER_MASK insead (3.4.0)
/* If can not match font name*/
p = __mg_globalCache.queueDummyHead.nextCache;
while (p != &__mg_globalCache.queueDummyHead) {
if (strncmp(p->cache.family, family, LEN_FONT_NAME) == 0) {
if (strncmp(p->cache.charset, charset, LEN_FONT_NAME) == 0) {
if (p->cache.fontsize == size) {
int s = style & 0x000000FF;
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;
}
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;
}
#else
p = __mg_globalCache.queueDummyHead.nextCache;
while (p != &__mg_globalCache.queueDummyHead) {
if (strncmp(p->cache.family, family, LEN_FONT_NAME) == 0
#if 0 // VincentWei: do not need to check charset.
&& strncmp(p->cache.charset, charset, LEN_FONT_NAME) == 0
#endif
if (strncmp(p->cache.df_name, df_name, LEN_UNIDEVFONT_NAME) == 0
&& p->cache.style == (style & FS_RENDER_MASK)
&& p->cache.fontsize == size
&& p->cache.rotation == rotation
&& (style & FS_RENDER_MASK) == p->cache.render_style) {
&& p->cache.rotation == rotation) {
return (HCACHE) p;
}
p = p->nextCache;
}
#endif
return (HCACHE)0;
}
@@ -675,15 +634,13 @@ void __mg_ttc_dump_all(void)
}
}
void __mg_ttc_dump(cache_t *cache)
void __mg_ttc_dump(FontCache *cache)
{
int i, j, k;
MemBlk *ptr;
#if 0
DP(("&cache = %p\n", cache));
DP(("cache.family = %s\n", cache->family));
DP(("cache.charset = %s\n", cache->charset));
DP(("cache.style = %d\n", cache->style));
DP(("cache.df_name = %s\n", cache->df_name));
DP(("cache.fontsize = %d\n", cache->fontsize));
DP(("cache.blkSize = %d\n", cache->blkSize));
DP(("cache.refers = %d\n", cache->refers));
@@ -729,7 +686,6 @@ void
__mg_ttc_dump_cacheinfo(TTFCACHEINFO *ca)
{
DP(("Dump TTFCACHEINFO %p...\n", ca));
DP(("cacheInfo->unicode = %d\n", ca->unicode));
DP(("cacheInfo->glyph_code = %d\n", ca->glyph_code));
DP(("cacheInfo->cur_xmin = %d, cacheInfo->cur_ymin = %d\n",
@@ -748,7 +704,6 @@ void
__mg_ttc_dump_instance(TTFINSTANCEINFO *in)
{
DP(("Dump TTFINSTANCEINFO %p...\n", in));
DP(("Instance->cur_unicode = %d\n", in->cur_unicode));
DP(("Instance->cur_glyph_code = %d\n", in->cur_glyph_code));
DP(("Instance->outline(addr) = %p\n", &in->cur_outline));
DP(("Instance->cur_xmin = %d, Instance->cur_ymin = %d\n",
@@ -765,5 +720,5 @@ __mg_ttc_dump_instance(TTFINSTANCEINFO *in)
#endif /* 0 */
#endif /* _MGFONT_TTF_CACHE */
#endif /* defined(_MGFONT_FT2) && defined(_MGFONT_TTF_CACHE) */
+175 -29
View File
@@ -42,6 +42,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "common.h"
#include "minigui.h"
@@ -70,7 +71,7 @@ int fontConvertFontType (const char* type)
if (strcasecmp (type, FONT_TYPE_NAME_SCALE_T1F) == 0)
return FONT_TYPE_SCALE_T1F;
if (strcasecmp (type, FONT_TYPE_NAME_ALL) == 0)
return FONT_TYPE_ALL;
return FONT_TYPE_ANY;
return -1;
}
@@ -96,7 +97,7 @@ BOOL fontGetTypeNameFromName (const char* name, char* type)
int fontGetFontTypeFromName (const char* name)
{
char type [LEN_FONT_NAME + 1];
char type [LEN_LOGFONT_NAME_FIELD + 1];
if (!fontGetTypeNameFromName (name, type))
return -1;
@@ -114,8 +115,8 @@ BOOL fontGetFamilyFromName (const char* name, char* family)
if (*(++family_part) == '\0')
return FALSE;
while (family_part [i] && i <= LEN_FONT_NAME) {
if (family_part [i] == '-') {
while (family_part [i] && i <= LEN_LOGFONT_FAMILY_FIELD) {
if (family_part [i] == '-'/* || family_part [i] == ',' */) {
family [i] = '\0';
break;
}
@@ -127,6 +128,99 @@ BOOL fontGetFamilyFromName (const char* name, char* family)
return TRUE;
}
static BOOL get_family_part_lower (const char* name, char* family)
{
int i = 0;
const char* family_part;
if ((family_part = strchr (name, '-')) == NULL)
return FALSE;
if (*(++family_part) == '\0')
return FALSE;
while (family_part [i] && i <= LEN_UNIDEVFONT_NAME) {
if (family_part [i] == '-') {
family [i] = '\0';
break;
}
family [i] = tolower(family_part [i]);
i++;
}
return TRUE;
}
#if 0
static const char *my_strstr(const char *haystack, const char *needle)
{
int i = 0, j = 0;
int tmp = i;
int str_len = strlen(haystack);
int substr_len = strlen(needle);
for (i = 0; i < str_len - substr_len; i++) {
tmp = i;
for (j = 0; j < substr_len; j++) {
if (haystack[tmp] == needle[j]) {
if (j == substr_len - 1)
return haystack + i;
tmp++;
}
else
break;
}
}
return NULL;
}
#endif
/* devfont family specification:
* family[,alias]...
*/
BOOL fontDoesMatchFamily (const char* name, const char* family)
{
// make sure there is a redundant space for the head and tail characters.
char family_part[LEN_LOGFONT_FAMILY_FIELD + 3];
char family_request[LEN_LOGFONT_NAME_FIELD + 3];
int i;
size_t len;
// add ',' to the head
family_part[0] = ',';
if (!get_family_part_lower(name, family_part + 1)) {
return FALSE;
}
// add ',' to the tail
len = strlen(family_part);
family_part[len] = ',';
family_part[len + 1] = '\0';
// make family (lowercase)
family_request[0] = ',';
i = 0;
while (family[i] && i < LEN_LOGFONT_NAME_FIELD) {
family_request[i + 1] = tolower(family[i]);
i++;
}
family_request[i + 1] = '\0';
// add ',' to the tail
len = strlen(family_request);
family_request[len] = ',';
family_request[len + 1] = '\0';
// try to match "<family_request>,"
if (strstr(family_part, family_request)) {
return TRUE;
}
return FALSE;
}
DWORD fontConvertStyle (const char* style_part)
{
DWORD style = 0;
@@ -142,7 +236,7 @@ DWORD fontConvertStyle (const char* style_part)
case FONT_WEIGHT_BOLD:
style |= FS_WEIGHT_BOLD;
break;
/* deprecated since v3.2.1
/* deprecated since v3.4.0
case FONT_WEIGHT_BOOK:
style |= FS_WEIGHT_BOOK;
break;
@@ -156,6 +250,9 @@ DWORD fontConvertStyle (const char* style_part)
case FONT_WEIGHT_REGULAR:
style |= FS_WEIGHT_REGULAR;
break;
case FONT_WEIGHT_NORMAL:
style |= FS_WEIGHT_NORMAL;
break;
case FONT_WEIGHT_LIGHT:
style |= FS_WEIGHT_LIGHT;
break;
@@ -165,7 +262,7 @@ DWORD fontConvertStyle (const char* style_part)
case FONT_WEIGHT_THIN:
style |= FS_WEIGHT_THIN;
break;
/* deprecated since v3.2.1
/* deprecated since v3.4.0
case FONT_WEIGHT_SUBPIXEL:
style |= FS_WEIGHT_SUBPIXEL;
break;
@@ -173,6 +270,7 @@ DWORD fontConvertStyle (const char* style_part)
style |= FS_WEIGHT_MASK;
break;
*/
case FONT_WEIGHT_ANY:
default:
style |= FS_WEIGHT_ANY;
break;
@@ -189,11 +287,10 @@ DWORD fontConvertStyle (const char* style_part)
case FONT_SLANT_ROMAN:
style |= FS_SLANT_ROMAN;
break;
case FONT_SLANT_ALL:
style |= FS_SLANT_MASK;
break;
case FONT_SLANT_ANY:
default:
return 0xFFFFFFFF;
style |= FS_SLANT_ANY;
break;
}
style &= ~FS_FLIP_MASK;
@@ -208,6 +305,7 @@ DWORD fontConvertStyle (const char* style_part)
style |= FS_FLIP_HORZVERT;
break;
default:
//style |= FS_FLIP_NONE;
break;
}
@@ -225,13 +323,8 @@ DWORD fontConvertStyle (const char* style_part)
case FONT_OTHER_TTFNOCACHEKERN:
style |= FS_OTHER_TTFNOCACHEKERN;
break;
case FONT_OTHER_LCDPORTRAIT:
style |= FS_OTHER_LCDPORTRAIT;
break;
case FONT_OTHER_LCDPORTRAITKERN:
style |= FS_OTHER_LCDPORTRAITKERN;
break;
default:
//style |= FS_OTHER_NONE;
break;
}
@@ -245,10 +338,18 @@ DWORD fontConvertStyle (const char* style_part)
case FONT_DECORATE_STRUCKOUT:
style |= FS_DECORATE_STRUCKOUT;
break;
case FONT_DECORATE_BOTH:
style |= FS_DECORATE_BOTH;
case FONT_DECORATE_REVERSE:
style |= FS_DECORATE_REVERSE;
break;
case FONT_DECORATE_OUTLINE:
style |= FS_DECORATE_OUTLINE;
break;
case FONT_DECORATE_US:
style |= FS_DECORATE_UNDERLINE;
style |= FS_DECORATE_STRUCKOUT;
break;
default:
//style |= FS_DECORATE_NONE;
break;
}
@@ -257,9 +358,6 @@ DWORD fontConvertStyle (const char* style_part)
case FONT_RENDER_MONO:
style |= FS_RENDER_MONO;
break;
case FONT_RENDER_OUTLINE:
style |= FS_RENDER_OUTLINE;
break;
case FONT_RENDER_GREY:
style |= FS_RENDER_GREY;
break;
@@ -347,7 +445,7 @@ int fontGetWidthFromName (const char* name)
{
int i;
const char* width_part = name;
char width [LEN_FONT_NAME + 1];
char width [LEN_LOGFONT_NAME_FIELD + 1];
for (i = 0; i < NR_LOOP_FOR_WIDTH; i++) {
if ((width_part = strchr (width_part, '-')) == NULL)
@@ -374,11 +472,59 @@ int fontGetWidthFromName (const char* name)
return atoi (width);
}
/* Since 3.4.0; only for LOGFONT name */
char fontGetOrientFromName (const char* name)
{
int i;
const char* orient_part = name;
char orient [LEN_LOGFONT_NAME_FIELD + 1];
for (i = 0; i < NR_LOOP_FOR_ORIENT; i++) {
if ((orient_part = strchr (orient_part, '-')) == NULL)
return FONT_ORIENT_UPRIGHT;
if (*(++orient_part) == '\0')
return FONT_ORIENT_UPRIGHT;
}
i = 0;
while (orient_part [i]) {
if (orient_part [i] == '-') {
orient [i] = '\0';
break;
}
orient [i] = orient_part [i];
i++;
}
if (orient_part [i] == '\0')
return FONT_ORIENT_UPRIGHT;
return orient[0];
}
int fontGetOrientPosFromName (const char* name)
{
int i;
const char* orient_part = name;
for (i = 0; i < NR_LOOP_FOR_ORIENT; i++) {
if ((orient_part = strchr (orient_part, '-')) == NULL)
return -1;
if (*(++orient_part) == '\0')
return -1;
}
return orient_part - name;
}
int fontGetHeightFromName (const char* name)
{
int i;
const char* height_part = name;
char height [LEN_FONT_NAME + 1];
char height [LEN_LOGFONT_NAME_FIELD + 1];
for (i = 0; i < NR_LOOP_FOR_HEIGHT; i++) {
if ((height_part = strchr (height_part, '-')) == NULL)
@@ -425,8 +571,8 @@ BOOL fontGetCharsetFromName (const char* name, char* charset)
return TRUE;
}
strncpy (charset, charset_part, LEN_FONT_NAME);
charset [LEN_FONT_NAME] = '\0';
strncpy (charset, charset_part, LEN_LOGFONT_NAME_FIELD);
charset [LEN_LOGFONT_NAME_FIELD] = '\0';
return TRUE;
}
@@ -448,8 +594,8 @@ BOOL fontGetCompatibleCharsetFromName (const char* name, char* charset)
if (*(++charset_part) == '\0')
return FALSE;
strncpy (charset, charset_part, LEN_FONT_NAME);
charset [LEN_FONT_NAME] = '\0';
strncpy (charset, charset_part, LEN_LOGFONT_NAME_FIELD);
charset [LEN_LOGFONT_NAME_FIELD] = '\0';
return TRUE;
}
@@ -507,8 +653,8 @@ BOOL charsetGetSpecificCharset (const char* charsets, int _index, char* charset)
return TRUE;
}
strncpy (charset, charsets, LEN_FONT_NAME);
charset [LEN_FONT_NAME] = '\0';
strncpy (charset, charsets, LEN_LOGFONT_NAME_FIELD);
charset [LEN_LOGFONT_NAME_FIELD] = '\0';
return TRUE;
}
+131 -122
View File
File diff suppressed because it is too large Load Diff
+504 -382
View File
File diff suppressed because it is too large Load Diff
+47 -37
View File
@@ -1,33 +1,33 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Or,
*
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
@@ -40,6 +40,12 @@
#ifndef GUI_FREETYP2_H
#define GUI_FREETYP2_H
#ifndef TTF_DBG
#define DP(x)
#else
#define DP(x) do { printf x; } while (0)
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -63,19 +69,17 @@ extern "C" {
#endif
#ifdef _MGFONT_TTF_CACHE
typedef unsigned long HCACHE;
typedef int (* MakeHashKeyFunc)(unsigned short unicode);
#endif
typedef void* HCACHE;
typedef int (* MakeHashKeyFunc)(Glyph32 gv);
#endif
typedef struct tagFTFACEINFO {
#ifdef _MGFONT_TTF_CACHE
/*should be MAX_PATH*/
char filepathname[256];
char* filepathname;
int face_index;
int cmap_index;
#else
FT_Face face;
#endif
FT_Face face;
BOOL valid;
} FTFACEINFO, *PFTFACEINFO;
@@ -85,9 +89,8 @@ typedef struct tagFTINSTANCEINFO {
FTC_ImageTypeRec image_type;
FT_Int glyph_done;
HCACHE cache;
#else
FT_Size size;
#endif
FT_Size size;
FT_Matrix matrix;
FT_Glyph glyph;
int rotation;
@@ -101,11 +104,12 @@ typedef struct tagFTINSTANCEINFO {
int ascent;
int descent;
FT_Bool use_kerning; /*FT_HAS_KERNING(face)*/
FT_Vector delta;
int is_index_old;
FT_Bool use_kerning;
FT_UInt cur_index;
#if 0
int is_index_old;
FT_UInt prev_index;
#endif
FT_LcdFilter ft_lcdfilter;
} FTINSTANCEINFO, *PFTINSTANCEINFO;
@@ -114,38 +118,44 @@ typedef struct tagFTINSTANCEINFO {
#define _TTF_HASH_NDIR 37
#define CACHE_VALID_ADVANCE 0x01
#define CACHE_VALID_BBOX 0x02
#define CACHE_VALID_BITMAP 0x04
typedef struct tagTTFCACHEINFO {
unsigned short unicode;
short glyph_code;
FT_UInt glyph_code;
Uint32 valid_advance:1;
Uint32 valid_bbox:1;
Uint32 valid_bitmap:1;
Uint32 reserved_flags:28;
FT_Vector advance;
FT_BBox bbox;
FT_Vector delta;
int flag;
int pitch;
int width;
int height;
void *bitmap;
} TTFCACHEINFO, *PTTFCACHEINFO;
extern HCACHE __mg_ttc_create(char *family, char *charset,
DWORD style, int size, int rotation,
extern HCACHE __mg_ttc_create(const char *df_name,
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 void __mg_ttc_release(HCACHE hCache);
extern int __mg_ttc_sys_init(int maxCache, int cacheSize);
extern void __mg_ttc_sys_deinit(void);
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache,
unsigned short unicode, int *size);
extern HCACHE __mg_ttc_is_exist(char *family, char *charset,
DWORD style, int size, int rotation);
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
extern void __mg_ttc_refer(HCACHE hCache);
#ifdef _MGCOMPLEX_SCRIPTS
extern void __mg_init_harzbuff_funcs(void);
extern void __mg_term_harzbuff_funcs(void);
#endif
#undef TTF_DBG
#ifndef TTF_DBG
#define DP(x)
#else
#define DP(x) do { printf x; } while (0)
#endif
#ifdef __cplusplus
File diff suppressed because it is too large Load Diff
-201
View File
@@ -1,201 +0,0 @@
/*
* 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/>.
*/
#ifndef __G_UNICODE_H__
#define __G_UNICODE_H__
/* These are the possible character classifications.
* See http://www.unicode.org/Public/UNIDATA/UCD.html#General_Category_Values
*/
#if 0 /* VincentWei: Moved to gid.h */
typedef enum
{
G_UNICODE_CONTROL,
G_UNICODE_FORMAT,
G_UNICODE_UNASSIGNED,
G_UNICODE_PRIVATE_USE,
G_UNICODE_SURROGATE,
G_UNICODE_LOWERCASE_LETTER,
G_UNICODE_MODIFIER_LETTER,
G_UNICODE_OTHER_LETTER,
G_UNICODE_TITLECASE_LETTER,
G_UNICODE_UPPERCASE_LETTER,
G_UNICODE_COMBINING_MARK,
G_UNICODE_ENCLOSING_MARK,
G_UNICODE_NON_SPACING_MARK,
G_UNICODE_DECIMAL_NUMBER,
G_UNICODE_LETTER_NUMBER,
G_UNICODE_OTHER_NUMBER,
G_UNICODE_CONNECT_PUNCTUATION,
G_UNICODE_DASH_PUNCTUATION,
G_UNICODE_CLOSE_PUNCTUATION,
G_UNICODE_FINAL_PUNCTUATION,
G_UNICODE_INITIAL_PUNCTUATION,
G_UNICODE_OTHER_PUNCTUATION,
G_UNICODE_OPEN_PUNCTUATION,
G_UNICODE_CURRENCY_SYMBOL,
G_UNICODE_MODIFIER_SYMBOL,
G_UNICODE_MATH_SYMBOL,
G_UNICODE_OTHER_SYMBOL,
G_UNICODE_LINE_SEPARATOR,
G_UNICODE_PARAGRAPH_SEPARATOR,
G_UNICODE_SPACE_SEPARATOR
} GUnicodeType;
#endif /* VincentWei: Moved to gid.h */
/* These are the possible line break classifications.
* Note that new types may be added in the future.
* Implementations may regard unknown values like G_UNICODE_BREAK_UNKNOWN
* See http://www.unicode.org/unicode/reports/tr14/
*/
typedef enum
{
G_UNICODE_BREAK_MANDATORY,
G_UNICODE_BREAK_CARRIAGE_RETURN,
G_UNICODE_BREAK_LINE_FEED,
G_UNICODE_BREAK_COMBINING_MARK,
G_UNICODE_BREAK_SURROGATE,
G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
G_UNICODE_BREAK_INSEPARABLE,
G_UNICODE_BREAK_NON_BREAKING_GLUE,
G_UNICODE_BREAK_CONTINGENT,
G_UNICODE_BREAK_SPACE,
G_UNICODE_BREAK_AFTER,
G_UNICODE_BREAK_BEFORE,
G_UNICODE_BREAK_BEFORE_AND_AFTER,
G_UNICODE_BREAK_HYPHEN,
G_UNICODE_BREAK_NON_STARTER,
G_UNICODE_BREAK_OPEN_PUNCTUATION,
G_UNICODE_BREAK_CLOSE_PUNCTUATION,
G_UNICODE_BREAK_QUOTATION,
G_UNICODE_BREAK_EXCLAMATION,
G_UNICODE_BREAK_IDEOGRAPHIC,
G_UNICODE_BREAK_NUMERIC,
G_UNICODE_BREAK_INFIX_SEPARATOR,
G_UNICODE_BREAK_SYMBOL,
G_UNICODE_BREAK_ALPHABETIC,
G_UNICODE_BREAK_PREFIX,
G_UNICODE_BREAK_POSTFIX,
G_UNICODE_BREAK_COMPLEX_CONTEXT,
G_UNICODE_BREAK_AMBIGUOUS,
G_UNICODE_BREAK_UNKNOWN,
G_UNICODE_BREAK_NEXT_LINE,
G_UNICODE_BREAK_WORD_JOINER,
G_UNICODE_BREAK_HANGUL_L_JAMO,
G_UNICODE_BREAK_HANGUL_V_JAMO,
G_UNICODE_BREAK_HANGUL_T_JAMO,
G_UNICODE_BREAK_HANGUL_LV_SYLLABLE,
G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE
} GUnicodeBreakType;
typedef enum
{ /* ISO 15924 code */
G_UNICODE_SCRIPT_INVALID_CODE = -1,
G_UNICODE_SCRIPT_COMMON = 0, /* Zyyy */
G_UNICODE_SCRIPT_INHERITED, /* Qaai */
G_UNICODE_SCRIPT_ARABIC, /* Arab */
G_UNICODE_SCRIPT_ARMENIAN, /* Armn */
G_UNICODE_SCRIPT_BENGALI, /* Beng */
G_UNICODE_SCRIPT_BOPOMOFO, /* Bopo */
G_UNICODE_SCRIPT_CHEROKEE, /* Cher */
G_UNICODE_SCRIPT_COPTIC, /* Qaac */
G_UNICODE_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
G_UNICODE_SCRIPT_DESERET, /* Dsrt */
G_UNICODE_SCRIPT_DEVANAGARI, /* Deva */
G_UNICODE_SCRIPT_ETHIOPIC, /* Ethi */
G_UNICODE_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
G_UNICODE_SCRIPT_GOTHIC, /* Goth */
G_UNICODE_SCRIPT_GREEK, /* Grek */
G_UNICODE_SCRIPT_GUJARATI, /* Gujr */
G_UNICODE_SCRIPT_GURMUKHI, /* Guru */
G_UNICODE_SCRIPT_HAN, /* Hani */
G_UNICODE_SCRIPT_HANGUL, /* Hang */
G_UNICODE_SCRIPT_HEBREW, /* Hebr */
G_UNICODE_SCRIPT_HIRAGANA, /* Hira */
G_UNICODE_SCRIPT_KANNADA, /* Knda */
G_UNICODE_SCRIPT_KATAKANA, /* Kana */
G_UNICODE_SCRIPT_KHMER, /* Khmr */
G_UNICODE_SCRIPT_LAO, /* Laoo */
G_UNICODE_SCRIPT_LATIN, /* Latn (Latf, Latg) */
G_UNICODE_SCRIPT_MALAYALAM, /* Mlym */
G_UNICODE_SCRIPT_MONGOLIAN, /* Mong */
G_UNICODE_SCRIPT_MYANMAR, /* Mymr */
G_UNICODE_SCRIPT_OGHAM, /* Ogam */
G_UNICODE_SCRIPT_OLD_ITALIC, /* Ital */
G_UNICODE_SCRIPT_ORIYA, /* Orya */
G_UNICODE_SCRIPT_RUNIC, /* Runr */
G_UNICODE_SCRIPT_SINHALA, /* Sinh */
G_UNICODE_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
G_UNICODE_SCRIPT_TAMIL, /* Taml */
G_UNICODE_SCRIPT_TELUGU, /* Telu */
G_UNICODE_SCRIPT_THAANA, /* Thaa */
G_UNICODE_SCRIPT_THAI, /* Thai */
G_UNICODE_SCRIPT_TIBETAN, /* Tibt */
G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
G_UNICODE_SCRIPT_YI, /* Yiii */
G_UNICODE_SCRIPT_TAGALOG, /* Tglg */
G_UNICODE_SCRIPT_HANUNOO, /* Hano */
G_UNICODE_SCRIPT_BUHID, /* Buhd */
G_UNICODE_SCRIPT_TAGBANWA, /* Tagb */
/* Unicode-4.0 additions */
G_UNICODE_SCRIPT_BRAILLE, /* Brai */
G_UNICODE_SCRIPT_CYPRIOT, /* Cprt */
G_UNICODE_SCRIPT_LIMBU, /* Limb */
G_UNICODE_SCRIPT_OSMANYA, /* Osma */
G_UNICODE_SCRIPT_SHAVIAN, /* Shaw */
G_UNICODE_SCRIPT_LINEAR_B, /* Linb */
G_UNICODE_SCRIPT_TAI_LE, /* Tale */
G_UNICODE_SCRIPT_UGARITIC, /* Ugar */
/* Unicode-4.1 additions */
G_UNICODE_SCRIPT_NEW_TAI_LUE, /* Talu */
G_UNICODE_SCRIPT_BUGINESE, /* Bugi */
G_UNICODE_SCRIPT_GLAGOLITIC, /* Glag */
G_UNICODE_SCRIPT_TIFINAGH, /* Tfng */
G_UNICODE_SCRIPT_SYLOTI_NAGRI, /* Sylo */
G_UNICODE_SCRIPT_OLD_PERSIAN, /* Xpeo */
G_UNICODE_SCRIPT_KHAROSHTHI, /* Khar */
/* Unicode-5.0 additions */
G_UNICODE_SCRIPT_UNKNOWN, /* Zzzz */
G_UNICODE_SCRIPT_BALINESE, /* Bali */
G_UNICODE_SCRIPT_CUNEIFORM, /* Xsux */
G_UNICODE_SCRIPT_PHOENICIAN, /* Phnx */
G_UNICODE_SCRIPT_PHAGS_PA, /* Phag */
G_UNICODE_SCRIPT_NKO /* Nkoo */
} GUnicodeScript;
#endif /* __G_UNICODE_H__ */
+157
View File
@@ -0,0 +1,157 @@
/*
* 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/>.
*/
/*
** harzbuff-minigui-funcs.c:
**
** Functions for using HarfBuzz with the MiniGUI to provide Unicode data.
**
** Create by WEI Yongming at 2019/03/14
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#if defined(_MGCHARSET_UNICODE) && defined(_MGCOMPLEX_SCRIPTS)
#include "minigui.h"
#include "gdi.h"
#include <hb.h>
static hb_unicode_combining_class_t
hb_minigui_unicode_combining_class (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode,
void *user_data)
{
return (hb_unicode_combining_class_t) UCharCombiningClass (unicode);
}
static hb_unicode_general_category_t
hb_minigui_unicode_general_category (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode,
void *user_data)
{
/* hb_unicode_general_category_t and GUnicodeType are identical */
return (hb_unicode_general_category_t) UCharGetCategory (unicode);
}
static hb_codepoint_t
hb_minigui_unicode_mirroring (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode,
void *user_data)
{
UCharGetMirror (unicode, &unicode);
return unicode;
}
static hb_script_t
hb_minigui_unicode_script (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode,
void *user_data)
{
return ScriptTypeToISO15924 (UCharGetScriptType(unicode));
}
static hb_bool_t
hb_minigui_unicode_compose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t a,
hb_codepoint_t b,
hb_codepoint_t *ab,
void *user_data)
{
return UCharCompose (a, b, ab);
}
static hb_bool_t
hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t ab,
hb_codepoint_t *a,
hb_codepoint_t *b,
void *user_data)
{
return UCharDecompose(ab, a, b);
}
static hb_unicode_funcs_t *funcs;
static hb_unicode_funcs_t *get_unicode_funcs(void)
{
funcs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (funcs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (funcs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (funcs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (funcs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (funcs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (funcs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (funcs);
return funcs;
}
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
void __mg_init_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
__hb_extern_get_unicode_funcs = get_unicode_funcs;
}
void __mg_term_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
if (funcs) {
hb_unicode_funcs_destroy(funcs);
}
else {
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
__FUNCTION__);
}
}
#endif /* defined(_MGCHARSET_UNICODE) && defined(_MGCOMPLEX_SCRIPTS) */
File diff suppressed because it is too large Load Diff
+85
View File
@@ -0,0 +1,85 @@
/* == Start of generated table == */
/*
* The following table is generated by running:
*
* ./gen-ascii-bidi-tables.py
*
* on ucd/UnicodeData.txt files with these headers:
*
* UnicodeData.txt does not have a header.
*/
#ifndef _MGFONT_ISO8859_BIDI_TABLES_H
#define _MGFONT_ISO8859_BIDI_TABLES_H
static const BidiType __mg_iso8859_1_bidi_char_type_map[] =
{
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_SS, BIDI_TYPE_BS, BIDI_TYPE_SS,
BIDI_TYPE_WS, BIDI_TYPE_BS, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BS, BIDI_TYPE_BS, BIDI_TYPE_BS, BIDI_TYPE_SS,
BIDI_TYPE_WS, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ET,
BIDI_TYPE_ET, BIDI_TYPE_ET, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ES,
BIDI_TYPE_CS, BIDI_TYPE_ES, BIDI_TYPE_CS, BIDI_TYPE_CS,
BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN,
BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN,
BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_CS, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BS, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_CS, BIDI_TYPE_ON, BIDI_TYPE_ET, BIDI_TYPE_ET,
BIDI_TYPE_ET, BIDI_TYPE_ET, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_BN, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ET, BIDI_TYPE_ET, BIDI_TYPE_EN, BIDI_TYPE_EN,
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_EN, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
};
#endif /* !_MGFONT_ISO8859_BIDI_TABLES_H */
/* == End of generated table == */
File diff suppressed because it is too large Load Diff
+373 -314
View File
File diff suppressed because it is too large Load Diff
+185
View File
@@ -0,0 +1,185 @@
/*
* 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/>.
*/
/*
** nullfont.c: The Null Font operation set.
**
** Created by WEI Yongming at 2019/03/27
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "common.h"
#include "minigui.h"
#include "gdi.h"
#include "devfont.h"
#include "charset.h"
#include "fontname.h"
#define NUF_WIDTH 8
#define NUF_HEIGHT 1
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{
return DEVFONTGLYPHTYPE_MONOBMP;
}
static int get_max_width (LOGFONT* logfont, DEVFONT* devfont)
{
return NUF_WIDTH;
}
static int get_ave_width (LOGFONT* logfont, DEVFONT* devfont)
{
return NUF_WIDTH;
}
static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
{
return GET_DEVFONT_SCALE (logfont, devfont);
}
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
{
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
SET_DEVFONT_SCALE(logfont, df_slot, expect);
return expect;
}
static int get_font_ascent (LOGFONT* logfont, DEVFONT* devfont)
{
return GET_DEVFONT_SCALE (logfont, devfont);
}
static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
{
return 0;
}
static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
Glyph32 glyph_value,
int* px, int* py, int* pwidth, int* pheight)
{
int scale = GET_DEVFONT_SCALE (logfont, devfont);
if (pwidth)
*pwidth = NUF_WIDTH;
if (pheight)
*pheight = NUF_HEIGHT;
if (py)
*py -= scale;
return NUF_WIDTH;
}
static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
Glyph32 glyph_value, int* px, int* py)
{
if (px)
*px += NUF_WIDTH;
return NUF_WIDTH;
}
static unsigned char null_bitmap = 0x18;
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
{
if (sz) {
sz->cx = 8;
sz->cy = 1;
}
if (pitch)
*pitch = 1;
if (scale)
*scale = GET_DEVFONT_SCALE (logfont, devfont);
return &null_bitmap;
}
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 gv)
{
return TRUE;
}
static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
{
return 0;
}
static void* load_font_data (DEVFONT* devfont, const char* fontname,
const char* filename)
{
return &null_bitmap;
}
static void unload_font_data (DEVFONT* devfont, void* data)
{
if (data != &null_bitmap) {
_WRN_PRINTF("data is not null_bitmap");
}
}
FONTOPS __mg_null_font_ops = {
get_glyph_bmptype,
get_ave_width,
get_max_width,
get_font_height,
get_font_size,
get_font_ascent,
get_font_descent,
is_glyph_existed,
get_glyph_advance,
get_glyph_bbox,
get_glyph_monobitmap,
NULL,
NULL,
NULL,
NULL,
NULL,
is_rotatable,
load_font_data,
unload_font_data
};
+669 -669
View File
File diff suppressed because it is too large Load Diff
+43 -36
View File
@@ -154,7 +154,7 @@ static void clear_glyph_tree (QPF_GLYPHTREE* tree)
free (tree->more);
}
static void* load_font_data (const char* font_name, const char* file_name)
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
{
FILE* fp = NULL;
uchar* data;
@@ -164,14 +164,14 @@ static void* load_font_data (const char* font_name, const char* file_name)
qpf_info = (QPFINFO*) calloc (1, sizeof(QPFINFO));
if (!(fp = fopen (file_name, "rb"))) {
_MG_PRINTF ("FONT>QPF: open file error: %s.\n",
_WRN_PRINTF ("FONT>QPF: open file error: %s.\n",
file_name);
goto error;
}
file_size = get_opened_file_size (fp);
if (file_size == 0) {
_MG_PRINTF ("FONT>QPF: empty font file: %s.\n",
_WRN_PRINTF ("FONT>QPF: empty font file: %s.\n",
file_name);
goto error;
}
@@ -180,14 +180,14 @@ static void* load_font_data (const char* font_name, const char* file_name)
if ((qpf_info->height
= fontGetHeightFromName (font_name)) == -1) {
_MG_PRINTF ("FONT>QPF: Invalid font name (height): %s.\n",
_WRN_PRINTF ("FONT>QPF: Invalid font name (height): %s.\n",
font_name);
goto error;
}
if ((qpf_info->width
= fontGetWidthFromName (font_name)) == -1) {
_MG_PRINTF ("FONT>QPF: Invalid font name (width): %s.\n",
_WRN_PRINTF ("FONT>QPF: Invalid font name (width): %s.\n",
font_name);
goto error;
}
@@ -222,7 +222,7 @@ error:
return NULL;
}
static void unload_font_data (void* data)
static void unload_font_data (DEVFONT* devfont, void* data)
{
QPFINFO* qpf_info = (QPFINFO*)data;
@@ -275,7 +275,7 @@ static unsigned char def_smooth_bitmap [] =
static QPF_GLYPH def_glyph = {&def_metrics, def_bitmap};
static QPF_GLYPH def_smooth_glyph = {&def_smooth_metrics, def_smooth_bitmap};
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{
if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH)
return DEVFONTGLYPHTYPE_GREYBMP;
@@ -302,7 +302,7 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
* GET_DEVFONT_SCALE (logfont, devfont);
}
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
{
int height = QPFONT_INFO_P (devfont)->fm->ascent +
QPFONT_INFO_P (devfont)->fm->descent;
@@ -311,7 +311,8 @@ static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
if (logfont->style & FS_OTHER_AUTOSCALE)
scale = font_GetBestScaleFactor (height, expect);
SET_DEVFONT_SCALE (logfont, devfont, scale);
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
SET_DEVFONT_SCALE (logfont, df_slot, scale);
return height * scale;
}
@@ -329,23 +330,24 @@ static int get_font_descent (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;
QPF_GLYPH* glyph;
if(devfont->charset_ops->conv_to_uc32)
glyph_value = REAL_GLYPH(glyph_value);
if (devfont->charset_ops->conv_to_uc32)
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
else
uc16 = glyph_value;
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
if (glyph == NULL) {
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
unsigned char ascii_ch = uc16;
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
logfont->sbc_devfont, ascii_ch, pitch, scale);
return logfont->devfonts[0]->font_ops->get_glyph_monobitmap (logfont,
logfont->devfonts[0], ascii_ch, sz, pitch, scale);
}
else
glyph = &def_glyph;
@@ -365,11 +367,12 @@ static const void* get_glyph_monobitmap (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;
QPF_GLYPH* glyph;
glyph_value = REAL_GLYPH(glyph_value);
if (scale)
*scale = GET_DEVFONT_SCALE (logfont, devfont);
@@ -400,6 +403,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
QPF_GLYPH* glyph;
unsigned short scale = GET_DEVFONT_SCALE (logfont, devfont);
glyph_value = REAL_GLYPH(glyph_value);
if(devfont->charset_ops->conv_to_uc32)
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
else
@@ -408,21 +412,21 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
if (glyph == NULL) {
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
unsigned char ascii_ch = uc16;
if (logfont->sbc_devfont->font_ops->get_glyph_bbox) {
return logfont->sbc_devfont->font_ops->get_glyph_bbox (logfont,
logfont->sbc_devfont, ascii_ch,
if (logfont->devfonts[0]->font_ops->get_glyph_bbox) {
return logfont->devfonts[0]->font_ops->get_glyph_bbox (logfont,
logfont->devfonts[0], ascii_ch,
px, py, pwidth, pheight);
}
else {
int width, height, ascent;
logfont->sbc_devfont->font_ops->get_glyph_advance
(logfont, logfont->sbc_devfont, glyph_value, &width, 0);
height = logfont->sbc_devfont->font_ops->get_font_height
(logfont, logfont->sbc_devfont);
ascent = logfont->sbc_devfont->font_ops->get_font_ascent
(logfont, logfont->sbc_devfont);
logfont->devfonts[0]->font_ops->get_glyph_advance
(logfont, logfont->devfonts[0], glyph_value, &width, 0);
height = logfont->devfonts[0]->font_ops->get_font_height
(logfont, logfont->devfonts[0]);
ascent = logfont->devfonts[0]->font_ops->get_font_ascent
(logfont, logfont->devfonts[0]);
if (pwidth) *pwidth = width;
if (pheight) *pheight = height;
@@ -452,6 +456,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
QPF_GLYPH* glyph;
int advance;
glyph_value = REAL_GLYPH(glyph_value);
if(devfont->charset_ops->conv_to_uc32)
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
else
@@ -460,11 +465,11 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
if (glyph == NULL) {
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
unsigned char ascii_ch = uc16;
if (logfont->sbc_devfont->font_ops->get_glyph_advance) {
return logfont->sbc_devfont->font_ops->
get_glyph_advance (logfont, logfont->sbc_devfont,
if (logfont->devfonts[0]->font_ops->get_glyph_advance) {
return logfont->devfonts[0]->font_ops->
get_glyph_advance (logfont, logfont->devfonts[0],
ascii_ch, px, py);
}
}
@@ -473,7 +478,8 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
}
advance = glyph->metrics->advance * GET_DEVFONT_SCALE (logfont, devfont);
*px += advance;
if (px)
*px += advance;
return advance;
}
@@ -498,17 +504,18 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
unsigned int uc16;
QPF_GLYPH* glyph;
glyph_value = REAL_GLYPH(glyph_value);
if(devfont->charset_ops->conv_to_uc32)
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
else
uc16 = glyph_value;
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
if (glyph == NULL) {
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) /* ASCII */
return logfont->sbc_devfont->font_ops->is_glyph_existed (logfont,
logfont->sbc_devfont, glyph_value);
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) /* ASCII */
return logfont->devfonts[0]->font_ops->is_glyph_existed (logfont,
logfont->devfonts[0], glyph_value);
else
return FALSE;
}
@@ -522,7 +529,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/
FONTOPS __mg_qpf_ops = {
get_glyph_type,
get_glyph_bmptype,
get_ave_width,
get_max_width,
get_font_height,
+17 -17
View File
@@ -65,11 +65,7 @@
#define RBFONT_INFO(devfont) ((RBFINFO*)(devfont.data))
/********************** Load/Unload of raw bitmap font ***********************/
#if 0
static void* load_font_data (char* font_name, char* file_name,
char* real_font_name)
#endif
static void* load_font_data (const char* font_name, const char* file_name)
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
{
FILE* fp = NULL;
RBFINFO* rbf_info = calloc (1, sizeof(RBFINFO));
@@ -129,7 +125,7 @@ error_load:
/********************** Init/Term of raw bitmap font ***********************/
static void unload_font_data (void* data)
static void unload_font_data (DEVFONT* devfont, void* data)
{
RBFINFO* rbfinfo = (RBFINFO*)data;
#ifdef HAVE_MMAP
@@ -143,7 +139,7 @@ static void unload_font_data (void* data)
/*************** Raw bitmap font operations *********************************/
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{
return DEVFONTGLYPHTYPE_MONOBMP;
}
@@ -158,7 +154,7 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
return RBFONT_INFO_P (devfont)->height * GET_DEVFONT_SCALE (logfont, devfont);
}
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
{
int height = RBFONT_INFO_P (devfont)->height;
unsigned short scale = 1;
@@ -166,7 +162,9 @@ static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
if (logfont->style & FS_OTHER_AUTOSCALE)
scale = font_GetBestScaleFactor (height, expect);
SET_DEVFONT_SCALE (logfont, devfont, scale);
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS) {
SET_DEVFONT_SCALE (logfont, df_slot, scale);
}
return height * scale;
}
@@ -192,7 +190,7 @@ static int get_font_ascent (LOGFONT* logfont, DEVFONT* devfont)
static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
{
int height = RBFONT_INFO_P (devfont)->height;
height *= GET_DEVFONT_SCALE (logfont, devfont);
if (height >= 40)
@@ -208,13 +206,13 @@ static int get_font_descent (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;
Glyph32 glyph_tmp = glyph_value;
if (glyph_tmp >= RBFONT_INFO_P (devfont)->nr_glyphs)
glyph_tmp = devfont->charset_ops->def_glyph_value;
glyph_value = REAL_GLYPH(glyph_value);
if (glyph_value >= RBFONT_INFO_P (devfont)->nr_glyphs)
glyph_value = devfont->charset_ops->def_char_value;
bitmap_size = ((RBFONT_INFO_P (devfont)->width + 7) >> 3)
* RBFONT_INFO_P (devfont)->height;
@@ -224,12 +222,13 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
if (scale)
*scale = GET_DEVFONT_SCALE (logfont, devfont);
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_tmp;
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_value;
}
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont,
Glyph32 glyph_value)
{
glyph_value = REAL_GLYPH(glyph_value);
if (glyph_value > RBFONT_INFO_P(devfont)->nr_glyphs)
return FALSE;
else
@@ -241,7 +240,8 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
{
int advance = RBFONT_INFO_P (devfont)->width *
GET_DEVFONT_SCALE (logfont, devfont);
*px += advance;
if (px)
*px += advance;
return advance;
}
@@ -268,7 +268,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/
FONTOPS __mg_rbf_ops = {
get_glyph_type,
get_glyph_bmptype,
get_ave_width,
get_ave_width, // max_width same as ave_width
get_font_height,

Some files were not shown because too many files have changed in this diff Show More