Drop the GDK_PRIVATE_CALL mechanism

We don't need to do this extra complication anymore, since
we're now living inside a single shared library.
This commit is contained in:
Matthias Clasen 2016-11-23 19:31:16 -05:00
parent 1af817e254
commit 3414f10bad
6 changed files with 16 additions and 75 deletions

View File

@ -121,7 +121,6 @@ gdk_private_headers = \
gdkx.h
gdk_c_sources = \
gdk-private.c \
gdk.c \
gdkapplaunchcontext.c \
gdkcairo.c \

View File

@ -1,22 +0,0 @@
#include "config.h"
#include "gdk-private.h"
GdkPrivateVTable *
gdk__private__ (void)
{
static GdkPrivateVTable table = {
gdk_device_grab_info,
gdk_display_open_default,
gdk_add_option_entries,
gdk_pre_parse,
gdk_gl_get_flags,
gdk_gl_set_flags,
gdk_window_freeze_toplevel_updates,
gdk_window_thaw_toplevel_updates,
gdk_display_get_rendering_mode,
gdk_display_set_rendering_mode,
gdk_window_move_to_rect
};
return &table;
}

View File

@ -4,8 +4,6 @@
#include <gdk/gdk.h>
#include "gdk/gdkinternals.h"
#define GDK_PRIVATE_CALL(symbol) (gdk__private__ ()->symbol)
GdkDisplay * gdk_display_open_default (void);
gboolean gdk_device_grab_info (GdkDisplay *display,
@ -35,38 +33,4 @@ void gdk_window_move_to_rect (GdkWindow *window,
gint rect_anchor_dx,
gint rect_anchor_dy);
typedef struct {
/* add all private functions here, initialize them in gdk-private.c */
gboolean (* gdk_device_grab_info) (GdkDisplay *display,
GdkDevice *device,
GdkWindow **grab_window,
gboolean *owner_events);
GdkDisplay *(* gdk_display_open_default) (void);
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);
void (* gdk_window_freeze_toplevel_updates) (GdkWindow *window);
void (* gdk_window_thaw_toplevel_updates) (GdkWindow *window);
GdkRenderingMode (* gdk_display_get_rendering_mode) (GdkDisplay *display);
void (* gdk_display_set_rendering_mode) (GdkDisplay *display,
GdkRenderingMode mode);
void (* gdk_window_move_to_rect) (GdkWindow *window,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity window_anchor,
GdkAnchorHints anchor_hints,
gint rect_anchor_dx,
gint rect_anchor_dy);
} GdkPrivateVTable;
GDK_AVAILABLE_IN_ALL
GdkPrivateVTable * gdk__private__ (void);
#endif /* __GDK__PRIVATE_H__ */

View File

@ -632,7 +632,7 @@ do_pre_parse_initialization (int *argc,
if (_gtk_module_has_mixed_deps (NULL))
g_error ("GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported");
GDK_PRIVATE_CALL (gdk_pre_parse) ();
gdk_pre_parse ();
gdk_event_handler_set ((GdkEventFunc)gtk_main_do_event, NULL, NULL);
#ifdef G_ENABLE_DEBUG
@ -775,7 +775,7 @@ post_parse_hook (GOptionContext *context,
if (info->open_default_display)
{
if (GDK_PRIVATE_CALL (gdk_display_open_default) () == NULL)
if (gdk_display_open_default () == NULL)
{
const char *display_name = gdk_get_display_arg_name ();
g_set_error (error,
@ -893,7 +893,7 @@ gtk_get_option_group (gboolean open_default_display)
group = g_option_group_new ("gtk", _("GTK+ Options"), _("Show GTK+ Options"), info, g_free);
g_option_group_set_parse_hooks (group, pre_parse_hook, post_parse_hook);
GDK_PRIVATE_CALL (gdk_add_option_entries) (group);
gdk_add_option_entries (group);
g_option_group_add_entries (group, gtk_args);
g_option_group_set_translation_domain (group, GETTEXT_PACKAGE);
@ -965,7 +965,7 @@ gtk_init_with_args (gint *argc,
return FALSE;
done:
return GDK_PRIVATE_CALL (gdk_display_open_default) () != NULL;
return gdk_display_open_default () != NULL;
}
@ -1056,7 +1056,7 @@ gtk_init_check (int *argc,
if (!gtk_parse_args (argc, argv))
return FALSE;
ret = GDK_PRIVATE_CALL (gdk_display_open_default) () != NULL;
ret = gdk_display_open_default () != NULL;
if (gtk_get_debug_flags () & GTK_DEBUG_INTERACTIVE)
gtk_window_set_interactive_debugging (TRUE);
@ -1525,7 +1525,7 @@ rewrite_event_for_grabs (GdkEvent *event)
display = gdk_window_get_display (event->any.window);
device = gdk_event_get_device (event);
if (!GDK_PRIVATE_CALL (gdk_device_grab_info) (display, device, &grab_window, &owner_events) ||
if (!gdk_device_grab_info (display, device, &grab_window, &owner_events) ||
!owner_events)
return NULL;
break;

View File

@ -4541,13 +4541,13 @@ gtk_menu_position (GtkMenu *menu,
g_signal_connect (toplevel, "moved-to-rect", G_CALLBACK (moved_to_rect_cb),
menu);
GDK_PRIVATE_CALL (gdk_window_move_to_rect) (toplevel,
&rect,
rect_anchor,
menu_anchor,
anchor_hints,
rect_anchor_dx,
rect_anchor_dy);
gdk_window_move_to_rect (toplevel,
&rect,
rect_anchor,
menu_anchor,
anchor_hints,
rect_anchor_dx,
rect_anchor_dy);
}
static void

View File

@ -6130,7 +6130,7 @@ gtk_window_unmap (GtkWidget *widget)
while (priv->configure_request_count > 0)
{
priv->configure_request_count--;
GDK_PRIVATE_CALL (gdk_window_thaw_toplevel_updates) (_gtk_widget_get_window (widget));
gdk_window_thaw_toplevel_updates (_gtk_widget_get_window (widget));
}
priv->configure_notify_received = FALSE;
@ -7444,7 +7444,7 @@ gtk_window_configure_event (GtkWidget *widget,
{
priv->configure_request_count -= 1;
GDK_PRIVATE_CALL (gdk_window_thaw_toplevel_updates) (_gtk_widget_get_window (widget));
gdk_window_thaw_toplevel_updates (_gtk_widget_get_window (widget));
}
/*
@ -9160,7 +9160,7 @@ gtk_window_move_resize (GtkWindow *window)
/* Increment the number of have-not-yet-received-notify requests */
priv->configure_request_count += 1;
GDK_PRIVATE_CALL (gdk_window_freeze_toplevel_updates) (gdk_window);
gdk_window_freeze_toplevel_updates (gdk_window);
/* for GTK_RESIZE_QUEUE toplevels, we are now awaiting a new
* configure event in response to our resizing request.