OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
3 * | 3 * |
4 * This is part of HarfBuzz, an OpenType Layout engine library. | 4 * This is part of HarfBuzz, an OpenType Layout engine library. |
5 * | 5 * |
6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
10 * all copies of this software. | 10 * all copies of this software. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return (HB_SentenceClass) prop->sentenceBreak; | 72 return (HB_SentenceClass) prop->sentenceBreak; |
73 } | 73 } |
74 | 74 |
75 void HB_GetGraphemeAndLineBreakClass(HB_UChar32 ch, HB_GraphemeClass *grapheme,
HB_LineBreakClass *lineBreak) | 75 void HB_GetGraphemeAndLineBreakClass(HB_UChar32 ch, HB_GraphemeClass *grapheme,
HB_LineBreakClass *lineBreak) |
76 { | 76 { |
77 const QUnicodeTables::Properties *prop = QUnicodeTables::properties(ch); | 77 const QUnicodeTables::Properties *prop = QUnicodeTables::properties(ch); |
78 *grapheme = (HB_GraphemeClass) prop->graphemeBreak; | 78 *grapheme = (HB_GraphemeClass) prop->graphemeBreak; |
79 *lineBreak = (HB_LineBreakClass) prop->line_break_class; | 79 *lineBreak = (HB_LineBreakClass) prop->line_break_class; |
80 } | 80 } |
81 | 81 |
82 void *HB_Library_Resolve(const char *library, const char *symbol) | 82 void *HB_Library_Resolve(const char *library, int version, const char *symbol) |
83 { | 83 { |
84 return QLibrary::resolve(library, symbol); | 84 return QLibrary::resolve(library, version, symbol); |
85 } | |
86 | |
87 void *HB_TextCodecForMib(int mib) | |
88 { | |
89 return QTextCodec::codecForMib(mib); | |
90 } | |
91 | |
92 char *HB_TextCodec_ConvertFromUnicode(void *codec, const HB_UChar16 *unicode, hb
_uint32 length, hb_uint32 *outputLength) | |
93 { | |
94 QByteArray data = reinterpret_cast<QTextCodec *>(codec)->fromUnicode((const
QChar *)unicode, length); | |
95 // ### suboptimal | |
96 char *output = (char *)malloc(data.length() + 1); | |
97 memcpy(output, data.constData(), data.length() + 1); | |
98 if (outputLength) | |
99 *outputLength = data.length(); | |
100 return output; | |
101 } | |
102 | |
103 void HB_TextCodec_FreeResult(char *string) | |
104 { | |
105 free(string); | |
106 } | 85 } |
107 | 86 |
108 } | 87 } |
OLD | NEW |