[niepce] * Use accessors instead of struct field on GdlDock



commit 89856f24ffb4cd00af95e471592dd2147c185187
Author: Hubert Figuiere <hub figuiere net>
Date:   Tue Apr 14 18:29:51 2009 -0400

    	* Use accessors instead of struct field on GdlDock
    	in planning for GSEAL_ENABLE.
---
 ChangeLog                        |    3 +++
 src/ext/libgdl/gdl-dock-master.c |    2 +-
 src/ext/libgdl/gdl-dock-object.c |   10 ++++++----
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1f973d9..b834d0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-04-14  Hubert Figuiere  <hub figuiere net>
 
+	* Use accessors instead of struct field on GdlDock
+	in planning for GSEAL_ENABLE.
+
 	* fwk::Dialog::add_header() does the markup.
 
 	* Edited labels only update when closing the dialog.
diff --git a/src/ext/libgdl/gdl-dock-master.c b/src/ext/libgdl/gdl-dock-master.c
index 03e1b3e..01ca349 100644
--- a/src/ext/libgdl/gdl-dock-master.c
+++ b/src/ext/libgdl/gdl-dock-master.c
@@ -505,7 +505,7 @@ gdl_dock_master_drag_motion (GdlDockItem *item,
         if (GTK_IS_WIDGET (widget)) {
             while (widget && (!GDL_IS_DOCK (widget) || 
 	           GDL_DOCK_OBJECT_GET_MASTER (widget) != master))
-                widget = widget->parent;
+                widget = gtk_widget_get_parent(widget);
             if (widget) {
                 gint win_w, win_h;
                 
diff --git a/src/ext/libgdl/gdl-dock-object.c b/src/ext/libgdl/gdl-dock-object.c
index dadf072..2d3245d 100644
--- a/src/ext/libgdl/gdl-dock-object.c
+++ b/src/ext/libgdl/gdl-dock-object.c
@@ -360,6 +360,7 @@ gdl_dock_object_real_detach (GdlDockObject *object,
 {
     GdlDockObject *parent;
     GtkWidget     *widget;
+    GtkWidget     *widget_parent;
     
     g_return_if_fail (object != NULL);
 
@@ -374,8 +375,9 @@ gdl_dock_object_real_detach (GdlDockObject *object,
     GDL_DOCK_OBJECT_UNSET_FLAGS (object, GDL_DOCK_ATTACHED);
     parent = gdl_dock_object_get_parent_object (object);
     widget = GTK_WIDGET (object);
-    if (widget->parent)
-        gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
+    widget_parent = gtk_widget_get_parent(widget);
+    if (widget_parent)
+        gtk_container_remove (GTK_CONTAINER (widget_parent), widget);
     if (parent)
         gdl_dock_object_reduce (parent);
 }
@@ -482,9 +484,9 @@ gdl_dock_object_get_parent_object (GdlDockObject *object)
     
     g_return_val_if_fail (object != NULL, NULL);
 
-    parent = GTK_WIDGET (object)->parent;
+    parent = gtk_widget_get_parent(GTK_WIDGET (object));
     while (parent && !GDL_IS_DOCK_OBJECT (parent)) {
-        parent = parent->parent;
+        parent = gtk_widget_get_parent(parent);
     }
     
     return parent ? GDL_DOCK_OBJECT (parent) : NULL;



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