root: Add gtk_root_get_surface_transform()

The function isn't used yet, so this is just infrastructure.
This commit is contained in:
Benjamin Otte 2019-02-09 22:15:32 +01:00
parent 2fbdd8b849
commit 446713fb8b
4 changed files with 42 additions and 0 deletions

View File

@ -43,10 +43,20 @@ gtk_root_default_get_display (GtkRoot *self)
return gdk_display_get_default ();
}
static void
gtk_root_default_get_surface_transform (GtkRoot *self,
int *x,
int *y)
{
*x = 0;
*y = 0;
}
static void
gtk_root_default_init (GtkRootInterface *iface)
{
iface->get_display = gtk_root_default_get_display;
iface->get_surface_transform = gtk_root_default_get_surface_transform;
}
GdkDisplay *
@ -60,3 +70,18 @@ gtk_root_get_display (GtkRoot *self)
return iface->get_display (self);
}
void
gtk_root_get_surface_transform (GtkRoot *self,
int *x,
int *y)
{
GtkRootInterface *iface;
g_return_if_fail (GTK_IS_ROOT (self));
g_return_if_fail (x != 0);
g_return_if_fail (y != 0);
iface = GTK_ROOT_GET_IFACE (self);
return iface->get_surface_transform (self, x, y);
}

View File

@ -46,6 +46,10 @@ struct _GtkRootInterface
/*< public >*/
GdkDisplay * (* get_display) (GtkRoot *self);
void (* get_surface_transform) (GtkRoot *root,
int *x,
int *y);
};

View File

@ -7,6 +7,9 @@ G_BEGIN_DECLS
GdkDisplay * gtk_root_get_display (GtkRoot *root);
void gtk_root_get_surface_transform (GtkRoot *self,
int *x,
int *y);
G_END_DECLS
#endif /* __GTK_ROOT_PRIVATE_H__ */

View File

@ -2507,10 +2507,20 @@ gtk_window_root_get_display (GtkRoot *root)
return priv->display;
}
static void
gtk_window_root_get_surface_transform (GtkRoot *root,
int *x,
int *y)
{
*x = 0;
*y = 0;
}
static void
gtk_window_root_interface_init (GtkRootInterface *iface)
{
iface->get_display = gtk_window_root_get_display;
iface->get_surface_transform = gtk_window_root_get_surface_transform;
}
/**