comparison src/gui_dwrite.cpp @ 29105:faf7fcd1c8d5 v8.2.5073

patch 8.2.5073: clang on MS-Windows produces warnings Commit: https://github.com/vim/vim/commit/35d7a2fb13fc833aa1b654ca6fd6e429e72e6b49 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 9 20:53:54 2022 +0100 patch 8.2.5073: clang on MS-Windows produces warnings Problem: Clang on MS-Windows produces warnings. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/10546)
author Bram Moolenaar <Bram@vim.org>
date Thu, 09 Jun 2022 22:00:07 +0200
parents a077948be0f4
children
comparison
equal deleted inserted replaced
29104:c58baa6d6dda 29105:faf7fcd1c8d5
48 48
49 #ifdef __MINGW32__ 49 #ifdef __MINGW32__
50 # define __maybenull SAL__maybenull 50 # define __maybenull SAL__maybenull
51 # define __in SAL__in 51 # define __in SAL__in
52 # define __out SAL__out 52 # define __out SAL__out
53 #endif
54
55 #ifdef __MINGW32__
56 # define UNUSED __attribute__((unused))
57 #else
58 # define UNUSED
53 #endif 59 #endif
54 60
55 #if (defined(_MSC_VER) && (_MSC_VER >= 1700)) || (__cplusplus >= 201103L) 61 #if (defined(_MSC_VER) && (_MSC_VER >= 1700)) || (__cplusplus >= 201103L)
56 # define FINAL final 62 # define FINAL final
57 #else 63 #else
417 virtual ~TextRenderer() 423 virtual ~TextRenderer()
418 { 424 {
419 } 425 }
420 426
421 IFACEMETHOD(IsPixelSnappingDisabled)( 427 IFACEMETHOD(IsPixelSnappingDisabled)(
422 __maybenull void* clientDrawingContext, 428 __maybenull void* clientDrawingContext UNUSED,
423 __out BOOL* isDisabled) 429 __out BOOL* isDisabled)
424 { 430 {
425 *isDisabled = FALSE; 431 *isDisabled = FALSE;
426 return S_OK; 432 return S_OK;
427 } 433 }
428 434
429 IFACEMETHOD(GetCurrentTransform)( 435 IFACEMETHOD(GetCurrentTransform)(
430 __maybenull void* clientDrawingContext, 436 __maybenull void* clientDrawingContext UNUSED,
431 __out DWRITE_MATRIX* transform) 437 __out DWRITE_MATRIX* transform)
432 { 438 {
433 // forward the render target's transform 439 // forward the render target's transform
434 pDWC_->mRT->GetTransform( 440 pDWC_->mRT->GetTransform(
435 reinterpret_cast<D2D1_MATRIX_3X2_F*>(transform)); 441 reinterpret_cast<D2D1_MATRIX_3X2_F*>(transform));
436 return S_OK; 442 return S_OK;
437 } 443 }
438 444
439 IFACEMETHOD(GetPixelsPerDip)( 445 IFACEMETHOD(GetPixelsPerDip)(
440 __maybenull void* clientDrawingContext, 446 __maybenull void* clientDrawingContext UNUSED,
441 __out FLOAT* pixelsPerDip) 447 __out FLOAT* pixelsPerDip)
442 { 448 {
443 float dpiX, unused; 449 float dpiX, unused;
444 pDWC_->mRT->GetDpi(&dpiX, &unused); 450 pDWC_->mRT->GetDpi(&dpiX, &unused);
445 *pixelsPerDip = dpiX / 96.0f; 451 *pixelsPerDip = dpiX / 96.0f;
446 return S_OK; 452 return S_OK;
447 } 453 }
448 454
449 IFACEMETHOD(DrawUnderline)( 455 IFACEMETHOD(DrawUnderline)(
450 __maybenull void* clientDrawingContext, 456 __maybenull void* clientDrawingContext UNUSED,
451 FLOAT baselineOriginX, 457 FLOAT baselineOriginX UNUSED,
452 FLOAT baselineOriginY, 458 FLOAT baselineOriginY UNUSED,
453 __in DWRITE_UNDERLINE const* underline, 459 __in DWRITE_UNDERLINE const* underline UNUSED,
454 IUnknown* clientDrawingEffect) 460 IUnknown* clientDrawingEffect UNUSED)
455 { 461 {
456 return E_NOTIMPL; 462 return E_NOTIMPL;
457 } 463 }
458 464
459 IFACEMETHOD(DrawStrikethrough)( 465 IFACEMETHOD(DrawStrikethrough)(
460 __maybenull void* clientDrawingContext, 466 __maybenull void* clientDrawingContext UNUSED,
461 FLOAT baselineOriginX, 467 FLOAT baselineOriginX UNUSED,
462 FLOAT baselineOriginY, 468 FLOAT baselineOriginY UNUSED,
463 __in DWRITE_STRIKETHROUGH const* strikethrough, 469 __in DWRITE_STRIKETHROUGH const* strikethrough UNUSED,
464 IUnknown* clientDrawingEffect) 470 IUnknown* clientDrawingEffect UNUSED)
465 { 471 {
466 return E_NOTIMPL; 472 return E_NOTIMPL;
467 } 473 }
468 474
469 IFACEMETHOD(DrawInlineObject)( 475 IFACEMETHOD(DrawInlineObject)(
470 __maybenull void* clientDrawingContext, 476 __maybenull void* clientDrawingContext UNUSED,
471 FLOAT originX, 477 FLOAT originX UNUSED,
472 FLOAT originY, 478 FLOAT originY UNUSED,
473 IDWriteInlineObject* inlineObject, 479 IDWriteInlineObject* inlineObject UNUSED,
474 BOOL isSideways, 480 BOOL isSideways UNUSED,
475 BOOL isRightToLeft, 481 BOOL isRightToLeft UNUSED,
476 IUnknown* clientDrawingEffect) 482 IUnknown* clientDrawingEffect UNUSED)
477 { 483 {
478 return E_NOTIMPL; 484 return E_NOTIMPL;
479 } 485 }
480 486
481 IFACEMETHOD(DrawGlyphRun)( 487 IFACEMETHOD(DrawGlyphRun)(
482 __maybenull void* clientDrawingContext, 488 __maybenull void* clientDrawingContext,
483 FLOAT baselineOriginX, 489 FLOAT baselineOriginX,
484 FLOAT baselineOriginY, 490 FLOAT baselineOriginY,
485 DWRITE_MEASURING_MODE measuringMode, 491 DWRITE_MEASURING_MODE measuringMode UNUSED,
486 __in DWRITE_GLYPH_RUN const* glyphRun, 492 __in DWRITE_GLYPH_RUN const* glyphRun,
487 __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription, 493 __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription UNUSED,
488 IUnknown* clientDrawingEffect) 494 IUnknown* clientDrawingEffect UNUSED)
489 { 495 {
490 TextRendererContext *context = 496 TextRendererContext *context =
491 reinterpret_cast<TextRendererContext*>(clientDrawingContext); 497 reinterpret_cast<TextRendererContext*>(clientDrawingContext);
492 498
493 AdjustedGlyphRun adjustedGlyphRun(glyphRun, context->cellWidth, 499 AdjustedGlyphRun adjustedGlyphRun(glyphRun, context->cellWidth,