mirror of
git://projects.qi-hardware.com/fped.git
synced 2024-11-04 23:37:33 +02:00
9c68c0de34
to stdout if not - there's no reason anymore to disallow editing the offset in new-style measurements - struct inst_ops is no longer opaque, so we can avoid adding even more silly little access functions and open-code straightforward callbacks - (re)stuctured hover/click/drag logic in gui_tool.c - added optional debugging output to gui_canvas.c - don't let a vector's base be dragged onto the vector's own end or onto one of its children - measurements can now be properly changed by dragging git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5414 99fdad57-331a-0410-800a-d7fa5415bdb3
64 lines
1.3 KiB
C
64 lines
1.3 KiB
C
/*
|
|
* meas.h - Measurements
|
|
*
|
|
* Written 2009 by Werner Almesberger
|
|
* Copyright 2009 by Werner Almesberger
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
|
|
#ifndef MEAS_H
|
|
#define MEAS_H
|
|
|
|
|
|
#include "coord.h"
|
|
#include "expr.h"
|
|
|
|
|
|
typedef int (*lt_op_type)(struct coord a, struct coord b);
|
|
|
|
struct vec;
|
|
struct obj;
|
|
|
|
struct meas {
|
|
enum meas_type {
|
|
mt_xy_next,
|
|
mt_x_next,
|
|
mt_y_next,
|
|
mt_xy_max,
|
|
mt_x_max,
|
|
mt_y_max,
|
|
mt_n
|
|
} type;
|
|
char *label; /* or NULL */
|
|
int inverted;
|
|
/* low is obj->base */
|
|
struct vec *high;
|
|
struct expr *offset;
|
|
};
|
|
|
|
struct sample {
|
|
struct coord pos;
|
|
struct sample *next;
|
|
};
|
|
|
|
|
|
int lt_x(struct coord a, struct coord b);
|
|
int lt_y(struct coord a, struct coord b);
|
|
int lt_xy(struct coord a, struct coord b);
|
|
|
|
struct coord meas_find_min(lt_op_type lt, const struct sample *s);
|
|
struct coord meas_find_next(lt_op_type lt, const struct sample *s,
|
|
struct coord ref);
|
|
struct coord meas_find_max(lt_op_type lt, const struct sample *s);
|
|
|
|
void meas_start(void);
|
|
void meas_post(struct vec *vec, struct coord pos);
|
|
int instantiate_meas(void);
|
|
|
|
#endif /* !MEAS_H */
|