Dusk Audio Framework
Loading...
Searching...
No Matches
Window.hpp
1/*
2 * DISTRHO Plugin Framework (DPF)
3 * Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any purpose with
6 * or without fee is hereby granted, provided that the above copyright notice and this
7 * permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
10 * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
11 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef DGL_WINDOW_HPP_INCLUDED
18#define DGL_WINDOW_HPP_INCLUDED
19
20#include "Geometry.hpp"
21
22#ifdef DGL_USE_FILE_BROWSER
23# include "FileBrowserDialog.hpp"
24#endif
25
26#ifdef DGL_USE_WEB_VIEW
27# include "WebView.hpp"
28#endif
29
30#include <vector>
31
32#ifdef DAF_NAMESPACE
34class PluginWindow;
36#endif
37
38START_NAMESPACE_DGL
39
40class Application;
41class TopLevelWidget;
42
43// -----------------------------------------------------------------------
44
45/**
46 DGL Window class.
47
48 This is the where all OS-related events initially happen, before being propagated to any widgets.
49
50 A Window MUST have an Application instance tied to it.
51 It is not possible to swap Application instances from within the lifetime of a Window.
52 But it is possible to completely change the Widgets that a Window contains during its lifetime.
53
54 Typically the event handling functions as following:
55 Application -> Window -> Top-Level-Widget -> SubWidgets
56
57 Please note that, unlike many other graphical toolkits out there,
58 DGL makes a clear distinction between a Window and a Widget.
59 You cannot directly draw in a Window, you need to create a Widget for that.
60
61 Also, a Window MUST have a single top-level Widget.
62 The Window will take care of global screen positioning and resizing, everything else is sent for widgets to handle.
63
64 ...
65 */
66class DAF_API Window
67{
68 struct PrivateData;
69
70public:
71 /**
72 Window graphics context as a scoped struct.
73 This class gives graphics context drawing time to a window's widgets.
74 Typically used for allowing OpenGL drawing operations during a window + widget constructor.
75
76 Unless you are subclassing the Window or StandaloneWindow classes, you do not need to care.
77 In such cases you will need to use this struct as a way to get a valid OpenGL context.
78 For example in a standalone application:
79 ```
80 int main()
81 {
82 Application app;
83 Window win(app);
84 ScopedPointer<MyCustomTopLevelWidget> widget;
85 {
86 const Window::ScopedGraphicsContext sgc(win);
87 widget = new MyCustomTopLevelWidget(win);
88 }
89 app.exec();
90 return 0;
91 }
92 ```
93
94 This struct is necessary because we cannot automatically make the window leave the OpenGL context in custom code.
95 And we must always cleanly enter and leave the OpenGL context.
96 So in order to avoid messing up the global host context, this class is used around widget creation.
97 */
99 {
100 /** Constructor that will make the @a window graphics context the current one.
101 If it already is, it is left current when done, so scopes can nest. */
102 explicit ScopedGraphicsContext(Window& window);
103
104 /** Overloaded constructor, gives back context to its transient parent when done */
105 explicit ScopedGraphicsContext(Window& window, Window& transientParentWindow);
106
107 /** Destructor for clearing current context, if not done yet */
109
110 /** Early context clearing, useful for standalone windows not created by you. */
111 void done();
112
113 /** Get a valid context back again. */
114 void reinit();
115
116 DAF_DECLARE_NON_COPYABLE(ScopedGraphicsContext)
117 DAF_PREVENT_HEAP_ALLOCATION
118
119 private:
120 Window& window;
121 Window::PrivateData* const ppData;
122 bool active;
123 bool reenter;
124 };
125
126 /**
127 Constructor for a regular, standalone window.
128 */
129 explicit Window(Application& app);
130
131 /**
132 Constructor for a modal window, by having another window as its transient parent.
133 The Application instance must be the same between the 2 windows.
134 */
135 explicit Window(Application& app, Window& transientParentWindow);
136
137 /**
138 Constructor for an embed Window without known size,
139 typically used in modules or plugins that run inside another host.
140 */
141 explicit Window(Application& app,
142 uintptr_t parentWindowHandle,
143 double scaleFactor,
144 bool resizable);
145
146 /**
147 Constructor for an embed Window with known size,
148 typically used in modules or plugins that run inside another host.
149 */
150 explicit Window(Application& app,
151 uintptr_t parentWindowHandle,
152 uint width,
153 uint height,
154 double scaleFactor,
155 bool resizable);
156
157 /**
158 Destructor.
159 */
160 virtual ~Window();
161
162 /**
163 Whether this Window is embed into another (usually not DGL-controlled) Window.
164 */
165 bool isEmbed() const noexcept;
166
167 /**
168 Check if this window is visible / mapped.
169 Invisible windows do not receive events except resize.
170 @see setVisible(bool)
171 */
172 bool isVisible() const noexcept;
173
174 /**
175 Set window visible (or not) according to @a visible.
176 Only valid for standalones, embed windows are always visible.
177 @see isVisible(), hide(), show()
178 */
179 void setVisible(bool visible);
180
181 /**
182 Show window.
183 This is the same as calling setVisible(true).
184 @see isVisible(), setVisible(bool)
185 */
186 void show();
187
188 /**
189 Hide window.
190 This is the same as calling setVisible(false).
191 @see isVisible(), setVisible(bool)
192 */
193 void hide();
194
195 /**
196 Hide window and notify application of a window close event.
197 The application event-loop will stop when all windows have been closed.
198 For standalone windows only, has no effect if window is embed.
199 @see isEmbed()
200
201 @note It is possible to hide the window while not stopping the event-loop.
202 A closed window is always hidden, but the reverse is not always true.
203 */
204 void close();
205
206 /**
207 Check if this window is resizable (by the user or window manager).
208 @see setResizable
209 */
210 bool isResizable() const noexcept;
211
212 /**
213 Set window as resizable (by the user or window manager).
214 It is always possible to resize a window programmatically, which is not the same as the user being allowed to it.
215 @note This function does nothing for plugins, where the resizable state is set via macro.
216 @see DAF_UI_USER_RESIZABLE
217 */
218 void setResizable(bool resizable);
219
220 /**
221 Get X offset, typically 0.
222 */
223 int getOffsetX() const noexcept;
224
225 /**
226 Get Y offset, typically 0.
227 */
228 int getOffsetY() const noexcept;
229
230 /**
231 Get offset.
232 */
233 Point<int> getOffset() const noexcept;
234
235 /**
236 Set X offset.
237 */
238 void setOffsetX(int x);
239
240 /**
241 Set Y offset.
242 */
243 void setOffsetY(int y);
244
245 /**
246 Set offset using @a x and @a y values.
247 */
248 void setOffset(int x, int y);
249
250 /**
251 Set offset.
252 */
253 void setOffset(const Point<int>& offset);
254
255 /**
256 Set the offset of an embedded window relative to its parent.
257
258 Embedded windows are normally positioned by their host, so the regular
259 setOffset methods intentionally ignore them. This explicit variant is
260 for hosts that own both the parent and embedded child window.
261
262 @return Whether the platform accepted the position change.
263 @see isEmbed()
264 */
265 bool setEmbeddedOffset(int x, int y);
266
267 /**
268 Get width.
269 */
270 uint getWidth() const noexcept;
271
272 /**
273 Get height.
274 */
275 uint getHeight() const noexcept;
276
277 /**
278 Get size.
279 */
280 Size<uint> getSize() const noexcept;
281
282 /**
283 Set width.
284 */
285 void setWidth(uint width);
286
287 /**
288 Set height.
289 */
290 void setHeight(uint height);
291
292 /**
293 Set size using @a width and @a height values.
294 */
295 void setSize(uint width, uint height);
296
297 /**
298 Set size.
299 */
300 void setSize(const Size<uint>& size);
301
302 /**
303 Get the title of the window previously set with setTitle().
304 */
305 const char* getTitle() const noexcept;
306
307 /**
308 Set the title of the window, typically displayed in the title bar or in window switchers.
309
310 This only makes sense for non-embedded windows.
311 */
312 void setTitle(const char* title);
313
314 /**
315 Check if key repeat events are ignored.
316 */
317 bool isIgnoringKeyRepeat() const noexcept;
318
319 /**
320 Set to ignore (or not) key repeat events according to @a ignore.
321 */
322 void setIgnoringKeyRepeat(bool ignore) noexcept;
323
324 /**
325 Get the clipboard contents.
326
327 This gets the system clipboard contents,
328 which may have been set with setClipboard() or copied from another application.
329
330 Returns the clipboard contents, or null.
331
332 @note By default only "text/plain" mimetype is supported and returned.
333 Override onClipboardDataOffer for supporting other types.
334 */
335 const void* getClipboard(size_t& dataSize);
336
337 /**
338 Set the clipboard contents.
339
340 This sets the system clipboard contents,
341 which can be retrieved with getClipboard() or pasted into other applications.
342
343 If using a string, the use of a null terminator is required (and must be part of dataSize).@n
344 The MIME type of the data "text/plain" is assumed if null is used.
345 */
346 bool setClipboard(const char* mimeType, const void* data, size_t dataSize);
347
348 /**
349 Start an outgoing copy-only drag of one existing file, from a primary mouse gesture.
350 The UTF-8 path must identify an absolute file path. Call on the UI thread.
351 Native delivery starts outside drawing, on a subsequent idle call. A true result means
352 the operation was accepted, not that a destination has accepted the file.
353 Keep the file available for asynchronous destination reads, including after this Window closes.
354 The Window cancels its drag on destruction. Supported on Windows, macOS and X11.
355 Returns false for an invalid file/gesture, an active drag, or an unsupported backend.
356 */
357 bool startFileDrag(const char* filename);
358
359 /**
360 A drag of files from another application over this window, see setAcceptingFileDrops().
361 Valid during the call it is passed to.
362 */
364 /** Pointer position, in the coordinates the window's top-level widgets get mouse events in. */
366 /** The files: numFiles absolute local paths, UTF-8 and NUL-terminated, at least one. */
367 const char* const* files;
368 uint numFiles;
369 /** Keyboard modifiers held, as far as the platform can tell. @see Modifier
370 X11 asks the server, Wayland knows them only while one of the application's windows has the
371 keyboard focus, and a drag that started in a Wayland client hides them from an XWayland window.
372 macOS reads the keys held. */
373 uint mod;
374 /** Event timestamp in milliseconds (if any). */
375 uint time;
376
377 /** Constructor for default/null values */
378 FileDropEvent() noexcept : pos(), files(nullptr), numFiles(0), mod(0x0), time(0) {}
379 };
380
381 /**
382 Whether this window receives files dragged onto it from other applications.
383 @see setAcceptingFileDrops(bool)
384 */
385 bool isAcceptingFileDrops() const noexcept;
386
387 /**
388 Let this window receive files dragged onto it from other applications, such as a file manager.
389 The window then gets onFileDragEnter(), onFileDragMove(), and onFileDragLeave() or onFileDrop().
390
391 Only a window of its own can take drops: this fails for an embedded window, and on platforms
392 without support (for now everything but X11, Wayland, macOS and Windows). On Windows it also
393 fails on a thread in COM's multi-threaded apartment, where OLE cannot deliver drops.
394 Turning it off always succeeds, and ends a drag in progress with onFileDragLeave() when the window
395 had the enter.
396 A window that never asks behaves exactly as before.
397 @see isAcceptingFileDrops()
398 */
399 bool setAcceptingFileDrops(bool accept);
400
401 /**
402 Set the mouse cursor.
403
404 This changes the system cursor that is displayed when the pointer is inside the window.
405 May fail if setting the cursor is not supported on this system,
406 for example if compiled on X11 without Xcursor support.
407 */
408 bool setCursor(MouseCursor cursor);
409
410 /**
411 Add a callback function to be triggered on every idle cycle or on a specific timer frequency.
412 You can add more than one, and remove them at anytime with removeIdleCallback().
413 This can be used to perform some action at a regular interval with relatively low frequency.
414
415 If providing a timer frequency, there are a few things to note:
416 1. There is a platform-specific limit to the number of supported timers, and overhead associated with each,
417 so you should create only a few timers and perform several tasks in one if necessary.
418 2. This timer frequency is not guaranteed to have a resolution better than 10ms
419 (the maximum timer resolution on Windows) and may be rounded up if it is too short.
420 On X11 and MacOS, a resolution of about 1ms can usually be relied on.
421
422 The callback is not owned or tracked beyond this, so it MUST be removed with removeIdleCallback()
423 before the callback object is destroyed, and while this window still exists.
424 A callback without a timer frequency is registered on the Application rather than on this window,
425 and destroying the window does not remove it, so a forgotten one is called through a dangling pointer.
426 */
427 bool addIdleCallback(IdleCallback* callback, uint timerFrequencyInMs = 0);
428
429 /**
430 Remove an idle callback previously added via addIdleCallback().
431 */
433
434 /**
435 Get the application associated with this window.
436 */
437 Application& getApp() const noexcept;
438
439 /**
440 Get the graphics context associated with this window.
441 GraphicsContext is an empty struct and needs to be casted into a different type in order to be usable,
442 for example GraphicsContext.
443 @see CairoSubWidget, CairoTopLevelWidget
444 */
445 const GraphicsContext& getGraphicsContext() const noexcept;
446
447 /**
448 Get the "native" window handle.
449 Returned value depends on the platform:
450 - HaikuOS: This is a pointer to a `BView`.
451 - MacOS: This is a pointer to an `NSView*`.
452 - Windows: This is a `HWND`.
453 - Everything else: This is an [X11] `Window`.
454 */
455 uintptr_t getNativeWindowHandle() const noexcept;
456
457 /**
458 Get this window's handle in the form xdg-desktop-portal expects for a dialog's parent,
459 so that a portal file chooser opens on top of it instead of floating free.
460 On X11 that is "x11:" and the window id, on Wayland "wayland:" and an xdg-foreign handle.
461
462 Returns an empty string when there is nothing to give: on platforms with no portals, and on
463 a Wayland compositor that has not answered with a handle (or does not implement xdg-foreign).
464 The returned string belongs to the window and is valid until the next call.
465 */
466 const char* getPortalParentHandle() const noexcept;
467
468 /**
469 Get the scale factor requested for this window.
470 This is purely informational, and up to developers to choose what to do with it.
471
472 If you do not want to deal with this yourself,
473 consider using setGeometryConstraints() where you can specify to automatically scale the window contents.
474 @see setGeometryConstraints
475 */
476 double getScaleFactor() const noexcept;
477
478 /**
479 Grab the keyboard input focus.
480 */
481 void focus();
482
483 /**
484 Whether any visible widget of this window wants the keyboard focus.
485 This asks Widget::wantsKeyboardFocus() of every visible top-level widget and, recursively,
486 of their visible subwidgets. A hidden widget hides its whole subtree.
487 */
489
490 #ifdef DGL_USE_FILE_BROWSER
491 /**
492 Open a file browser dialog with this window as transient parent.
493 A few options can be specified to setup the dialog.
494
495 If a path is selected, onFileSelected() will be called with the user chosen path.
496 If the user cancels or does not pick a file, onFileSelected() will be called with nullptr as filename.
497
498 This function does not block the event loop.
499 */
500 bool openFileBrowser(const DGL_NAMESPACE::FileBrowserOptions& options = FileBrowserOptions());
501 #endif
502
503 #ifdef DGL_USE_WEB_VIEW
504 /**
505 Create a new web view.
506
507 The web view will be added on top of this window.
508 This means it will draw on top of whatever is below it,
509 something to take into consideration if mixing regular widgets with web views.
510
511 Provided metrics in @p options must have scale factor pre-applied.
512
513 @p url: The URL to open, assumed to be in encoded form (e.g spaces converted to %20)
514 @p options: Extra options, optional
515 */
516 bool createWebView(const char* url, const DGL_NAMESPACE::WebViewOptions& options = WebViewOptions());
517
518 /**
519 Evaluate/run JavaScript on the web view.
520 */
521 void evaluateJS(const char* js);
522 #endif
523
524 /**
525 Request repaint of this window, for the entire area.
526 */
527 void repaint() noexcept;
528
529 /**
530 Request partial repaint of this window, with bounds according to @a rect.
531 */
532 void repaint(const Rectangle<uint>& rect) noexcept;
533
534 /**
535 Render this window's content into a picture file, specified by @a filename.
536 Window must be visible and on screen.
537 Written picture format is PPM.
538 */
539 void renderToPicture(const char* filename);
540
541 /**
542 Run this window as a modal, blocking input events from the parent.
543 Only valid for windows that have been created with another window as parent (as passed in the constructor).
544 Can optionally block-wait, but such option is only available if the application is running as standalone.
545 */
546 void runAsModal(bool blockWait = false);
547
548 /**
549 Get the geometry constraints set for the Window.
550 @see setGeometryConstraints
551 */
552 Size<uint> getGeometryConstraints(bool& keepAspectRatio);
553
554 /**
555 Set geometry constraints for the Window when resized by the user, and optionally scale contents automatically.
556
557 The minimum size is given unscaled: with @a automaticallyScale the constraint handed to the
558 windowing system is the minimum multiplied by the window scale factor.
559
560 @a resizeNowIfAutoScaling additionally resizes the window to that scaled minimum as
561 auto-scaling is switched on. It is ignored once the Window is already auto-scaling, so a
562 later call cannot pull a user-resized window back down to its minimum.
563 */
564 void setGeometryConstraints(uint minimumWidth,
565 uint minimumHeight,
566 bool keepAspectRatio = false,
567 bool automaticallyScale = false,
568 bool resizeNowIfAutoScaling = true);
569
570 /**
571 Set the transient parent of the window.
572
573 Set this for transient children like dialogs, to have them properly associated with their parent window.
574 This should be not be called for embed windows, or after making the window visible.
575 */
576 void setTransientParent(uintptr_t transientParentWindowHandle);
577
578 /** DEPRECATED Use isIgnoringKeyRepeat(). */
579 DAF_DEPRECATED_BY("isIgnoringKeyRepeat()")
580 inline bool getIgnoringKeyRepeat() const noexcept { return isIgnoringKeyRepeat(); }
581
582 /** DEPRECATED Use getScaleFactor(). */
583 DAF_DEPRECATED_BY("getScaleFactor()")
584 inline double getScaling() const noexcept { return getScaleFactor(); }
585
586 /** DEPRECATED Use runAsModal(bool). */
587 DAF_DEPRECATED_BY("runAsModal(bool)")
588 inline void exec(bool blockWait = false) { runAsModal(blockWait); }
589
590protected:
591 /**
592 Get the types available for the data in a clipboard.
593 Must only be called within the context of onClipboardDataOffer.
594 */
595 std::vector<ClipboardDataOffer> getClipboardDataOfferTypes();
596
597 /**
598 A function called when clipboard has data present, possibly with several datatypes.
599 While handling this event, the data types can be investigated with getClipboardDataOfferTypes() to decide whether to accept the offer.
600
601 Reimplement and return a non-zero id to accept the clipboard data offer for a particular type.
602 Applications must ignore any type they do not recognize.
603
604 The default implementation accepts the "text/plain" mimetype.
605 */
606 virtual uint32_t onClipboardDataOffer();
607
608 /**
609 A function called when files dragged from another application first come over this window,
610 once their list is known. Return whether the window would take them if dropped at @a ev.pos.
611 The answer shows as the platform's drag feedback. The source is only ever told of a copy.
612
613 Called on the event thread, like every other window callback, and only for a window that accepts
614 file drops. Keep it short: the window may be closed or deleted from here, but must not block.
615 The default implementation refuses.
616 @see setAcceptingFileDrops(bool)
617 */
618 virtual bool onFileDragEnter(const FileDropEvent& ev);
619
620 /**
621 A function called when the files dragged over this window move.
622 Return whether they would be taken if dropped at @a ev.pos.
623 The default implementation answers what onFileDragEnter() answered.
624 */
625 virtual bool onFileDragMove(const FileDropEvent& ev);
626
627 /**
628 A function called when the drag left this window, or ended without a drop on it.
629 Comes only after onFileDragEnter(), and never after onFileDrop().
630 The default implementation does nothing.
631 */
632 virtual void onFileDragLeave();
633
634 /**
635 A function called when the files are dropped, at a position the last answer accepted.
636 Return whether the files were taken. To act on them at length, remember the paths and do it on
637 the next idle: on some platforms the source waits for this call to return.
638 The default implementation refuses.
639 */
640 virtual bool onFileDrop(const FileDropEvent& ev);
641
642 /**
643 A function called when the window is attempted to be closed.
644 Returning true closes the window, which is the default behaviour.
645 Override this method and return false to prevent the window from being closed by the user.
646
647 This method is not used for embed windows, and not even made available in DAF_NAMESPACE::UI.
648 For embed windows, closing is handled by the host/parent process and we have no control over it.
649 As such, a close action on embed windows will always succeed and cannot be cancelled.
650
651 NOTE: This currently does not work under macOS.
652 */
653 virtual bool onClose();
654
655 /**
656 A function called when the window gains or loses the keyboard focus.
657 The default implementation does nothing.
658 */
659 virtual void onFocus(bool focus, CrossingMode mode);
660
661 /**
662 A function called when the window is resized.
663 Called from the drawing path, with the graphics context current, before the first draw that
664 follows the resize. If there is a top-level widget associated with this window, its size has
665 already been set by the time this runs.
666 The default implementation sets up drawing context where necessary.
667 */
668 virtual void onReshape(uint width, uint height);
669
670 /**
671 A function called when scale factor requested for this window changes.
672 The default implementation does nothing.
673 WARNING function needs a proper name
674 */
675 virtual void onScaleFactorChanged(double scaleFactor);
676
677 #ifdef DGL_USE_FILE_BROWSER
678 /**
679 A function called when a path is selected by the user, as triggered by openFileBrowser().
680 This action happens after the user confirms the action, so the file browser dialog will be closed at this point.
681 The default implementation does nothing.
682 */
683 virtual void onFileSelected(const char* filename);
684
685 /** DEPRECATED Use onFileSelected(). */
686 DAF_DEPRECATED_BY("onFileSelected(const char*)")
687 inline virtual void fileBrowserSelected(const char* filename) { return onFileSelected(filename); }
688 #endif
689
690private:
691 PrivateData* const pData;
692 friend class Application;
693 friend class TopLevelWidget;
694 #ifdef DAF_NAMESPACE
695 friend class DAF_NAMESPACE::PluginWindow;
696 #endif
697
698 /** @internal */
699 explicit Window(Application& app,
700 uintptr_t parentWindowHandle,
701 uint width,
702 uint height,
703 double scaleFactor,
704 bool resizable,
705 bool usesScheduledRepaints,
706 bool usesSizeRequest,
707 bool doPostInit);
708
709 DAF_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window)
710};
711
712// -----------------------------------------------------------------------
713
714END_NAMESPACE_DGL
715
716#endif // DGL_WINDOW_HPP_INCLUDED
Definition Application.hpp:90
Definition Geometry.hpp:41
Definition Geometry.hpp:612
Definition Geometry.hpp:133
Definition TopLevelWidget.hpp:47
Definition Window.hpp:67
void runAsModal(bool blockWait=false)
uintptr_t getNativeWindowHandle() const noexcept
void focus()
virtual void onReshape(uint width, uint height)
virtual uint32_t onClipboardDataOffer()
bool getIgnoringKeyRepeat() const noexcept
Definition Window.hpp:580
const char * getTitle() const noexcept
virtual bool onFileDrop(const FileDropEvent &ev)
void setResizable(bool resizable)
void setVisible(bool visible)
void setHeight(uint height)
bool isResizable() const noexcept
int getOffsetX() const noexcept
Size< uint > getGeometryConstraints(bool &keepAspectRatio)
Window(Application &app, uintptr_t parentWindowHandle, double scaleFactor, bool resizable)
Window(Application &app)
virtual void onScaleFactorChanged(double scaleFactor)
void close()
Point< int > getOffset() const noexcept
void setIgnoringKeyRepeat(bool ignore) noexcept
void hide()
bool startFileDrag(const char *filename)
void setOffsetX(int x)
virtual bool onFileDragMove(const FileDropEvent &ev)
virtual bool onFileDragEnter(const FileDropEvent &ev)
bool setAcceptingFileDrops(bool accept)
bool removeIdleCallback(IdleCallback *callback)
uint getHeight() const noexcept
void setOffset(int x, int y)
virtual ~Window()
Window(Application &app, Window &transientParentWindow)
virtual void onFileDragLeave()
bool isVisible() const noexcept
std::vector< ClipboardDataOffer > getClipboardDataOfferTypes()
bool setEmbeddedOffset(int x, int y)
Application & getApp() const noexcept
void repaint() noexcept
virtual void onFocus(bool focus, CrossingMode mode)
double getScaleFactor() const noexcept
bool anyWidgetWantsKeyboardFocus()
bool setClipboard(const char *mimeType, const void *data, size_t dataSize)
void setSize(uint width, uint height)
void show()
int getOffsetY() const noexcept
const void * getClipboard(size_t &dataSize)
virtual bool onClose()
double getScaling() const noexcept
Definition Window.hpp:584
void setGeometryConstraints(uint minimumWidth, uint minimumHeight, bool keepAspectRatio=false, bool automaticallyScale=false, bool resizeNowIfAutoScaling=true)
bool setCursor(MouseCursor cursor)
uint getWidth() const noexcept
void setTitle(const char *title)
void setTransientParent(uintptr_t transientParentWindowHandle)
bool isIgnoringKeyRepeat() const noexcept
void renderToPicture(const char *filename)
void setOffsetY(int y)
const GraphicsContext & getGraphicsContext() const noexcept
void setWidth(uint width)
bool addIdleCallback(IdleCallback *callback, uint timerFrequencyInMs=0)
const char * getPortalParentHandle() const noexcept
Window(Application &app, uintptr_t parentWindowHandle, uint width, uint height, double scaleFactor, bool resizable)
void exec(bool blockWait=false)
Definition Window.hpp:588
bool isAcceptingFileDrops() const noexcept
Size< uint > getSize() const noexcept
bool isEmbed() const noexcept
#define END_NAMESPACE_DAF
Definition DafInfo.hpp:996
#define START_NAMESPACE_DAF
Definition DafInfo.hpp:990
FileBrowserOptions()
Definition FileBrowserDialogImpl.hpp:85
Definition Base.hpp:287
Definition Base.hpp:293
WebViewOptions()
Definition WebViewImpl.hpp:64
Definition Window.hpp:363
FileDropEvent() noexcept
Definition Window.hpp:378
uint mod
Definition Window.hpp:373
uint time
Definition Window.hpp:375
Point< double > pos
Definition Window.hpp:365
const char *const * files
Definition Window.hpp:367
ScopedGraphicsContext(Window &window)
ScopedGraphicsContext(Window &window, Window &transientParentWindow)