wbemprox: Add support for uncommitted instances in IWbemClassObject::Get.
[wine] / dlls / dwrite / layout.c
1 /*
2  *    Text format and layout
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 <stdarg.h>
24
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "dwrite.h"
29 #include "dwrite_private.h"
30
31 #include "wine/debug.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
34
35 struct dwrite_textlayout {
36     IDWriteTextLayout IDWriteTextLayout_iface;
37     LONG ref;
38 };
39
40 static inline struct dwrite_textlayout *impl_from_IDWriteTextLayout(IDWriteTextLayout *iface)
41 {
42     return CONTAINING_RECORD(iface, struct dwrite_textlayout, IDWriteTextLayout_iface);
43 }
44
45 static HRESULT WINAPI dwritetextlayout_QueryInterface(IDWriteTextLayout *iface, REFIID riid, void **obj)
46 {
47     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
48
49     TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
50
51     if (IsEqualIID(riid, &IID_IUnknown) ||
52         IsEqualIID(riid, &IID_IDWriteTextFormat) ||
53         IsEqualIID(riid, &IID_IDWriteTextLayout))
54     {
55         *obj = iface;
56         IDWriteTextLayout_AddRef(iface);
57         return S_OK;
58     }
59
60     *obj = NULL;
61
62     return E_NOINTERFACE;
63 }
64
65 static ULONG WINAPI dwritetextlayout_AddRef(IDWriteTextLayout *iface)
66 {
67     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
68     ULONG ref = InterlockedIncrement(&This->ref);
69     TRACE("(%p)->(%d)\n", This, ref);
70     return ref;
71 }
72
73 static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout *iface)
74 {
75     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
76     ULONG ref = InterlockedDecrement(&This->ref);
77
78     TRACE("(%p)->(%d)\n", This, ref);
79
80     if (!ref)
81         heap_free(This);
82
83     return S_OK;
84 }
85
86 static HRESULT WINAPI dwritetextlayout_SetTextAlignment(IDWriteTextLayout *iface, DWRITE_TEXT_ALIGNMENT alignment)
87 {
88     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
89     FIXME("(%p)->(%d): stub\n", This, alignment);
90     return E_NOTIMPL;
91 }
92
93 static HRESULT WINAPI dwritetextlayout_SetParagraphAlignment(IDWriteTextLayout *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment)
94 {
95     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
96     FIXME("(%p)->(%d): stub\n", This, alignment);
97     return E_NOTIMPL;
98 }
99
100 static HRESULT WINAPI dwritetextlayout_SetWordWrapping(IDWriteTextLayout *iface, DWRITE_WORD_WRAPPING wrapping)
101 {
102     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
103     FIXME("(%p)->(%d): stub\n", This, wrapping);
104     return E_NOTIMPL;
105 }
106
107 static HRESULT WINAPI dwritetextlayout_SetReadingDirection(IDWriteTextLayout *iface, DWRITE_READING_DIRECTION direction)
108 {
109     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
110     FIXME("(%p)->(%d): stub\n", This, direction);
111     return E_NOTIMPL;
112 }
113
114 static HRESULT WINAPI dwritetextlayout_SetFlowDirection(IDWriteTextLayout *iface, DWRITE_FLOW_DIRECTION direction)
115 {
116     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
117     FIXME("(%p)->(%d): stub\n", This, direction);
118     return E_NOTIMPL;
119 }
120
121 static HRESULT WINAPI dwritetextlayout_SetIncrementalTabStop(IDWriteTextLayout *iface, FLOAT tabstop)
122 {
123     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
124     FIXME("(%p)->(%f): stub\n", This, tabstop);
125     return E_NOTIMPL;
126 }
127
128 static HRESULT WINAPI dwritetextlayout_SetTrimming(IDWriteTextLayout *iface, DWRITE_TRIMMING const *trimming,
129     IDWriteInlineObject *trimming_sign)
130 {
131     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
132     FIXME("(%p)->(%p %p): stub\n", This, trimming, trimming_sign);
133     return E_NOTIMPL;
134 }
135
136 static HRESULT WINAPI dwritetextlayout_SetLineSpacing(IDWriteTextLayout *iface, DWRITE_LINE_SPACING_METHOD spacing,
137     FLOAT line_spacing, FLOAT baseline)
138 {
139     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
140     FIXME("(%p)->(%d %f %f): stub\n", This, spacing, line_spacing, baseline);
141     return E_NOTIMPL;
142 }
143
144 static DWRITE_TEXT_ALIGNMENT WINAPI dwritetextlayout_GetTextAlignment(IDWriteTextLayout *iface)
145 {
146     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
147     FIXME("(%p): stub\n", This);
148     return DWRITE_TEXT_ALIGNMENT_LEADING;
149 }
150
151 static DWRITE_PARAGRAPH_ALIGNMENT WINAPI dwritetextlayout_GetParagraphAlignment(IDWriteTextLayout *iface)
152 {
153     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
154     FIXME("(%p): stub\n", This);
155     return DWRITE_PARAGRAPH_ALIGNMENT_NEAR;
156 }
157
158 static DWRITE_WORD_WRAPPING WINAPI dwritetextlayout_GetWordWrapping(IDWriteTextLayout *iface)
159 {
160     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
161     FIXME("(%p): stub\n", This);
162     return DWRITE_WORD_WRAPPING_NO_WRAP;
163 }
164
165 static DWRITE_READING_DIRECTION WINAPI dwritetextlayout_GetReadingDirection(IDWriteTextLayout *iface)
166 {
167     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
168     FIXME("(%p): stub\n", This);
169     return DWRITE_READING_DIRECTION_LEFT_TO_RIGHT;
170 }
171
172 static DWRITE_FLOW_DIRECTION WINAPI dwritetextlayout_GetFlowDirection(IDWriteTextLayout *iface)
173 {
174     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
175     FIXME("(%p): stub\n", This);
176     return DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM;
177 }
178
179 static FLOAT WINAPI dwritetextlayout_GetIncrementalTabStop(IDWriteTextLayout *iface)
180 {
181     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
182     FIXME("(%p): stub\n", This);
183     return 0.0;
184 }
185
186 static HRESULT WINAPI dwritetextlayout_GetTrimming(IDWriteTextLayout *iface, DWRITE_TRIMMING *options,
187     IDWriteInlineObject **trimming_sign)
188 {
189     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
190     FIXME("(%p)->(%p %p): stub\n", This, options, trimming_sign);
191     return E_NOTIMPL;
192 }
193
194 static HRESULT WINAPI dwritetextlayout_GetLineSpacing(IDWriteTextLayout *iface, DWRITE_LINE_SPACING_METHOD *method,
195     FLOAT *spacing, FLOAT *baseline)
196 {
197     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
198     FIXME("(%p)->(%p %p %p): stub\n", This, method, spacing, baseline);
199     return E_NOTIMPL;
200 }
201
202 static HRESULT WINAPI dwritetextlayout_GetFontCollection(IDWriteTextLayout *iface, IDWriteFontCollection **collection)
203 {
204     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
205     FIXME("(%p)->(%p): stub\n", This, collection);
206     return E_NOTIMPL;
207 }
208
209 static UINT32 WINAPI dwritetextlayout_GetFontFamilyNameLength(IDWriteTextLayout *iface)
210 {
211     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
212     FIXME("(%p): stub\n", This);
213     return 0;
214 }
215
216 static HRESULT WINAPI dwritetextlayout_GetFontFamilyName(IDWriteTextLayout *iface, WCHAR *name, UINT32 size)
217 {
218     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
219     FIXME("(%p)->(%p %u): stub\n", This, name, size);
220     return E_NOTIMPL;
221 }
222
223 static DWRITE_FONT_WEIGHT WINAPI dwritetextlayout_GetFontWeight(IDWriteTextLayout *iface)
224 {
225     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
226     FIXME("(%p): stub\n", This);
227     return DWRITE_FONT_WEIGHT_NORMAL;
228 }
229
230 static DWRITE_FONT_STYLE WINAPI dwritetextlayout_GetFontStyle(IDWriteTextLayout *iface)
231 {
232     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
233     FIXME("(%p): stub\n", This);
234     return DWRITE_FONT_STYLE_NORMAL;
235 }
236
237 static DWRITE_FONT_STRETCH WINAPI dwritetextlayout_GetFontStretch(IDWriteTextLayout *iface)
238 {
239     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
240     FIXME("(%p): stub\n", This);
241     return DWRITE_FONT_STRETCH_NORMAL;
242 }
243
244 static FLOAT WINAPI dwritetextlayout_GetFontSize(IDWriteTextLayout *iface)
245 {
246     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
247     FIXME("(%p): stub\n", This);
248     return 0.0;
249 }
250
251 static UINT32 WINAPI dwritetextlayout_GetLocaleNameLength(IDWriteTextLayout *iface)
252 {
253     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
254     FIXME("(%p): stub\n", This);
255     return 0;
256 }
257
258 static HRESULT WINAPI dwritetextlayout_GetLocaleName(IDWriteTextLayout *iface, WCHAR *name, UINT32 size)
259 {
260     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
261     FIXME("(%p)->(%p %u): stub\n", This, name, size);
262     return E_NOTIMPL;
263 }
264
265 static HRESULT WINAPI dwritetextlayout_SetMaxWidth(IDWriteTextLayout *iface, FLOAT maxWidth)
266 {
267     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
268     FIXME("(%p)->(%f): stub\n", This, maxWidth);
269     return E_NOTIMPL;
270 }
271
272 static HRESULT WINAPI dwritetextlayout_SetMaxHeight(IDWriteTextLayout *iface, FLOAT maxHeight)
273 {
274     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
275     FIXME("(%p)->(%f): stub\n", This, maxHeight);
276     return E_NOTIMPL;
277 }
278
279 static HRESULT WINAPI dwritetextlayout_SetFontCollection(IDWriteTextLayout *iface, IDWriteFontCollection* collection, DWRITE_TEXT_RANGE range)
280 {
281     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
282     FIXME("(%p)->(%p %u:%u): stub\n", This, collection, range.startPosition, range.length);
283     return E_NOTIMPL;
284 }
285
286 static HRESULT WINAPI dwritetextlayout_SetFontFamilyName(IDWriteTextLayout *iface, WCHAR const *name, DWRITE_TEXT_RANGE range)
287 {
288     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
289     FIXME("(%p)->(%s %u:%u): stub\n", This, debugstr_w(name), range.startPosition, range.length);
290     return E_NOTIMPL;
291 }
292
293 static HRESULT WINAPI dwritetextlayout_SetFontWeight(IDWriteTextLayout *iface, DWRITE_FONT_WEIGHT weight, DWRITE_TEXT_RANGE range)
294 {
295     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
296     FIXME("(%p)->(%d %u:%u): stub\n", This, weight, range.startPosition, range.length);
297     return E_NOTIMPL;
298 }
299
300 static HRESULT WINAPI dwritetextlayout_SetFontStyle(IDWriteTextLayout *iface, DWRITE_FONT_STYLE style, DWRITE_TEXT_RANGE range)
301 {
302     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
303     FIXME("(%p)->(%d %u:%u): stub\n", This, style, range.startPosition, range.length);
304     return E_NOTIMPL;
305 }
306
307 static HRESULT WINAPI dwritetextlayout_SetFontStretch(IDWriteTextLayout *iface, DWRITE_FONT_STRETCH stretch, DWRITE_TEXT_RANGE range)
308 {
309     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
310     FIXME("(%p)->(%d %u:%u): stub\n", This, stretch, range.startPosition, range.length);
311     return E_NOTIMPL;
312 }
313
314 static HRESULT WINAPI dwritetextlayout_SetFontSize(IDWriteTextLayout *iface, FLOAT size, DWRITE_TEXT_RANGE range)
315 {
316     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
317     FIXME("(%p)->(%f %u:%u): stub\n", This, size, range.startPosition, range.length);
318     return E_NOTIMPL;
319 }
320
321 static HRESULT WINAPI dwritetextlayout_SetUnderline(IDWriteTextLayout *iface, BOOL underline, DWRITE_TEXT_RANGE range)
322 {
323     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
324     FIXME("(%p)->(%d %u:%u): stub\n", This, underline, range.startPosition, range.length);
325     return E_NOTIMPL;
326 }
327
328 static HRESULT WINAPI dwritetextlayout_SetStrikethrough(IDWriteTextLayout *iface, BOOL strikethrough, DWRITE_TEXT_RANGE range)
329 {
330     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
331     FIXME("(%p)->(%d %u:%u): stub\n", This, strikethrough, range.startPosition, range.length);
332     return E_NOTIMPL;
333 }
334
335 static HRESULT WINAPI dwritetextlayout_SetDrawingEffect(IDWriteTextLayout *iface, IUnknown* effect, DWRITE_TEXT_RANGE range)
336 {
337     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
338     FIXME("(%p)->(%p %u:%u): stub\n", This, effect, range.startPosition, range.length);
339     return E_NOTIMPL;
340 }
341
342 static HRESULT WINAPI dwritetextlayout_SetInlineObject(IDWriteTextLayout *iface, IDWriteInlineObject *object, DWRITE_TEXT_RANGE range)
343 {
344     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
345     FIXME("(%p)->(%p %u:%u): stub\n", This, object, range.startPosition, range.length);
346     return E_NOTIMPL;
347 }
348
349 static HRESULT WINAPI dwritetextlayout_SetTypography(IDWriteTextLayout *iface, IDWriteTypography* typography, DWRITE_TEXT_RANGE range)
350 {
351     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
352     FIXME("(%p)->(%p %u:%u): stub\n", This, typography, range.startPosition, range.length);
353     return E_NOTIMPL;
354 }
355
356 static HRESULT WINAPI dwritetextlayout_SetLocaleName(IDWriteTextLayout *iface, WCHAR const* locale, DWRITE_TEXT_RANGE range)
357 {
358     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
359     FIXME("(%p)->(%s %u:%u): stub\n", This, debugstr_w(locale), range.startPosition, range.length);
360     return E_NOTIMPL;
361 }
362
363 static FLOAT WINAPI dwritetextlayout_GetMaxWidth(IDWriteTextLayout *iface)
364 {
365     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
366     FIXME("(%p): stub\n", This);
367     return 0.0;
368 }
369
370 static FLOAT WINAPI dwritetextlayout_GetMaxHeight(IDWriteTextLayout *iface)
371 {
372     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
373     FIXME("(%p): stub\n", This);
374     return 0.0;
375 }
376
377 static HRESULT WINAPI dwritetextlayout_layout_GetFontCollection(IDWriteTextLayout *iface, UINT32 pos,
378     IDWriteFontCollection** collection, DWRITE_TEXT_RANGE *range)
379 {
380     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
381     FIXME("(%p)->(%p %p): stub\n", This, collection, range);
382     return E_NOTIMPL;
383 }
384
385 static HRESULT WINAPI dwritetextlayout_layout_GetFontFamilyNameLength(IDWriteTextLayout *iface,
386     UINT32 pos, UINT32* len, DWRITE_TEXT_RANGE *range)
387 {
388     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
389     FIXME("(%p)->(%d %p %p): stub\n", This, pos, len, range);
390     return E_NOTIMPL;
391 }
392
393 static HRESULT WINAPI dwritetextlayout_layout_GetFontFamilyName(IDWriteTextLayout *iface,
394     UINT32 position, WCHAR* name, UINT32 name_size, DWRITE_TEXT_RANGE *range)
395 {
396     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
397     FIXME("(%p)->(%u %p %u %p): stub\n", This, position, name, name_size, range);
398     return E_NOTIMPL;
399 }
400
401 static HRESULT WINAPI dwritetextlayout_layout_GetFontWeight(IDWriteTextLayout *iface,
402     UINT32 position, DWRITE_FONT_WEIGHT *weight, DWRITE_TEXT_RANGE *range)
403 {
404     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
405     FIXME("(%p)->(%u %p %p): stub\n", This, position, weight, range);
406     return E_NOTIMPL;
407 }
408
409 static HRESULT WINAPI dwritetextlayout_layout_GetFontStyle(IDWriteTextLayout *iface,
410     UINT32 currentPosition, DWRITE_FONT_STYLE *style, DWRITE_TEXT_RANGE *range)
411 {
412     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
413     FIXME("(%p)->(%u %p %p): stub\n", This, currentPosition, style, range);
414     return E_NOTIMPL;
415 }
416
417 static HRESULT WINAPI dwritetextlayout_layout_GetFontStretch(IDWriteTextLayout *iface,
418     UINT32 position, DWRITE_FONT_STRETCH *stretch, DWRITE_TEXT_RANGE *range)
419 {
420     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
421     FIXME("(%p)->(%u %p %p): stub\n", This, position, stretch, range);
422     return E_NOTIMPL;
423 }
424
425 static HRESULT WINAPI dwritetextlayout_layout_GetFontSize(IDWriteTextLayout *iface,
426     UINT32 position, FLOAT *size, DWRITE_TEXT_RANGE *range)
427 {
428     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
429     FIXME("(%p)->(%u %p %p): stub\n", This, position, size, range);
430     return E_NOTIMPL;
431 }
432
433 static HRESULT WINAPI dwritetextlayout_GetUnderline(IDWriteTextLayout *iface,
434     UINT32 position, BOOL *has_underline, DWRITE_TEXT_RANGE *range)
435 {
436     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
437     FIXME("(%p)->(%u %p %p): stub\n", This, position, has_underline, range);
438     return E_NOTIMPL;
439 }
440
441 static HRESULT WINAPI dwritetextlayout_GetStrikethrough(IDWriteTextLayout *iface,
442     UINT32 position, BOOL *has_strikethrough, DWRITE_TEXT_RANGE *range)
443 {
444     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
445     FIXME("(%p)->(%u %p %p): stub\n", This, position, has_strikethrough, range);
446     return E_NOTIMPL;
447 }
448
449 static HRESULT WINAPI dwritetextlayout_GetDrawingEffect(IDWriteTextLayout *iface,
450     UINT32 position, IUnknown **effect, DWRITE_TEXT_RANGE *range)
451 {
452     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
453     FIXME("(%p)->(%u %p %p): stub\n", This, position, effect, range);
454     return E_NOTIMPL;
455 }
456
457 static HRESULT WINAPI dwritetextlayout_GetInlineObject(IDWriteTextLayout *iface,
458     UINT32 position, IDWriteInlineObject **object, DWRITE_TEXT_RANGE *range)
459 {
460     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
461     FIXME("(%p)->(%u %p %p): stub\n", This, position, object, range);
462     return E_NOTIMPL;
463 }
464
465 static HRESULT WINAPI dwritetextlayout_GetTypography(IDWriteTextLayout *iface,
466     UINT32 position, IDWriteTypography** typography, DWRITE_TEXT_RANGE *range)
467 {
468     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
469     FIXME("(%p)->(%u %p %p): stub\n", This, position, typography, range);
470     return E_NOTIMPL;
471 }
472
473 static HRESULT WINAPI dwritetextlayout_layout_GetLocaleNameLength(IDWriteTextLayout *iface,
474     UINT32 position, UINT32* length, DWRITE_TEXT_RANGE *range)
475 {
476     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
477     FIXME("(%p)->(%u %p %p): stub\n", This, position, length, range);
478     return E_NOTIMPL;
479 }
480
481 static HRESULT WINAPI dwritetextlayout_layout_GetLocaleName(IDWriteTextLayout *iface,
482     UINT32 position, WCHAR* name, UINT32 name_size, DWRITE_TEXT_RANGE *range)
483 {
484     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
485     FIXME("(%p)->(%u %p %u %p): stub\n", This, position, name, name_size, range);
486     return E_NOTIMPL;
487 }
488
489 static HRESULT WINAPI dwritetextlayout_Draw(IDWriteTextLayout *iface,
490     void *context, IDWriteTextRenderer* renderer, FLOAT originX, FLOAT originY)
491 {
492     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
493     FIXME("(%p)->(%p %p %f %f): stub\n", This, context, renderer, originX, originY);
494     return E_NOTIMPL;
495 }
496
497 static HRESULT WINAPI dwritetextlayout_GetLineMetrics(IDWriteTextLayout *iface,
498     DWRITE_LINE_METRICS *metrics, UINT32 max_count, UINT32 *actual_count)
499 {
500     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
501     FIXME("(%p)->(%p %u %p): stub\n", This, metrics, max_count, actual_count);
502     return E_NOTIMPL;
503 }
504
505 static HRESULT WINAPI dwritetextlayout_GetMetrics(IDWriteTextLayout *iface, DWRITE_TEXT_METRICS *metrics)
506 {
507     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
508     FIXME("(%p)->(%p): stub\n", This, metrics);
509     return E_NOTIMPL;
510 }
511
512 static HRESULT WINAPI dwritetextlayout_GetOverhangMetrics(IDWriteTextLayout *iface, DWRITE_OVERHANG_METRICS *overhangs)
513 {
514     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
515     FIXME("(%p)->(%p): stub\n", This, overhangs);
516     return E_NOTIMPL;
517 }
518
519 static HRESULT WINAPI dwritetextlayout_GetClusterMetrics(IDWriteTextLayout *iface,
520     DWRITE_CLUSTER_METRICS *metrics, UINT32 max_count, UINT32* act_count)
521 {
522     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
523     FIXME("(%p)->(%p %u %p): stub\n", This, metrics, max_count, act_count);
524     return E_NOTIMPL;
525 }
526
527 static HRESULT WINAPI dwritetextlayout_DetermineMinWidth(IDWriteTextLayout *iface, FLOAT* min_width)
528 {
529     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
530     FIXME("(%p)->(%p): stub\n", This, min_width);
531     return E_NOTIMPL;
532 }
533
534 static HRESULT WINAPI dwritetextlayout_HitTestPoint(IDWriteTextLayout *iface,
535     FLOAT pointX, FLOAT pointY, BOOL* is_trailinghit, BOOL* is_inside, DWRITE_HIT_TEST_METRICS *metrics)
536 {
537     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
538     FIXME("(%p)->(%f %f %p %p %p): stub\n", This, pointX, pointY, is_trailinghit, is_inside, metrics);
539     return E_NOTIMPL;
540 }
541
542 static HRESULT WINAPI dwritetextlayout_HitTestTextPosition(IDWriteTextLayout *iface,
543     UINT32 textPosition, BOOL is_trailinghit, FLOAT* pointX, FLOAT* pointY, DWRITE_HIT_TEST_METRICS *metrics)
544 {
545     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
546     FIXME("(%p)->(%u %d %p %p %p): stub\n", This, textPosition, is_trailinghit, pointX, pointY, metrics);
547     return E_NOTIMPL;
548 }
549
550 static HRESULT WINAPI dwritetextlayout_HitTestTextRange(IDWriteTextLayout *iface,
551     UINT32 textPosition, UINT32 textLength, FLOAT originX, FLOAT originY,
552     DWRITE_HIT_TEST_METRICS *metrics, UINT32 max_metricscount, UINT32* actual_metricscount)
553 {
554     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
555     FIXME("(%p)->(%u %u %f %f %p %u %p): stub\n", This, textPosition, textLength, originX, originY, metrics,
556         max_metricscount, actual_metricscount);
557     return E_NOTIMPL;
558 }
559
560 static const IDWriteTextLayoutVtbl dwritetextlayoutvtbl = {
561     dwritetextlayout_QueryInterface,
562     dwritetextlayout_AddRef,
563     dwritetextlayout_Release,
564     dwritetextlayout_SetTextAlignment,
565     dwritetextlayout_SetParagraphAlignment,
566     dwritetextlayout_SetWordWrapping,
567     dwritetextlayout_SetReadingDirection,
568     dwritetextlayout_SetFlowDirection,
569     dwritetextlayout_SetIncrementalTabStop,
570     dwritetextlayout_SetTrimming,
571     dwritetextlayout_SetLineSpacing,
572     dwritetextlayout_GetTextAlignment,
573     dwritetextlayout_GetParagraphAlignment,
574     dwritetextlayout_GetWordWrapping,
575     dwritetextlayout_GetReadingDirection,
576     dwritetextlayout_GetFlowDirection,
577     dwritetextlayout_GetIncrementalTabStop,
578     dwritetextlayout_GetTrimming,
579     dwritetextlayout_GetLineSpacing,
580     dwritetextlayout_GetFontCollection,
581     dwritetextlayout_GetFontFamilyNameLength,
582     dwritetextlayout_GetFontFamilyName,
583     dwritetextlayout_GetFontWeight,
584     dwritetextlayout_GetFontStyle,
585     dwritetextlayout_GetFontStretch,
586     dwritetextlayout_GetFontSize,
587     dwritetextlayout_GetLocaleNameLength,
588     dwritetextlayout_GetLocaleName,
589     dwritetextlayout_SetMaxWidth,
590     dwritetextlayout_SetMaxHeight,
591     dwritetextlayout_SetFontCollection,
592     dwritetextlayout_SetFontFamilyName,
593     dwritetextlayout_SetFontWeight,
594     dwritetextlayout_SetFontStyle,
595     dwritetextlayout_SetFontStretch,
596     dwritetextlayout_SetFontSize,
597     dwritetextlayout_SetUnderline,
598     dwritetextlayout_SetStrikethrough,
599     dwritetextlayout_SetDrawingEffect,
600     dwritetextlayout_SetInlineObject,
601     dwritetextlayout_SetTypography,
602     dwritetextlayout_SetLocaleName,
603     dwritetextlayout_GetMaxWidth,
604     dwritetextlayout_GetMaxHeight,
605     dwritetextlayout_layout_GetFontCollection,
606     dwritetextlayout_layout_GetFontFamilyNameLength,
607     dwritetextlayout_layout_GetFontFamilyName,
608     dwritetextlayout_layout_GetFontWeight,
609     dwritetextlayout_layout_GetFontStyle,
610     dwritetextlayout_layout_GetFontStretch,
611     dwritetextlayout_layout_GetFontSize,
612     dwritetextlayout_GetUnderline,
613     dwritetextlayout_GetStrikethrough,
614     dwritetextlayout_GetDrawingEffect,
615     dwritetextlayout_GetInlineObject,
616     dwritetextlayout_GetTypography,
617     dwritetextlayout_layout_GetLocaleNameLength,
618     dwritetextlayout_layout_GetLocaleName,
619     dwritetextlayout_Draw,
620     dwritetextlayout_GetLineMetrics,
621     dwritetextlayout_GetMetrics,
622     dwritetextlayout_GetOverhangMetrics,
623     dwritetextlayout_GetClusterMetrics,
624     dwritetextlayout_DetermineMinWidth,
625     dwritetextlayout_HitTestPoint,
626     dwritetextlayout_HitTestTextPosition,
627     dwritetextlayout_HitTestTextRange
628 };
629
630 HRESULT create_textlayout(IDWriteTextLayout **layout)
631 {
632     struct dwrite_textlayout *This;
633
634     *layout = NULL;
635
636     This = heap_alloc(sizeof(struct dwrite_textlayout));
637     if (!This) return E_OUTOFMEMORY;
638
639     This->IDWriteTextLayout_iface.lpVtbl = &dwritetextlayoutvtbl;
640     This->ref = 1;
641
642     *layout = &This->IDWriteTextLayout_iface;
643
644     return S_OK;
645 }