2020-08-14 01:47:54 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
|
|
|
* Copyright (C) 2020 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2023-03-31 19:11:10 +00:00
|
|
|
#pragma once
|
2020-08-14 01:47:54 +00:00
|
|
|
|
2021-09-24 18:35:48 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include "gdktypes.h"
|
2022-09-23 00:47:09 +00:00
|
|
|
#include <glib/gstdio.h>
|
2020-08-14 01:47:54 +00:00
|
|
|
|
2021-09-24 18:35:48 +00:00
|
|
|
G_BEGIN_DECLS
|
2020-08-14 01:47:54 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
GDK_DEBUG_MISC = 1 << 0,
|
|
|
|
GDK_DEBUG_EVENTS = 1 << 1,
|
|
|
|
GDK_DEBUG_DND = 1 << 2,
|
|
|
|
GDK_DEBUG_INPUT = 1 << 3,
|
|
|
|
GDK_DEBUG_EVENTLOOP = 1 << 4,
|
|
|
|
GDK_DEBUG_FRAMES = 1 << 5,
|
|
|
|
GDK_DEBUG_SETTINGS = 1 << 6,
|
|
|
|
GDK_DEBUG_OPENGL = 1 << 7,
|
|
|
|
GDK_DEBUG_VULKAN = 1 << 8,
|
|
|
|
GDK_DEBUG_SELECTION = 1 << 9,
|
|
|
|
GDK_DEBUG_CLIPBOARD = 1 << 10,
|
2023-10-15 14:34:11 +00:00
|
|
|
GDK_DEBUG_DMABUF = 1 << 11,
|
2023-10-29 03:54:33 +00:00
|
|
|
GDK_DEBUG_OFFLOAD = 1 << 12,
|
2023-10-15 14:34:11 +00:00
|
|
|
|
2020-08-14 01:47:54 +00:00
|
|
|
/* flags below are influencing behavior */
|
2024-06-28 15:41:03 +00:00
|
|
|
GDK_DEBUG_LINEAR = 1 << 13,
|
2024-07-13 12:55:22 +00:00
|
|
|
GDK_DEBUG_HDR = 1 << 14,
|
2024-07-13 12:54:47 +00:00
|
|
|
GDK_DEBUG_PORTALS = 1 << 15,
|
|
|
|
GDK_DEBUG_NO_PORTALS = 1 << 16,
|
2024-08-19 19:04:36 +00:00
|
|
|
GDK_DEBUG_GL_NO_FRACTIONAL= 1 << 17,
|
|
|
|
GDK_DEBUG_FORCE_OFFLOAD = 1 << 18,
|
|
|
|
GDK_DEBUG_GL_PREFER_GL = 1 << 19,
|
|
|
|
GDK_DEBUG_GL_DEBUG = 1 << 20,
|
|
|
|
GDK_DEBUG_DEFAULT_SETTINGS= 1 << 21,
|
|
|
|
GDK_DEBUG_HIGH_DEPTH = 1 << 22,
|
|
|
|
GDK_DEBUG_NO_VSYNC = 1 << 23,
|
2020-08-14 01:47:54 +00:00
|
|
|
} GdkDebugFlags;
|
|
|
|
|
2024-08-19 19:04:36 +00:00
|
|
|
typedef enum {
|
|
|
|
GDK_FEATURE_OPENGL = 1 << 0,
|
|
|
|
GDK_FEATURE_GL_API = 1 << 1,
|
|
|
|
GDK_FEATURE_GLES_API = 1 << 2,
|
|
|
|
GDK_FEATURE_EGL = 1 << 3,
|
|
|
|
GDK_FEATURE_GLX = 1 << 4,
|
|
|
|
GDK_FEATURE_WGL = 1 << 5,
|
|
|
|
GDK_FEATURE_VULKAN = 1 << 6,
|
|
|
|
GDK_FEATURE_DMABUF = 1 << 7,
|
2024-08-19 20:20:11 +00:00
|
|
|
GDK_FEATURE_OFFLOAD = 1 << 8,
|
2024-08-19 20:04:15 +00:00
|
|
|
GDK_FEATURE_COLOR_MANAGEMENT = 1 << 9,
|
2024-08-19 19:04:36 +00:00
|
|
|
} GdkFeatures;
|
|
|
|
|
2024-08-19 20:04:15 +00:00
|
|
|
#define GDK_ALL_FEATURES ((1 << 10) - 1)
|
2024-08-19 19:04:36 +00:00
|
|
|
|
2020-08-14 01:47:54 +00:00
|
|
|
extern guint _gdk_debug_flags;
|
|
|
|
|
|
|
|
GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display);
|
|
|
|
void gdk_display_set_debug_flags (GdkDisplay *display,
|
|
|
|
GdkDebugFlags flags);
|
|
|
|
|
2024-08-19 19:04:36 +00:00
|
|
|
gboolean gdk_has_feature (GdkFeatures feature);
|
|
|
|
|
2023-11-05 08:46:22 +00:00
|
|
|
static inline void
|
|
|
|
gdk_debug_message (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
|
|
|
static inline void
|
|
|
|
gdk_debug_message (const char *format, ...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
char *s;
|
|
|
|
|
|
|
|
va_start (args, format);
|
|
|
|
s = g_strdup_vprintf (format, args);
|
|
|
|
va_end (args);
|
2023-03-28 01:56:41 +00:00
|
|
|
#ifdef GLIB_USING_SYSTEM_PRINTF
|
2023-11-05 08:46:22 +00:00
|
|
|
fprintf (stderr, "%s\n", s);
|
2023-03-28 01:56:41 +00:00
|
|
|
#else
|
2023-11-05 08:46:22 +00:00
|
|
|
g_fprintf (stderr, "%s\n", s);
|
2023-03-28 01:56:41 +00:00
|
|
|
#endif
|
2023-11-05 08:46:22 +00:00
|
|
|
g_free (s);
|
|
|
|
}
|
2022-09-23 00:47:09 +00:00
|
|
|
|
2020-08-14 01:47:54 +00:00
|
|
|
#define GDK_DISPLAY_DEBUG_CHECK(display,type) \
|
|
|
|
G_UNLIKELY (gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
|
|
|
|
|
2022-09-23 00:47:09 +00:00
|
|
|
#define GDK_DISPLAY_DEBUG(display,type,...) \
|
2022-09-23 14:11:59 +00:00
|
|
|
G_STMT_START { \
|
2022-09-23 00:47:09 +00:00
|
|
|
if (GDK_DISPLAY_DEBUG_CHECK (display,type)) \
|
|
|
|
gdk_debug_message (__VA_ARGS__); \
|
2022-09-23 14:11:59 +00:00
|
|
|
} G_STMT_END
|
2022-09-23 00:47:09 +00:00
|
|
|
|
2020-08-14 01:47:54 +00:00
|
|
|
#define GDK_DEBUG_CHECK(type) GDK_DISPLAY_DEBUG_CHECK (NULL,type)
|
2022-09-23 00:47:09 +00:00
|
|
|
#define GDK_DEBUG(type,...) GDK_DISPLAY_DEBUG (NULL,type,__VA_ARGS__)
|
2020-08-14 01:47:54 +00:00
|
|
|
|
2022-11-17 19:01:11 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
const char *key;
|
|
|
|
guint value;
|
|
|
|
const char *help;
|
|
|
|
} GdkDebugKey;
|
|
|
|
|
|
|
|
guint gdk_parse_debug_var (const char *variable,
|
2024-08-19 20:47:38 +00:00
|
|
|
const char *docs,
|
2022-11-17 19:01:11 +00:00
|
|
|
const GdkDebugKey *keys,
|
|
|
|
guint nkeys);
|
|
|
|
|