/* PROGRAM(CtreeNode); */
/* INHERIT(data); */

/* FIXME: Finish this later...
 * PROGRAM(ctree);
 * COMPLEX_FUNCTION(create, int, int);
 *NAME_ARGS(columns, tree_column);
 * The number of columns, and the column that should be the 'tree' column.
*FUNCTION(insert_node, "function(object,object,array(string),int,object,object,object,object,int,int:object)");
*RETURNS(GTK.CtreeNode);
*NAME_ARGS(parent, sibling, columntitles, spacing, pixmap_closed, mask_closed, pixmap_opened, mask_opened, is_leaf, expanded);
*ARGS(GTK.CtreeNode, GTK.CtreeNode, array(string), int, GDK.Pixmap, GDK.Bitmap, GTK.Pixmap, GDK.Bitmap, int, int);
*{
*  if(args != 10)
*    error("Wrong number of arguments to insert_node(...);\n");
*  else
*  {
*#define GET_IF_NOT_NULL(a,type,ind,name) type name=sp[-args+a].u.integer?sp[-a].u.ind:0;
*#define GOBJ(name,type)  Gdk##type name = get_pgdkobject(_##name, pgtk_##type##_program);
*    GET_IF_NOT_NULL(0, struct object *, _parent, object);
*    GET_IF_NOT_NULL(1, struct object *, _sibling, object);
*    GET_IF_NOT_NULL(2, struct array *,  _titles, array);
*    GET_IF_NOT_NULL(3, int, spacing, integer);
*    GET_IF_NOT_NULL(4, struct object *, _pixmap_closed, object);
*    GET_IF_NOT_NULL(3, struct object *, _mask_closed, object);
*    GET_IF_NOT_NULL(3, struct object *, _pixmap_opened, object);
*    GET_IF_NOT_NULL(3, struct object *, _mask_opened, integer);
*    GET_IF_NOT_NULL(3, int, is_leaf, integer);
*    GET_IF_NOT_NULL(3, int, expanded, integer);
*
*    GOBJ(parent, CtreeNode);
*    GOBJ(sibling, CtreeNode);
*    GOBJ(pixmap_closed, GdkPixmap);
*    GOBJ(mask_closed, GdkBitmap);
*    GOBJ(pixmap_opened, GdkPixmap);
*    GOBJ(mask_opened, GdkBitmap);
*
*
*    gchar  **titles = NULL;
*    CTreeNode * n;
*    struct object *o;
*
*    if(_titles)
*    {
*      titles = malloc( (_titles->size+1) * sizeof(gchar *) );
*      for(i=0; i<_titles->size; i++)
*      {
*        if(_titles->item[i].type != T_STRING)
*        {
*          free(titles);
*          error("Wrong element %d in title array. Expected string\n", i);
*        }
*        titles[i] = (gchar *)_titles->item[i].u.string->str;
*      }
*      titles[i] = NULL;
*    }
*
*    n = gtk_ctree_insert_node( GTK_CTREE( THIS->obj ), parent, sibling, 
*                               titles, spacing, pixmap_closed, mask_closed, 
*                               pixmap_opened, mask_opened, is_leaf, expanded );
*    if(titles)
*      free(titles);
*
*
*    pop_n_elems(args);
*    o = low_clone( pgtk_CtreeNode_program );
*    call_c_initializers( o );
*    ((struct object_wrapper *)o->storage)->obj = (void *)n;
*    push_object( o );
*  }
*}
*
*COMPLEX_FUNCTION(remove_node, CtreeNode );
*FUNCTION(is_viewable, "function(object:int)");
*ARGS(GTK.CtreeNode);
*NAME_ARGS(node);
*{
*  struct object *o;
*  int i;
*  get_all_args( "is_viewable", args, "%o", &o );
*  
*  i = gtk_ctree_is_viewable( GTK_CTREE(THIS->obj), 
*                             get_pgdkobject( o, pgtk_Ctreeode_program ));
*  pop_n_elems(args);
*  push_int(i);
*}
*
*COMPLEX_FUNCTION(last, "function(object:object)");
*{
*  struct object *o;
*  GtkCtreeNode *n;
*  get_all_args( "last", args, "%o", &o );
*  
*  n = gtk_ctree_last( GTK_CTREE(THIS->obj), 
*                      get_pgdkobject( o, pgtk_Ctreeode_program ));
*  pop_n_elems(args);
*  o = low_clone( pgtk_CtreeNode_program );
*  call_c_initializers( o );
*  ((struct object_wrapper *)o->storage)->obj = (void *)n;
*  push_object( o );
*}
*
*COMPLEX_FUNCTION(node_nth, "function(int:object)");
*{
*  struct object *o;
*  GtkCtreeNode *n;
*  int i;
*  get_all_args( "nth", args, "%i", &i );
*  
*  n = gtk_ctree_nth( GTK_CTREE(THIS->obj), i );
*  pop_n_elems(args);
*  o = low_clone( pgtk_CtreeNode_program );
*  call_c_initializers( o );
*  ((struct object_wrapper *)o->storage)->obj = (void *)n;
*  push_object( o );
*}
*
*/

