[gtk/wip/matthiasc/popup5: 102/115] native: add public getters for surface and renderer
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup5: 102/115] native: add public getters for surface and renderer
- Date: Sun, 19 May 2019 04:52:58 +0000 (UTC)
commit 0cb4f0879ffab12bbfa428387a58f58e095879d8
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 17 20:37:31 2019 +0000
native: add public getters for surface and renderer
gtk/gtknative.c | 26 +++++++++++++++++++++++++-
gtk/gtknative.h | 12 +++++++++---
gtk/gtknativeprivate.h | 2 --
3 files changed, 34 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtknative.c b/gtk/gtknative.c
index 4352dfc407..4f5feb0593 100644
--- a/gtk/gtknative.c
+++ b/gtk/gtknative.c
@@ -68,6 +68,30 @@ gtk_native_default_init (GtkNativeInterface *iface)
iface->check_resize = gtk_native_default_check_resize;
}
+/**
+ * gtk_native_get_surface:
+ * @self: a #GtkNative
+ *
+ * Returns the surface of this #GtkNative.
+ *
+ * Returns: the surface of @self
+ */
+GdkSurface *
+gtk_native_get_surface (GtkNative *self)
+{
+ g_return_val_if_fail (GTK_IS_NATIVE (self), NULL);
+
+ return GTK_NATIVE_GET_IFACE (self)->get_surface (self);
+}
+
+/**
+ * gtk_native_get_renderer:
+ * @self: a #GtkNative
+ *
+ * Returns the renderer that is used for this #GtkNative.
+ *
+ * Returns: the renderer for @self
+ */
GskRenderer *
gtk_native_get_renderer (GtkNative *self)
{
@@ -101,7 +125,7 @@ gtk_native_check_resize (GtkNative *self)
* @surface: a #GdkSurface
*
* Finds the GtkNative associated with the surface.
- *
+ *
* Returns: (transfer none): the #GtkNative that is associated with @surface
*/
GtkWidget *
diff --git a/gtk/gtknative.h b/gtk/gtknative.h
index 261fe0de72..bca65089e3 100644
--- a/gtk/gtknative.h
+++ b/gtk/gtknative.h
@@ -45,11 +45,12 @@ struct _GtkNativeInterface
GTypeInterface g_iface;
/*< public >*/
+ GdkSurface * (* get_surface) (GtkNative *self);
GskRenderer * (* get_renderer) (GtkNative *self);
void (* get_surface_transform) (GtkNative *self,
- int *x,
- int *y);
+ int *x,
+ int *y);
void (* check_resize) (GtkNative *self);
};
@@ -58,8 +59,13 @@ GDK_AVAILABLE_IN_ALL
GtkWidget * gtk_native_get_for_surface (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-void gtk_native_check_resize (GtkNative *self);
+void gtk_native_check_resize (GtkNative *self);
+GDK_AVAILABLE_IN_ALL
+GdkSurface *gtk_native_get_surface (GtkNative *self);
+
+GDK_AVAILABLE_IN_ALL
+GskRenderer *gtk_native_get_renderer (GtkNative *self);
G_END_DECLS
diff --git a/gtk/gtknativeprivate.h b/gtk/gtknativeprivate.h
index 32a8efa7da..c6b62bd67b 100644
--- a/gtk/gtknativeprivate.h
+++ b/gtk/gtknativeprivate.h
@@ -5,8 +5,6 @@
G_BEGIN_DECLS
-GskRenderer * gtk_native_get_renderer (GtkNative *self);
-
void gtk_native_get_surface_transform (GtkNative *self,
int *x,
int *y);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]