[gtk+/wip/baedert/drawing: 346/355] widget: Remove gtk_cairo_transform_to_window
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 346/355] widget: Remove gtk_cairo_transform_to_window
- Date: Tue, 11 Jul 2017 16:57:25 +0000 (UTC)
commit 0a8e16dd9efaa27d3503b816edef2006e0812f65
Author: Timm Bäder <mail baedert org>
Date: Sat Jul 8 21:10:17 2017 +0200
widget: Remove gtk_cairo_transform_to_window
Useless in a world without windows and cairo.
docs/reference/gtk/gtk4-sections.txt | 1 -
gtk/gtkwidget.c | 74 ----------------------------------
2 files changed, 0 insertions(+), 75 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index f9ba6ef..66bcd1b 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4607,7 +4607,6 @@ gtk_widget_trigger_tooltip_query
gtk_widget_get_window
gtk_widget_register_window
gtk_widget_unregister_window
-gtk_cairo_transform_to_window
gtk_widget_get_allocated_width
gtk_widget_get_allocated_height
gtk_widget_get_allocation
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f9a1111..06828f2 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6792,80 +6792,6 @@ out:
return return_val;
}
-/* Returns TRUE if a translation should be done */
-static gboolean
-_gtk_widget_get_translation_to_window (GtkWidget *widget,
- GdkWindow *window,
- int *x,
- int *y)
-{
- GdkWindow *w, *widget_window;
-
- if (!_gtk_widget_get_has_window (widget))
- {
- *x = -widget->priv->allocation.x;
- *y = -widget->priv->allocation.y;
- }
- else
- {
- *x = 0;
- *y = 0;
- }
-
- widget_window = _gtk_widget_get_window (widget);
-
- for (w = window; w && w != widget_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;
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/**
- * gtk_cairo_transform_to_window:
- * @cr: the cairo context to transform
- * @widget: the widget the context is currently centered for
- * @window: the window to transform the context to
- *
- * Transforms the given cairo context @cr that from @widget-relative
- * coordinates to @window-relative coordinates.
- * If the @widget’s window is not an ancestor of @window, no
- * modification will be applied.
- *
- * This is the inverse to the transformation GTK applies when
- * preparing an expose event to be emitted with the #GtkWidget::draw
- * signal. It is intended to help porting multiwindow widgets from
- * GTK+ 2 to the rendering architecture of GTK+ 3.
- *
- * Since: 3.0
- **/
-void
-gtk_cairo_transform_to_window (cairo_t *cr,
- GtkWidget *widget,
- GdkWindow *window)
-{
- int x, y;
-
- g_return_if_fail (cr != NULL);
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (_gtk_widget_get_translation_to_window (widget, window, &x, &y))
- cairo_translate (cr, x, y);
-}
-
static gboolean
event_window_is_still_viewable (const GdkEvent *event)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]