mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
Move GDK GL flags accessors to the private vtable
This allows us to use the GDK_PRIVATE_CALL macro inside gtk. https://bugzilla.gnome.org/show_bug.cgi?id=739781
This commit is contained in:
parent
eedbec2066
commit
585af218a3
@ -9,6 +9,8 @@ gdk__private__ (void)
|
||||
gdk_display_open_default,
|
||||
gdk_add_option_entries,
|
||||
gdk_pre_parse,
|
||||
gdk_gl_get_flags,
|
||||
gdk_gl_set_flags,
|
||||
};
|
||||
|
||||
return &table;
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define __GDK__PRIVATE_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include "gdk/gdkinternals.h"
|
||||
|
||||
#define GDK_PRIVATE_CALL(symbol) (gdk__private__ ()->symbol)
|
||||
|
||||
@ -16,6 +17,9 @@ void gdk_add_option_entries (GOptionGroup *group);
|
||||
|
||||
void gdk_pre_parse (void);
|
||||
|
||||
GdkGLFlags gdk_gl_get_flags (void);
|
||||
void gdk_gl_set_flags (GdkGLFlags flags);
|
||||
|
||||
typedef struct {
|
||||
/* add all private functions here, initialize them in gdk-private.c */
|
||||
gboolean (* gdk_device_grab_info) (GdkDisplay *display,
|
||||
@ -27,6 +31,8 @@ typedef struct {
|
||||
|
||||
void (* gdk_add_option_entries) (GOptionGroup *group);
|
||||
void (* gdk_pre_parse) (void);
|
||||
GdkGLFlags (* gdk_gl_get_flags) (void);
|
||||
void (* gdk_gl_set_flags) (GdkGLFlags flags);
|
||||
} GdkPrivateVTable;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
@ -75,6 +75,7 @@
|
||||
#include "gdkinternals.h"
|
||||
|
||||
#include "gdkintl.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
|
@ -109,12 +109,6 @@ extern guint _gdk_debug_flags;
|
||||
extern guint _gdk_gl_flags;
|
||||
extern GdkRenderingMode _gdk_rendering_mode;
|
||||
|
||||
/* export these so we can use them from the inspector */
|
||||
_GDK_EXTERN
|
||||
GdkGLFlags gdk_gl_get_flags (void);
|
||||
_GDK_EXTERN
|
||||
void gdk_gl_set_flags (GdkGLFlags flags);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
#define GDK_NOTE(type,action) G_STMT_START { \
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "gdkframeclockidle.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
#include "gdkglcontextprivate.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "x11/gdkx.h"
|
||||
#endif
|
||||
|
||||
#include "gdk/gdkinternals.h"
|
||||
#include "gdk/gdk-private.h"
|
||||
|
||||
struct _GtkInspectorVisualPrivate
|
||||
{
|
||||
@ -492,7 +492,7 @@ init_gl (GtkInspectorVisual *vis)
|
||||
{
|
||||
GdkGLFlags flags;
|
||||
|
||||
flags = gdk_gl_get_flags ();
|
||||
flags = GDK_PRIVATE_CALL (gdk_gl_get_flags) ();
|
||||
|
||||
if (flags & GDK_GL_ALWAYS)
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (vis->priv->gl_combo), "always");
|
||||
@ -528,14 +528,14 @@ update_gl_flag (GtkSwitch *sw,
|
||||
{
|
||||
GdkGLFlags flags;
|
||||
|
||||
flags = gdk_gl_get_flags ();
|
||||
flags = GDK_PRIVATE_CALL (gdk_gl_get_flags) ();
|
||||
|
||||
if (gtk_switch_get_active (sw))
|
||||
flags |= flag;
|
||||
else
|
||||
flags &= ~flag;
|
||||
|
||||
gdk_gl_set_flags (flags);
|
||||
GDK_PRIVATE_CALL (gdk_gl_set_flags) (flags);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user