[hyena] Support child-level invalidation
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hyena] Support child-level invalidation
- Date: Wed, 26 May 2010 02:39:38 +0000 (UTC)
commit d86d00633712276c2e323eafaff34bb899f5ed60
Author: Aaron Bockover <abockover novell com>
Date: Fri Jan 22 18:46:41 2010 -0500
Support child-level invalidation
src/Hyena.Gui/Hyena.Data.Gui/DataViewChild.cs | 15 ++++++++++
.../Hyena.Data.Gui/ListView/ListViewBase.cs | 15 ++++++++++
.../Hyena.Data.Gui/ListView/ListView_Rendering.cs | 30 +++----------------
3 files changed, 35 insertions(+), 25 deletions(-)
---
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/DataViewChild.cs b/src/Hyena.Gui/Hyena.Data.Gui/DataViewChild.cs
index 07b2cef..9480f7b 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/DataViewChild.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/DataViewChild.cs
@@ -38,6 +38,12 @@ namespace Hyena.Data.Gui
public DataViewLayout ParentLayout { get; set; }
public int ModelRowIndex { get; set; }
+ public override void Invalidate (Gdk.Rectangle area)
+ {
+ Gdk.Window.DebugUpdates = true;
+ ParentLayout.View.QueueDirtyRegion (area);
+ }
+
#region Data Binding
private PropertyInfo property_info;
@@ -125,6 +131,15 @@ namespace Hyena.Data.Gui
public abstract void Render (CellContext context);
public abstract Gdk.Size Measure ();
+ public virtual void Invalidate (Gdk.Rectangle area)
+ {
+ }
+
+ public void Invalidate ()
+ {
+ Invalidate (Allocation);
+ }
+
public virtual bool ButtonEvent (int x, int y, bool pressed, uint button)
{
return false;
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListViewBase.cs b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListViewBase.cs
index 40e748c..d6c3722 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListViewBase.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListViewBase.cs
@@ -33,5 +33,20 @@ namespace Hyena.Data.Gui
{
public class ListViewBase : Widget
{
+ public void QueueDirtyRegion (Gdk.Rectangle region)
+ {
+ region.Intersect (Allocation);
+ QueueDrawArea (region.X, region.Y, region.Width, region.Height);
+ }
+
+ public void QueueDirtyRegion (Cairo.Rectangle region)
+ {
+ QueueDirtyRegion (new Gdk.Rectangle () {
+ X = (int)Math.Floor (region.X),
+ Y = (int)Math.Floor (region.Y),
+ Width = (int)Math.Ceiling (region.Width),
+ Height = (int)Math.Ceiling (region.Height)
+ });
+ }
}
}
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
index 6fb7865..f872340 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
@@ -532,6 +532,11 @@ namespace Hyena.Data.Gui
}
}
+ protected void QueueDirtyRegion ()
+ {
+ QueueDirtyRegion (list_rendering_alloc);
+ }
+
protected virtual void ColumnCellDataProvider (ColumnCell cell, object boundItem)
{
}
@@ -585,30 +590,5 @@ namespace Hyena.Data.Gui
#endregion
-#region Invalidation
-
- protected void QueueDirtyRegion (Gdk.Rectangle region)
- {
- region.Intersect (Allocation);
- QueueDrawArea (region.X, region.Y, region.Width, region.Height);
- }
-
- protected void QueueDirtyRegion (Cairo.Rectangle region)
- {
- QueueDirtyRegion (new Gdk.Rectangle () {
- X = (int)Math.Floor (region.X),
- Y = (int)Math.Floor (region.Y),
- Width = (int)Math.Ceiling (region.Width),
- Height = (int)Math.Ceiling (region.Height)
- });
- }
-
- protected void QueueDirtyRegion ()
- {
- QueueDirtyRegion (list_rendering_alloc);
- }
-
-#endregion
-
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]