VST3: fetch midi mappings all at once, use it for note/sound-off
[carla.git] / source / modules / juce_graphics / native / juce_win32_Direct2DGraphicsContext.h
bloba407a77a58091e7af502b70c10989d9bc33385a3
1 /*
2 ==============================================================================
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
23 ==============================================================================
26 namespace juce
29 #ifndef _WINDEF_
30 class HWND__; // Forward or never
31 typedef HWND__* HWND;
32 #endif
34 class Direct2DLowLevelGraphicsContext : public LowLevelGraphicsContext
36 public:
37 Direct2DLowLevelGraphicsContext (HWND);
38 ~Direct2DLowLevelGraphicsContext();
40 //==============================================================================
41 bool isVectorDevice() const override { return false; }
43 void setOrigin (Point<int>) override;
44 void addTransform (const AffineTransform&) override;
45 float getPhysicalPixelScaleFactor() override;
46 bool clipToRectangle (const Rectangle<int>&) override;
47 bool clipToRectangleList (const RectangleList<int>&) override;
48 void excludeClipRectangle (const Rectangle<int>&) override;
49 void clipToPath (const Path&, const AffineTransform&) override;
50 void clipToImageAlpha (const Image&, const AffineTransform&) override;
51 bool clipRegionIntersects (const Rectangle<int>&) override;
52 Rectangle<int> getClipBounds() const override;
53 bool isClipEmpty() const override;
55 //==============================================================================
56 void saveState() override;
57 void restoreState() override;
58 void beginTransparencyLayer (float opacity) override;
59 void endTransparencyLayer() override;
61 //==============================================================================
62 void setFill (const FillType&) override;
63 void setOpacity (float) override;
64 void setInterpolationQuality (Graphics::ResamplingQuality) override;
66 //==============================================================================
67 void fillRect (const Rectangle<int>&, bool replaceExistingContents) override;
68 void fillRect (const Rectangle<float>&) override;
69 void fillRectList (const RectangleList<float>&) override;
70 void fillPath (const Path&, const AffineTransform&) override;
71 void drawImage (const Image& sourceImage, const AffineTransform&) override;
73 //==============================================================================
74 void drawLine (const Line<float>&) override;
75 void setFont (const Font&) override;
76 const Font& getFont() override;
77 void drawGlyph (int glyphNumber, const AffineTransform&) override;
78 bool drawTextLayout (const AttributedString&, const Rectangle<float>&) override;
80 void resized();
81 void clear();
83 void start();
84 void end();
86 //==============================================================================
87 private:
88 struct SavedState;
90 HWND hwnd;
92 SavedState* currentState;
93 OwnedArray<SavedState> states;
95 Rectangle<int> bounds;
97 struct Pimpl;
98 std::unique_ptr<Pimpl> pimpl;
100 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Direct2DLowLevelGraphicsContext)
103 } // namespace juce