[grits] Add hidden method for object



commit c70ea0e7bbcbabe6b4ea6e67984f529276aa4a8e
Author: Andy Spencer <andy753421 gmail com>
Date:   Tue May 24 05:16:55 2011 +0000

    Add hidden method for object
    
    This allows object to hide nested objects when they are hidden

 src/objects/grits-object.c |    8 ++++++++
 src/objects/grits-object.h |    3 +++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/objects/grits-object.c b/src/objects/grits-object.c
index b321b6e..3cfd802 100644
--- a/src/objects/grits-object.c
+++ b/src/objects/grits-object.c
@@ -121,6 +121,14 @@ void grits_object_draw(GritsObject *object, GritsOpenGL *opengl)
 	g_mutex_unlock(opengl->sphere_lock);
 }
 
+void grits_object_hide(GritsObject *object, gboolean hidden)
+{
+	GritsObjectClass *klass = GRITS_OBJECT_GET_CLASS(object);
+	object->hidden = hidden;
+	if (klass->hide)
+		klass->hide(object, hidden);
+}
+
 void grits_object_queue_draw(GritsObject *object)
 {
 	if (object->viewer)
diff --git a/src/objects/grits-object.h b/src/objects/grits-object.h
index dcacd9d..de77ac5 100644
--- a/src/objects/grits-object.h
+++ b/src/objects/grits-object.h
@@ -55,6 +55,7 @@ struct _GritsObjectClass {
 
 	/* Move some of these to GObject? */
 	void (*draw) (GritsObject *object, GritsOpenGL *opengl);
+	void (*hide) (GritsObject *object, gboolean hidden);
 };
 
 GType grits_object_get_type(void);
@@ -62,6 +63,8 @@ GType grits_object_get_type(void);
 /* Implemented by sub-classes */
 void grits_object_draw(GritsObject *object, GritsOpenGL *opengl);
 
+void grits_object_hide(GritsObject *object, gboolean hidden);
+
 /**
  * grits_object_queue_draw:
  * @object: The #GritsObject that needs drawing



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]