1 | /* GDK - The GIMP Drawing Kit |
2 | * Copyright (C) 2020 Red Hat, Inc. |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
16 | */ |
17 | |
18 | #ifndef __GDK_DEBUG_H__ |
19 | #define __GDK_DEBUG_H__ |
20 | |
21 | #include <glib.h> |
22 | |
23 | #include "gdktypes.h" |
24 | |
25 | G_BEGIN_DECLS |
26 | |
27 | typedef enum { |
28 | GDK_DEBUG_MISC = 1 << 0, |
29 | GDK_DEBUG_EVENTS = 1 << 1, |
30 | GDK_DEBUG_DND = 1 << 2, |
31 | GDK_DEBUG_INPUT = 1 << 3, |
32 | GDK_DEBUG_EVENTLOOP = 1 << 4, |
33 | GDK_DEBUG_FRAMES = 1 << 5, |
34 | GDK_DEBUG_SETTINGS = 1 << 6, |
35 | GDK_DEBUG_OPENGL = 1 << 7, |
36 | GDK_DEBUG_VULKAN = 1 << 8, |
37 | GDK_DEBUG_SELECTION = 1 << 9, |
38 | GDK_DEBUG_CLIPBOARD = 1 << 10, |
39 | /* flags below are influencing behavior */ |
40 | GDK_DEBUG_NOGRABS = 1 << 11, |
41 | GDK_DEBUG_GL_DISABLE = 1 << 12, |
42 | GDK_DEBUG_GL_SOFTWARE = 1 << 13, |
43 | GDK_DEBUG_GL_TEXTURE_RECT = 1 << 14, |
44 | GDK_DEBUG_GL_LEGACY = 1 << 15, |
45 | GDK_DEBUG_GL_GLES = 1 << 16, |
46 | GDK_DEBUG_GL_DEBUG = 1 << 17, |
47 | GDK_DEBUG_GL_EGL = 1 << 18, |
48 | GDK_DEBUG_GL_GLX = 1 << 19, |
49 | GDK_DEBUG_GL_WGL = 1 << 20, |
50 | GDK_DEBUG_VULKAN_DISABLE = 1 << 21, |
51 | GDK_DEBUG_VULKAN_VALIDATE = 1 << 22, |
52 | GDK_DEBUG_DEFAULT_SETTINGS= 1 << 23, |
53 | GDK_DEBUG_HIGH_DEPTH = 1 << 24, |
54 | } GdkDebugFlags; |
55 | |
56 | extern guint _gdk_debug_flags; |
57 | |
58 | GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display); |
59 | void gdk_display_set_debug_flags (GdkDisplay *display, |
60 | GdkDebugFlags flags); |
61 | |
62 | #ifdef G_ENABLE_DEBUG |
63 | |
64 | #define GDK_DISPLAY_DEBUG_CHECK(display,type) \ |
65 | G_UNLIKELY (gdk_display_get_debug_flags (display) & GDK_DEBUG_##type) |
66 | #define GDK_DISPLAY_NOTE(display,type,action) G_STMT_START { \ |
67 | if (GDK_DISPLAY_DEBUG_CHECK (display,type)) \ |
68 | { action; }; } G_STMT_END |
69 | |
70 | #else /* !G_ENABLE_DEBUG */ |
71 | |
72 | #define GDK_DISPLAY_DEBUG_CHECK(display,type) 0 |
73 | #define GDK_DISPLAY_NOTE(display,type,action) |
74 | |
75 | #endif /* G_ENABLE_DEBUG */ |
76 | |
77 | #define GDK_DEBUG_CHECK(type) GDK_DISPLAY_DEBUG_CHECK (NULL,type) |
78 | #define GDK_NOTE(type,action) GDK_DISPLAY_NOTE (NULL,type,action) |
79 | |
80 | #endif |
81 | |