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;
47 DWRITE_FONT_WEIGHT weight;
48 DWRITE_FONT_STYLE style;
49 DWRITE_FONT_STRETCH stretch;
54 static inline struct dwrite_textlayout *impl_from_IDWriteTextLayout(IDWriteTextLayout *iface)
56 return CONTAINING_RECORD(iface, struct dwrite_textlayout, IDWriteTextLayout_iface);
59 static inline struct dwrite_textformat *impl_from_IDWriteTextFormat(IDWriteTextFormat *iface)
61 return CONTAINING_RECORD(iface, struct dwrite_textformat, IDWriteTextFormat_iface);
64 static HRESULT WINAPI dwritetextlayout_QueryInterface(IDWriteTextLayout *iface, REFIID riid, void **obj)
66 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
68 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
70 if (IsEqualIID(riid, &IID_IUnknown) ||
71 IsEqualIID(riid, &IID_IDWriteTextFormat) ||
72 IsEqualIID(riid, &IID_IDWriteTextLayout))
75 IDWriteTextLayout_AddRef(iface);
84 static ULONG WINAPI dwritetextlayout_AddRef(IDWriteTextLayout *iface)
86 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
87 ULONG ref = InterlockedIncrement(&This->ref);
88 TRACE("(%p)->(%d)\n", This, ref);
92 static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout *iface)
94 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
95 ULONG ref = InterlockedDecrement(&This->ref);
97 TRACE("(%p)->(%d)\n", This, ref);
105 static HRESULT WINAPI dwritetextlayout_SetTextAlignment(IDWriteTextLayout *iface, DWRITE_TEXT_ALIGNMENT alignment)
107 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
108 FIXME("(%p)->(%d): stub\n", This, alignment);
112 static HRESULT WINAPI dwritetextlayout_SetParagraphAlignment(IDWriteTextLayout *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment)
114 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
115 FIXME("(%p)->(%d): stub\n", This, alignment);
119 static HRESULT WINAPI dwritetextlayout_SetWordWrapping(IDWriteTextLayout *iface, DWRITE_WORD_WRAPPING wrapping)
121 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
122 FIXME("(%p)->(%d): stub\n", This, wrapping);
126 static HRESULT WINAPI dwritetextlayout_SetReadingDirection(IDWriteTextLayout *iface, DWRITE_READING_DIRECTION direction)
128 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
129 FIXME("(%p)->(%d): stub\n", This, direction);
133 static HRESULT WINAPI dwritetextlayout_SetFlowDirection(IDWriteTextLayout *iface, DWRITE_FLOW_DIRECTION direction)
135 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
136 FIXME("(%p)->(%d): stub\n", This, direction);
140 static HRESULT WINAPI dwritetextlayout_SetIncrementalTabStop(IDWriteTextLayout *iface, FLOAT tabstop)
142 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
143 FIXME("(%p)->(%f): stub\n", This, tabstop);
147 static HRESULT WINAPI dwritetextlayout_SetTrimming(IDWriteTextLayout *iface, DWRITE_TRIMMING const *trimming,
148 IDWriteInlineObject *trimming_sign)
150 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
151 FIXME("(%p)->(%p %p): stub\n", This, trimming, trimming_sign);
155 static HRESULT WINAPI dwritetextlayout_SetLineSpacing(IDWriteTextLayout *iface, DWRITE_LINE_SPACING_METHOD spacing,
156 FLOAT line_spacing, FLOAT baseline)
158 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
159 FIXME("(%p)->(%d %f %f): stub\n", This, spacing, line_spacing, baseline);
163 static DWRITE_TEXT_ALIGNMENT WINAPI dwritetextlayout_GetTextAlignment(IDWriteTextLayout *iface)
165 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
166 FIXME("(%p): stub\n", This);
167 return DWRITE_TEXT_ALIGNMENT_LEADING;
170 static DWRITE_PARAGRAPH_ALIGNMENT WINAPI dwritetextlayout_GetParagraphAlignment(IDWriteTextLayout *iface)
172 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
173 FIXME("(%p): stub\n", This);
174 return DWRITE_PARAGRAPH_ALIGNMENT_NEAR;
177 static DWRITE_WORD_WRAPPING WINAPI dwritetextlayout_GetWordWrapping(IDWriteTextLayout *iface)
179 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
180 FIXME("(%p): stub\n", This);
181 return DWRITE_WORD_WRAPPING_NO_WRAP;
184 static DWRITE_READING_DIRECTION WINAPI dwritetextlayout_GetReadingDirection(IDWriteTextLayout *iface)
186 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
187 FIXME("(%p): stub\n", This);
188 return DWRITE_READING_DIRECTION_LEFT_TO_RIGHT;
191 static DWRITE_FLOW_DIRECTION WINAPI dwritetextlayout_GetFlowDirection(IDWriteTextLayout *iface)
193 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
194 FIXME("(%p): stub\n", This);
195 return DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM;
198 static FLOAT WINAPI dwritetextlayout_GetIncrementalTabStop(IDWriteTextLayout *iface)
200 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
201 FIXME("(%p): stub\n", This);
205 static HRESULT WINAPI dwritetextlayout_GetTrimming(IDWriteTextLayout *iface, DWRITE_TRIMMING *options,
206 IDWriteInlineObject **trimming_sign)
208 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
209 FIXME("(%p)->(%p %p): stub\n", This, options, trimming_sign);
213 static HRESULT WINAPI dwritetextlayout_GetLineSpacing(IDWriteTextLayout *iface, DWRITE_LINE_SPACING_METHOD *method,
214 FLOAT *spacing, FLOAT *baseline)
216 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
217 FIXME("(%p)->(%p %p %p): stub\n", This, method, spacing, baseline);
221 static HRESULT WINAPI dwritetextlayout_GetFontCollection(IDWriteTextLayout *iface, IDWriteFontCollection **collection)
223 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
224 FIXME("(%p)->(%p): stub\n", This, collection);
228 static UINT32 WINAPI dwritetextlayout_GetFontFamilyNameLength(IDWriteTextLayout *iface)
230 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
231 FIXME("(%p): stub\n", This);
235 static HRESULT WINAPI dwritetextlayout_GetFontFamilyName(IDWriteTextLayout *iface, WCHAR *name, UINT32 size)
237 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
238 FIXME("(%p)->(%p %u): stub\n", This, name, size);
242 static DWRITE_FONT_WEIGHT WINAPI dwritetextlayout_GetFontWeight(IDWriteTextLayout *iface)
244 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
245 FIXME("(%p): stub\n", This);
246 return DWRITE_FONT_WEIGHT_NORMAL;
249 static DWRITE_FONT_STYLE WINAPI dwritetextlayout_GetFontStyle(IDWriteTextLayout *iface)
251 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
252 FIXME("(%p): stub\n", This);
253 return DWRITE_FONT_STYLE_NORMAL;
256 static DWRITE_FONT_STRETCH WINAPI dwritetextlayout_GetFontStretch(IDWriteTextLayout *iface)
258 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
259 FIXME("(%p): stub\n", This);
260 return DWRITE_FONT_STRETCH_NORMAL;
263 static FLOAT WINAPI dwritetextlayout_GetFontSize(IDWriteTextLayout *iface)
265 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
266 FIXME("(%p): stub\n", This);
270 static UINT32 WINAPI dwritetextlayout_GetLocaleNameLength(IDWriteTextLayout *iface)
272 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
273 FIXME("(%p): stub\n", This);
277 static HRESULT WINAPI dwritetextlayout_GetLocaleName(IDWriteTextLayout *iface, WCHAR *name, UINT32 size)
279 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
280 FIXME("(%p)->(%p %u): stub\n", This, name, size);
284 static HRESULT WINAPI dwritetextlayout_SetMaxWidth(IDWriteTextLayout *iface, FLOAT maxWidth)
286 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
287 FIXME("(%p)->(%f): stub\n", This, maxWidth);
291 static HRESULT WINAPI dwritetextlayout_SetMaxHeight(IDWriteTextLayout *iface, FLOAT maxHeight)
293 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
294 FIXME("(%p)->(%f): stub\n", This, maxHeight);
298 static HRESULT WINAPI dwritetextlayout_SetFontCollection(IDWriteTextLayout *iface, IDWriteFontCollection* collection, DWRITE_TEXT_RANGE range)
300 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
301 FIXME("(%p)->(%p %u:%u): stub\n", This, collection, range.startPosition, range.length);
305 static HRESULT WINAPI dwritetextlayout_SetFontFamilyName(IDWriteTextLayout *iface, WCHAR const *name, DWRITE_TEXT_RANGE range)
307 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
308 FIXME("(%p)->(%s %u:%u): stub\n", This, debugstr_w(name), range.startPosition, range.length);
312 static HRESULT WINAPI dwritetextlayout_SetFontWeight(IDWriteTextLayout *iface, DWRITE_FONT_WEIGHT weight, DWRITE_TEXT_RANGE range)
314 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
315 FIXME("(%p)->(%d %u:%u): stub\n", This, weight, range.startPosition, range.length);
319 static HRESULT WINAPI dwritetextlayout_SetFontStyle(IDWriteTextLayout *iface, DWRITE_FONT_STYLE style, DWRITE_TEXT_RANGE range)
321 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
322 FIXME("(%p)->(%d %u:%u): stub\n", This, style, range.startPosition, range.length);
326 static HRESULT WINAPI dwritetextlayout_SetFontStretch(IDWriteTextLayout *iface, DWRITE_FONT_STRETCH stretch, DWRITE_TEXT_RANGE range)
328 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
329 FIXME("(%p)->(%d %u:%u): stub\n", This, stretch, range.startPosition, range.length);
333 static HRESULT WINAPI dwritetextlayout_SetFontSize(IDWriteTextLayout *iface, FLOAT size, DWRITE_TEXT_RANGE range)
335 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
336 FIXME("(%p)->(%f %u:%u): stub\n", This, size, range.startPosition, range.length);
340 static HRESULT WINAPI dwritetextlayout_SetUnderline(IDWriteTextLayout *iface, BOOL underline, DWRITE_TEXT_RANGE range)
342 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
343 FIXME("(%p)->(%d %u:%u): stub\n", This, underline, range.startPosition, range.length);
347 static HRESULT WINAPI dwritetextlayout_SetStrikethrough(IDWriteTextLayout *iface, BOOL strikethrough, DWRITE_TEXT_RANGE range)
349 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
350 FIXME("(%p)->(%d %u:%u): stub\n", This, strikethrough, range.startPosition, range.length);
354 static HRESULT WINAPI dwritetextlayout_SetDrawingEffect(IDWriteTextLayout *iface, IUnknown* effect, DWRITE_TEXT_RANGE range)
356 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
357 FIXME("(%p)->(%p %u:%u): stub\n", This, effect, range.startPosition, range.length);
361 static HRESULT WINAPI dwritetextlayout_SetInlineObject(IDWriteTextLayout *iface, IDWriteInlineObject *object, DWRITE_TEXT_RANGE range)
363 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
364 FIXME("(%p)->(%p %u:%u): stub\n", This, object, range.startPosition, range.length);
368 static HRESULT WINAPI dwritetextlayout_SetTypography(IDWriteTextLayout *iface, IDWriteTypography* typography, DWRITE_TEXT_RANGE range)
370 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
371 FIXME("(%p)->(%p %u:%u): stub\n", This, typography, range.startPosition, range.length);
375 static HRESULT WINAPI dwritetextlayout_SetLocaleName(IDWriteTextLayout *iface, WCHAR const* locale, DWRITE_TEXT_RANGE range)
377 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
378 FIXME("(%p)->(%s %u:%u): stub\n", This, debugstr_w(locale), range.startPosition, range.length);
382 static FLOAT WINAPI dwritetextlayout_GetMaxWidth(IDWriteTextLayout *iface)
384 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
385 FIXME("(%p): stub\n", This);
389 static FLOAT WINAPI dwritetextlayout_GetMaxHeight(IDWriteTextLayout *iface)
391 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
392 FIXME("(%p): stub\n", This);
396 static HRESULT WINAPI dwritetextlayout_layout_GetFontCollection(IDWriteTextLayout *iface, UINT32 pos,
397 IDWriteFontCollection** collection, DWRITE_TEXT_RANGE *range)
399 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
400 FIXME("(%p)->(%p %p): stub\n", This, collection, range);
404 static HRESULT WINAPI dwritetextlayout_layout_GetFontFamilyNameLength(IDWriteTextLayout *iface,
405 UINT32 pos, UINT32* len, DWRITE_TEXT_RANGE *range)
407 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
408 FIXME("(%p)->(%d %p %p): stub\n", This, pos, len, range);
412 static HRESULT WINAPI dwritetextlayout_layout_GetFontFamilyName(IDWriteTextLayout *iface,
413 UINT32 position, WCHAR* name, UINT32 name_size, DWRITE_TEXT_RANGE *range)
415 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
416 FIXME("(%p)->(%u %p %u %p): stub\n", This, position, name, name_size, range);
420 static HRESULT WINAPI dwritetextlayout_layout_GetFontWeight(IDWriteTextLayout *iface,
421 UINT32 position, DWRITE_FONT_WEIGHT *weight, DWRITE_TEXT_RANGE *range)
423 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
424 FIXME("(%p)->(%u %p %p): stub\n", This, position, weight, range);
428 static HRESULT WINAPI dwritetextlayout_layout_GetFontStyle(IDWriteTextLayout *iface,
429 UINT32 currentPosition, DWRITE_FONT_STYLE *style, DWRITE_TEXT_RANGE *range)
431 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
432 FIXME("(%p)->(%u %p %p): stub\n", This, currentPosition, style, range);
436 static HRESULT WINAPI dwritetextlayout_layout_GetFontStretch(IDWriteTextLayout *iface,
437 UINT32 position, DWRITE_FONT_STRETCH *stretch, DWRITE_TEXT_RANGE *range)
439 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
440 FIXME("(%p)->(%u %p %p): stub\n", This, position, stretch, range);
444 static HRESULT WINAPI dwritetextlayout_layout_GetFontSize(IDWriteTextLayout *iface,
445 UINT32 position, FLOAT *size, DWRITE_TEXT_RANGE *range)
447 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
448 FIXME("(%p)->(%u %p %p): stub\n", This, position, size, range);
452 static HRESULT WINAPI dwritetextlayout_GetUnderline(IDWriteTextLayout *iface,
453 UINT32 position, BOOL *has_underline, DWRITE_TEXT_RANGE *range)
455 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
456 FIXME("(%p)->(%u %p %p): stub\n", This, position, has_underline, range);
460 static HRESULT WINAPI dwritetextlayout_GetStrikethrough(IDWriteTextLayout *iface,
461 UINT32 position, BOOL *has_strikethrough, DWRITE_TEXT_RANGE *range)
463 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
464 FIXME("(%p)->(%u %p %p): stub\n", This, position, has_strikethrough, range);
468 static HRESULT WINAPI dwritetextlayout_GetDrawingEffect(IDWriteTextLayout *iface,
469 UINT32 position, IUnknown **effect, DWRITE_TEXT_RANGE *range)
471 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
472 FIXME("(%p)->(%u %p %p): stub\n", This, position, effect, range);
476 static HRESULT WINAPI dwritetextlayout_GetInlineObject(IDWriteTextLayout *iface,
477 UINT32 position, IDWriteInlineObject **object, DWRITE_TEXT_RANGE *range)
479 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
480 FIXME("(%p)->(%u %p %p): stub\n", This, position, object, range);
484 static HRESULT WINAPI dwritetextlayout_GetTypography(IDWriteTextLayout *iface,
485 UINT32 position, IDWriteTypography** typography, DWRITE_TEXT_RANGE *range)
487 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
488 FIXME("(%p)->(%u %p %p): stub\n", This, position, typography, range);
492 static HRESULT WINAPI dwritetextlayout_layout_GetLocaleNameLength(IDWriteTextLayout *iface,
493 UINT32 position, UINT32* length, DWRITE_TEXT_RANGE *range)
495 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
496 FIXME("(%p)->(%u %p %p): stub\n", This, position, length, range);
500 static HRESULT WINAPI dwritetextlayout_layout_GetLocaleName(IDWriteTextLayout *iface,
501 UINT32 position, WCHAR* name, UINT32 name_size, DWRITE_TEXT_RANGE *range)
503 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
504 FIXME("(%p)->(%u %p %u %p): stub\n", This, position, name, name_size, range);
508 static HRESULT WINAPI dwritetextlayout_Draw(IDWriteTextLayout *iface,
509 void *context, IDWriteTextRenderer* renderer, FLOAT originX, FLOAT originY)
511 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
512 FIXME("(%p)->(%p %p %f %f): stub\n", This, context, renderer, originX, originY);
516 static HRESULT WINAPI dwritetextlayout_GetLineMetrics(IDWriteTextLayout *iface,
517 DWRITE_LINE_METRICS *metrics, UINT32 max_count, UINT32 *actual_count)
519 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
520 FIXME("(%p)->(%p %u %p): stub\n", This, metrics, max_count, actual_count);
524 static HRESULT WINAPI dwritetextlayout_GetMetrics(IDWriteTextLayout *iface, DWRITE_TEXT_METRICS *metrics)
526 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
527 FIXME("(%p)->(%p): stub\n", This, metrics);
531 static HRESULT WINAPI dwritetextlayout_GetOverhangMetrics(IDWriteTextLayout *iface, DWRITE_OVERHANG_METRICS *overhangs)
533 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
534 FIXME("(%p)->(%p): stub\n", This, overhangs);
538 static HRESULT WINAPI dwritetextlayout_GetClusterMetrics(IDWriteTextLayout *iface,
539 DWRITE_CLUSTER_METRICS *metrics, UINT32 max_count, UINT32* act_count)
541 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
542 FIXME("(%p)->(%p %u %p): stub\n", This, metrics, max_count, act_count);
546 static HRESULT WINAPI dwritetextlayout_DetermineMinWidth(IDWriteTextLayout *iface, FLOAT* min_width)
548 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
549 FIXME("(%p)->(%p): stub\n", This, min_width);
553 static HRESULT WINAPI dwritetextlayout_HitTestPoint(IDWriteTextLayout *iface,
554 FLOAT pointX, FLOAT pointY, BOOL* is_trailinghit, BOOL* is_inside, DWRITE_HIT_TEST_METRICS *metrics)
556 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
557 FIXME("(%p)->(%f %f %p %p %p): stub\n", This, pointX, pointY, is_trailinghit, is_inside, metrics);
561 static HRESULT WINAPI dwritetextlayout_HitTestTextPosition(IDWriteTextLayout *iface,
562 UINT32 textPosition, BOOL is_trailinghit, FLOAT* pointX, FLOAT* pointY, DWRITE_HIT_TEST_METRICS *metrics)
564 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
565 FIXME("(%p)->(%u %d %p %p %p): stub\n", This, textPosition, is_trailinghit, pointX, pointY, metrics);
569 static HRESULT WINAPI dwritetextlayout_HitTestTextRange(IDWriteTextLayout *iface,
570 UINT32 textPosition, UINT32 textLength, FLOAT originX, FLOAT originY,
571 DWRITE_HIT_TEST_METRICS *metrics, UINT32 max_metricscount, UINT32* actual_metricscount)
573 struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface);
574 FIXME("(%p)->(%u %u %f %f %p %u %p): stub\n", This, textPosition, textLength, originX, originY, metrics,
575 max_metricscount, actual_metricscount);
579 static const IDWriteTextLayoutVtbl dwritetextlayoutvtbl = {
580 dwritetextlayout_QueryInterface,
581 dwritetextlayout_AddRef,
582 dwritetextlayout_Release,
583 dwritetextlayout_SetTextAlignment,
584 dwritetextlayout_SetParagraphAlignment,
585 dwritetextlayout_SetWordWrapping,
586 dwritetextlayout_SetReadingDirection,
587 dwritetextlayout_SetFlowDirection,
588 dwritetextlayout_SetIncrementalTabStop,
589 dwritetextlayout_SetTrimming,
590 dwritetextlayout_SetLineSpacing,
591 dwritetextlayout_GetTextAlignment,
592 dwritetextlayout_GetParagraphAlignment,
593 dwritetextlayout_GetWordWrapping,
594 dwritetextlayout_GetReadingDirection,
595 dwritetextlayout_GetFlowDirection,
596 dwritetextlayout_GetIncrementalTabStop,
597 dwritetextlayout_GetTrimming,
598 dwritetextlayout_GetLineSpacing,
599 dwritetextlayout_GetFontCollection,
600 dwritetextlayout_GetFontFamilyNameLength,
601 dwritetextlayout_GetFontFamilyName,
602 dwritetextlayout_GetFontWeight,
603 dwritetextlayout_GetFontStyle,
604 dwritetextlayout_GetFontStretch,
605 dwritetextlayout_GetFontSize,
606 dwritetextlayout_GetLocaleNameLength,
607 dwritetextlayout_GetLocaleName,
608 dwritetextlayout_SetMaxWidth,
609 dwritetextlayout_SetMaxHeight,
610 dwritetextlayout_SetFontCollection,
611 dwritetextlayout_SetFontFamilyName,
612 dwritetextlayout_SetFontWeight,
613 dwritetextlayout_SetFontStyle,
614 dwritetextlayout_SetFontStretch,
615 dwritetextlayout_SetFontSize,
616 dwritetextlayout_SetUnderline,
617 dwritetextlayout_SetStrikethrough,
618 dwritetextlayout_SetDrawingEffect,
619 dwritetextlayout_SetInlineObject,
620 dwritetextlayout_SetTypography,
621 dwritetextlayout_SetLocaleName,
622 dwritetextlayout_GetMaxWidth,
623 dwritetextlayout_GetMaxHeight,
624 dwritetextlayout_layout_GetFontCollection,
625 dwritetextlayout_layout_GetFontFamilyNameLength,
626 dwritetextlayout_layout_GetFontFamilyName,
627 dwritetextlayout_layout_GetFontWeight,
628 dwritetextlayout_layout_GetFontStyle,
629 dwritetextlayout_layout_GetFontStretch,
630 dwritetextlayout_layout_GetFontSize,
631 dwritetextlayout_GetUnderline,
632 dwritetextlayout_GetStrikethrough,
633 dwritetextlayout_GetDrawingEffect,
634 dwritetextlayout_GetInlineObject,
635 dwritetextlayout_GetTypography,
636 dwritetextlayout_layout_GetLocaleNameLength,
637 dwritetextlayout_layout_GetLocaleName,
638 dwritetextlayout_Draw,
639 dwritetextlayout_GetLineMetrics,
640 dwritetextlayout_GetMetrics,
641 dwritetextlayout_GetOverhangMetrics,
642 dwritetextlayout_GetClusterMetrics,
643 dwritetextlayout_DetermineMinWidth,
644 dwritetextlayout_HitTestPoint,
645 dwritetextlayout_HitTestTextPosition,
646 dwritetextlayout_HitTestTextRange
649 HRESULT create_textlayout(IDWriteTextLayout **layout)
651 struct dwrite_textlayout *This;
655 This = heap_alloc(sizeof(struct dwrite_textlayout));
656 if (!This) return E_OUTOFMEMORY;
658 This->IDWriteTextLayout_iface.lpVtbl = &dwritetextlayoutvtbl;
661 *layout = &This->IDWriteTextLayout_iface;
666 static HRESULT WINAPI dwritetextformat_QueryInterface(IDWriteTextFormat *iface, REFIID riid, void **obj)
668 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
670 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
672 if (IsEqualIID(riid, &IID_IUnknown) ||
673 IsEqualIID(riid, &IID_IDWriteTextFormat))
676 IDWriteTextFormat_AddRef(iface);
682 return E_NOINTERFACE;
685 static ULONG WINAPI dwritetextformat_AddRef(IDWriteTextFormat *iface)
687 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
688 ULONG ref = InterlockedIncrement(&This->ref);
689 TRACE("(%p)->(%d)\n", This, ref);
693 static ULONG WINAPI dwritetextformat_Release(IDWriteTextFormat *iface)
695 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
696 ULONG ref = InterlockedDecrement(&This->ref);
698 TRACE("(%p)->(%d)\n", This, ref);
702 heap_free(This->family_name);
703 heap_free(This->locale);
710 static HRESULT WINAPI dwritetextformat_SetTextAlignment(IDWriteTextFormat *iface, DWRITE_TEXT_ALIGNMENT alignment)
712 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
713 FIXME("(%p)->(%d): stub\n", This, alignment);
717 static HRESULT WINAPI dwritetextformat_SetParagraphAlignment(IDWriteTextFormat *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment)
719 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
720 FIXME("(%p)->(%d): stub\n", This, alignment);
724 static HRESULT WINAPI dwritetextformat_SetWordWrapping(IDWriteTextFormat *iface, DWRITE_WORD_WRAPPING wrapping)
726 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
727 FIXME("(%p)->(%d): stub\n", This, wrapping);
731 static HRESULT WINAPI dwritetextformat_SetReadingDirection(IDWriteTextFormat *iface, DWRITE_READING_DIRECTION direction)
733 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
734 FIXME("(%p)->(%d): stub\n", This, direction);
738 static HRESULT WINAPI dwritetextformat_SetFlowDirection(IDWriteTextFormat *iface, DWRITE_FLOW_DIRECTION direction)
740 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
741 FIXME("(%p)->(%d): stub\n", This, direction);
745 static HRESULT WINAPI dwritetextformat_SetIncrementalTabStop(IDWriteTextFormat *iface, FLOAT tabstop)
747 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
748 FIXME("(%p)->(%f): stub\n", This, tabstop);
752 static HRESULT WINAPI dwritetextformat_SetTrimming(IDWriteTextFormat *iface, DWRITE_TRIMMING const *trimming,
753 IDWriteInlineObject *trimming_sign)
755 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
756 FIXME("(%p)->(%p %p): stub\n", This, trimming, trimming_sign);
760 static HRESULT WINAPI dwritetextformat_SetLineSpacing(IDWriteTextFormat *iface, DWRITE_LINE_SPACING_METHOD spacing,
761 FLOAT line_spacing, FLOAT baseline)
763 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
764 FIXME("(%p)->(%d %f %f): stub\n", This, spacing, line_spacing, baseline);
768 static DWRITE_TEXT_ALIGNMENT WINAPI dwritetextformat_GetTextAlignment(IDWriteTextFormat *iface)
770 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
771 FIXME("(%p): stub\n", This);
772 return DWRITE_TEXT_ALIGNMENT_LEADING;
775 static DWRITE_PARAGRAPH_ALIGNMENT WINAPI dwritetextformat_GetParagraphAlignment(IDWriteTextFormat *iface)
777 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
778 FIXME("(%p): stub\n", This);
779 return DWRITE_PARAGRAPH_ALIGNMENT_NEAR;
782 static DWRITE_WORD_WRAPPING WINAPI dwritetextformat_GetWordWrapping(IDWriteTextFormat *iface)
784 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
785 FIXME("(%p): stub\n", This);
786 return DWRITE_WORD_WRAPPING_NO_WRAP;
789 static DWRITE_READING_DIRECTION WINAPI dwritetextformat_GetReadingDirection(IDWriteTextFormat *iface)
791 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
792 FIXME("(%p): stub\n", This);
793 return DWRITE_READING_DIRECTION_LEFT_TO_RIGHT;
796 static DWRITE_FLOW_DIRECTION WINAPI dwritetextformat_GetFlowDirection(IDWriteTextFormat *iface)
798 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
799 FIXME("(%p): stub\n", This);
800 return DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM;
803 static FLOAT WINAPI dwritetextformat_GetIncrementalTabStop(IDWriteTextFormat *iface)
805 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
806 FIXME("(%p): stub\n", This);
810 static HRESULT WINAPI dwritetextformat_GetTrimming(IDWriteTextFormat *iface, DWRITE_TRIMMING *options,
811 IDWriteInlineObject **trimming_sign)
813 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
814 FIXME("(%p)->(%p %p): stub\n", This, options, trimming_sign);
818 static HRESULT WINAPI dwritetextformat_GetLineSpacing(IDWriteTextFormat *iface, DWRITE_LINE_SPACING_METHOD *method,
819 FLOAT *spacing, FLOAT *baseline)
821 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
822 FIXME("(%p)->(%p %p %p): stub\n", This, method, spacing, baseline);
826 static HRESULT WINAPI dwritetextformat_GetFontCollection(IDWriteTextFormat *iface, IDWriteFontCollection **collection)
828 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
829 FIXME("(%p)->(%p): stub\n", This, collection);
833 static UINT32 WINAPI dwritetextformat_GetFontFamilyNameLength(IDWriteTextFormat *iface)
835 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
836 FIXME("(%p): stub\n", This);
840 static HRESULT WINAPI dwritetextformat_GetFontFamilyName(IDWriteTextFormat *iface, WCHAR *name, UINT32 size)
842 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
843 FIXME("(%p)->(%p %u): stub\n", This, name, size);
847 static DWRITE_FONT_WEIGHT WINAPI dwritetextformat_GetFontWeight(IDWriteTextFormat *iface)
849 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
850 FIXME("(%p): stub\n", This);
851 return DWRITE_FONT_WEIGHT_NORMAL;
854 static DWRITE_FONT_STYLE WINAPI dwritetextformat_GetFontStyle(IDWriteTextFormat *iface)
856 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
857 FIXME("(%p): stub\n", This);
858 return DWRITE_FONT_STYLE_NORMAL;
861 static DWRITE_FONT_STRETCH WINAPI dwritetextformat_GetFontStretch(IDWriteTextFormat *iface)
863 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
864 FIXME("(%p): stub\n", This);
865 return DWRITE_FONT_STRETCH_NORMAL;
868 static FLOAT WINAPI dwritetextformat_GetFontSize(IDWriteTextFormat *iface)
870 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
871 FIXME("(%p): stub\n", This);
875 static UINT32 WINAPI dwritetextformat_GetLocaleNameLength(IDWriteTextFormat *iface)
877 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
878 FIXME("(%p): stub\n", This);
882 static HRESULT WINAPI dwritetextformat_GetLocaleName(IDWriteTextFormat *iface, WCHAR *name, UINT32 size)
884 struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
885 FIXME("(%p)->(%p %u): stub\n", This, name, size);
889 static const IDWriteTextFormatVtbl dwritetextformatvtbl = {
890 dwritetextformat_QueryInterface,
891 dwritetextformat_AddRef,
892 dwritetextformat_Release,
893 dwritetextformat_SetTextAlignment,
894 dwritetextformat_SetParagraphAlignment,
895 dwritetextformat_SetWordWrapping,
896 dwritetextformat_SetReadingDirection,
897 dwritetextformat_SetFlowDirection,
898 dwritetextformat_SetIncrementalTabStop,
899 dwritetextformat_SetTrimming,
900 dwritetextformat_SetLineSpacing,
901 dwritetextformat_GetTextAlignment,
902 dwritetextformat_GetParagraphAlignment,
903 dwritetextformat_GetWordWrapping,
904 dwritetextformat_GetReadingDirection,
905 dwritetextformat_GetFlowDirection,
906 dwritetextformat_GetIncrementalTabStop,
907 dwritetextformat_GetTrimming,
908 dwritetextformat_GetLineSpacing,
909 dwritetextformat_GetFontCollection,
910 dwritetextformat_GetFontFamilyNameLength,
911 dwritetextformat_GetFontFamilyName,
912 dwritetextformat_GetFontWeight,
913 dwritetextformat_GetFontStyle,
914 dwritetextformat_GetFontStretch,
915 dwritetextformat_GetFontSize,
916 dwritetextformat_GetLocaleNameLength,
917 dwritetextformat_GetLocaleName
920 HRESULT create_textformat(const WCHAR *family_name, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style,
921 DWRITE_FONT_STRETCH stretch, FLOAT size, const WCHAR *locale, IDWriteTextFormat **format)
923 struct dwrite_textformat *This;
925 This = heap_alloc(sizeof(struct dwrite_textformat));
926 if (!This) return E_OUTOFMEMORY;
928 This->IDWriteTextFormat_iface.lpVtbl = &dwritetextformatvtbl;
930 This->family_name = heap_strdupW(family_name);
931 This->locale = heap_strdupW(locale);
932 This->weight = weight;
936 *format = &This->IDWriteTextFormat_iface;