Changeset 6e90da8


Ignore:
Timestamp:
Jun 3, 2010, 6:48:13 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
fcce3f1
Parents:
840032d
git-author:
David Benjamin <davidben@mit.edu> (06/03/10 18:45:30)
git-committer:
David Benjamin <davidben@mit.edu> (06/03/10 18:48:13)
Message:
Add some more query functions for children

Probably should just expose the linked list or add a dummy iterator
wrapper.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • window.c

    r840032d r6e90da8  
    215215    func(w, user_data);
    216216  }
     217}
     218
     219gboolean owl_window_has_children(owl_window *parent)
     220{
     221  return parent->child != NULL;
     222}
     223
     224int owl_window_num_children(owl_window *parent)
     225{
     226  owl_window *w;
     227  int num = 0;
     228  for (w = parent->child;
     229       w != NULL;
     230       w = w->next) {
     231    num++;
     232  }
     233  return num;
    217234}
    218235
  • window.h

    r853f397 r6e90da8  
    3434
    3535void owl_window_children_foreach(owl_window *parent, GFunc func, gpointer user_data);
     36gboolean owl_window_has_children(owl_window *parent);
     37int owl_window_num_children(owl_window *parent);
    3638owl_window *owl_window_get_parent(owl_window *w);
    3739
Note: See TracChangeset for help on using the changeset viewer.