pike.git / src / post_modules / GTK2 / source / gtktreemodel.pre

version» Context lines:

pike.git/src/post_modules/GTK2/source/gtktreemodel.pre:28:    struct object *o1;    int res;    get_all_args("get_iter",args,"%o",&o1);    iter=(GtkTreeIter *)g_malloc(sizeof(GtkTreeIter));    if (iter==NULL)    SIMPLE_OUT_OF_MEMORY_ERROR("get_iter",sizeof(GtkTreeIter));    res=gtk_tree_model_get_iter(GTK_TREE_MODEL(THIS->obj),    iter,(GtkTreePath *)get_pg2object(o1,pgtk2_tree_path_program));    pgtk2_pop_n_elems(args);    if (res) { -  push_gobjectclass(iter,pgtk2_tree_iter_program); +  push_pgdk2object(iter,pgtk2_tree_iter_program,1);    } else {    push_int(0); -  +  g_free( iter );    }    }   }      +GTK2.TreeIter get_iter_from_string(string path)   //! Returns a valid iterator from a path string.   {    pgtk2_verify_inited();    {    GtkTreeIter *iter;
pike.git/src/post_modules/GTK2/source/gtktreemodel.pre:52:    const gchar *s;    get_all_args("get_iter_from_string",args,"%s",&s);       iter=(GtkTreeIter *)g_malloc(sizeof(GtkTreeIter));    if (iter==NULL)    SIMPLE_OUT_OF_MEMORY_ERROR("get_iter_from_string",sizeof(GtkTreeIter));    res=gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(THIS->obj),    iter,s);    pgtk2_pop_n_elems(args);    if (res) { -  push_gobjectclass(iter,pgtk2_tree_iter_program); +  push_pgdk2object(iter,pgtk2_tree_iter_program,1);    } else {    push_int(0); -  +  g_free( iter );    }    }   }      +GTK2.TreeIter get_iter_first()   //! Get GTK2.TreeIter with the first iterator in the tree ("0").   {    pgtk2_verify_inited();    pgtk2_pop_n_elems(args);    {    GtkTreeIter *iter;    int res;    iter=(GtkTreeIter *)g_malloc(sizeof(GtkTreeIter));    if (iter==NULL)    SIMPLE_OUT_OF_MEMORY_ERROR("get_iter_first",sizeof(GtkTreeIter));    res=gtk_tree_model_get_iter_first(GTK_TREE_MODEL(THIS->obj),    iter);    if (res) { -  push_gobjectclass(iter,pgtk2_tree_iter_program); +  push_pgdk2object(iter,pgtk2_tree_iter_program,1);    } else {    push_int(0); -  +  g_free( iter );    }    }   }      +GTK2.TreePath get_path(GTK2.TreeIter iter)   //! Returns a GTK2.TreePath from iter.   {    pgtk2_verify_inited();    {    GtkTreePath *path;
pike.git/src/post_modules/GTK2/source/gtktreemodel.pre:110:    {    int i;    int cols;    struct object *o1;    GtkTreeIter *gti;    get_all_args("get_row",args,"%o",&o1);    gti=(GtkTreeIter *)get_pg2object(o1,pgtk2_tree_iter_program);    pgtk2_pop_n_elems(args);    cols=gtk_tree_model_get_n_columns(GTK_TREE_MODEL(THIS->obj));    for (i=0; i<cols; i++) { -  GValue v={0}; +  GValue v = {0};    gtk_tree_model_get_value(GTK_TREE_MODEL(THIS->obj),gti,i,&v);    pgtk2_push_gvalue_rt(&v);    g_value_unset(&v);    }    f_aggregate(cols);    }   }      mixed get_value(GTK2.TreeIter iter, int column)   //! Get value at column of iter.
pike.git/src/post_modules/GTK2/source/gtktreemodel.pre:167:    GtkTreeIter *iter;    struct object *o1;    int res;    get_all_args("iter_children",args,"%o",&o1);    iter=g_malloc(sizeof(GtkTreeIter));    if (iter==NULL)    SIMPLE_OUT_OF_MEMORY_ERROR("iter_children",sizeof(GtkTreeIter));    res=gtk_tree_model_iter_children(GTK_TREE_MODEL(THIS->obj),    iter,(GtkTreeIter *)get_pg2object(o1,pgtk2_tree_iter_program));    pgtk2_pop_n_elems(args); -  push_gobjectclass(iter,pgtk2_tree_iter_program); +  if( res ) +  push_pgdk2object(iter,pgtk2_tree_iter_program,1); +  else +  { +  push_int(0); +  g_free(iter);    }    } -  + }      int iter_has_child(GTK2.TreeIter iter)   //! Check if iter has children.   {    pgtk2_verify_inited();    {    struct object *o1;    int res;    get_all_args("iter_has_child",args,"%o",&o1);    res=gtk_tree_model_iter_has_child(GTK_TREE_MODEL(THIS->obj),
pike.git/src/post_modules/GTK2/source/gtktreemodel.pre:224:    int res;    INT_TYPE n;    get_all_args("iter_nth_child",args,"%o%i",&o1,&n);    iter=g_malloc(sizeof(GtkTreeIter));    if (iter==NULL)    SIMPLE_OUT_OF_MEMORY_ERROR("iter_nth_child",sizeof(GtkTreeIter));    res=gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(THIS->obj),    iter,(GtkTreeIter *)get_pg2object(o1,pgtk2_tree_iter_program),n);    pgtk2_pop_n_elems(args);    if (res) { -  push_gobjectclass(iter,pgtk2_tree_iter_program); +  push_pgdk2object(iter,pgtk2_tree_iter_program,1);    } else {    push_int(0); -  +  g_free( iter );    }    }   }      +GTK2.TreeIter iter_parent(GTK2.TreeIter child)   //! Get parent of child, or 0 if none.   {    pgtk2_verify_inited();    {    GtkTreeIter *iter;    struct object *o1;    int res;    get_all_args("iter_parent",args,"%o",&o1);    iter=g_malloc(sizeof(GtkTreeIter));    if (iter==NULL)    SIMPLE_OUT_OF_MEMORY_ERROR("iter_parent",sizeof(GtkTreeIter));    res=gtk_tree_model_iter_parent(GTK_TREE_MODEL(THIS->obj),    iter,(GtkTreeIter *)get_pg2object(o1,pgtk2_tree_iter_program));    pgtk2_pop_n_elems(args);    if (res) { -  push_gobjectclass(iter,pgtk2_tree_iter_program); +  push_pgdk2object(iter,pgtk2_tree_iter_program,1);    } else {    push_int(0); -  +  g_free( iter );    }    }   }      require gtk22;   string get_string_from_iter(GTK2.TreeIter iter)   //! Get string representation of iter.   {    pgtk2_verify_inited();    {