forked from AuroraMiddleware/gtk
container: Remove get_render_node() support API
It's unused now.
This commit is contained in:
parent
e8381f84d6
commit
e2fb970889
@ -3333,150 +3333,3 @@ gtk_container_get_path_for_child (GtkContainer *container,
|
||||
return path;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_propagate_render_node_for_child (GtkContainer *container,
|
||||
GtkWidget *child,
|
||||
GskRenderer *renderer,
|
||||
GskRenderNode *parent)
|
||||
{
|
||||
GskRenderNode *node;
|
||||
GdkWindow *window, *w;
|
||||
GtkAllocation allocation;
|
||||
int x, y;
|
||||
graphene_matrix_t m;
|
||||
graphene_point3d_t tmp;
|
||||
|
||||
if (!_gtk_widget_is_drawable (child))
|
||||
return;
|
||||
|
||||
node = gtk_widget_get_render_node (child, renderer);
|
||||
if (node == NULL)
|
||||
return;
|
||||
|
||||
/* translate coordinates. Ugly business, that. */
|
||||
if (!_gtk_widget_get_has_window (GTK_WIDGET (container)))
|
||||
{
|
||||
gtk_widget_get_clip (GTK_WIDGET (container), &allocation);
|
||||
x = -allocation.x;
|
||||
y = -allocation.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
window = _gtk_widget_get_window (GTK_WIDGET (container));
|
||||
|
||||
for (w = _gtk_widget_get_window (child); w && w != window; w = gdk_window_get_parent (w))
|
||||
{
|
||||
int wx, wy;
|
||||
gdk_window_get_position (w, &wx, &wy);
|
||||
x += wx;
|
||||
y += wy;
|
||||
}
|
||||
|
||||
if (w == NULL)
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
if (!_gtk_widget_get_has_window (child))
|
||||
{
|
||||
gtk_widget_get_clip (child, &allocation);
|
||||
x += allocation.x;
|
||||
y += allocation.y;
|
||||
}
|
||||
|
||||
graphene_matrix_init_translate (&m, graphene_point3d_init (&tmp, x, y, 0));
|
||||
gsk_render_node_set_transform (node, &m);
|
||||
|
||||
gsk_render_node_append_child (parent, node);
|
||||
gsk_render_node_unref (node);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GtkContainer *container;
|
||||
GskRenderer *renderer;
|
||||
GskRenderNode *parent;
|
||||
GArray *child_infos;
|
||||
} RenderData;
|
||||
|
||||
static gboolean
|
||||
should_propagate_node (GtkWidget *child,
|
||||
RenderData *data)
|
||||
{
|
||||
if (!_gtk_widget_is_drawable (child))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
propagate_render_node (GtkWidget *child,
|
||||
gpointer data_)
|
||||
{
|
||||
RenderData *data = data_;
|
||||
|
||||
gtk_container_propagate_render_node_for_child (data->container,
|
||||
child,
|
||||
data->renderer,
|
||||
data->parent);
|
||||
}
|
||||
|
||||
static void
|
||||
collect_child_infos (GtkWidget *widget,
|
||||
gpointer data_)
|
||||
{
|
||||
RenderData *data = data_;
|
||||
ChildOrderInfo info;
|
||||
GList *siblings;
|
||||
GdkWindow *window;
|
||||
|
||||
if (!should_propagate_node (widget, data))
|
||||
return;
|
||||
|
||||
info.child = widget;
|
||||
info.window_depth = G_MAXINT;
|
||||
|
||||
window = _gtk_widget_get_window (widget);
|
||||
if (window == NULL)
|
||||
return;
|
||||
|
||||
if (window != gtk_widget_get_window (GTK_WIDGET (data->container)))
|
||||
{
|
||||
siblings = gdk_window_peek_children (gdk_window_get_parent (window));
|
||||
info.window_depth = g_list_index (siblings, window);
|
||||
}
|
||||
|
||||
g_array_append_val (data->child_infos, info);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_propagate_render_node (GtkContainer *container,
|
||||
GskRenderer *renderer,
|
||||
GskRenderNode *parent_node)
|
||||
{
|
||||
RenderData data;
|
||||
int i;
|
||||
|
||||
data.container = container;
|
||||
data.renderer = renderer;
|
||||
data.parent = parent_node;
|
||||
|
||||
data.child_infos = g_array_new (FALSE, TRUE, sizeof (ChildOrderInfo));
|
||||
|
||||
gtk_container_forall (container, collect_child_infos, &data);
|
||||
|
||||
g_array_sort (data.child_infos, compare_children_for_draw);
|
||||
|
||||
for (i = 0; i < data.child_infos->len; i++)
|
||||
{
|
||||
ChildOrderInfo *info = &g_array_index (data.child_infos, ChildOrderInfo, i);
|
||||
|
||||
propagate_render_node (info->child, &data);
|
||||
}
|
||||
|
||||
g_array_free (data.child_infos, TRUE);
|
||||
}
|
||||
|
@ -43,13 +43,6 @@ void _gtk_container_maybe_start_idle_sizer (GtkContainer *container);
|
||||
void gtk_container_get_children_clip (GtkContainer *container,
|
||||
GtkAllocation *out_clip);
|
||||
|
||||
void gtk_container_propagate_render_node (GtkContainer *container,
|
||||
GskRenderer *renderer,
|
||||
GskRenderNode *parent_node);
|
||||
void gtk_container_propagate_render_node_for_child (GtkContainer *container,
|
||||
GtkWidget *child,
|
||||
GskRenderer *renderer,
|
||||
GskRenderNode *parent_node);
|
||||
void gtk_container_snapshot_child (GtkContainer *container,
|
||||
GtkWidget *child,
|
||||
GtkSnapshot *snapshot);
|
||||
|
Loading…
Reference in New Issue
Block a user