MCPcopy Create free account
hub / github.com/DISTRHO/DPF / CairoBaseWidget

Class CairoBaseWidget

dgl/Cairo.hpp:128–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126 */
127template <class BaseWidget>
128class CairoBaseWidget : public BaseWidget
129{
130public:
131 /**
132 Constructor for a CairoSubWidget.
133 */
134 explicit CairoBaseWidget(Widget* const parentGroupWidget);
135
136 /**
137 Constructor for a CairoTopLevelWidget.
138 */
139 explicit CairoBaseWidget(Window& windowToMapTo);
140
141 /**
142 Constructor for a CairoStandaloneWindow without parent window.
143 */
144 explicit CairoBaseWidget(Application& app);
145
146 /**
147 Constructor for a CairoStandaloneWindow with parent window.
148 */
149 explicit CairoBaseWidget(Application& app, Window& parentWindow);
150
151 /**
152 Destructor.
153 */
154 ~CairoBaseWidget() override {}
155
156protected:
157 /**
158 New virtual onDisplay function.
159 @see onDisplay
160 */
161 virtual void onCairoDisplay(const CairoGraphicsContext& context) = 0;
162
163private:
164 /**
165 Widget display function.
166 Implemented internally to pass context into the drawing function.
167 */
168 void onDisplay() final
169 {
170 onCairoDisplay(static_cast<const CairoGraphicsContext&>(BaseWidget::getGraphicsContext()));
171 }
172
173 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CairoBaseWidget);
174};
175
176typedef CairoBaseWidget<SubWidget> CairoSubWidget;
177typedef CairoBaseWidget<TopLevelWidget> CairoTopLevelWidget;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected