ReactOS 0.4.17-dev-923-g4c9a150
factory.c
Go to the documentation of this file.
1/*
2 * Copyright 2014 Henri Verbeet for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#define D2D1_INIT_GUID
20#include "d2d1_private.h"
21
22#include "xmllite.h"
23#include "wine/list.h"
24
27
29{
30 ~0u, /* No ID2D1Factory version limit by default. */
31};
32
34{
35 ID2D1Properties_Release(&reg->properties->ID2D1Properties_iface);
36 free(reg);
37}
38
40{
42}
43
45{
47}
48
50{
52
53 return TRUE;
54}
55
57{
59}
60
62{
63 list_add_tail(&factory->effects, &effect->entry);
64}
65
67 const GUID *id)
68{
71
73
75 {
76 if (IsEqualGUID(id, &reg->id)) return reg;
77 }
78
79 return NULL;
80}
81
83{
84 HDC hdc;
85
86 if (!(hdc = GetDC(NULL)))
87 {
88 factory->dpi_x = factory->dpi_y = 96.0f;
89 return E_FAIL;
90 }
91
94
96
97 return S_OK;
98}
99
101{
103
104 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
105
106 if ((IsEqualGUID(iid, &IID_ID2D1Factory7) && d2d_settings.max_version_factory >= 7)
107 || (IsEqualGUID(iid, &IID_ID2D1Factory6) && d2d_settings.max_version_factory >= 6)
108 || (IsEqualGUID(iid, &IID_ID2D1Factory5) && d2d_settings.max_version_factory >= 5)
109 || (IsEqualGUID(iid, &IID_ID2D1Factory4) && d2d_settings.max_version_factory >= 4)
110 || (IsEqualGUID(iid, &IID_ID2D1Factory3) && d2d_settings.max_version_factory >= 3)
111 || (IsEqualGUID(iid, &IID_ID2D1Factory2) && d2d_settings.max_version_factory >= 2)
112 || (IsEqualGUID(iid, &IID_ID2D1Factory1) && d2d_settings.max_version_factory >= 1)
113 || IsEqualGUID(iid, &IID_ID2D1Factory)
114 || IsEqualGUID(iid, &IID_IUnknown))
115 {
116 ID2D1Factory7_AddRef(iface);
117 *out = iface;
118 return S_OK;
119 }
120 else if (IsEqualGUID(iid, &IID_ID2D1Multithread))
121 {
122 ID2D1Factory7_AddRef(iface);
123 *out = &factory->ID2D1Multithread_iface;
124 return S_OK;
125 }
126
127 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
128
129 *out = NULL;
130 return E_NOINTERFACE;
131}
132
134{
137
138 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
139
140 return refcount;
141}
142
144{
147 struct d2d_effect_registration *reg, *reg2;
148
149 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
150
151 if (!refcount)
152 {
153 if (factory->device)
154 ID3D10Device1_Release(factory->device);
156 {
158 }
160 free(factory);
161 }
162
163 return refcount;
164}
165
167{
169
170 TRACE("iface %p.\n", iface);
171
173}
174
176{
178
179 TRACE("iface %p, dpi_x %p, dpi_y %p.\n", iface, dpi_x, dpi_y);
180
181 *dpi_x = factory->dpi_x;
182 *dpi_y = factory->dpi_y;
183}
184
186 const D2D1_RECT_F *rect, ID2D1RectangleGeometry **geometry)
187{
188 struct d2d_geometry *object;
189 HRESULT hr;
190
191 TRACE("iface %p, rect %s, geometry %p.\n", iface, debug_d2d_rect_f(rect), geometry);
192
193 if (!(object = calloc(1, sizeof(*object))))
194 return E_OUTOFMEMORY;
195
196 if (FAILED(hr = d2d_rectangle_geometry_init(object, (ID2D1Factory *)iface, rect)))
197 {
198 WARN("Failed to initialise rectangle geometry, hr %#lx.\n", hr);
199 free(object);
200 return hr;
201 }
202
203 TRACE("Created rectangle geometry %p.\n", object);
204 *geometry = (ID2D1RectangleGeometry *)&object->ID2D1Geometry_iface;
205
206 return S_OK;
207}
208
211{
212 struct d2d_geometry *object;
213 HRESULT hr;
214
215 TRACE("iface %p, rounded_rect %s, geometry %p.\n", iface, debug_d2d_rounded_rect(rounded_rect), geometry);
216
217 if (!(object = calloc(1, sizeof(*object))))
218 return E_OUTOFMEMORY;
219
221 {
222 WARN("Failed to initialise rounded rectangle geometry, hr %#lx.\n", hr);
223 free(object);
224 return hr;
225 }
226
227 TRACE("Created rounded rectangle geometry %p.\n", object);
228 *geometry = (ID2D1RoundedRectangleGeometry *)&object->ID2D1Geometry_iface;
229
230 return S_OK;
231}
232
234 const D2D1_ELLIPSE *ellipse, ID2D1EllipseGeometry **geometry)
235{
236 struct d2d_geometry *object;
237 HRESULT hr;
238
239 TRACE("iface %p, ellipse %s, geometry %p.\n", iface, debug_d2d_ellipse(ellipse), geometry);
240
241 if (!(object = calloc(1, sizeof(*object))))
242 return E_OUTOFMEMORY;
243
244 if (FAILED(hr = d2d_ellipse_geometry_init(object, (ID2D1Factory *)iface, ellipse)))
245 {
246 WARN("Failed to initialise ellipse geometry, hr %#lx.\n", hr);
247 free(object);
248 return hr;
249 }
250
251 TRACE("Created ellipse geometry %p.\n", object);
252 *geometry = (ID2D1EllipseGeometry *)&object->ID2D1Geometry_iface;
253
254 return S_OK;
255}
256
259{
260 struct d2d_geometry *object;
261 HRESULT hr;
262
263 TRACE("iface %p, fill_mode %#x, geometries %p, geometry_count %u, group %p.\n",
264 iface, fill_mode, geometries, geometry_count, group);
265
266 if (!(object = calloc(1, sizeof(*object))))
267 return E_OUTOFMEMORY;
268
269 if (FAILED(hr = d2d_geometry_group_init(object, (ID2D1Factory *)iface, fill_mode, geometries, geometry_count)))
270 {
271 WARN("Failed to initialise geometry group, hr %#lx.\n", hr);
272 free(object);
273 return hr;
274 }
275
276 TRACE("Created geometry group %p.\n", object);
277 *group = (ID2D1GeometryGroup *)&object->ID2D1Geometry_iface;
278
279 return S_OK;
280}
281
284 ID2D1TransformedGeometry **transformed_geometry)
285{
286 struct d2d_geometry *object;
287
288 TRACE("iface %p, src_geometry %p, transform %p, transformed_geometry %p.\n",
289 iface, src_geometry, transform, transformed_geometry);
290
291 if (!(object = calloc(1, sizeof(*object))))
292 return E_OUTOFMEMORY;
293
295
296 TRACE("Created transformed geometry %p.\n", object);
297 *transformed_geometry = (ID2D1TransformedGeometry *)&object->ID2D1Geometry_iface;
298
299 return S_OK;
300}
301
303 ID2D1PathGeometry **geometry)
304{
305 struct d2d_geometry *object;
306
307 TRACE("iface %p, geometry %p.\n", iface, geometry);
308
309 if (!(object = calloc(1, sizeof(*object))))
310 return E_OUTOFMEMORY;
311
312 d2d_path_geometry_init(object, (ID2D1Factory *)iface);
313
314 TRACE("Created path geometry %p.\n", object);
315 *geometry = (ID2D1PathGeometry *)&object->ID2D1Geometry_iface;
316
317 return S_OK;
318}
319
321 const D2D1_STROKE_STYLE_PROPERTIES *desc, const float *dashes, UINT32 dash_count,
322 ID2D1StrokeStyle **stroke_style)
323{
324 struct d2d_stroke_style *object;
326 HRESULT hr;
327
328 TRACE("iface %p, desc %p, dashes %p, dash_count %u, stroke_style %p.\n",
329 iface, desc, dashes, dash_count, stroke_style);
330
331 if (!(object = calloc(1, sizeof(*object))))
332 return E_OUTOFMEMORY;
333
334 desc1.startCap = desc->startCap;
335 desc1.endCap = desc->endCap;
336 desc1.dashCap = desc->dashCap;
337 desc1.lineJoin = desc->lineJoin;
338 desc1.miterLimit = desc->miterLimit;
339 desc1.dashStyle = desc->dashStyle;
340 desc1.dashOffset = desc->dashOffset;
342
343 if (FAILED(hr = d2d_stroke_style_init(object, (ID2D1Factory *)iface, &desc1, dashes, dash_count)))
344 {
345 WARN("Failed to initialise stroke style, hr %#lx.\n", hr);
346 free(object);
347 return hr;
348 }
349
350 TRACE("Created stroke style %p.\n", object);
351 *stroke_style = (ID2D1StrokeStyle *)&object->ID2D1StrokeStyle1_iface;
352
353 return S_OK;
354}
355
357 const D2D1_DRAWING_STATE_DESCRIPTION *desc, IDWriteRenderingParams *text_rendering_params,
358 ID2D1DrawingStateBlock **state_block)
359{
361 struct d2d_state_block *object;
362
363 TRACE("iface %p, desc %p, text_rendering_params %p, state_block %p.\n",
364 iface, desc, text_rendering_params, state_block);
365
366 if (!(object = calloc(1, sizeof(*object))))
367 return E_OUTOFMEMORY;
368
369 if (desc)
370 {
371 memcpy(&state_desc, desc, sizeof(*desc));
373 state_desc.unitMode = D2D1_UNIT_MODE_DIPS;
374 }
375
376 d2d_state_block_init(object, (ID2D1Factory *)iface, desc ? &state_desc : NULL, text_rendering_params);
377
378 TRACE("Created state block %p.\n", object);
379 *state_block = (ID2D1DrawingStateBlock *)&object->ID2D1DrawingStateBlock1_iface;
380
381 return S_OK;
382}
383
385{
386 HRESULT hr = S_OK;
387
390 WARN("Failed to create device, hr %#lx.\n", hr);
391
392 *device = factory->device;
393 return hr;
394}
395
398{
402 HRESULT hr;
403
404 TRACE("iface %p, target %p, desc %p, render_target %p.\n", iface, target, desc, render_target);
405
406 if (!(object = calloc(1, sizeof(*object))))
407 return E_OUTOFMEMORY;
408
410 {
411 free(object);
412 return hr;
413 }
414
416 {
417 WARN("Failed to initialise render target, hr %#lx.\n", hr);
418 free(object);
419 return hr;
420 }
421
422 TRACE("Created render target %p.\n", object);
423 *render_target = object->dxgi_target;
424
425 return S_OK;
426}
427
430 ID2D1HwndRenderTarget **render_target)
431{
435 HRESULT hr;
436
437 TRACE("iface %p, desc %p, hwnd_rt_desc %p, render_target %p.\n", iface, desc, hwnd_rt_desc, render_target);
438
440 return hr;
441
442 if (!(object = calloc(1, sizeof(*object))))
443 return E_OUTOFMEMORY;
444
445 if (FAILED(hr = d2d_hwnd_render_target_init(object, (ID2D1Factory1 *)iface, device, desc, hwnd_rt_desc)))
446 {
447 WARN("Failed to initialise render target, hr %#lx.\n", hr);
448 free(object);
449 return hr;
450 }
451
452 TRACE("Created render target %p.\n", object);
453 *render_target = &object->ID2D1HwndRenderTarget_iface;
454
455 return S_OK;
456}
457
459 IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1RenderTarget **render_target)
460{
461 IDXGIDevice *dxgi_device;
463 HRESULT hr;
464
465 TRACE("iface %p, surface %p, desc %p, render_target %p.\n", iface, surface, desc, render_target);
466
467 if (FAILED(hr = IDXGISurface_GetDevice(surface, &IID_IDXGIDevice, (void **)&dxgi_device)))
468 {
469 WARN("Failed to get DXGI device, hr %#lx.\n", hr);
470 return hr;
471 }
472
473 hr = ID2D1Factory1_CreateDevice((ID2D1Factory1 *)iface, dxgi_device, &device);
474 IDXGIDevice_Release(dxgi_device);
475 if (FAILED(hr))
476 {
477 WARN("Failed to create D2D device, hr %#lx.\n", hr);
478 return hr;
479 }
480
482 NULL, NULL, desc, (void **)render_target);
483 ID2D1Device_Release(device);
484 return hr;
485}
486
489{
493 HRESULT hr;
494
495 TRACE("iface %p, desc %p, render_target %p.\n", iface, desc, render_target);
496
498 return hr;
499
500 if (!(object = calloc(1, sizeof(*object))))
501 return E_OUTOFMEMORY;
502
503 if (FAILED(hr = d2d_dc_render_target_init(object, (ID2D1Factory1 *)iface, device, desc)))
504 {
505 WARN("Failed to initialise render target, hr %#lx.\n", hr);
506 free(object);
507 return hr;
508 }
509
510 TRACE("Created render target %p.\n", object);
511 *render_target = &object->ID2D1DCRenderTarget_iface;
512
513 return S_OK;
514}
515
517 bool allow_get_dxgi_device, REFIID iid, void **device)
518{
519 struct d2d_device *object;
520 HRESULT hr;
521
522 if (!(object = calloc(1, sizeof(*object))))
523 return E_OUTOFMEMORY;
524
526
527 TRACE("Create device %p.\n", object);
528
529 hr = ID2D1Device6_QueryInterface(&object->ID2D1Device6_iface, iid, device);
530 ID2D1Device6_Release(&object->ID2D1Device6_iface);
531
532 return hr;
533}
534
536 IDXGIDevice *dxgi_device, ID2D1Device **device)
537{
538 TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
539
540 return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device, (void **)device);
541}
542
544 const D2D1_STROKE_STYLE_PROPERTIES1 *desc, const float *dashes, UINT32 dash_count,
545 ID2D1StrokeStyle1 **stroke_style)
546{
547 struct d2d_stroke_style *object;
548 HRESULT hr;
549
550 TRACE("iface %p, desc %p, dashes %p, dash_count %u, stroke_style %p.\n",
551 iface, desc, dashes, dash_count, stroke_style);
552
553 if (!(object = calloc(1, sizeof(*object))))
554 return E_OUTOFMEMORY;
555
556 if (FAILED(hr = d2d_stroke_style_init(object, (ID2D1Factory *)iface,
558 {
559 WARN("Failed to initialise stroke style, hr %#lx.\n", hr);
560 free(object);
561 return hr;
562 }
563
564 TRACE("Created stroke style %p.\n", object);
565 *stroke_style = &object->ID2D1StrokeStyle1_iface;
566
567 return S_OK;
568}
569
571 ID2D1PathGeometry1 **geometry)
572{
573 struct d2d_geometry *object;
574
575 TRACE("iface %p, geometry %p.\n", iface, geometry);
576
577 if (!(object = calloc(1, sizeof(*object))))
578 return E_OUTOFMEMORY;
579
580 d2d_path_geometry_init(object, (ID2D1Factory *)iface);
581
582 TRACE("Created path geometry %p.\n", object);
583 *geometry = (ID2D1PathGeometry1 *)&object->ID2D1Geometry_iface;
584
585 return S_OK;
586}
587
589 const D2D1_DRAWING_STATE_DESCRIPTION1 *desc, IDWriteRenderingParams *text_rendering_params,
590 ID2D1DrawingStateBlock1 **state_block)
591{
592 struct d2d_state_block *object;
593
594 TRACE("iface %p, desc %p, text_rendering_params %p, state_block %p.\n",
595 iface, desc, text_rendering_params, state_block);
596
597 if (!(object = calloc(1, sizeof(*object))))
598 return E_OUTOFMEMORY;
599
601
602 TRACE("Created state block %p.\n", object);
603 *state_block = &object->ID2D1DrawingStateBlock1_iface;
604
605 return S_OK;
606}
607
610{
611 FIXME("iface %p, stream %p, metafile %p stub!\n", iface, stream, metafile);
612
613 return E_NOTIMPL;
614}
615
617 const WCHAR *expected_name, unsigned int *depth)
618{
619 const WCHAR *node_name;
620 XmlNodeType node_type;
621 HRESULT hr;
622
623 assert(expected_type != XmlNodeType_Whitespace);
624
625 while ((hr = IXmlReader_Read(reader, &node_type)) == S_OK)
626 {
627 if (node_type == XmlNodeType_Whitespace)
628 continue;
629
630 if (expected_type != XmlNodeType_None && node_type != expected_type)
632
633 if (expected_name)
634 {
635 if (FAILED(hr = IXmlReader_GetLocalName(reader, &node_name, NULL)))
636 return hr;
637
638 if (wcscmp(node_name, expected_name))
640 }
641
642 if (depth)
643 IXmlReader_GetDepth(reader, depth);
644 return S_OK;
645 }
646
647 return hr;
648}
649
650static HRESULT parse_effect_skip_element(IXmlReader *reader, unsigned int element_depth)
651{
652 XmlNodeType node_type;
653 unsigned int depth;
654 HRESULT hr;
655
656 if (IXmlReader_IsEmptyElement(reader)) return S_OK;
657
658 while ((hr = IXmlReader_Read(reader, &node_type)) == S_OK)
659 {
660 IXmlReader_GetDepth(reader, &depth);
661 if (node_type == XmlNodeType_EndElement && depth == element_depth + 1)
662 {
663 return S_OK;
664 }
665 }
666
667 return hr;
668}
669
671{
672 const WCHAR *value;
673
674 *ret = NULL;
675
676 if (IXmlReader_MoveToAttributeByName(reader, name, NULL) != S_OK)
677 return E_INVALIDARG;
678 if (IXmlReader_GetValue(reader, &value, NULL) != S_OK)
679 return E_INVALIDARG;
680 if (!(*ret = wcsdup(value)))
681 return E_OUTOFMEMORY;
682
683 return S_OK;
684}
685
687{
688 static const WCHAR *types[] =
689 {
691 [D2D1_PROPERTY_TYPE_STRING] = L"string",
692 [D2D1_PROPERTY_TYPE_BOOL] = L"bool",
693 [D2D1_PROPERTY_TYPE_UINT32] = L"uint32",
694 [D2D1_PROPERTY_TYPE_INT32] = L"int32",
695 [D2D1_PROPERTY_TYPE_FLOAT] = L"float",
696 [D2D1_PROPERTY_TYPE_VECTOR2] = L"vector2",
697 [D2D1_PROPERTY_TYPE_VECTOR3] = L"vector3",
698 [D2D1_PROPERTY_TYPE_VECTOR4] = L"vector4",
699 [D2D1_PROPERTY_TYPE_BLOB] = L"blob",
700 [D2D1_PROPERTY_TYPE_IUNKNOWN] = L"iunknown",
701 [D2D1_PROPERTY_TYPE_ENUM] = L"enum",
702 [D2D1_PROPERTY_TYPE_ARRAY] = L"array",
703 [D2D1_PROPERTY_TYPE_CLSID] = L"clsid",
704 [D2D1_PROPERTY_TYPE_MATRIX_3X2] = L"matrix3x2",
705 [D2D1_PROPERTY_TYPE_MATRIX_4X3] = L"matrix4x3",
706 [D2D1_PROPERTY_TYPE_MATRIX_4X4] = L"matrix4x4",
707 [D2D1_PROPERTY_TYPE_MATRIX_5X4] = L"matrix5x4",
708 [D2D1_PROPERTY_TYPE_COLOR_CONTEXT] = L"colorcontext",
709 };
710 unsigned int i;
711 WCHAR *value;
712 HRESULT hr;
713
714 if (FAILED(hr = parse_effect_get_attribute(reader, L"type", &value))) return hr;
715
717
718 for (i = 0; i < ARRAY_SIZE(types); ++i)
719 {
720 if (!wcscmp(value, types[i]))
721 {
722 *type = i;
723 break;
724 }
725 }
726
727 free(value);
728
730}
731
733 const WCHAR *name)
734{
735 unsigned int i;
736
737 for (i = 0; i < effect->properties->count; ++i)
738 {
739 if (!wcscmp(name, effect->properties->properties[i].name))
740 return &effect->properties->properties[i];
741 }
742
743 return NULL;
744}
745
747 const WCHAR *name)
748{
749 if (!wcscmp(name, L"DisplayName")) return D2D1_PROPERTY_DISPLAYNAME;
750 if (!wcscmp(name, L"Author")) return D2D1_PROPERTY_AUTHOR;
751 if (!wcscmp(name, L"Category")) return D2D1_PROPERTY_CATEGORY;
752 if (!wcscmp(name, L"Description")) return D2D1_PROPERTY_DESCRIPTION;
753 return props->custom_count;
754}
755
757{
758 WCHAR *name = NULL, *value = NULL;
760 unsigned int depth;
762 HRESULT hr;
763
765 return hr;
766
768 {
769 free(name);
770 return hr;
771 }
772
773 /* Check for duplicates. */
774 if (parse_effect_get_property(effect, name))
776
778
779 if (SUCCEEDED(hr))
780 {
781 /* FIXME: sub properties are ignored */
782 IXmlReader_MoveToElement(reader);
783 IXmlReader_GetDepth(reader, &depth);
785 }
786
787 if (SUCCEEDED(hr))
788 {
791 }
792
793 free(value);
794 free(name);
795
796 return hr;
797}
798
800{
801 struct d2d_effect_property *inputs, *min_inputs, *max_inputs;
802 struct d2d_effect_properties *subproperties;
803 UINT32 min_inputs_value, max_inputs_value;
804 unsigned int depth, input_count = 0;
805 XmlNodeType node_type;
806 WCHAR *name, *value;
807 WCHAR buffW[16];
808 HRESULT hr;
809
810 if (FAILED(hr = d2d_effect_properties_add(effect->properties, L"Inputs",
812 return hr;
813
814 if (!(inputs = d2d_effect_properties_get_property_by_name(effect->properties, L"Inputs")))
815 return E_FAIL;
816 if (!(inputs->subproperties = calloc(1, sizeof(*inputs->subproperties))))
817 return E_OUTOFMEMORY;
819 subproperties = inputs->subproperties;
820
825
827 {
830 free(value);
831 if (FAILED(hr)) return hr;
832 }
834 {
837 free(value);
838 if (FAILED(hr)) return hr;
839 }
840
841 min_inputs = d2d_effect_properties_get_property_by_name(effect->properties, L"MinInputs");
842 max_inputs = d2d_effect_properties_get_property_by_name(effect->properties, L"MaxInputs");
843
844 if (!IXmlReader_IsEmptyElement(reader))
845 {
847 {
848 if (FAILED(hr = IXmlReader_GetNodeType(reader, &node_type))) return hr;
849 if (node_type == XmlNodeType_EndElement) continue;
851
852 if (FAILED(hr = parse_effect_get_attribute(reader, L"name", &name))) return hr;
853
854 swprintf(buffW, ARRAY_SIZE(buffW), L"%lu", input_count);
855 d2d_effect_subproperties_add(subproperties, buffW, input_count, D2D1_PROPERTY_TYPE_STRING, name);
856 input_count++;
857
858 free(name);
859 }
860 *(UINT32 *)(effect->properties->data.ptr + inputs->data.offset) = input_count;
861
862 if (FAILED(hr = IXmlReader_GetNodeType(reader, &node_type))) return hr;
864 }
865
866 if (min_inputs)
867 d2d_effect_property_get_uint32_value(effect->properties, min_inputs, &min_inputs_value);
868 if (max_inputs)
869 d2d_effect_property_get_uint32_value(effect->properties, max_inputs, &max_inputs_value);
870
871 /* Validate the range */
872 if (min_inputs && max_inputs)
873 {
874 if (min_inputs_value > max_inputs_value)
875 {
876 WARN("Invalid input count range %u - %u.\n", min_inputs_value, max_inputs_value);
877 return E_INVALIDARG;
878 }
879 }
880
881 /* Validate actual input count with specified range. */
882 if (min_inputs && min_inputs_value > input_count)
883 {
884 WARN("Too few inputs were declared, expected at least %u.\n", min_inputs_value);
885 return E_INVALIDARG;
886 }
887
888 if (max_inputs && max_inputs_value < input_count)
889 {
890 WARN("Too many inputs were declared, expected at most %u.\n", max_inputs_value);
891 return E_INVALIDARG;
892 }
893
894 /* Apply default value to a missing property. If both properties are missing, add them. */
895 if (min_inputs != max_inputs)
896 {
897 swprintf(buffW, ARRAY_SIZE(buffW), L"%lu", min_inputs ? min_inputs_value : max_inputs_value);
898 if (min_inputs)
900 else
902 }
903 else if (!min_inputs)
904 {
905 swprintf(buffW, ARRAY_SIZE(buffW), L"%lu", input_count);
907 if (SUCCEEDED(hr))
909 }
910
911 return hr;
912}
913
915{
916 const WCHAR *node_name;
917 XmlNodeType node_type;
918 unsigned int depth;
919 HRESULT hr;
920
921 /* Xml declaration node is mandatory. */
923 return hr;
924
925 /* Top level "Effect" element. */
927 return hr;
928
929 /* Loop inside effect node */
931 {
932 if (FAILED(hr = IXmlReader_GetNodeType(reader, &node_type))) return hr;
933 if (node_type != XmlNodeType_Element && node_type != XmlNodeType_EndElement) continue;
934 if (FAILED(hr = IXmlReader_GetLocalName(reader, &node_name, NULL))) return hr;
935 if (node_type == XmlNodeType_EndElement) break;
936
937 if (!wcscmp(node_name, L"Property"))
939 else if (!wcscmp(node_name, L"Inputs"))
941 else
942 {
943 WARN("Unexpected element %s.\n", debugstr_w(node_name));
945 }
946
947 if (FAILED(hr))
948 return hr;
949 }
950
951 return hr;
952}
953
955 REFCLSID effect_id, IStream *property_xml, const D2D1_PROPERTY_BINDING *bindings,
956 UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory, BOOL builtin)
957{
958 struct d2d_effect_registration *effect;
960 unsigned int i;
961 HRESULT hr;
962
964 {
965 if (IsEqualGUID(effect_id, &effect->id))
966 {
967 if (effect->builtin) return E_INVALIDARG;
968 ++effect->registration_count;
969 return S_OK;
970 }
971 }
972
973 if (FAILED(hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL)))
974 return hr;
975
976 if (FAILED(hr = IXmlReader_SetInput(reader, (IUnknown *)property_xml)))
977 {
978 IXmlReader_Release(reader);
979 return hr;
980 }
981
982 if (!(effect = calloc(1, sizeof(*effect))))
983 {
984 IXmlReader_Release(reader);
985 return E_OUTOFMEMORY;
986 }
987 if (!(effect->properties = calloc(1, sizeof(*effect->properties))))
988 {
989 IXmlReader_Release(reader);
990 free(effect);
991 return E_OUTOFMEMORY;
992 }
994 effect->builtin = builtin;
995
996 hr = parse_effect_xml(reader, effect);
997 IXmlReader_Release(reader);
998 if (FAILED(hr))
999 {
1000 WARN("Failed to parse effect xml, hr %#lx.\n", hr);
1002 return hr;
1003 }
1004
1005 /* Check required properties. */
1006 if (!parse_effect_get_property(effect, L"DisplayName")
1007 || !parse_effect_get_property(effect, L"Author")
1008 || !parse_effect_get_property(effect, L"Category")
1009 || !parse_effect_get_property(effect, L"Description")
1010 || !parse_effect_get_property(effect, L"Inputs"))
1011 {
1012 WARN("Missing required properties.\n");
1014 return E_INVALIDARG;
1015 }
1016
1017 /* Bind getter and setter. */
1018 for (i = 0; i < binding_count; ++i)
1019 {
1021
1022 if (!(property = parse_effect_get_property(effect, bindings[i].propertyName)))
1023 {
1024 WARN("Failed to bind to missing property.\n");
1027 }
1028
1029 property->get_function = bindings[i].getFunction;
1030 property->set_function = bindings[i].setFunction;
1031 }
1032
1033 effect->registration_count = 1;
1034 effect->id = *effect_id;
1035 effect->factory = effect_factory;
1036
1038
1039 return S_OK;
1040}
1041
1043 REFCLSID effect_id, IStream *property_xml, const D2D1_PROPERTY_BINDING *bindings,
1044 UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory)
1045{
1047
1048 TRACE("iface %p, effect_id %s, property_xml %p, bindings %p, binding_count %u, effect_factory %p.\n",
1049 iface, debugstr_guid(effect_id), property_xml, bindings, binding_count, effect_factory);
1050
1052
1053 return d2d_factory_register_effect_from_stream(factory, effect_id, property_xml, bindings,
1054 binding_count, effect_factory, FALSE);
1055}
1056
1058 REFCLSID effect_id, const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings,
1059 UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory, BOOL builtin)
1060{
1061 static const LARGE_INTEGER zero;
1062 IStream *stream;
1063 ULONG size;
1064 HRESULT hr;
1065
1067 return hr;
1068
1069 size = sizeof(*property_xml) * (wcslen(property_xml) + 1);
1070 if (SUCCEEDED(hr = IStream_Write(stream, property_xml, size, NULL)))
1071 hr = IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
1072
1073 if (SUCCEEDED(hr))
1075 binding_count, effect_factory, builtin);
1076
1077 IStream_Release(stream);
1078 return hr;
1079}
1080
1082 const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings, UINT32 binding_count,
1083 PD2D1_EFFECT_FACTORY effect_factory)
1084{
1085 return d2d_factory_register_effect_from_string(factory, effect_id, property_xml, bindings,
1086 binding_count, effect_factory, TRUE);
1087}
1088
1090 REFCLSID effect_id, const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings,
1091 UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory)
1092{
1094
1095 TRACE("iface %p, effect_id %s, property_xml %s, bindings %p, binding_count %u, effect_factory %p.\n",
1096 iface, debugstr_guid(effect_id), debugstr_w(property_xml), bindings, binding_count, effect_factory);
1097
1099
1100 return d2d_factory_register_effect_from_string(factory, effect_id, property_xml, bindings,
1101 binding_count, effect_factory, FALSE);
1102}
1103
1105{
1107 struct d2d_effect_registration *effect;
1108
1109 TRACE("iface %p, effect_id %s.\n", iface, debugstr_guid(effect_id));
1110
1112
1114 {
1115 if (IsEqualGUID(effect_id, &effect->id))
1116 {
1117 if (effect->builtin) break;
1118 if (!--effect->registration_count)
1119 {
1120 list_remove(&effect->entry);
1122 }
1123 return S_OK;
1124 }
1125 }
1126
1128}
1129
1131 CLSID *effects, UINT32 effect_count, UINT32 *returned, UINT32 *registered)
1132{
1134 struct d2d_effect_registration *effect;
1135 UINT32 ret, reg;
1136
1137 TRACE("iface %p, effects %p, effect_count %u, returned %p, registered %p.\n",
1138 iface, effects, effect_count, returned, registered);
1139
1140 if (!returned) returned = &ret;
1141 if (!registered) registered = &reg;
1142
1143 *registered = 0;
1144 *returned = 0;
1145
1147
1148 LIST_FOR_EACH_ENTRY(effect, &factory->effects, struct d2d_effect_registration, entry)
1149 {
1150 if (effects && effect_count)
1151 {
1152 *effects = effect->id;
1153 effects++;
1154 effect_count--;
1155 *returned += 1;
1156 }
1157
1158 *registered += 1;
1159 }
1160
1161 if (!effects) return S_OK;
1162 return *returned == *registered ? S_OK : D2DERR_INSUFFICIENT_BUFFER;
1163}
1164
1167{
1169 const struct d2d_effect_registration *reg;
1170
1171 TRACE("iface %p, effect_id %s, props %p.\n", iface, debugstr_guid(effect_id), props);
1172
1174
1176 {
1177 WARN("Effect id %s not found.\n", wine_dbgstr_guid(effect_id));
1179 }
1180
1181 *props = &reg->properties->ID2D1Properties_iface;
1182 ID2D1Properties_AddRef(*props);
1183
1184 return S_OK;
1185}
1186
1188 IDXGIDevice *dxgi_device, ID2D1Device1 **device)
1189{
1190 TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
1191
1192 return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device1, (void **)device);
1193}
1194
1196 IDXGIDevice *dxgi_device, ID2D1Device2 **device)
1197{
1198 TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
1199
1200 return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device2, (void **)device);
1201}
1202
1204 IDXGIDevice *dxgi_device, ID2D1Device3 **device)
1205{
1206 TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
1207
1208 return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device3, (void **)device);
1209}
1210
1212 IDXGIDevice *dxgi_device, ID2D1Device4 **device)
1213{
1214 TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
1215
1216 return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device4, (void **)device);
1217}
1218
1220 IDXGIDevice *dxgi_device, ID2D1Device5 **device)
1221{
1222 TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
1223
1224 return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device5, (void **)device);
1225}
1226
1228 IDXGIDevice *dxgi_device, ID2D1Device6 **device)
1229{
1230 TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
1231
1232 return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, true, &IID_ID2D1Device6, (void **)device);
1233}
1234
1235static const struct ID2D1Factory7Vtbl d2d_factory_vtbl =
1236{
1270};
1271
1273{
1275 return d2d_factory_QueryInterface(&factory->ID2D1Factory7_iface, iid, out);
1276}
1277
1279{
1281 return d2d_factory_AddRef(&factory->ID2D1Factory7_iface);
1282}
1283
1285{
1287 return d2d_factory_Release(&factory->ID2D1Factory7_iface);
1288}
1289
1291{
1292 return TRUE;
1293}
1294
1296{
1298
1299 TRACE("%p.\n", iface);
1300
1302}
1303
1305{
1307
1308 TRACE("%p.\n", iface);
1309
1311}
1312
1314{
1315 return FALSE;
1316}
1317
1319{
1320}
1321
1323{
1324}
1325
1326static const struct ID2D1MultithreadVtbl d2d_factory_multithread_vtbl =
1327{
1334};
1335
1336static const struct ID2D1MultithreadVtbl d2d_factory_multithread_noop_vtbl =
1337{
1344};
1345
1347 const D2D1_FACTORY_OPTIONS *factory_options)
1348{
1349 if (factory_options && factory_options->debugLevel != D2D1_DEBUG_LEVEL_NONE)
1350 WARN("Ignoring debug level %#x.\n", factory_options->debugLevel);
1351
1352 factory->ID2D1Factory7_iface.lpVtbl = &d2d_factory_vtbl;
1353 factory->ID2D1Multithread_iface.lpVtbl = factory_type == D2D1_FACTORY_TYPE_SINGLE_THREADED ?
1355 factory->factory_type = factory_type;
1356 factory->refcount = 1;
1358 list_init(&factory->effects);
1360 InitOnceInitialize(&factory->init_builtins);
1361}
1362
1364 const D2D1_FACTORY_OPTIONS *factory_options, void **factory)
1365{
1366 struct d2d_factory *object;
1367 HRESULT hr;
1368
1369 TRACE("factory_type %#x, iid %s, factory_options %p, factory %p.\n",
1370 factory_type, debugstr_guid(iid), factory_options, factory);
1371
1374 {
1375 return E_INVALIDARG;
1376 }
1377
1378 if (!(object = calloc(1, sizeof(*object))))
1379 return E_OUTOFMEMORY;
1380
1381 d2d_factory_init(object, factory_type, factory_options);
1382
1383 TRACE("Created factory %p.\n", object);
1384
1385 hr = ID2D1Factory7_QueryInterface(&object->ID2D1Factory7_iface, iid, factory);
1386 ID2D1Factory7_Release(&object->ID2D1Factory7_iface);
1387
1388 return hr;
1389}
1390
1392{
1393 float theta, sin_theta, cos_theta;
1394
1395 TRACE("angle %.8e, center %s, matrix %p.\n", angle, debug_d2d_point_2f(&center), matrix);
1396
1397 theta = angle * (M_PI / 180.0f);
1398 sin_theta = sinf(theta);
1399 cos_theta = cosf(theta);
1400
1401 /* translate(center) * rotate(theta) * translate(-center) */
1402 matrix->_11 = cos_theta;
1403 matrix->_12 = sin_theta;
1404 matrix->_21 = -sin_theta;
1405 matrix->_22 = cos_theta;
1406 matrix->_31 = center.x - center.x * cos_theta + center.y * sin_theta;
1407 matrix->_32 = center.y - center.x * sin_theta - center.y * cos_theta;
1408}
1409
1410void WINAPI D2D1MakeSkewMatrix(float angle_x, float angle_y, D2D1_POINT_2F center, D2D1_MATRIX_3X2_F *matrix)
1411{
1412 float tan_x, tan_y;
1413
1414 TRACE("angle_x %.8e, angle_y %.8e, center %s, matrix %p.\n", angle_x, angle_y, debug_d2d_point_2f(&center), matrix);
1415
1416 tan_x = tan(angle_x * (M_PI / 180.0f));
1417 tan_y = tan(angle_y * (M_PI / 180.0f));
1418
1419 /* translate(-center) * skew() * translate(center) */
1420 matrix->_11 = 1.0f;
1421 matrix->_12 = tan_y;
1422 matrix->_21 = tan_x;
1423 matrix->_22 = 1.0f;
1424 matrix->_31 = -tan_x * center.y;
1425 matrix->_32 = -tan_y * center.x;
1426}
1427
1429{
1430 TRACE("matrix %p.\n", matrix);
1431
1432 return (matrix->_11 * matrix->_22 - matrix->_21 * matrix->_12) != 0.0f;
1433}
1434
1436{
1438
1439 TRACE("matrix %p.\n", matrix);
1440
1441 return d2d_matrix_invert(matrix, &m);
1442}
1443
1445 const D2D1_CREATION_PROPERTIES *properties, ID2D1Device **device)
1446{
1447 D2D1_CREATION_PROPERTIES default_properties = {0};
1448 D2D1_FACTORY_OPTIONS factory_options;
1450 ID3D11Device *d3d_device;
1452 HRESULT hr;
1453
1454 TRACE("dxgi_device %p, properties %p, device %p.\n", dxgi_device, properties, device);
1455
1456 if (!properties)
1457 {
1458 if (SUCCEEDED(IDXGIDevice_QueryInterface(dxgi_device, &IID_ID3D11Device, (void **)&d3d_device)))
1459 {
1460 if (!(ID3D11Device_GetCreationFlags(d3d_device) & D3D11_CREATE_DEVICE_SINGLETHREADED))
1462 ID3D11Device_Release(d3d_device);
1463 }
1464 properties = &default_properties;
1465 }
1466
1467 switch (properties->threadingMode)
1468 {
1471 break;
1474 break;
1475 default:
1476 return E_INVALIDARG;
1477 }
1478
1479 factory_options.debugLevel = properties->debugLevel;
1480 if (FAILED(hr = D2D1CreateFactory(factory_type, &IID_ID2D1Factory1, &factory_options, (void **)&factory)))
1481 return hr;
1482
1483 hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, device);
1484 ID2D1Factory1_Release(factory);
1485 return hr;
1486}
1487
1488void WINAPI D2D1SinCos(float angle, float *s, float *c)
1489{
1490 TRACE("angle %.8e, s %p, c %p.\n", angle, s, c);
1491
1492 *s = sinf(angle);
1493 *c = cosf(angle);
1494}
1495
1497{
1498 TRACE("angle %.8e.\n", angle);
1499
1500 return tanf(angle);
1501}
1502
1503float WINAPI D2D1Vec3Length(float x, float y, float z)
1504{
1505 TRACE("x %.8e, y %.8e, z %.8e.\n", x, y, z);
1506
1507 return sqrtf(x * x + y * y + z * z);
1508}
1509
1510/* See IEC 61966-2-1:1999; also described in the EXT_texture_sRGB OpenGL
1511 * extension, among others. */
1512static float srgb_transfer_function(float x)
1513{
1514 if (x <= 0.0f)
1515 return 0.0f;
1516 else if (x >= 1.0f)
1517 return 1.0f;
1518 else if (x <= 0.0031308f)
1519 return 12.92f * x;
1520 else
1521 return 1.055f * powf(x, 1.0f / 2.4f) - 0.055f;
1522}
1523
1525{
1526 if (x <= 0.0f)
1527 return 0.0f;
1528 else if (x >= 1.0f)
1529 return 1.0f;
1530 else if (x <= 0.04045f)
1531 return x / 12.92f;
1532 else
1533 return powf((x + 0.055f) / 1.055f, 2.4f);
1534}
1535
1537 D2D1_COLOR_SPACE dst_colour_space, const D2D1_COLOR_F *colour)
1538{
1540
1541 TRACE("src_colour_space %#x, dst_colour_space %#x, colour %s.\n",
1542 src_colour_space, dst_colour_space, debug_d2d_color_f(colour));
1543
1544 if (src_colour_space == D2D1_COLOR_SPACE_CUSTOM || dst_colour_space == D2D1_COLOR_SPACE_CUSTOM)
1545 {
1546 ret.r = 0.0f;
1547 ret.g = 0.0f;
1548 ret.b = 0.0f;
1549 ret.a = 0.0f;
1550
1551 return ret;
1552 }
1553
1554 if (src_colour_space == dst_colour_space)
1555 return *colour;
1556
1557 if (src_colour_space == D2D1_COLOR_SPACE_SRGB && dst_colour_space == D2D1_COLOR_SPACE_SCRGB)
1558 {
1562 ret.a = colour->a;
1563
1564 return ret;
1565 }
1566
1567 if (src_colour_space == D2D1_COLOR_SPACE_SCRGB && dst_colour_space == D2D1_COLOR_SPACE_SRGB)
1568 {
1569 ret.r = srgb_transfer_function(colour->r);
1570 ret.g = srgb_transfer_function(colour->g);
1571 ret.b = srgb_transfer_function(colour->b);
1572 ret.a = colour->a;
1573
1574 return ret;
1575 }
1576
1577 FIXME("Unhandled conversion from source colour space %#x to destination colour space %#x.\n",
1578 src_colour_space, dst_colour_space);
1579 ret.r = 0.0f;
1580 ret.g = 0.0f;
1581 ret.b = 0.0f;
1582 ret.a = 0.0f;
1583
1584 return ret;
1585}
1586
1587static bool get_config_key_u32(HKEY default_key, HKEY application_key, const char *name, uint32_t *value)
1588{
1589 DWORD type, size;
1590 uint32_t data;
1591
1592 size = sizeof(data);
1593 if (application_key && !RegQueryValueExA(application_key,
1594 name, 0, &type, (BYTE *)&data, &size) && type == REG_DWORD)
1595 goto success;
1596
1597 size = sizeof(data);
1598 if (default_key && !RegQueryValueExA(default_key,
1599 name, 0, &type, (BYTE *)&data, &size) && type == REG_DWORD)
1600 goto success;
1601
1602 return false;
1603
1604success:
1605 *value = data;
1606 return true;
1607}
1608
1609static void d2d_settings_init(void)
1610{
1611 HKEY default_key, tmp_key, application_key = NULL;
1612 char buffer[MAX_PATH + 10];
1613 DWORD len;
1614
1615 if (RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Direct2D", &default_key))
1616 default_key = NULL;
1617
1619 if (len && len < MAX_PATH)
1620 {
1621 char *p, *appname = buffer;
1622
1623 if ((p = strrchr(appname, '/')))
1624 appname = p + 1;
1625 if ((p = strrchr(appname, '\\')))
1626 appname = p + 1;
1627 strcat(appname, "\\Direct2D");
1628
1629 if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\AppDefaults", &tmp_key))
1630 {
1631 if (RegOpenKeyA(tmp_key, appname, &application_key))
1632 application_key = NULL;
1633 RegCloseKey(tmp_key);
1634 }
1635 }
1636
1637 if (!default_key && !application_key)
1638 return;
1639
1640 if (get_config_key_u32(default_key, application_key, "max_version_factory", &d2d_settings.max_version_factory))
1641 ERR_(winediag)("Limiting maximum Direct2D factory version to %#x.\n", d2d_settings.max_version_factory);
1642
1643 if (application_key)
1644 RegCloseKey(application_key);
1645 if (default_key)
1646 RegCloseKey(default_key);
1647}
1648
1650{
1653 return TRUE;
1654}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define RegCloseKey(hKey)
Definition: registry.h:49
RECT rect
Definition: combotst.c:67
D2D1_FILL_MODE
Definition: d2d1.idl:84
D2D1_FACTORY_TYPE
Definition: d2d1.idl:77
@ D2D1_FACTORY_TYPE_SINGLE_THREADED
Definition: d2d1.idl:78
@ D2D1_FACTORY_TYPE_MULTI_THREADED
Definition: d2d1.idl:79
@ D2D1_DEBUG_LEVEL_NONE
Definition: d2d1.idl:69
@ D2D1_PROPERTY_MAX_INPUTS
Definition: d2d1_1.idl:198
@ D2D1_PROPERTY_MIN_INPUTS
Definition: d2d1_1.idl:197
@ D2D1_PROPERTY_DISPLAYNAME
Definition: d2d1_1.idl:190
@ D2D1_PROPERTY_DESCRIPTION
Definition: d2d1_1.idl:193
@ D2D1_PROPERTY_CATEGORY
Definition: d2d1_1.idl:192
@ D2D1_PROPERTY_INPUTS
Definition: d2d1_1.idl:194
@ D2D1_PROPERTY_AUTHOR
Definition: d2d1_1.idl:191
D2D1_PROPERTY_TYPE
Definition: d2d1_1.idl:164
@ D2D1_PROPERTY_TYPE_BLOB
Definition: d2d1_1.idl:174
@ D2D1_PROPERTY_TYPE_CLSID
Definition: d2d1_1.idl:178
@ D2D1_PROPERTY_TYPE_MATRIX_5X4
Definition: d2d1_1.idl:182
@ D2D1_PROPERTY_TYPE_ENUM
Definition: d2d1_1.idl:176
@ D2D1_PROPERTY_TYPE_BOOL
Definition: d2d1_1.idl:167
@ D2D1_PROPERTY_TYPE_MATRIX_3X2
Definition: d2d1_1.idl:179
@ D2D1_PROPERTY_TYPE_MATRIX_4X4
Definition: d2d1_1.idl:181
@ D2D1_PROPERTY_TYPE_UINT32
Definition: d2d1_1.idl:168
@ D2D1_PROPERTY_TYPE_UNKNOWN
Definition: d2d1_1.idl:165
@ D2D1_PROPERTY_TYPE_MATRIX_4X3
Definition: d2d1_1.idl:180
@ D2D1_PROPERTY_TYPE_STRING
Definition: d2d1_1.idl:166
@ D2D1_PROPERTY_TYPE_VECTOR2
Definition: d2d1_1.idl:171
@ D2D1_PROPERTY_TYPE_FLOAT
Definition: d2d1_1.idl:170
@ D2D1_PROPERTY_TYPE_VECTOR3
Definition: d2d1_1.idl:172
@ D2D1_PROPERTY_TYPE_IUNKNOWN
Definition: d2d1_1.idl:175
@ D2D1_PROPERTY_TYPE_ARRAY
Definition: d2d1_1.idl:177
@ D2D1_PROPERTY_TYPE_INT32
Definition: d2d1_1.idl:169
@ D2D1_PROPERTY_TYPE_VECTOR4
Definition: d2d1_1.idl:173
@ D2D1_PROPERTY_TYPE_COLOR_CONTEXT
Definition: d2d1_1.idl:183
@ D2D1_SUBPROPERTY_ISREADONLY
Definition: d2d1_1.idl:205
@ D2D1_SUBPROPERTY_DISPLAYNAME
Definition: d2d1_1.idl:204
D2D1_COLOR_SPACE
Definition: d2d1_1.idl:79
@ D2D1_COLOR_SPACE_SCRGB
Definition: d2d1_1.idl:82
@ D2D1_COLOR_SPACE_CUSTOM
Definition: d2d1_1.idl:80
@ D2D1_COLOR_SPACE_SRGB
Definition: d2d1_1.idl:81
@ D2D1_UNIT_MODE_DIPS
Definition: d2d1_1.idl:65
@ D2D1_THREADING_MODE_SINGLE_THREADED
Definition: d2d1_1.idl:216
@ D2D1_THREADING_MODE_MULTI_THREADED
Definition: d2d1_1.idl:217
@ D2D1_PRIMITIVE_BLEND_SOURCE_OVER
Definition: d2d1_1.idl:55
@ D2D1_STROKE_TRANSFORM_TYPE_NORMAL
Definition: d2d1_1.idl:47
HRESULT(__stdcall * PD2D1_EFFECT_FACTORY)(IUnknown **effect)
Definition: d2d1_1.idl:321
static BOOL d2d_matrix_invert(D2D_MATRIX_3X2_F *dst, const D2D_MATRIX_3X2_F *src)
Definition: d2d1_private.h:936
HRESULT d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory, const D2D1_STROKE_STYLE_PROPERTIES1 *desc, const float *dashes, UINT32 dash_count)
Definition: stroke.c:202
struct d2d_device * unsafe_impl_from_ID2D1Device(ID2D1Device1 *iface)
Definition: device.c:4522
static const char * debug_d2d_point_2f(const D2D1_POINT_2F *point)
Definition: d2d1_private.h:993
void d2d_transformed_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory, ID2D1Geometry *src_geometry, const D2D_MATRIX_3X2_F *transform)
Definition: geometry.c:5226
HRESULT d2d_dc_render_target_init(struct d2d_dc_render_target *render_target, ID2D1Factory1 *factory, ID3D10Device1 *d3d_device, const D2D1_RENDER_TARGET_PROPERTIES *desc)
void d2d_effect_init_properties(struct d2d_effect *effect, struct d2d_effect_properties *properties)
Definition: effect.c:2440
HRESULT d2d_hwnd_render_target_init(struct d2d_hwnd_render_target *render_target, ID2D1Factory1 *factory, ID3D10Device1 *d3d_device, const D2D1_RENDER_TARGET_PROPERTIES *desc, const D2D1_HWND_RENDER_TARGET_PROPERTIES *hwnd_desc)
HRESULT d2d_rounded_rectangle_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory, const D2D1_ROUNDED_RECT *rounded_rect)
Definition: geometry.c:4876
static const char * debug_d2d_color_f(const D2D1_COLOR_F *colour)
Definition: d2d1_private.h:986
void d2d_device_init(struct d2d_device *device, ID2D1Factory1 *factory, IDXGIDevice *dxgi_device, bool allow_get_dxgi_device)
Definition: device.c:4530
static const char * debug_d2d_ellipse(const D2D1_ELLIPSE *ellipse)
HRESULT d2d_effect_subproperties_add(struct d2d_effect_properties *props, const WCHAR *name, UINT32 index, D2D1_PROPERTY_TYPE type, const WCHAR *value)
Definition: effect.c:1287
struct d2d_effect_property * d2d_effect_properties_get_property_by_name(const struct d2d_effect_properties *properties, const WCHAR *name)
Definition: effect.c:1345
static struct d2d_factory * unsafe_impl_from_ID2D1Factory(ID2D1Factory *iface)
Definition: d2d1_private.h:704
static const char * debug_d2d_rect_f(const D2D1_RECT_F *rect)
HRESULT d2d_d3d_create_render_target(struct d2d_device *device, IDXGISurface *surface, IUnknown *outer_unknown, const struct d2d_device_context_ops *ops, const D2D1_RENDER_TARGET_PROPERTIES *desc, void **render_target)
Definition: device.c:4183
static const char * debug_d2d_rounded_rect(const D2D1_ROUNDED_RECT *rounded_rect)
void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory)
Definition: geometry.c:3965
void d2d_effects_init_builtins(struct d2d_factory *factory)
Definition: effect.c:1074
HRESULT d2d_rectangle_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory, const D2D1_RECT_F *rect)
Definition: geometry.c:4591
HRESULT d2d_wic_render_target_init(struct d2d_wic_render_target *render_target, ID2D1Factory1 *factory, ID3D10Device1 *d3d_device, IWICBitmap *bitmap, const D2D1_RENDER_TARGET_PROPERTIES *desc)
HRESULT d2d_effect_properties_add(struct d2d_effect_properties *props, const WCHAR *name, UINT32 index, D2D1_PROPERTY_TYPE type, const WCHAR *value)
Definition: effect.c:1281
HRESULT d2d_effect_property_get_uint32_value(const struct d2d_effect_properties *properties, const struct d2d_effect_property *prop, UINT32 *value)
Definition: effect.c:1422
HRESULT d2d_geometry_group_init(struct d2d_geometry *geometry, ID2D1Factory *factory, D2D1_FILL_MODE fill_mode, ID2D1Geometry **src_geometries, unsigned int geometry_count)
Definition: geometry.c:5497
void d2d_state_block_init(struct d2d_state_block *state_block, ID2D1Factory *factory, const D2D1_DRAWING_STATE_DESCRIPTION1 *desc, IDWriteRenderingParams *text_rendering_params)
Definition: state_block.c:164
HRESULT d2d_ellipse_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory, const D2D1_ELLIPSE *ellipse)
Definition: geometry.c:4185
#define D2DERR_INSUFFICIENT_BUFFER
Definition: d2derr.h:23
@ D3D10_CREATE_DEVICE_BGRA_SUPPORT
Definition: d3d10.idl:995
const UINT D3D10_1_SDK_VERSION
Definition: d3d10_1.idl:150
@ D3D10_FEATURE_LEVEL_10_0
Definition: d3d10_1.idl:54
HRESULT WINAPI D3D10CreateDevice1(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, HMODULE swrast, UINT flags, D3D10_FEATURE_LEVEL1 hw_level, UINT sdk_version, ID3D10Device1 **device)
Definition: d3d10_1_main.c:182
@ D3D10_DRIVER_TYPE_HARDWARE
Definition: d3d10misc.h:29
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
HRESULT hr
Definition: delayimp.cpp:582
HRESULT d2d_factory_register_builtin_effect(struct d2d_factory *factory, REFCLSID effect_id, const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings, UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory)
Definition: factory.c:1081
static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry(ID2D1Factory7 *iface, ID2D1PathGeometry **geometry)
Definition: factory.c:302
void d2d_factory_register_effect(struct d2d_factory *factory, struct d2d_effect_registration *effect)
Definition: factory.c:61
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory4_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device3 **device)
Definition: factory.c:1203
static UINT32 parse_effect_get_property_index(struct d2d_effect_properties *props, const WCHAR *name)
Definition: factory.c:746
static float srgb_transfer_function(float x)
Definition: factory.c:1512
static HRESULT d2d_factory_get_device(struct d2d_factory *factory, ID3D10Device1 **device)
Definition: factory.c:384
static HRESULT STDMETHODCALLTYPE d2d_factory_QueryInterface(ID2D1Factory7 *iface, REFIID iid, void **out)
Definition: factory.c:100
static void d2d_factory_init(struct d2d_factory *factory, D2D1_FACTORY_TYPE factory_type, const D2D1_FACTORY_OPTIONS *factory_options)
Definition: factory.c:1346
void WINAPI D2D1MakeRotateMatrix(float angle, D2D1_POINT_2F center, D2D1_MATRIX_3X2_F *matrix)
Definition: factory.c:1391
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateGeometryGroup(ID2D1Factory7 *iface, D2D1_FILL_MODE fill_mode, ID2D1Geometry **geometries, UINT32 geometry_count, ID2D1GeometryGroup **group)
Definition: factory.c:257
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock(ID2D1Factory7 *iface, const D2D1_DRAWING_STATE_DESCRIPTION *desc, IDWriteRenderingParams *text_rendering_params, ID2D1DrawingStateBlock **state_block)
Definition: factory.c:356
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateHwndRenderTarget(ID2D1Factory7 *iface, const D2D1_RENDER_TARGET_PROPERTIES *desc, const D2D1_HWND_RENDER_TARGET_PROPERTIES *hwnd_rt_desc, ID2D1HwndRenderTarget **render_target)
Definition: factory.c:428
static BOOL STDMETHODCALLTYPE d2d_factory_st_GetMultithreadProtected(ID2D1Multithread *iface)
Definition: factory.c:1313
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRectangleGeometry(ID2D1Factory7 *iface, const D2D1_RECT_F *rect, ID2D1RectangleGeometry **geometry)
Definition: factory.c:185
static const struct ID2D1Factory7Vtbl d2d_factory_vtbl
Definition: factory.c:1235
static HRESULT parse_effect_get_next_xml_node(IXmlReader *reader, XmlNodeType expected_type, const WCHAR *expected_name, unsigned int *depth)
Definition: factory.c:616
static HRESULT d2d_factory_register_effect_from_stream(struct d2d_factory *factory, REFCLSID effect_id, IStream *property_xml, const D2D1_PROPERTY_BINDING *bindings, UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory, BOOL builtin)
Definition: factory.c:954
static float srgb_inverse_transfer_function(float x)
Definition: factory.c:1524
static struct d2d_factory * impl_from_ID2D1Multithread(ID2D1Multithread *iface)
Definition: factory.c:44
float WINAPI D2D1Tan(float angle)
Definition: factory.c:1496
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock1(ID2D1Factory7 *iface, const D2D1_DRAWING_STATE_DESCRIPTION1 *desc, IDWriteRenderingParams *text_rendering_params, ID2D1DrawingStateBlock1 **state_block)
Definition: factory.c:588
static HRESULT STDMETHODCALLTYPE d2d_factory_UnregisterEffect(ID2D1Factory7 *iface, REFCLSID effect_id)
Definition: factory.c:1104
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory7_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device6 **device)
Definition: factory.c:1227
D2D1_COLOR_F WINAPI D2D1ConvertColorSpace(D2D1_COLOR_SPACE src_colour_space, D2D1_COLOR_SPACE dst_colour_space, const D2D1_COLOR_F *colour)
Definition: factory.c:1536
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateWicBitmapRenderTarget(ID2D1Factory7 *iface, IWICBitmap *target, const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1RenderTarget **render_target)
Definition: factory.c:396
float WINAPI D2D1Vec3Length(float x, float y, float z)
Definition: factory.c:1503
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device **device)
Definition: factory.c:535
static BOOL WINAPI d2d_factory_builtins_initonce(INIT_ONCE *once, void *param, void **context)
Definition: factory.c:49
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory6_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device5 **device)
Definition: factory.c:1219
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory5_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device4 **device)
Definition: factory.c:1211
static void STDMETHODCALLTYPE d2d_factory_st_Leave(ID2D1Multithread *iface)
Definition: factory.c:1322
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateEllipseGeometry(ID2D1Factory7 *iface, const D2D1_ELLIPSE *ellipse, ID2D1EllipseGeometry **geometry)
Definition: factory.c:233
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory2_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device1 **device)
Definition: factory.c:1187
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateTransformedGeometry(ID2D1Factory7 *iface, ID2D1Geometry *src_geometry, const D2D1_MATRIX_3X2_F *transform, ID2D1TransformedGeometry **transformed_geometry)
Definition: factory.c:282
static struct d2d_factory * impl_from_ID2D1Factory7(ID2D1Factory7 *iface)
Definition: factory.c:39
static const struct ID2D1MultithreadVtbl d2d_factory_multithread_noop_vtbl
Definition: factory.c:1336
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle1(ID2D1Factory7 *iface, const D2D1_STROKE_STYLE_PROPERTIES1 *desc, const float *dashes, UINT32 dash_count, ID2D1StrokeStyle1 **stroke_style)
Definition: factory.c:543
static HRESULT STDMETHODCALLTYPE d2d_factory_GetEffectProperties(ID2D1Factory7 *iface, REFCLSID effect_id, ID2D1Properties **props)
Definition: factory.c:1165
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
Definition: factory.c:1649
static bool get_config_key_u32(HKEY default_key, HKEY application_key, const char *name, uint32_t *value)
Definition: factory.c:1587
void WINAPI D2D1MakeSkewMatrix(float angle_x, float angle_y, D2D1_POINT_2F center, D2D1_MATRIX_3X2_F *matrix)
Definition: factory.c:1410
static ULONG STDMETHODCALLTYPE d2d_factory_AddRef(ID2D1Factory7 *iface)
Definition: factory.c:133
static void d2d_effect_registration_cleanup(struct d2d_effect_registration *reg)
Definition: factory.c:33
static ULONG STDMETHODCALLTYPE d2d_factory_mt_Release(ID2D1Multithread *iface)
Definition: factory.c:1284
static void d2d_settings_init(void)
Definition: factory.c:1609
BOOL WINAPI D2D1IsMatrixInvertible(const D2D1_MATRIX_3X2_F *matrix)
Definition: factory.c:1428
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRoundedRectangleGeometry(ID2D1Factory7 *iface, const D2D1_ROUNDED_RECT *rounded_rect, ID2D1RoundedRectangleGeometry **geometry)
Definition: factory.c:209
static HRESULT parse_effect_get_property_type(IXmlReader *reader, D2D1_PROPERTY_TYPE *type)
Definition: factory.c:686
static HRESULT parse_effect_skip_element(IXmlReader *reader, unsigned int element_depth)
Definition: factory.c:650
static HRESULT d2d_factory_reload_sysmetrics(struct d2d_factory *factory)
Definition: factory.c:82
static HRESULT d2d_factory_register_effect_from_string(struct d2d_factory *factory, REFCLSID effect_id, const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings, UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory, BOOL builtin)
Definition: factory.c:1057
static struct d2d_effect_property * parse_effect_get_property(const struct d2d_effect_registration *effect, const WCHAR *name)
Definition: factory.c:732
static HRESULT STDMETHODCALLTYPE d2d_factory_GetRegisteredEffects(ID2D1Factory7 *iface, CLSID *effects, UINT32 effect_count, UINT32 *returned, UINT32 *registered)
Definition: factory.c:1130
HRESULT WINAPI D2D1CreateDevice(IDXGIDevice *dxgi_device, const D2D1_CREATION_PROPERTIES *properties, ID2D1Device **device)
Definition: factory.c:1444
static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromStream(ID2D1Factory7 *iface, REFCLSID effect_id, IStream *property_xml, const D2D1_PROPERTY_BINDING *bindings, UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory)
Definition: factory.c:1042
static HRESULT STDMETHODCALLTYPE d2d_factory_ReloadSystemMetrics(ID2D1Factory7 *iface)
Definition: factory.c:166
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDxgiSurfaceRenderTarget(ID2D1Factory7 *iface, IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1RenderTarget **render_target)
Definition: factory.c:458
static void STDMETHODCALLTYPE d2d_factory_mt_Leave(ID2D1Multithread *iface)
Definition: factory.c:1304
static void d2d_factory_init_builtin_effects(struct d2d_factory *factory)
Definition: factory.c:56
static HRESULT parse_effect_property(IXmlReader *reader, struct d2d_effect_registration *effect)
Definition: factory.c:756
static ULONG STDMETHODCALLTYPE d2d_factory_mt_AddRef(ID2D1Multithread *iface)
Definition: factory.c:1278
static HRESULT STDMETHODCALLTYPE d2d_factory_mt_QueryInterface(ID2D1Multithread *iface, REFIID iid, void **out)
Definition: factory.c:1272
static HRESULT parse_effect_get_attribute(IXmlReader *reader, const WCHAR *name, WCHAR **ret)
Definition: factory.c:670
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDCRenderTarget(ID2D1Factory7 *iface, const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1DCRenderTarget **render_target)
Definition: factory.c:487
HRESULT d2d_factory_create_device(ID2D1Factory1 *factory, IDXGIDevice *dxgi_device, bool allow_get_dxgi_device, REFIID iid, void **device)
Definition: factory.c:516
BOOL WINAPI D2D1InvertMatrix(D2D1_MATRIX_3X2_F *matrix)
Definition: factory.c:1435
static ULONG STDMETHODCALLTYPE d2d_factory_Release(ID2D1Factory7 *iface)
Definition: factory.c:143
static HRESULT parse_effect_xml(IXmlReader *reader, struct d2d_effect_registration *effect)
Definition: factory.c:914
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory3_CreateDevice(ID2D1Factory7 *iface, IDXGIDevice *dxgi_device, ID2D1Device2 **device)
Definition: factory.c:1195
static void STDMETHODCALLTYPE d2d_factory_st_Enter(ID2D1Multithread *iface)
Definition: factory.c:1318
HRESULT WINAPI D2D1CreateFactory(D2D1_FACTORY_TYPE factory_type, REFIID iid, const D2D1_FACTORY_OPTIONS *factory_options, void **factory)
Definition: factory.c:1363
static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromString(ID2D1Factory7 *iface, REFCLSID effect_id, const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings, UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory)
Definition: factory.c:1089
static void STDMETHODCALLTYPE d2d_factory_GetDesktopDpi(ID2D1Factory7 *iface, float *dpi_x, float *dpi_y)
Definition: factory.c:175
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateGdiMetafile(ID2D1Factory7 *iface, IStream *stream, ID2D1GdiMetafile **metafile)
Definition: factory.c:608
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle(ID2D1Factory7 *iface, const D2D1_STROKE_STYLE_PROPERTIES *desc, const float *dashes, UINT32 dash_count, ID2D1StrokeStyle **stroke_style)
Definition: factory.c:320
static BOOL STDMETHODCALLTYPE d2d_factory_mt_GetMultithreadProtected(ID2D1Multithread *iface)
Definition: factory.c:1290
static void STDMETHODCALLTYPE d2d_factory_mt_Enter(ID2D1Multithread *iface)
Definition: factory.c:1295
static const struct ID2D1MultithreadVtbl d2d_factory_multithread_vtbl
Definition: factory.c:1326
static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry1(ID2D1Factory7 *iface, ID2D1PathGeometry1 **geometry)
Definition: factory.c:570
struct d2d_effect_registration * d2d_factory_get_registered_effect(ID2D1Factory *iface, const GUID *id)
Definition: factory.c:66
void WINAPI D2D1SinCos(float angle, float *s, float *c)
Definition: factory.c:1488
static HRESULT parse_effect_inputs(IXmlReader *reader, struct d2d_effect_registration *effect)
Definition: factory.c:799
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT32 uint32_t
Definition: types.h:75
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL delete_on_release, IStream **stream)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1971
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define MAX_PATH
Definition: compat.h:34
#define WINE_DECLARE_DEBUG_CHANNEL(x)
Definition: compat.h:45
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
BOOL WINAPI InitOnceExecuteOnce(_Inout_ PINIT_ONCE InitOnce, _In_ __callback PINIT_ONCE_FN InitFn, _Inout_opt_ PVOID Parameter, _Outptr_opt_result_maybenull_ LPVOID *Context)
Definition: InitOnce.c:12
#define assert(_expr)
Definition: assert.h:32
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
_ACRTIMP float __cdecl powf(float, float)
Definition: powf.c:14
_ACRTIMP float __cdecl cosf(float)
Definition: cosf.c:13
_ACRTIMP float __cdecl sinf(float)
Definition: sinf.c:13
_ACRTIMP double __cdecl tan(double)
Definition: tan.c:122
_ACRTIMP float __cdecl tanf(float)
Definition: tanf.c:72
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
_ACRTIMP char *__cdecl strrchr(const char *, int)
Definition: string.c:3303
#define swprintf
Definition: precomp.h:40
HRESULT WINAPI CreateXmlReader(REFIID riid, void **obj, IMalloc *imalloc)
Definition: reader.c:3616
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
r reserved
Definition: btrfs.c:3006
factory_type
Definition: factory.h:22
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint GLenum GLenum transform
Definition: glext.h:9407
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
GLuint GLenum matrix
Definition: glext.h:9407
GLboolean GLuint group
Definition: glext.h:11120
GLfloat angle
Definition: glext.h:10853
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
GLdouble GLdouble z
Definition: glext.h:5874
const GLfloat * m
Definition: glext.h:10848
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
static int reg
Definition: i386-dis.c:1290
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define M_PI
Definition: macros.h:263
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
static const unsigned char metafile[]
Definition: olepicture.c:126
#define sqrtf(x)
Definition: mymath.h:59
short WCHAR
Definition: pedump.c:58
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
#define calloc
Definition: rosglue.h:14
#define REG_DWORD
Definition: sdbapi.c:615
#define ERR_(ch,...)
Definition: debug.h:156
strcat
Definition: string.h:92
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:181
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242
#define LIST_FOR_EACH_ENTRY_REV(elem, list, type, field)
Definition: list.h:260
int zero
Definition: sehframes.cpp:29
#define TRACE(s)
Definition: solgame.cpp:4
struct vkd3d_spirv_builtin builtin
Definition: spirv.c:4840
D2D1_DEBUG_LEVEL debugLevel
Definition: d2d1_1.idl:224
D2D1_THREADING_MODE threadingMode
Definition: d2d1_1.idl:223
D2D1_PRIMITIVE_BLEND primitiveBlend
Definition: d2d1_1.idl:247
D2D1_DEBUG_LEVEL debugLevel
Definition: d2d1.idl:306
PD2D1_PROPERTY_SET_FUNCTION setFunction
PD2D1_PROPERTY_GET_FUNCTION getFunction
D2D1_STROKE_TRANSFORM_TYPE transformType
Definition: d2d1_1.idl:237
D2D1_DASH_STYLE dashStyle
Definition: d2d1_1.idl:235
Definition: http.c:7252
bool allow_get_dxgi_device
Definition: d2d1_private.h:616
struct d2d_effect * effect
Definition: d2d1_private.h:660
union d2d_effect_property::@250 data
struct d2d_effect_properties * subproperties
Definition: d2d1_private.h:653
struct d2d_effect_properties * properties
Definition: d2d1_private.h:683
PD2D1_EFFECT_FACTORY factory
Definition: d2d1_private.h:678
ID2D1Factory7 ID2D1Factory7_iface
Definition: d2d1_private.h:688
ID2D1Multithread ID2D1Multithread_iface
Definition: d2d1_private.h:689
D2D1_FILL_MODE fill_mode
Definition: d2d1_private.h:570
ID2D1Geometry * src_geometry
Definition: d2d1_private.h:585
D2D1_ELLIPSE ellipse
Definition: d2d1_private.h:559
D2D1_ROUNDED_RECT rounded_rect
Definition: d2d1_private.h:581
UINT32 geometry_count
Definition: d2d1_private.h:591
unsigned int max_version_factory
Definition: d2d1_private.h:61
IDWriteRenderingParams * text_rendering_params
Definition: d2d1_private.h:457
Definition: devices.h:37
Definition: main.c:439
Definition: name.c:39
Definition: reader.h:84
Definition: parse.h:23
Definition: tools.h:99
Definition: cmds.c:130
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:687
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t UINT32
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
Definition: pdh_main.c:64
static const WCHAR props[]
Definition: wbemdisp.c:288
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define success(from, fromstr, to, tostr)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
RTL_RUN_ONCE INIT_ONCE
Definition: winbase.h:3654
WINBASEAPI VOID WINAPI InitOnceInitialize(_Out_ PINIT_ONCE InitOnce)
#define WINAPI
Definition: msvc.h:6
#define D2DERR_EFFECT_IS_NOT_REGISTERED
Definition: winerror.h:7391
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define E_NOINTERFACE
Definition: winerror.h:3479
#define D2DERR_INVALID_PROPERTY
Definition: winerror.h:7392
#define ERROR_NOT_FOUND
Definition: winerror.h:1014
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define LOGPIXELSX
Definition: wingdi.h:718
#define HKEY_CURRENT_USER
Definition: winreg.h:11
XmlNodeType
Definition: xmllite.idl:23
@ XmlNodeType_Whitespace
Definition: xmllite.idl:32
@ XmlNodeType_EndElement
Definition: xmllite.idl:33
@ XmlNodeType_XmlDeclaration
Definition: xmllite.idl:34
@ XmlNodeType_None
Definition: xmllite.idl:24
@ XmlNodeType_Element
Definition: xmllite.idl:25
unsigned char BYTE
Definition: xxhash.c:193