[gtk/wip/matthiasc/popup5: 12/89] window: Implement GtkNative
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup5: 12/89] window: Implement GtkNative
- Date: Thu, 2 May 2019 21:54:15 +0000 (UTC)
commit df3025e8da2eac20fff9a5eb02d487e757457fb0
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Apr 29 05:44:57 2019 +0000
window: Implement GtkNative
Adapt GtkWindow to implement both GtkRoot and GtkNative.
gtk/gtkwindow.c | 38 +++++++++++++++++++++++++++-----------
1 file changed, 27 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index de59910b0c..5693dc1790 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -62,6 +62,7 @@
#include "gtkpopoverprivate.h"
#include "gtkprivate.h"
#include "gtkroot.h"
+#include "gtknative.h"
#include "gtkseparatormenuitem.h"
#include "gtksettings.h"
#include "gtksnapshot.h"
@@ -549,7 +550,8 @@ static void gtk_window_buildable_custom_finished (GtkBuildable *buildable,
gpointer user_data);
/* GtkRoot */
-static void gtk_window_root_interface_init (GtkRootInterface *iface);
+static void gtk_window_root_interface_init (GtkRootInterface *iface);
+static void gtk_window_native_interface_init (GtkNativeInterface *iface);
static void ensure_state_flag_backdrop (GtkWidget *widget);
static void unset_titlebar (GtkWindow *window);
@@ -566,6 +568,8 @@ G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_BIN,
G_ADD_PRIVATE (GtkWindow)
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
gtk_window_buildable_interface_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_NATIVE,
+ gtk_window_native_interface_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_ROOT,
gtk_window_root_interface_init))
@@ -2351,21 +2355,27 @@ gtk_window_root_get_display (GtkRoot *root)
return priv->display;
}
+static void
+gtk_window_root_interface_init (GtkRootInterface *iface)
+{
+ iface->get_display = gtk_window_root_get_display;
+}
+
static GskRenderer *
-gtk_window_root_get_renderer (GtkRoot *root)
+gtk_window_native_get_renderer (GtkNative *native)
{
- GtkWindow *self = GTK_WINDOW (root);
+ GtkWindow *self = GTK_WINDOW (native);
GtkWindowPrivate *priv = gtk_window_get_instance_private (self);
return priv->renderer;
}
static void
-gtk_window_root_get_surface_transform (GtkRoot *root,
- int *x,
- int *y)
+gtk_window_native_get_surface_transform (GtkNative *native,
+ int *x,
+ int *y)
{
- GtkWindow *self = GTK_WINDOW (root);
+ GtkWindow *self = GTK_WINDOW (native);
GtkStyleContext *context;
GtkBorder margin, border, padding;
@@ -2379,11 +2389,17 @@ gtk_window_root_get_surface_transform (GtkRoot *root,
}
static void
-gtk_window_root_interface_init (GtkRootInterface *iface)
+gtk_window_native_check_resize (GtkNative *native)
{
- iface->get_display = gtk_window_root_get_display;
- iface->get_renderer = gtk_window_root_get_renderer;
- iface->get_surface_transform = gtk_window_root_get_surface_transform;
+ gtk_window_check_resize (GTK_WINDOW (native));
+}
+
+static void
+gtk_window_native_interface_init (GtkNativeInterface *iface)
+{
+ iface->get_renderer = gtk_window_native_get_renderer;
+ iface->get_surface_transform = gtk_window_native_get_surface_transform;
+ iface->check_resize = gtk_window_native_check_resize;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]