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

gEDA-cvs: gaf.git: branch: master updated (1.7.0-20110116-132-ga2caee6)



The branch, master has been updated
       via  a2caee658af54b32ac3ad88564d8a04822db2fff (commit)
      from  5f4308e8a6421175751aac21763d694973b6a016 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 libgeda/include/libgeda/prototype.h |    1 +
 libgeda/src/o_basic.c               |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)


=================
 Commit Messages
=================

commit a2caee658af54b32ac3ad88564d8a04822db2fff
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: Add o_get_parent() function.
    
    Add a function to retrieve an OBJECT's containing complex OBJECT, if
    present.

:100644 100644 4f0f584... 7bc486a... M	libgeda/include/libgeda/prototype.h
:100644 100644 020e549... bbbd477... M	libgeda/src/o_basic.c

=========
 Changes
=========

commit a2caee658af54b32ac3ad88564d8a04822db2fff
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: Add o_get_parent() function.
    
    Add a function to retrieve an OBJECT's containing complex OBJECT, if
    present.

diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h
index 4f0f584..7bc486a 100644
--- a/libgeda/include/libgeda/prototype.h
+++ b/libgeda/include/libgeda/prototype.h
@@ -114,6 +114,7 @@ void o_mirror_world(TOPLEVEL *toplevel, int world_centerx, int world_centery, OB
 double o_shortest_distance(OBJECT *object, int x, int y);
 void o_set_color(TOPLEVEL *toplevel, OBJECT *object, int color);
 PAGE *o_get_page (TOPLEVEL *toplevel, OBJECT *object);
+OBJECT *o_get_parent (TOPLEVEL *toplevel, OBJECT *object);
 void o_add_change_notify(TOPLEVEL *toplevel, ChangeNotifyFunc pre_change_func, ChangeNotifyFunc change_func, void *user_data);
 void o_remove_change_notify(TOPLEVEL *toplevel, ChangeNotifyFunc pre_change_func, ChangeNotifyFunc change_func, void *user_data);
 gboolean o_is_visible (TOPLEVEL *toplevel, OBJECT *object);
diff --git a/libgeda/src/o_basic.c b/libgeda/src/o_basic.c
index 020e549..bbbd477 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -643,6 +643,27 @@ o_get_page_compat (TOPLEVEL *toplevel, OBJECT *object) {
   }
 }
 
+/*! \brief Get an object's containing complex object.
+ *
+ * \par Function Description
+ * If \a object is part of a complex #OBJECT, returns that
+ * #OBJECT. Otherwise, returns NULL.
+ *
+ * \param [in] toplevel  The TOPLEVEL structure.
+ * \param [in] object    The OBJECT for which to get the containing OBJECT.
+ * \return The complex OBJECT which owns \a object, or NULL.
+ */
+OBJECT *
+o_get_parent (TOPLEVEL *toplevel, OBJECT *object)
+{
+  g_return_val_if_fail ((object != NULL), NULL);
+
+  if (object->parent != NULL) {
+    return object->parent;
+  }
+  return NULL;
+}
+
 /* Structure for each entry in a TOPLEVEL's list of registered change
  * notification handlers */
 struct change_notify_entry {




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs