@@ -5161,7 +5161,7 @@ GpStatus WINGDIPAPI GdipIsVisibleRectI(GpGraphics *graphics, INT x, INT y, INT w
5161
5161
return GdipIsVisibleRect (graphics , (REAL )x , (REAL )y , (REAL )width , (REAL )height , result );
5162
5162
}
5163
5163
5164
- GpStatus gdip_format_string (HDC hdc ,
5164
+ GpStatus gdip_format_string (GpGraphics * graphics ,
5165
5165
GDIPCONST WCHAR * string , INT length , GDIPCONST GpFont * font ,
5166
5166
GDIPCONST RectF * rect , GDIPCONST GpStringFormat * format , int ignore_empty_clip ,
5167
5167
gdip_format_string_callback callback , void * user_data )
@@ -5243,7 +5243,7 @@ GpStatus gdip_format_string(HDC hdc,
5243
5243
halign = format -> align ;
5244
5244
5245
5245
while (sum < length ){
5246
- GetTextExtentExPointW (hdc , stringdup + sum , length - sum ,
5246
+ GetTextExtentExPointW (graphics -> hdc , stringdup + sum , length - sum ,
5247
5247
nwidth , & fit , NULL , & size );
5248
5248
fitcpy = fit ;
5249
5249
@@ -5292,7 +5292,7 @@ GpStatus gdip_format_string(HDC hdc,
5292
5292
else
5293
5293
lineend = fit ;
5294
5294
5295
- GetTextExtentExPointW (hdc , stringdup + sum , lineend ,
5295
+ GetTextExtentExPointW (graphics -> hdc , stringdup + sum , lineend ,
5296
5296
nwidth , & j , NULL , & size );
5297
5297
5298
5298
bounds .Width = size .cx ;
@@ -5326,7 +5326,7 @@ GpStatus gdip_format_string(HDC hdc,
5326
5326
if (hotkeyprefix_offsets [hotkeyprefix_end_pos ] >= sum + lineend )
5327
5327
break ;
5328
5328
5329
- stat = callback (hdc , stringdup , sum , lineend ,
5329
+ stat = callback (graphics , stringdup , sum , lineend ,
5330
5330
font , rect , format , lineno , & bounds ,
5331
5331
& hotkeyprefix_offsets [hotkeyprefix_pos ],
5332
5332
hotkeyprefix_end_pos - hotkeyprefix_pos , user_data );
@@ -5392,7 +5392,7 @@ struct measure_ranges_args {
5392
5392
REAL rel_width , rel_height ;
5393
5393
};
5394
5394
5395
- static GpStatus measure_ranges_callback (HDC hdc ,
5395
+ static GpStatus measure_ranges_callback (GpGraphics * graphics ,
5396
5396
GDIPCONST WCHAR * string , INT index , INT length , GDIPCONST GpFont * font ,
5397
5397
GDIPCONST RectF * rect , GDIPCONST GpStringFormat * format ,
5398
5398
INT lineno , const RectF * bounds , INT * underlined_indexes ,
@@ -5414,11 +5414,11 @@ static GpStatus measure_ranges_callback(HDC hdc,
5414
5414
range_rect .Y = bounds -> Y / args -> rel_height ;
5415
5415
range_rect .Height = bounds -> Height / args -> rel_height ;
5416
5416
5417
- GetTextExtentExPointW (hdc , string + index , range_start - index ,
5417
+ GetTextExtentExPointW (graphics -> hdc , string + index , range_start - index ,
5418
5418
INT_MAX , NULL , NULL , & range_size );
5419
5419
range_rect .X = (bounds -> X + range_size .cx ) / args -> rel_width ;
5420
5420
5421
- GetTextExtentExPointW (hdc , string + index , range_end - index ,
5421
+ GetTextExtentExPointW (graphics -> hdc , string + index , range_end - index ,
5422
5422
INT_MAX , NULL , NULL , & range_size );
5423
5423
range_rect .Width = (bounds -> X + range_size .cx ) / args -> rel_width - range_rect .X ;
5424
5424
@@ -5496,7 +5496,7 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
5496
5496
5497
5497
gdi_transform_acquire (graphics );
5498
5498
5499
- stat = gdip_format_string (hdc , string , length , font , & scaled_rect , stringFormat ,
5499
+ stat = gdip_format_string (graphics , string , length , font , & scaled_rect , stringFormat ,
5500
5500
(stringFormat -> attr & StringFormatFlagsNoClip ) != 0 , measure_ranges_callback , & args );
5501
5501
5502
5502
gdi_transform_release (graphics );
@@ -5517,7 +5517,7 @@ struct measure_string_args {
5517
5517
REAL rel_width , rel_height ;
5518
5518
};
5519
5519
5520
- static GpStatus measure_string_callback (HDC hdc ,
5520
+ static GpStatus measure_string_callback (GpGraphics * graphics ,
5521
5521
GDIPCONST WCHAR * string , INT index , INT length , GDIPCONST GpFont * font ,
5522
5522
GDIPCONST RectF * rect , GDIPCONST GpStringFormat * format ,
5523
5523
INT lineno , const RectF * bounds , INT * underlined_indexes ,
@@ -5619,7 +5619,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
5619
5619
5620
5620
gdi_transform_acquire (graphics );
5621
5621
5622
- gdip_format_string (hdc , string , length , font , & scaled_rect , format , TRUE,
5622
+ gdip_format_string (graphics , string , length , font , & scaled_rect , format , TRUE,
5623
5623
measure_string_callback , & args );
5624
5624
5625
5625
gdi_transform_release (graphics );
@@ -5640,12 +5640,11 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
5640
5640
}
5641
5641
5642
5642
struct draw_string_args {
5643
- GpGraphics * graphics ;
5644
5643
GDIPCONST GpBrush * brush ;
5645
5644
REAL x , y , rel_width , rel_height , ascent ;
5646
5645
};
5647
5646
5648
- static GpStatus draw_string_callback (HDC hdc ,
5647
+ static GpStatus draw_string_callback (GpGraphics * graphics ,
5649
5648
GDIPCONST WCHAR * string , INT index , INT length , GDIPCONST GpFont * font ,
5650
5649
GDIPCONST RectF * rect , GDIPCONST GpStringFormat * format ,
5651
5650
INT lineno , const RectF * bounds , INT * underlined_indexes ,
@@ -5658,7 +5657,7 @@ static GpStatus draw_string_callback(HDC hdc,
5658
5657
position .X = args -> x + bounds -> X / args -> rel_width ;
5659
5658
position .Y = args -> y + bounds -> Y / args -> rel_height + args -> ascent ;
5660
5659
5661
- stat = draw_driver_string (args -> graphics , & string [index ], length , font , format ,
5660
+ stat = draw_driver_string (graphics , & string [index ], length , font , format ,
5662
5661
args -> brush , & position ,
5663
5662
DriverStringOptionsCmapLookup |DriverStringOptionsRealizedAdvance , NULL );
5664
5663
@@ -5668,7 +5667,7 @@ static GpStatus draw_string_callback(HDC hdc,
5668
5667
REAL underline_y , underline_height ;
5669
5668
int i ;
5670
5669
5671
- GetOutlineTextMetricsW (hdc , sizeof (otm ), & otm );
5670
+ GetOutlineTextMetricsW (graphics -> hdc , sizeof (otm ), & otm );
5672
5671
5673
5672
underline_height = otm .otmsUnderscoreSize / args -> rel_height ;
5674
5673
underline_y = position .Y - otm .otmsUnderscorePosition / args -> rel_height - underline_height / 2 ;
@@ -5679,13 +5678,13 @@ static GpStatus draw_string_callback(HDC hdc,
5679
5678
SIZE text_size ;
5680
5679
INT ofs = underlined_indexes [i ] - index ;
5681
5680
5682
- GetTextExtentExPointW (hdc , string + index , ofs , INT_MAX , NULL , NULL , & text_size );
5681
+ GetTextExtentExPointW (graphics -> hdc , string + index , ofs , INT_MAX , NULL , NULL , & text_size );
5683
5682
start_x = text_size .cx / args -> rel_width ;
5684
5683
5685
- GetTextExtentExPointW (hdc , string + index , ofs + 1 , INT_MAX , NULL , NULL , & text_size );
5684
+ GetTextExtentExPointW (graphics -> hdc , string + index , ofs + 1 , INT_MAX , NULL , NULL , & text_size );
5686
5685
end_x = text_size .cx / args -> rel_width ;
5687
5686
5688
- GdipFillRectangle (args -> graphics , (GpBrush * )args -> brush , position .X + start_x , underline_y , end_x - start_x , underline_height );
5687
+ GdipFillRectangle (graphics , (GpBrush * )args -> brush , position .X + start_x , underline_y , end_x - start_x , underline_height );
5689
5688
}
5690
5689
}
5691
5690
@@ -5783,7 +5782,6 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
5783
5782
get_font_hfont (graphics , font , format , & gdifont , NULL , NULL );
5784
5783
SelectObject (hdc , gdifont );
5785
5784
5786
- args .graphics = graphics ;
5787
5785
args .brush = brush ;
5788
5786
5789
5787
args .x = rect -> X ;
@@ -5797,7 +5795,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
5797
5795
GetTextMetricsW (hdc , & textmetric );
5798
5796
args .ascent = textmetric .tmAscent / rel_height ;
5799
5797
5800
- gdip_format_string (hdc , string , length , font , & scaled_rect , format , TRUE,
5798
+ gdip_format_string (graphics , string , length , font , & scaled_rect , format , TRUE,
5801
5799
draw_string_callback , & args );
5802
5800
5803
5801
gdi_transform_release (graphics );
0 commit comments