Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
gtk_wrapper.h
1// SPDX-FileCopyrightText: © 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __GTK_WRAPPER_H__
5#define __GTK_WRAPPER_H__
6
7#include "zrythm-config.h"
8
9// NOLINTBEGIN
10
11#include <QtGui>
12#include <QtWidgets>
13
14#include <glibmm.h>
15
16#ifdef __GNUC__
17# pragma GCC diagnostic push
18# pragma GCC diagnostic ignored "-Wredundant-decls"
19#endif
20
21#include <giomm.h>
22
23#ifdef __GNUC__
24# pragma GCC diagnostic pop
25#endif
26
27G_GNUC_BEGIN_IGNORE_DEPRECATIONS
28// #include <gtk/gtk.h>
29G_GNUC_END_IGNORE_DEPRECATIONS
30
31#if HAVE_X11
32/* hack to drop dumb typedefs and macros defined by X11 in the public namespace */
33# define Region RegionForX11
34# define None NoneForX11
35# define Status StatusForX11
36# define DestroyNotify DestroyNotifyForX11
37# define Color ColorForX11
38# define Time TimeForX11
39# define Bool BoolForX11
40// # include <gdk/x11/gdkx.h>
41# undef Region
42# undef None
43# undef Status
44# undef DestroyNotify
45# undef Color
46# undef Time
47# undef Bool
48#endif
49
50/* another hack for dumb macros by Windows */
51#ifdef IN
52# define WINDOWS_MACRO_IN_DEFINED
53# undef IN
54#endif
55#ifdef OUT
56# define WINDOWS_MACRO_OUT_DEFINED
57# undef OUT
58#endif
59#ifdef UNICODE
60# define WINDOWS_MACRO_UNICODE_DEFINED
61# undef UNICODE
62#endif
63#ifdef WINDING
64# define WINDOWS_WINDING WINDING
65# undef WINDING
66#endif
67#ifdef IGNORE
68# define WINDOWS_IGNORE IGNORE
69# undef IGNORE
70#endif
71#ifdef near
72# undef near
73#endif
74#ifdef NEAR
75# define WINDOWS_NEAR_DEFINED
76# undef NEAR
77/* we need NEAR to be defined. by default it's defined as `near`, but we don't
78 * want `near` to be defined (because it's used by graphene), so we define NEAR
79 * to be empty (`near` was empty too anyway) */
80# define NEAR
81#endif
82
83// #include <gtkmm.h>
84
85#ifdef WINDOWS_MACRO_IN_DEFINED
86# define IN
87# undef WINDOWS_MACRO_IN_DEFINED
88#endif
89#ifdef WINDOWS_MACRO_OUT_DEFINED
90# define OUT
91# undef WINDOWS_MACRO_OUT_DEFINED
92#endif
93#ifdef WINDOWS_MACRO_UNICODE_DEFINED
94# define UNICODE
95# undef WINDOWS_MACRO_UNICODE_DEFINED
96#endif
97#ifdef WINDOWS_WINDING
98# define WINDING WINDOWS_WINDING
99# undef WINDOWS_WINDING
100#endif
101#ifdef WINDOWS_IGNORE
102# define IGNORE WINDOWS_IGNORE
103# undef WINDOWS_IGNORE
104#endif
105
106#ifdef _WIN32
107// # include <gdk/win32/gdkwin32.h>
108#endif
109
110// NOLINTEND
111
112#endif // __GTK_WRAPPER_H__