dwrite: Added a stub for IDWriteTextAnalyzer.
[wine] / dlls / dwrite / analyzer.c
1 /*
2  *    Text analyzer
3  *
4  * Copyright 2012 Nikolay Sivov for CodeWeavers
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #define COBJMACROS
22
23 #include "dwrite.h"
24 #include "dwrite_private.h"
25
26 #include "wine/debug.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
29
30 static HRESULT WINAPI dwritetextanalyzer_QueryInterface(IDWriteTextAnalyzer *iface, REFIID riid, void **obj)
31 {
32     TRACE("(%s %p)\n", debugstr_guid(riid), obj);
33
34     if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDWriteTextAnalyzer))
35     {
36         *obj = iface;
37         return S_OK;
38     }
39
40     *obj = NULL;
41     return E_NOINTERFACE;
42
43 }
44
45 static ULONG WINAPI dwritetextanalyzer_AddRef(IDWriteTextAnalyzer *iface)
46 {
47     return 2;
48 }
49
50 static ULONG WINAPI dwritetextanalyzer_Release(IDWriteTextAnalyzer *iface)
51 {
52     return 1;
53 }
54
55 static HRESULT WINAPI dwritetextanalyzer_AnalyzeScript(IDWriteTextAnalyzer *iface,
56     IDWriteTextAnalysisSource* source, UINT32 position, UINT32 length, IDWriteTextAnalysisSink* sink)
57 {
58     FIXME("(%p %u %u %p): stub\n", source, position, length, sink);
59     return E_NOTIMPL;
60 }
61
62 static HRESULT WINAPI dwritetextanalyzer_AnalyzeBidi(IDWriteTextAnalyzer *iface,
63     IDWriteTextAnalysisSource* source, UINT32 position, UINT32 length, IDWriteTextAnalysisSink* sink)
64 {
65     FIXME("(%p %u %u %p): stub\n", source, position, length, sink);
66     return E_NOTIMPL;
67 }
68
69 static HRESULT WINAPI dwritetextanalyzer_AnalyzeNumberSubstitution(IDWriteTextAnalyzer *iface,
70     IDWriteTextAnalysisSource* source, UINT32 position, UINT32 length, IDWriteTextAnalysisSink* sink)
71 {
72     FIXME("(%p %u %u %p): stub\n", source, position, length, sink);
73     return E_NOTIMPL;
74 }
75
76 static HRESULT WINAPI dwritetextanalyzer_AnalyzeLineBreakpoints(IDWriteTextAnalyzer *iface,
77     IDWriteTextAnalysisSource* source, UINT32 position, UINT32 length, IDWriteTextAnalysisSink* sink)
78 {
79     FIXME("(%p %u %u %p): stub\n", source, position, length, sink);
80     return E_NOTIMPL;
81 }
82
83 static HRESULT WINAPI dwritetextanalyzer_GetGlyphs(IDWriteTextAnalyzer *iface,
84     WCHAR const* text, UINT32 length, IDWriteFontFace* font_face, BOOL is_sideways,
85     BOOL is_rtl, DWRITE_SCRIPT_ANALYSIS const* analysis, WCHAR const* locale,
86     IDWriteNumberSubstitution* substitution, DWRITE_TYPOGRAPHIC_FEATURES const** features,
87     UINT32 const* feature_range_len, UINT32 feature_ranges, UINT32 max_glyph_count,
88     UINT16* clustermap, DWRITE_SHAPING_TEXT_PROPERTIES* text_props, UINT16* glyph_indices,
89     DWRITE_SHAPING_GLYPH_PROPERTIES* glyph_props, UINT32* actual_glyph_count)
90 {
91     FIXME("(%s:%u %p %d %d %p %s %p %p %p %u %u %p %p %p %p %p): stub\n", debugstr_wn(text, length),
92         length, font_face, is_sideways, is_rtl, analysis, debugstr_w(locale), substitution, features, feature_range_len,
93         feature_ranges, max_glyph_count, clustermap, text_props, glyph_indices, glyph_props, actual_glyph_count);
94     return E_NOTIMPL;
95 }
96
97 static HRESULT WINAPI dwritetextanalyzer_GetGlyphPlacements(IDWriteTextAnalyzer *iface,
98     WCHAR const* text, UINT16 const* clustermap, DWRITE_SHAPING_TEXT_PROPERTIES* props,
99     UINT32 text_len, UINT16 const* glyph_indices, DWRITE_SHAPING_GLYPH_PROPERTIES const* glyph_props,
100     UINT32 glyph_count, IDWriteFontFace * font_face, FLOAT fontEmSize, BOOL is_sideways, BOOL is_rtl,
101     DWRITE_SCRIPT_ANALYSIS const* analysis, WCHAR const* locale, DWRITE_TYPOGRAPHIC_FEATURES const** features,
102     UINT32 const* feature_range_len, UINT32 feature_ranges, FLOAT* glyph_advances, DWRITE_GLYPH_OFFSET* glyph_offsets)
103 {
104     FIXME("(%s %p %p %u %p %p %u %p %f %d %d %p %s %p %p %u %p %p): stub\n", debugstr_w(text),
105         clustermap, props, text_len, glyph_indices, glyph_props, glyph_count, font_face, fontEmSize, is_sideways,
106         is_rtl, analysis, debugstr_w(locale), features, feature_range_len, feature_ranges, glyph_advances, glyph_offsets);
107     return E_NOTIMPL;
108 }
109
110 static HRESULT WINAPI dwritetextanalyzer_GetGdiCompatibleGlyphPlacements(IDWriteTextAnalyzer *iface,
111     WCHAR const* text, UINT16 const* clustermap, DWRITE_SHAPING_TEXT_PROPERTIES* props,
112     UINT32 text_len, UINT16 const* glyph_indices, DWRITE_SHAPING_GLYPH_PROPERTIES const* glyph_props,
113     UINT32 glyph_count, IDWriteFontFace * font_face, FLOAT fontEmSize, FLOAT pixels_per_dip,
114     DWRITE_MATRIX const* transform, BOOL use_gdi_natural, BOOL is_sideways, BOOL is_rtl,
115     DWRITE_SCRIPT_ANALYSIS const* analysis, WCHAR const* locale, DWRITE_TYPOGRAPHIC_FEATURES const** features,
116     UINT32 const* feature_range_lengths, UINT32 feature_ranges, FLOAT* glyph_advances, DWRITE_GLYPH_OFFSET* glyph_offsets)
117 {
118     FIXME("(%s %p %p %u %p %p %u %p %f %f %p %d %d %d %p %s %p %p %u %p %p): stub\n", debugstr_w(text),
119         clustermap, props, text_len, glyph_indices, glyph_props, glyph_count, font_face, fontEmSize, pixels_per_dip,
120         transform, use_gdi_natural, is_sideways, is_rtl, analysis, debugstr_w(locale), features, feature_range_lengths,
121         feature_ranges, glyph_advances, glyph_offsets);
122     return E_NOTIMPL;
123 }
124
125 static const struct IDWriteTextAnalyzerVtbl textanalyzervtbl = {
126     dwritetextanalyzer_QueryInterface,
127     dwritetextanalyzer_AddRef,
128     dwritetextanalyzer_Release,
129     dwritetextanalyzer_AnalyzeScript,
130     dwritetextanalyzer_AnalyzeBidi,
131     dwritetextanalyzer_AnalyzeNumberSubstitution,
132     dwritetextanalyzer_AnalyzeLineBreakpoints,
133     dwritetextanalyzer_GetGlyphs,
134     dwritetextanalyzer_GetGlyphPlacements,
135     dwritetextanalyzer_GetGdiCompatibleGlyphPlacements
136 };
137
138 static IDWriteTextAnalyzer textanalyzer = { &textanalyzervtbl };
139
140 HRESULT get_textanalyzer(IDWriteTextAnalyzer **ret)
141 {
142     *ret = &textanalyzer;
143     return S_OK;
144 }