예제 #1
0
int number_of_frames(Quark *project)
{
    int nframes = 0;
    
    quark_traverse(project, frame_count_hook, &nframes);
    
    return nframes;
}
예제 #2
0
int number_of_graphs(Quark *project)
{
    int ngraphs = 0;
    
    quark_traverse(project, graph_count_hook, &ngraphs);
    
    return ngraphs;
}
예제 #3
0
void rescale_viewport(Quark *project, double ext_x, double ext_y)
{
    ext_xy_t ext_xy;
    ext_xy.x = ext_x;
    ext_xy.y = ext_y;

    quark_traverse(project, hook, &ext_xy);
}
예제 #4
0
파일: utils.c 프로젝트: armando-2011/grace
int quark_get_number_of_descendant_sets(Quark *q)
{
    int nsets = 0;
    
    quark_traverse(q, set_count_hook, &nsets);
    
    return nsets;
}
예제 #5
0
파일: explorer.c 프로젝트: mariusal/grace
static int create_children_hook(unsigned int step, void *data, void *udata)
{
    ExplorerUI *eui = (ExplorerUI *) udata;
    Quark *q = (Quark *) data;

    quark_traverse(q, create_hook, eui);

    return TRUE;
}
예제 #6
0
파일: explorer.c 프로젝트: mariusal/grace
void explorer_after_undo(GraceApp *gapp, Quark *pr)
{
    ExplorerUI *eui = gapp->gui->eui;

    if (!eui) {
        return;
    }

    quark_traverse(pr, create_hook, eui);
    explorer_restore_quark_state(eui);
}
예제 #7
0
파일: files.c 프로젝트: astrotycoon/grace
GProject *load_any_project(GraceApp *gapp, const char *fn)
{
    GProject *gp;
    
    /* FIXME: A temporary hack */
    if (fn && strstr(fn, ".xgr")) {
        gp = load_xgr_project(gapp, fn);
    } else {
        gp = load_agr_project(gapp, fn);
    }

    if (gp) {
        quark_traverse(gproject_get_top(gp), project_hook, NULL);
    }

    return gp;
}
예제 #8
0
파일: utils.c 프로젝트: armando-2011/grace
/* 
 * Coalesce two SSDs. fromq will be deleted, preceded by transferring of all
 * its children to toq
 */
int ssd_coalesce(Quark *toq, Quark *fromq)
{
    unsigned int nrows, ncols, i, j;
    ss_data *ssd;
    AMem *amem  = toq->amem;
    coalesce_hook_t p;
       
    nrows = ssd_get_nrows(fromq);
    if (nrows > ssd_get_nrows(toq)) {
        if (ssd_set_nrows(toq, nrows) != RETURN_SUCCESS) {
            return RETURN_FAILURE;
        }
    }

    /* original number of columns */
    ncols = ssd_get_ncols(toq);
    
    ssd = ssd_get_data(fromq);
    for (i = 0; i < ssd->ncols; i++) {
        ss_column *col = &ssd->cols[i];
        
        ss_column *col_new = ssd_add_col(toq, col->format);
        if (!col_new) {
            return RETURN_FAILURE;
        }
        
        col_new->label = amem_strdup(amem, col->label);
        
        if (col->format == FFORMAT_STRING) {
            for (j = 0; j < nrows; j++) {
                ((char **) col_new->data)[j] =
                    amem_strdup(amem, ((char **) col->data)[j]);
            }
        } else {
            memcpy(col_new->data, col->data, nrows*SIZEOF_DOUBLE);
        }
    }
    
    p.toq = toq;
    p.nshift = ncols;
    quark_traverse(fromq, coalesce_hook, &p);
    
    quark_free(fromq);
    
    return RETURN_SUCCESS;
}
예제 #9
0
파일: utils.c 프로젝트: armando-2011/grace
int quark_get_descendant_sets(Quark *q, Quark ***sets)
{
    set_hook_t p;
    
    if (q) {
        p.nsets = 0;
        p.sets  = xmalloc(quark_get_number_of_descendant_sets(q)*SIZEOF_VOID_P);

        if (p.sets) {
            quark_traverse(q, set_hook, &p);
        }
        
        *sets = p.sets;

        return p.nsets;
    } else {
        return 0;
    }
}
예제 #10
0
void autotick_graph_axes(Quark *q, int amask)
{
    quark_traverse(q, autotick_hook, &amask);
}