2 * Text format and layout
4 * Copyright 2012 Nikolay Sivov for CodeWeavers
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.
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.
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
29 #include "dwrite_private.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
35 struct dwrite_textlayout {
36 IDWriteTextLayout IDWriteTextLayout_iface;
40 struct dwrite_textformat {
41 IDWriteTextFormat IDWriteTextFormat_iface;
45 static inline struct dwrite_textlayout *impl_from_IDWriteTextLayout(IDWriteTextLayout *iface)
47 return CONTAINING_RECORD(iface, struct dwrite_textlayout, IDWriteTextLayout_iface);
50 static inline struct dwrite_textformat *impl_from_IDWriteTextFormat(IDWriteTextFormat *iface)
52 return CONTAINING_RECORD(iface, struct dwrite_textformat, IDWriteTextFormat_iface);
55 static HRESULT WINAPI dwritetextlayout_QueryInterface(IDWriteTextLayout *iface, REFIID riid, void **obj)
57 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
59 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
61 if (IsEqualIID(riid, &IID_IUnknown) ||
62 IsEqualIID(riid, &IID_IDWriteTextFormat) ||
63 IsEqualIID(riid, &IID_IDWriteTextLayout))
66 IDWriteTextLayout_AddRef(iface);
75 static ULONG WINAPI dwritetextlayout_AddRef(IDWriteTextLayout *iface)
77 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
78 ULONG ref = InterlockedIncrement(&This->ref);
79 TRACE("(%p)->(%d)\n", This, ref);
83 static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout *iface)
85 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
86 ULONG ref = InterlockedDecrement(&This->ref);
88 TRACE("(%p)->(%d)\n", This, ref);
96 static HRESULT WINAPI dwritetextlayout_SetTextAlignment(IDWriteTextLayout *iface, DWRITE_TEXT_ALIGNMENT alignment)
98 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
99 FIXME("(%p)->(%d): stub\n", This, alignment);
103 static HRESULT WINAPI dwritetextlayout_SetParagraphAlignment(IDWriteTextLayout *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment)
105 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
106 FIXME("(%p)->(%d): stub\n", This, alignment);
110 static HRESULT WINAPI dwritetextlayout_SetWordWrapping(IDWriteTextLayout *iface, DWRITE_WORD_WRAPPING wrapping)
112 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
113 FIXME("(%p)->(%d): stub\n", This, wrapping);
117 static HRESULT WINAPI dwritetextlayout_SetReadingDirection(IDWriteTextLayout *iface, DWRITE_READING_DIRECTION direction)
119 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
120 FIXME("(%p)->(%d): stub\n", This, direction);
124 static HRESULT WINAPI dwritetextlayout_SetFlowDirection(IDWriteTextLayout *iface, DWRITE_FLOW_DIRECTION direction)
126 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
127 FIXME("(%p)->(%d): stub\n", This, direction);
131 static HRESULT WINAPI dwritetextlayout_SetIncrementalTabStop(IDWriteTextLayout *iface, FLOAT tabstop)
133 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
134 FIXME("(%p)->(%f): stub\n", This, tabstop);
138 static HRESULT WINAPI dwritetextlayout_SetTrimming(IDWriteTextLayout *iface, DWRITE_TRIMMING const *trimming,
139 IDWriteInlineObject *trimming_sign)
141 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
142 FIXME("(%p)->(%p %p): stub\n", This, trimming, trimming_sign);
146 static HRESULT WINAPI dwritetextlayout_SetLineSpacing(IDWriteTextLayout *iface, DWRITE_LINE_SPACING_METHOD spacing,
147 FLOAT line_spacing, FLOAT baseline)
149 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
150 FIXME("(%p)->(%d %f %f): stub\n", This, spacing, line_spacing, baseline);
154 static DWRITE_TEXT_ALIGNMENT WINAPI dwritetextlayout_GetTextAlignment(IDWriteTextLayout *iface)
156 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
157 FIXME("(%p): stub\n", This);
158 return DWRITE_TEXT_ALIGNMENT_LEADING;
161 static DWRITE_PARAGRAPH_ALIGNMENT WINAPI dwritetextlayout_GetParagraphAlignment(IDWriteTextLayout *iface)
163 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
164 FIXME("(%p): stub\n", This);
165 return DWRITE_PARAGRAPH_ALIGNMENT_NEAR;
168 static DWRITE_WORD_WRAPPING WINAPI dwritetextlayout_GetWordWrapping(IDWriteTextLayout *iface)
170 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
171 FIXME("(%p): stub\n", This);
172 return DWRITE_WORD_WRAPPING_NO_WRAP;
175 static DWRITE_READING_DIRECTION WINAPI dwritetextlayout_GetReadingDirection(IDWriteTextLayout *iface)
177 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
178 FIXME("(%p): stub\n", This);
179 return DWRITE_READING_DIRECTION_LEFT_TO_RIGHT;
182 static DWRITE_FLOW_DIRECTION WINAPI dwritetextlayout_GetFlowDirection(IDWriteTextLayout *iface)
184 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
185 FIXME("(%p): stub\n", This);
186 return DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM;
189 static FLOAT WINAPI dwritetextlayout_GetIncrementalTabStop(IDWriteTextLayout *iface)
191 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
192 FIXME("(%p): stub\n", This);
196 static HRESULT WINAPI dwritetextlayout_GetTrimming(IDWriteTextLayout *iface, DWRITE_TRIMMING *options,
197 IDWriteInlineObject **trimming_sign)
199 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
200 FIXME("(%p)->(%p %p): stub\n", This, options, trimming_sign);
204 static HRESULT WINAPI dwritetextlayout_GetLineSpacing(IDWriteTextLayout *iface, DWRITE_LINE_SPACING_METHOD *method,
205 FLOAT *spacing, FLOAT *baseline)
207 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
208 FIXME("(%p)->(%p %p %p): stub\n", This, method, spacing, baseline);
212 static HRESULT WINAPI dwritetextlayout_GetFontCollection(IDWriteTextLayout *iface, IDWriteFontCollection **collection)
214 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
215 FIXME("(%p)->(%p): stub\n", This, collection);
219 static UINT32 WINAPI dwritetextlayout_GetFontFamilyNameLength(IDWriteTextLayout *iface)
221 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
222 FIXME("(%p): stub\n", This);
226 static HRESULT WINAPI dwritetextlayout_GetFontFamilyName(IDWriteTextLayout *iface, WCHAR *name, UINT32 size)
228 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
229 FIXME("(%p)->(%p %u): stub\n", This, name, size);
233 static DWRITE_FONT_WEIGHT WINAPI dwritetextlayout_GetFontWeight(IDWriteTextLayout *iface)
235 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
236 FIXME("(%p): stub\n", This);
237 return DWRITE_FONT_WEIGHT_NORMAL;
240 static DWRITE_FONT_STYLE WINAPI dwritetextlayout_GetFontStyle(IDWriteTextLayout *iface)
242 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
243 FIXME("(%p): stub\n", This);
244 return DWRITE_FONT_STYLE_NORMAL;
247 static DWRITE_FONT_STRETCH WINAPI dwritetextlayout_GetFontStretch(IDWriteTextLayout *iface)
249 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
250 FIXME("(%p): stub\n", This);
251 return DWRITE_FONT_STRETCH_NORMAL;
254 static FLOAT WINAPI dwritetextlayout_GetFontSize(IDWriteTextLayout *iface)
256 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
257 FIXME("(%p): stub\n", This);
261 static UINT32 WINAPI dwritetextlayout_GetLocaleNameLength(IDWriteTextLayout *iface)
263 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
264 FIXME("(%p): stub\n", This);
268 static HRESULT WINAPI dwritetextlayout_GetLocaleName(IDWriteTextLayout *iface, WCHAR *name, UINT32 size)
270 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
271 FIXME("(%p)->(%p %u): stub\n", This, name, size);
275 static HRESULT WINAPI dwritetextlayout_SetMaxWidth(IDWriteTextLayout *iface, FLOAT maxWidth)
277 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
278 FIXME("(%p)->(%f): stub\n", This, maxWidth);
282 static HRESULT WINAPI dwritetextlayout_SetMaxHeight(IDWriteTextLayout *iface, FLOAT maxHeight)
284 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
285 FIXME("(%p)->(%f): stub\n", This, maxHeight);
289 static HRESULT WINAPI dwritetextlayout_SetFontCollection(IDWriteTextLayout *iface, IDWriteFontCollection* collection, DWRITE_TEXT_RANGE range)
291 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
292 FIXME("(%p)->(%p %u:%u): stub\n", This, collection, range.startPosition, range.length);
296 static HRESULT WINAPI dwritetextlayout_SetFontFamilyName(IDWriteTextLayout *iface, WCHAR const *name, DWRITE_TEXT_RANGE range)
298 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
299 FIXME("(%p)->(%s %u:%u): stub\n", This, debugstr_w(name), range.startPosition, range.length);
303 static HRESULT WINAPI dwritetextlayout_SetFontWeight(IDWriteTextLayout *iface, DWRITE_FONT_WEIGHT weight, DWRITE_TEXT_RANGE range)
305 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
306 FIXME("(%p)->(%d %u:%u): stub\n", This, weight, range.startPosition, range.length);
310 static HRESULT WINAPI dwritetextlayout_SetFontStyle(IDWriteTextLayout *iface, DWRITE_FONT_STYLE style, DWRITE_TEXT_RANGE range)
312 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
313 FIXME("(%p)->(%d %u:%u): stub\n", This, style, range.startPosition, range.length);
317 static HRESULT WINAPI dwritetextlayout_SetFontStretch(IDWriteTextLayout *iface, DWRITE_FONT_STRETCH stretch, DWRITE_TEXT_RANGE range)
319 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
320 FIXME("(%p)->(%d %u:%u): stub\n", This, stretch, range.startPosition, range.length);
324 static HRESULT WINAPI dwritetextlayout_SetFontSize(IDWriteTextLayout *iface, FLOAT size, DWRITE_TEXT_RANGE range)
326 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
327 FIXME("(%p)->(%f %u:%u): stub\n", This, size, range.startPosition, range.length);
331 static HRESULT WINAPI dwritetextlayout_SetUnderline(IDWriteTextLayout *iface, BOOL underline, DWRITE_TEXT_RANGE range)
333 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
334 FIXME("(%p)->(%d %u:%u): stub\n", This, underline, range.startPosition, range.length);
338 static HRESULT WINAPI dwritetextlayout_SetStrikethrough(IDWriteTextLayout *iface, BOOL strikethrough, DWRITE_TEXT_RANGE range)
340 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
341 FIXME("(%p)->(%d %u:%u): stub\n", This, strikethrough, range.startPosition, range.length);
345 static HRESULT WINAPI dwritetextlayout_SetDrawingEffect(IDWriteTextLayout *iface, IUnknown* effect, DWRITE_TEXT_RANGE range)
347 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
348 FIXME("(%p)->(%p %u:%u): stub\n", This, effect, range.startPosition, range.length);
352 static HRESULT WINAPI dwritetextlayout_SetInlineObject(IDWriteTextLayout *iface, IDWriteInlineObject *object, DWRITE_TEXT_RANGE range)
354 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
355 FIXME("(%p)->(%p %u:%u): stub\n", This, object, range.startPosition, range.length);
359 static HRESULT WINAPI dwritetextlayout_SetTypography(IDWriteTextLayout *iface, IDWriteTypography* typography, DWRITE_TEXT_RANGE range)
361 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
362 FIXME("(%p)->(%p %u:%u): stub\n", This, typography, range.startPosition, range.length);
366 static HRESULT WINAPI dwritetextlayout_SetLocaleName(IDWriteTextLayout *iface, WCHAR const* locale, DWRITE_TEXT_RANGE range)
368 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
369 FIXME("(%p)->(%s %u:%u): stub\n", This, debugstr_w(locale), range.startPosition, range.length);
373 static FLOAT WINAPI dwritetextlayout_GetMaxWidth(IDWriteTextLayout *iface)
375 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
376 FIXME("(%p): stub\n", This);
380 static FLOAT WINAPI dwritetextlayout_GetMaxHeight(IDWriteTextLayout *iface)
382 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
383 FIXME("(%p): stub\n", This);
387 static HRESULT WINAPI dwritetextlayout_layout_GetFontCollection(IDWriteTextLayout *iface, UINT32 pos,
388 IDWriteFontCollection** collection, DWRITE_TEXT_RANGE *range)
390 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
391 FIXME("(%p)->(%p %p): stub\n", This, collection, range);
395 static HRESULT WINAPI dwritetextlayout_layout_GetFontFamilyNameLength(IDWriteTextLayout *iface,
396 UINT32 pos, UINT32* len, DWRITE_TEXT_RANGE *range)
398 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
399 FIXME("(%p)->(%d %p %p): stub\n", This, pos, len, range);
403 static HRESULT WINAPI dwritetextlayout_layout_GetFontFamilyName(IDWriteTextLayout *iface,
404 UINT32 position, WCHAR* name, UINT32 name_size, DWRITE_TEXT_RANGE *range)
406 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
407 FIXME("(%p)->(%u %p %u %p): stub\n", This, position, name, name_size, range);
411 static HRESULT WINAPI dwritetextlayout_layout_GetFontWeight(IDWriteTextLayout *iface,
412 UINT32 position, DWRITE_FONT_WEIGHT *weight, DWRITE_TEXT_RANGE *range)
414 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
415 FIXME("(%p)->(%u %p %p): stub\n", This, position, weight, range);
419 static HRESULT WINAPI dwritetextlayout_layout_GetFontStyle(IDWriteTextLayout *iface,
420 UINT32 currentPosition, DWRITE_FONT_STYLE *style, DWRITE_TEXT_RANGE *range)
422 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
423 FIXME("(%p)->(%u %p %p): stub\n", This, currentPosition, style, range);
427 static HRESULT WINAPI dwritetextlayout_layout_GetFontStretch(IDWriteTextLayout *iface,
428 UINT32 position, DWRITE_FONT_STRETCH *stretch, DWRITE_TEXT_RANGE *range)
430 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
431 FIXME("(%p)->(%u %p %p): stub\n", This, position, stretch, range);
435 static HRESULT WINAPI dwritetextlayout_layout_GetFontSize(IDWriteTextLayout *iface,
436 UINT32 position, FLOAT *size, DWRITE_TEXT_RANGE *range)
438 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
439 FIXME("(%p)->(%u %p %p): stub\n", This, position, size, range);
443 static HRESULT WINAPI dwritetextlayout_GetUnderline(IDWriteTextLayout *iface,
444 UINT32 position, BOOL *has_underline, DWRITE_TEXT_RANGE *range)
446 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
447 FIXME("(%p)->(%u %p %p): stub\n", This, position, has_underline, range);
451 static HRESULT WINAPI dwritetextlayout_GetStrikethrough(IDWriteTextLayout *iface,
452 UINT32 position, BOOL *has_strikethrough, DWRITE_TEXT_RANGE *range)
454 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
455 FIXME("(%p)->(%u %p %p): stub\n", This, position, has_strikethrough, range);
459 static HRESULT WINAPI dwritetextlayout_GetDrawingEffect(IDWriteTextLayout *iface,
460 UINT32 position, IUnknown **effect, DWRITE_TEXT_RANGE *range)
462 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
463 FIXME("(%p)->(%u %p %p): stub\n", This, position, effect, range);
467 static HRESULT WINAPI dwritetextlayout_GetInlineObject(IDWriteTextLayout *iface,
468 UINT32 position, IDWriteInlineObject **object, DWRITE_TEXT_RANGE *range)
470 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
471 FIXME("(%p)->(%u %p %p): stub\n", This, position, object, range);
475 static HRESULT WINAPI dwritetextlayout_GetTypography(IDWriteTextLayout *iface,
476 UINT32 position, IDWriteTypography** typography, DWRITE_TEXT_RANGE *range)
478 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
479 FIXME("(%p)->(%u %p %p): stub\n", This, position, typography, range);
483 static HRESULT WINAPI dwritetextlayout_layout_GetLocaleNameLength(IDWriteTextLayout *iface,
484 UINT32 position, UINT32* length, DWRITE_TEXT_RANGE *range)
486 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
487 FIXME("(%p)->(%u %p %p): stub\n", This, position, length, range);
491 static HRESULT WINAPI dwritetextlayout_layout_GetLocaleName(IDWriteTextLayout *iface,
492 UINT32 position, WCHAR* name, UINT32 name_size, DWRITE_TEXT_RANGE *range)
494 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
495 FIXME("(%p)->(%u %p %u %p): stub\n", This, position, name, name_size, range);
499 static HRESULT WINAPI dwritetextlayout_Draw(IDWriteTextLayout *iface,
500 void *context, IDWriteTextRenderer* renderer, FLOAT originX, FLOAT originY)
502 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
503 FIXME("(%p)->(%p %p %f %f): stub\n", This, context, renderer, originX, originY);
507 static HRESULT WINAPI dwritetextlayout_GetLineMetrics(IDWriteTextLayout *iface,
508 DWRITE_LINE_METRICS *metrics, UINT32 max_count, UINT32 *actual_count)
510 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
511 FIXME("(%p)->(%p %u %p): stub\n", This, metrics, max_count, actual_count);
515 static HRESULT WINAPI dwritetextlayout_GetMetrics(IDWriteTextLayout *iface, DWRITE_TEXT_METRICS *metrics)
517 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
518 FIXME("(%p)->(%p): stub\n", This, metrics);
522 static HRESULT WINAPI dwritetextlayout_GetOverhangMetrics(IDWriteTextLayout *iface, DWRITE_OVERHANG_METRICS *overhangs)
524 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
525 FIXME("(%p)->(%p): stub\n", This, overhangs);
529 static HRESULT WINAPI dwritetextlayout_GetClusterMetrics(IDWriteTextLayout *iface,
530 DWRITE_CLUSTER_METRICS *metrics, UINT32 max_count, UINT32* act_count)
532 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
533 FIXME("(%p)->(%p %u %p): stub\n", This, metrics, max_count, act_count);
537 static HRESULT WINAPI dwritetextlayout_DetermineMinWidth(IDWriteTextLayout *iface, FLOAT* min_width)
539 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
540 FIXME("(%p)->(%p): stub\n", This, min_width);
544 static HRESULT WINAPI dwritetextlayout_HitTestPoint(IDWriteTextLayout *iface,
545 FLOAT pointX, FLOAT pointY, BOOL* is_trailinghit, BOOL* is_inside, DWRITE_HIT_TEST_METRICS *metrics)
547 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
548 FIXME("(%p)->(%f %f %p %p %p): stub\n", This, pointX, pointY, is_trailinghit, is_inside, metrics);
552 static HRESULT WINAPI dwritetextlayout_HitTestTextPosition(IDWriteTextLayout *iface,
553 UINT32 textPosition, BOOL is_trailinghit, FLOAT* pointX, FLOAT* pointY, DWRITE_HIT_TEST_METRICS *metrics)
555 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
556 FIXME("(%p)->(%u %d %p %p %p): stub\n", This, textPosition, is_trailinghit, pointX, pointY, metrics);
560 static HRESULT WINAPI dwritetextlayout_HitTestTextRange(IDWriteTextLayout *iface,
561 UINT32 textPosition, UINT32 textLength, FLOAT originX, FLOAT originY,
562 DWRITE_HIT_TEST_METRICS *metrics, UINT32 max_metricscount, UINT32* actual_metricscount)
564 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
565 FIXME("(%p)->(%u %u %f %f %p %u %p): stub\n", This, textPosition, textLength, originX, originY, metrics,
566 max_metricscount, actual_metricscount);
570 static const IDWriteTextLayoutVtbl dwritetextlayoutvtbl = {
571 dwritetextlayout_QueryInterface,
572 dwritetextlayout_AddRef,
573 dwritetextlayout_Release,
574 dwritetextlayout_SetTextAlignment,
575 dwritetextlayout_SetParagraphAlignment,
576 dwritetextlayout_SetWordWrapping,
577 dwritetextlayout_SetReadingDirection,
578 dwritetextlayout_SetFlowDirection,
579 dwritetextlayout_SetIncrementalTabStop,
580 dwritetextlayout_SetTrimming,
581 dwritetextlayout_SetLineSpacing,
582 dwritetextlayout_GetTextAlignment,
583 dwritetextlayout_GetParagraphAlignment,
584 dwritetextlayout_GetWordWrapping,
585 dwritetextlayout_GetReadingDirection,
586 dwritetextlayout_GetFlowDirection,
587 dwritetextlayout_GetIncrementalTabStop,
588 dwritetextlayout_GetTrimming,
589 dwritetextlayout_GetLineSpacing,
590 dwritetextlayout_GetFontCollection,
591 dwritetextlayout_GetFontFamilyNameLength,
592 dwritetextlayout_GetFontFamilyName,
593 dwritetextlayout_GetFontWeight,
594 dwritetextlayout_GetFontStyle,
595 dwritetextlayout_GetFontStretch,
596 dwritetextlayout_GetFontSize,
597 dwritetextlayout_GetLocaleNameLength,
598 dwritetextlayout_GetLocaleName,
599 dwritetextlayout_SetMaxWidth,
600 dwritetextlayout_SetMaxHeight,
601 dwritetextlayout_SetFontCollection,
602 dwritetextlayout_SetFontFamilyName,
603 dwritetextlayout_SetFontWeight,
604 dwritetextlayout_SetFontStyle,
605 dwritetextlayout_SetFontStretch,
606 dwritetextlayout_SetFontSize,
607 dwritetextlayout_SetUnderline,
608 dwritetextlayout_SetStrikethrough,
609 dwritetextlayout_SetDrawingEffect,
610 dwritetextlayout_SetInlineObject,
611 dwritetextlayout_SetTypography,
612 dwritetextlayout_SetLocaleName,
613 dwritetextlayout_GetMaxWidth,
614 dwritetextlayout_GetMaxHeight,
615 dwritetextlayout_layout_GetFontCollection,
616 dwritetextlayout_layout_GetFontFamilyNameLength,
617 dwritetextlayout_layout_GetFontFamilyName,
618 dwritetextlayout_layout_GetFontWeight,
619 dwritetextlayout_layout_GetFontStyle,
620 dwritetextlayout_layout_GetFontStretch,
621 dwritetextlayout_layout_GetFontSize,
622 dwritetextlayout_GetUnderline,
623 dwritetextlayout_GetStrikethrough,
624 dwritetextlayout_GetDrawingEffect,
625 dwritetextlayout_GetInlineObject,
626 dwritetextlayout_GetTypography,
627 dwritetextlayout_layout_GetLocaleNameLength,
628 dwritetextlayout_layout_GetLocaleName,
629 dwritetextlayout_Draw,
630 dwritetextlayout_GetLineMetrics,
631 dwritetextlayout_GetMetrics,
632 dwritetextlayout_GetOverhangMetrics,
633 dwritetextlayout_GetClusterMetrics,
634 dwritetextlayout_DetermineMinWidth,
635 dwritetextlayout_HitTestPoint,
636 dwritetextlayout_HitTestTextPosition,
637 dwritetextlayout_HitTestTextRange
640 HRESULT create_textlayout(IDWriteTextLayout **layout)
642 struct dwrite_textlayout *This;
646 This = heap_alloc(sizeof(struct dwrite_textlayout));
647 if (!This) return E_OUTOFMEMORY;
649 This->IDWriteTextLayout_iface.lpVtbl = &dwritetextlayoutvtbl;
652 *layout = &This->IDWriteTextLayout_iface;
657 static HRESULT WINAPI dwritetextformat_QueryInterface(IDWriteTextFormat *iface, REFIID riid, void **obj)
659 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
661 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
663 if (IsEqualIID(riid, &IID_IUnknown) ||
664 IsEqualIID(riid, &IID_IDWriteTextFormat))
667 IDWriteTextFormat_AddRef(iface);
673 return E_NOINTERFACE;
676 static ULONG WINAPI dwritetextformat_AddRef(IDWriteTextFormat *iface)
678 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
679 ULONG ref = InterlockedIncrement(&This->ref);
680 TRACE("(%p)->(%d)\n", This, ref);
684 static ULONG WINAPI dwritetextformat_Release(IDWriteTextFormat *iface)
686 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
687 ULONG ref = InterlockedDecrement(&This->ref);
689 TRACE("(%p)->(%d)\n", This, ref);
697 static HRESULT WINAPI dwritetextformat_SetTextAlignment(IDWriteTextFormat *iface, DWRITE_TEXT_ALIGNMENT alignment)
699 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
700 FIXME("(%p)->(%d): stub\n", This, alignment);
704 static HRESULT WINAPI dwritetextformat_SetParagraphAlignment(IDWriteTextFormat *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment)
706 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
707 FIXME("(%p)->(%d): stub\n", This, alignment);
711 static HRESULT WINAPI dwritetextformat_SetWordWrapping(IDWriteTextFormat *iface, DWRITE_WORD_WRAPPING wrapping)
713 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
714 FIXME("(%p)->(%d): stub\n", This, wrapping);
718 static HRESULT WINAPI dwritetextformat_SetReadingDirection(IDWriteTextFormat *iface, DWRITE_READING_DIRECTION direction)
720 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
721 FIXME("(%p)->(%d): stub\n", This, direction);
725 static HRESULT WINAPI dwritetextformat_SetFlowDirection(IDWriteTextFormat *iface, DWRITE_FLOW_DIRECTION direction)
727 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
728 FIXME("(%p)->(%d): stub\n", This, direction);
732 static HRESULT WINAPI dwritetextformat_SetIncrementalTabStop(IDWriteTextFormat *iface, FLOAT tabstop)
734 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
735 FIXME("(%p)->(%f): stub\n", This, tabstop);
739 static HRESULT WINAPI dwritetextformat_SetTrimming(IDWriteTextFormat *iface, DWRITE_TRIMMING const *trimming,
740 IDWriteInlineObject *trimming_sign)
742 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
743 FIXME("(%p)->(%p %p): stub\n", This, trimming, trimming_sign);
747 static HRESULT WINAPI dwritetextformat_SetLineSpacing(IDWriteTextFormat *iface, DWRITE_LINE_SPACING_METHOD spacing,
748 FLOAT line_spacing, FLOAT baseline)
750 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
751 FIXME("(%p)->(%d %f %f): stub\n", This, spacing, line_spacing, baseline);
755 static DWRITE_TEXT_ALIGNMENT WINAPI dwritetextformat_GetTextAlignment(IDWriteTextFormat *iface)
757 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
758 FIXME("(%p): stub\n", This);
759 return DWRITE_TEXT_ALIGNMENT_LEADING;
762 static DWRITE_PARAGRAPH_ALIGNMENT WINAPI dwritetextformat_GetParagraphAlignment(IDWriteTextFormat *iface)
764 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
765 FIXME("(%p): stub\n", This);
766 return DWRITE_PARAGRAPH_ALIGNMENT_NEAR;
769 static DWRITE_WORD_WRAPPING WINAPI dwritetextformat_GetWordWrapping(IDWriteTextFormat *iface)
771 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
772 FIXME("(%p): stub\n", This);
773 return DWRITE_WORD_WRAPPING_NO_WRAP;
776 static DWRITE_READING_DIRECTION WINAPI dwritetextformat_GetReadingDirection(IDWriteTextFormat *iface)
778 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
779 FIXME("(%p): stub\n", This);
780 return DWRITE_READING_DIRECTION_LEFT_TO_RIGHT;
783 static DWRITE_FLOW_DIRECTION WINAPI dwritetextformat_GetFlowDirection(IDWriteTextFormat *iface)
785 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
786 FIXME("(%p): stub\n", This);
787 return DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM;
790 static FLOAT WINAPI dwritetextformat_GetIncrementalTabStop(IDWriteTextFormat *iface)
792 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
793 FIXME("(%p): stub\n", This);
797 static HRESULT WINAPI dwritetextformat_GetTrimming(IDWriteTextFormat *iface, DWRITE_TRIMMING *options,
798 IDWriteInlineObject **trimming_sign)
800 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
801 FIXME("(%p)->(%p %p): stub\n", This, options, trimming_sign);
805 static HRESULT WINAPI dwritetextformat_GetLineSpacing(IDWriteTextFormat *iface, DWRITE_LINE_SPACING_METHOD *method,
806 FLOAT *spacing, FLOAT *baseline)
808 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
809 FIXME("(%p)->(%p %p %p): stub\n", This, method, spacing, baseline);
813 static HRESULT WINAPI dwritetextformat_GetFontCollection(IDWriteTextFormat *iface, IDWriteFontCollection **collection)
815 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
816 FIXME("(%p)->(%p): stub\n", This, collection);
820 static UINT32 WINAPI dwritetextformat_GetFontFamilyNameLength(IDWriteTextFormat *iface)
822 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
823 FIXME("(%p): stub\n", This);
827 static HRESULT WINAPI dwritetextformat_GetFontFamilyName(IDWriteTextFormat *iface, WCHAR *name, UINT32 size)
829 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
830 FIXME("(%p)->(%p %u): stub\n", This, name, size);
834 static DWRITE_FONT_WEIGHT WINAPI dwritetextformat_GetFontWeight(IDWriteTextFormat *iface)
836 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
837 FIXME("(%p): stub\n", This);
838 return DWRITE_FONT_WEIGHT_NORMAL;
841 static DWRITE_FONT_STYLE WINAPI dwritetextformat_GetFontStyle(IDWriteTextFormat *iface)
843 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
844 FIXME("(%p): stub\n", This);
845 return DWRITE_FONT_STYLE_NORMAL;
848 static DWRITE_FONT_STRETCH WINAPI dwritetextformat_GetFontStretch(IDWriteTextFormat *iface)
850 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
851 FIXME("(%p): stub\n", This);
852 return DWRITE_FONT_STRETCH_NORMAL;
855 static FLOAT WINAPI dwritetextformat_GetFontSize(IDWriteTextFormat *iface)
857 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
858 FIXME("(%p): stub\n", This);
862 static UINT32 WINAPI dwritetextformat_GetLocaleNameLength(IDWriteTextFormat *iface)
864 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
865 FIXME("(%p): stub\n", This);
869 static HRESULT WINAPI dwritetextformat_GetLocaleName(IDWriteTextFormat *iface, WCHAR *name, UINT32 size)
871 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
872 FIXME("(%p)->(%p %u): stub\n", This, name, size);
876 static const IDWriteTextFormatVtbl dwritetextformatvtbl = {
877 dwritetextformat_QueryInterface,
878 dwritetextformat_AddRef,
879 dwritetextformat_Release,
880 dwritetextformat_SetTextAlignment,
881 dwritetextformat_SetParagraphAlignment,
882 dwritetextformat_SetWordWrapping,
883 dwritetextformat_SetReadingDirection,
884 dwritetextformat_SetFlowDirection,
885 dwritetextformat_SetIncrementalTabStop,
886 dwritetextformat_SetTrimming,
887 dwritetextformat_SetLineSpacing,
888 dwritetextformat_GetTextAlignment,
889 dwritetextformat_GetParagraphAlignment,
890 dwritetextformat_GetWordWrapping,
891 dwritetextformat_GetReadingDirection,
892 dwritetextformat_GetFlowDirection,
893 dwritetextformat_GetIncrementalTabStop,
894 dwritetextformat_GetTrimming,
895 dwritetextformat_GetLineSpacing,
896 dwritetextformat_GetFontCollection,
897 dwritetextformat_GetFontFamilyNameLength,
898 dwritetextformat_GetFontFamilyName,
899 dwritetextformat_GetFontWeight,
900 dwritetextformat_GetFontStyle,
901 dwritetextformat_GetFontStretch,
902 dwritetextformat_GetFontSize,
903 dwritetextformat_GetLocaleNameLength,
904 dwritetextformat_GetLocaleName
907 HRESULT create_textformat(IDWriteTextFormat **format)
909 struct dwrite_textformat *This;
911 This = heap_alloc(sizeof(struct dwrite_textformat));
912 if (!This) return E_OUTOFMEMORY;
914 This->IDWriteTextFormat_iface.lpVtbl = &dwritetextformatvtbl;
917 *format = &This->IDWriteTextFormat_iface;