17 #ifndef DGL_WINDOW_HPP_INCLUDED
18 #define DGL_WINDOW_HPP_INCLUDED
20 #include "Geometry.hpp"
22 #ifndef DGL_FILE_BROWSER_DISABLED
23 # include "FileBrowserDialog.hpp"
28 #ifdef DISTRHO_NAMESPACE
109 DISTRHO_PREVENT_HEAP_ALLOCATION
113 Window::PrivateData* ppData;
133 uintptr_t parentWindowHandle,
142 uintptr_t parentWindowHandle,
163 bool isVisible() const noexcept;
170 void setVisible(
bool visible);
201 bool isResizable() const noexcept;
209 void setResizable(
bool resizable);
214 int getOffsetX() const noexcept;
219 int getOffsetY() const noexcept;
224 Point<
int> getOffset() const noexcept;
229 void setOffsetX(
int x);
234 void setOffsetY(
int y);
239 void setOffset(
int x,
int y);
244 void setOffset(const
Point<
int>& offset);
249 uint getWidth() const noexcept;
254 uint getHeight() const noexcept;
259 Size<uint> getSize() const noexcept;
264 void setWidth(uint width);
269 void setHeight(uint height);
274 void setSize(uint width, uint height);
279 void setSize(const
Size<uint>& size);
284 const
char* getTitle() const noexcept;
291 void setTitle(const
char* title);
296 bool isIgnoringKeyRepeat() const noexcept;
301 void setIgnoringKeyRepeat(
bool ignore) noexcept;
314 const
void* getClipboard(
size_t& dataSize);
325 bool setClipboard(const
char* mimeType, const
void* data,
size_t dataSize);
334 bool setCursor(MouseCursor cursor);
348 bool addIdleCallback(
IdleCallback* callback, uint timerFrequencyInMs = 0);
376 uintptr_t getNativeWindowHandle() const noexcept;
386 double getScaleFactor() const noexcept;
393 #ifndef DGL_FILE_BROWSER_DISABLED
421 void renderToPicture(const
char* filename);
428 void runAsModal(
bool blockWait = false);
434 Size<uint> getGeometryConstraints(
bool& keepAspectRatio);
439 void setGeometryConstraints(uint minimumWidth,
441 bool keepAspectRatio = false,
442 bool automaticallyScale = false,
443 bool resizeNowIfAutoScaling = true);
451 void setTransientParent(uintptr_t transientParentWindowHandle);
454 DISTRHO_DEPRECATED_BY("isIgnoringKeyRepeat()")
455 inline
bool getIgnoringKeyRepeat() const noexcept {
return isIgnoringKeyRepeat(); }
458 DISTRHO_DEPRECATED_BY(
"getScaleFactor()")
459 inline
double getScaling() const noexcept {
return getScaleFactor(); }
462 DISTRHO_DEPRECATED_BY(
"runAsModal(bool)")
463 inline
void exec(
bool blockWait = false) { runAsModal(blockWait); }
500 virtual void onFocus(
bool focus, CrossingMode mode);
516 #ifndef DGL_FILE_BROWSER_DISABLED
525 DISTRHO_DEPRECATED_BY(
"onFileSelected(const char*)")
526 inline virtual
void fileBrowserSelected(const
char* filename) {
return onFileSelected(filename); }
530 PrivateData*
const pData;
533 #ifdef DISTRHO_NAMESPACE
534 friend class DISTRHO_NAMESPACE::PluginWindow;
539 uintptr_t parentWindowHandle,
547 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
Window)
Definition: Application.hpp:43
Definition: Geometry.hpp:41
Definition: Geometry.hpp:614
Definition: Geometry.hpp:133
Definition: Window.hpp:63
virtual void onReshape(uint width, uint height)
virtual uint32_t onClipboardDataOffer()
Window(Application &app, uintptr_t parentWindowHandle, double scaleFactor, bool resizable)
virtual void onScaleFactorChanged(double scaleFactor)
bool openFileBrowser(const DGL_NAMESPACE::FileBrowserOptions &options=FileBrowserOptions())
std::vector< ClipboardDataOffer > getClipboardDataOfferTypes()
Window(Application &app, Window &transientParentWindow)
virtual void onFocus(bool focus, CrossingMode mode)
virtual void onFileSelected(const char *filename)
Window(Application &app, uintptr_t parentWindowHandle, uint width, uint height, double scaleFactor, bool resizable)
bool isEmbed() const noexcept
#define END_NAMESPACE_DISTRHO
Definition: DistrhoInfo.hpp:834
#define START_NAMESPACE_DISTRHO
Definition: DistrhoInfo.hpp:828
Definition: FileBrowserDialogImpl.hpp:33
Definition: Window.hpp:95
ScopedGraphicsContext(Window &window)
ScopedGraphicsContext(Window &window, Window &transientParentWindow)