[gtk+] quartz: move gdkgeometry-quartz into gdkwindow-quartz.c
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] quartz: move gdkgeometry-quartz into gdkwindow-quartz.c
- Date: Thu, 23 Dec 2010 13:27:41 +0000 (UTC)
commit f0b8dcb4f3281ac8ee53fc75c68c6a02a620f7f1
Author: Kristian Rietveld <kris gtk org>
Date: Thu Dec 23 14:11:38 2010 +0100
quartz: move gdkgeometry-quartz into gdkwindow-quartz.c
gdk/quartz/Makefile.am | 1 -
gdk/quartz/gdkgeometry-quartz.c | 73 ---------------------------------------
gdk/quartz/gdkprivate-quartz.h | 8 ----
gdk/quartz/gdkwindow-quartz.c | 54 +++++++++++++++++++++++++++-
4 files changed, 52 insertions(+), 84 deletions(-)
---
diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am
index b9c5b46..33197e9 100644
--- a/gdk/quartz/Makefile.am
+++ b/gdk/quartz/Makefile.am
@@ -32,7 +32,6 @@ libgdk_quartz_la_SOURCES = \
gdkdnd-quartz.h \
gdkevents-quartz.c \
gdkeventloop-quartz.c \
- gdkgeometry-quartz.c \
gdkglobals-quartz.c \
gdkkeys-quartz.c \
gdkprivate-quartz.h \
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h
index b1ef443..7427198 100644
--- a/gdk/quartz/gdkprivate-quartz.h
+++ b/gdk/quartz/gdkprivate-quartz.h
@@ -75,14 +75,6 @@ void _gdk_quartz_event_loop_release_event (NSEvent *event);
GdkEventType _gdk_quartz_keys_event_type (NSEvent *event);
gboolean _gdk_quartz_keys_is_modifier (guint keycode);
-/* Geometry */
-void _gdk_quartz_window_translate (GdkWindow *window,
- cairo_region_t *area,
- gint dx,
- gint dy);
-gboolean _gdk_quartz_window_queue_antiexpose (GdkWindow *window,
- cairo_region_t *area);
-
/* Drag and Drop */
void _gdk_quartz_window_register_dnd (GdkWindow *window);
GdkDragContext * _gdk_quartz_window_drag_begin (GdkWindow *window,
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index a9655b2..6e0b8a2 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2220,6 +2220,56 @@ gdk_window_quartz_set_static_gravities (GdkWindow *window,
return FALSE;
}
+static gboolean
+gdk_quartz_window_queue_antiexpose (GdkWindow *window,
+ cairo_region_t *area)
+{
+ return FALSE;
+}
+
+static void
+gdk_quartz_window_translate (GdkWindow *window,
+ cairo_region_t *area,
+ gint dx,
+ gint dy)
+{
+ cairo_region_t *invalidate, *scrolled;
+ GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *)window->impl;
+ GdkRectangle extents;
+
+ cairo_region_get_extents (area, &extents);
+
+ [impl->view scrollRect:NSMakeRect (extents.x - dx, extents.y - dy,
+ extents.width, extents.height)
+ by:NSMakeSize (dx, dy)];
+
+ if (impl->needs_display_region)
+ {
+ cairo_region_t *intersection;
+
+ /* Invalidate already invalidated area that was moved at new
+ * location.
+ */
+ intersection = cairo_region_copy (impl->needs_display_region);
+ cairo_region_intersect (intersection, area);
+ cairo_region_translate (intersection, dx, dy);
+
+ _gdk_quartz_window_set_needs_display_in_region (window, intersection);
+ cairo_region_destroy (intersection);
+ }
+
+ /* Calculate newly exposed area that needs invalidation */
+ scrolled = cairo_region_copy (area);
+ cairo_region_translate (scrolled, dx, dy);
+
+ invalidate = cairo_region_copy (area);
+ cairo_region_subtract (invalidate, scrolled);
+ cairo_region_destroy (scrolled);
+
+ _gdk_quartz_window_set_needs_display_in_region (window, invalidate);
+ cairo_region_destroy (invalidate);
+}
+
static void
gdk_quartz_window_set_focus_on_map (GdkWindow *window,
gboolean focus_on_map)
@@ -2945,8 +2995,8 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->shape_combine_region = gdk_window_quartz_shape_combine_region;
impl_class->input_shape_combine_region = gdk_window_quartz_input_shape_combine_region;
impl_class->set_static_gravities = gdk_window_quartz_set_static_gravities;
- impl_class->queue_antiexpose = _gdk_quartz_window_queue_antiexpose;
- impl_class->translate = _gdk_quartz_window_translate;
+ impl_class->queue_antiexpose = gdk_quartz_window_queue_antiexpose;
+ impl_class->translate = gdk_quartz_window_translate;
impl_class->destroy = gdk_quartz_window_destroy;
impl_class->destroy_foreign = gdk_quartz_window_destroy_foreign;
impl_class->resize_cairo_surface = gdk_window_quartz_resize_cairo_surface;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]