comparison DPF-Prymula-audioplugins/dpf/dgl/src/pugl.hpp @ 3:84e66ea83026

DPF-Prymula-audioplugins-0.231015-2
author prymula <prymula76@outlook.com>
date Mon, 16 Oct 2023 21:53:34 +0200
parents
children
comparison
equal deleted inserted replaced
2:cf2cb71d31dd 3:84e66ea83026
1 /*
2 * DISTRHO Plugin Framework (DPF)
3 * Copyright (C) 2012-2022 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_PUGL_HPP_INCLUDED
18 #define DGL_PUGL_HPP_INCLUDED
19
20 #include "../Base.hpp"
21
22 /* we will include all header files used in pugl.h in their C++ friendly form, then pugl stuff in custom namespace */
23 #include <cstddef>
24 #ifdef DISTRHO_PROPER_CPP11_SUPPORT
25 # include <cstdbool>
26 # include <cstdint>
27 #else
28 # include <stdbool.h>
29 # include <stdint.h>
30 #endif
31
32 // hidden api
33 #define PUGL_API
34 #define PUGL_DISABLE_DEPRECATED
35 #define PUGL_NO_INCLUDE_GL_H
36 #define PUGL_NO_INCLUDE_GLU_H
37
38 #ifndef DISTRHO_OS_MAC
39 START_NAMESPACE_DGL
40 #endif
41
42 #include "pugl-upstream/include/pugl/pugl.h"
43
44 // --------------------------------------------------------------------------------------------------------------------
45
46 // DGL specific, expose backend enter
47 bool puglBackendEnter(PuglView* view);
48
49 // DGL specific, expose backend leave
50 bool puglBackendLeave(PuglView* view);
51
52 // DGL specific, assigns backend that matches current DGL build
53 void puglSetMatchingBackendForCurrentBuild(PuglView* view);
54
55 // bring view window into the foreground, aka "raise" window
56 void puglRaiseWindow(PuglView* view);
57
58 // get scale factor from parent window if possible, fallback to puglGetScaleFactor
59 double puglGetScaleFactorFromParent(const PuglView* view);
60
61 // combined puglSetSizeHint using PUGL_MIN_SIZE, PUGL_MIN_ASPECT and PUGL_MAX_ASPECT
62 PuglStatus puglSetGeometryConstraints(PuglView* view, uint width, uint height, bool aspect);
63
64 // set view as resizable (or not) during runtime
65 void puglSetResizable(PuglView* view, bool resizable);
66
67 // set window size while also changing default
68 PuglStatus puglSetSizeAndDefault(PuglView* view, uint width, uint height);
69
70 // DGL specific, build-specific drawing prepare
71 void puglOnDisplayPrepare(PuglView* view);
72
73 // DGL specific, build-specific fallback resize
74 void puglFallbackOnResize(PuglView* view);
75
76 #if defined(DISTRHO_OS_HAIKU)
77
78 // nothing here yet
79
80 #elif defined(DISTRHO_OS_MAC)
81
82 // macOS specific, add another view's window as child
83 PuglStatus puglMacOSAddChildWindow(PuglView* view, PuglView* child);
84
85 // macOS specific, remove another view's window as child
86 PuglStatus puglMacOSRemoveChildWindow(PuglView* view, PuglView* child);
87
88 // macOS specific, center view based on parent coordinates (if there is one)
89 void puglMacOSShowCentered(PuglView* view);
90
91 #elif defined(DISTRHO_OS_WASM)
92
93 // nothing here yet
94
95 #elif defined(DISTRHO_OS_WINDOWS)
96
97 // win32 specific, call ShowWindow with SW_RESTORE
98 void puglWin32RestoreWindow(PuglView* view);
99
100 // win32 specific, center view based on parent coordinates (if there is one)
101 void puglWin32ShowCentered(PuglView* view);
102
103 #elif defined(HAVE_X11)
104
105 #define DGL_USING_X11
106
107 // X11 specific, update world without triggering exposure evente
108 PuglStatus puglX11UpdateWithoutExposures(PuglWorld* world);
109
110 // X11 specific, set dialog window type and pid hints
111 void puglX11SetWindowTypeAndPID(const PuglView* view, bool isStandalone);
112
113 #endif
114
115 // --------------------------------------------------------------------------------------------------------------------
116
117 #ifndef DISTRHO_OS_MAC
118 END_NAMESPACE_DGL
119 #endif
120
121 #endif // DGL_PUGL_HPP_INCLUDED